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.

MSP430FR5994: Generic code optimization for - printf, floating point and for loops in the code

Part Number: MSP430FR5994


Hello everyone,

I am executing a rather intensive code for executing a neural network on the MSP430. While the code is built correctly and the debugging also gives some results, I do receive many warnings in my code namely for - for printf commands (with suggestions of moving them to RAM in run time), floating point operations (with suggestions of moving them to RAM in run time) and for loops (counting upwards & moving them to RAM). As my code executes correctly, I ignored them for the time being. However, the execution is rather slow and I was trying to think of ways in which I could deal with these three warning issues which arise in many instances of the code. Some settings I have changed to support my execution are as follows:

printf support - full; optimization level - 0 (register optimization); size of heap for dynamic allocation - 400. 

The RAM usage is as follows: MSP430:  Flash/FRAM usage is 188266 bytes. RAM usage is 4398 bytes.

Additionally, I am changing the linker file to ensure enough space for the data model with the following setting:

#ifndef __LARGE_DATA_MODEL__
.const : {} > FRAM /* Constant data */
#else
.const : {} >> FRAM2 /* Constant data */
#endif

With all these changes already implemented and the code executing the functionality almost correctly, what possible changes could I make in the settings or memory allocations to deal with the warnings I have mentioned above? If I could get an idea of how the MSP430 would respond to the changes I make, that would be extremely helpful as I can then also check if I can make some changes to the code.  

Regards,

Siddhant

  • Hi Siddhant,

    Are the warnings you're getting showing up in the "Advice" tab or prefixed with "(ULP X.Y)" as shown in this link [link]?

    These warnings should be generated by ULP Advisor, a static analysis tool that scans your code through a set of low power coding rules. This is enabled by default for MSP430 projects.

    If you click the warning in the Advice tab, detailed info on what the rule means/how to remedy the warning should be opened.

    Thanks,

    Urica Wang

**Attention** This is a public forum