Question
Standard library: stm32xxx_rcc.c: waste of RAM?
Posted on March 30, 2016 at 18:25
Hi,
I am looking how to save a few bytes in RAM. I am using the standard peripheral lib, and included in stm32f10x_rcc.c, stm32f2xx_rcc.c and stm32l1xx_rcc.c, I found some static constant arrays (PLLMulTable, APBAHBPrescTable, ADCPrescTable) which are only used to lookup some constants. Now these arrays are declared ''static __I'', __I is a preprocessor symbol defined as ''const volatile''. This leads to locating the arrays in RAM. Is there any reason for this? I think, it would save some bytes in RAM if these arrays would just be declared as ''static const'', because in this case the toolchain just locates them into the text segment in Flash memory. Or am I missing something?