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.

MSP430 CCS5 RAM Problem

Other Parts Discussed in Thread: MSP430F5510

Hi,

I am using CCS 5.2.1 with MSP430F5510 chip. The total amount of RAM is 4kB + 2kB USB memory.

When I added the following line to the code: "unsigned int tst[10000];" - the project was built without any errors or warnings, but program does not works.

The device type in the project settings exactly matched with my chip.

Any advice how to set this error/warning in CCS?

Thanks.

 

 

  • Nikolai Bouianov said:
    When I added the following line to the code: "unsigned int tst[10000];" -

    Where?

    When you do it inside a funciton, it is a local variable. So at runtime, the CPU tries to allocate 20k stack for this array, causing an instant stack overflow.
    Since this happens at runtime, the linker cannot throw an error. And to the compiler, the amount of available ram is unknown, so it cannot warn you that what you want won't work.

  • Thank you,

    I found the problem.

    The array was declared at top level, but CCS doing optimization. If array was never accessed in the program then CCS automatically excudes it.

    This is very unconvinient for me as I am planning my data structure to see if everything could be fitted into RAM.

    The only workaround I found is incude someting like array[0] = 3; for each array and variable.

     

**Attention** This is a public forum