Hello,
on one of our projects on an STM32F4 device we have more RAM but we are short on ROM space.
Our C/C++ strings are complied into ROM, as usual.
I noticed and tested that if I make initialized data NOT constant, the variables as located in RAM sections, as expected, the initialized image in ROM is however COMPRESSED, so ROM usage decreases.
Is there some global project settings/macro/compiler command that would allow me to place C strings into RAM without extra hassle ( e.g. using printf format strings directly as a parameter to printf, as opposed to declaring it as a variable with special attributes placing it in a special section of memory ) ?
The "pragma arm section" that was available in previous Keil compiler version is not supported in armclang6.I think I know how to do this with the __attribute__ section, but that would require the string literals to be declared as variables, and make the code quite unreadable.
Thanks for any info on this.
Paul.
Hello Paul,
pragma clang section is the equivalent of pragma arm section in armclang
https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_cmf1493390581125.htm
If you are unaware, there is a migration guide to help move from armcc to armclang
https://developer.arm.com/documentation/100068/0608/compiler-source-code-compatibility/language-extension-compatibility--pragmas