This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS570LC4357: TMS570LC4357

Part Number: TMS570LC4357


Tool/software: TI C/C++ Compiler

Hello,

I want to run a smal program on the chip. I faced two main problems:

- the first is that if I do the array initialization in this way : 

xmss_params params;
    // TODO test more different OIDs
    uint32_t oid = 0x00000001;

    /* For WOTS it doesn't matter if we use XMSS or XMSSMT. */
    xmss_parse_oid(&params, oid);
 
    unsigned char seed[params.n];

Th program enter in a infinite loop.

To solve that i defined manually the size of the arrays. e.g. 

unsigned char seed[32];

Which is not practical. Is it another solution for that?

- The second problem is: when I add code lines to the main function, the program stopped in the first line, and the debugger indicates these code line data entry:

resetEntry
        b   resetEntry
undefEntry
        b   undefEntry
svcEntry
        b   svcEntry
prefetchEntry
        b   prefetchEntry
dataEntry
        b   dataEntry
        b   phantomInterrupt
        ldr pc,[pc,#-0x1b0]
        ldr pc,[pc,#-0x1b0]

When I delete the last code lines and minimize the size of main function, the error disappears.

Bests,

Rachel.

  • As for declaring this local array with a variable length ...

    Soundes Marzougui said:
    unsigned char seed[params.n];

    This is a feature called variable length arrays.  For short, I will call them VLA.  VLA is supported in the TI ARM compiler.  However, it calls a special function in the RTS library which eventually calls malloc.  So, you need to be sure you have enough heap memory allocated, or it silently fails.  Please see this forum thread for related discussion.  That thread is about VLA on MSP430, but the same concepts apply to the TI ARM compiler.

    Soundes Marzougui said:
    To solve that i defined manually the size of the arrays.

    I realize that is not ideal.  But it is much simpler than VLA.  I suspect it is the best choice for you.

    Regarding ...

    Soundes Marzougui said:
    when I add code lines to the main function, the program stopped in the first line, and the debugger indicates these code line data entry:

    I suspect the root cause of this failure occurred much earlier, and caused the program to execute in an uncontrolled way.  It finally stops in the interrupt vectors, which is what the debugger shows you.

    Soundes Marzougui said:
    When I delete the last code lines

    I'm not sure what you mean when you say you add code lines, or delete code lines.  Please give a specific example.

    Thanks and regards,

    -George