Define address for pages of RAM variables
Hi everyone,
I have a peculiar case. We are updating our product from a legacy micro, on which we were using an external EEPROM to store a LOT of settings (in the hundreds of KB). These were stored in pages of 1K each, and each page was different.
Now, we want to update these boards with an STM32 but use the same format to store these settings.
For example, page0 at offset 0 stores an uint8_t called product type. Offset 1 stores a uint16_t called product_subtype, offset 3 another uint16_t, etc
We need to have a very well defined location for each of these, as we load them from EEPROM on boot and store them back to the EEPROM on shutdown. There is also a software that manipulates these settings, and to change these settings, the software tells the micro that it wants to read the uint16_t variable at page0, offset 1 (ie product_subtype), then maybe store the value "2" to this address.
So, for all this to work, the address of all these variables must be defined and respected.
In our legacy processor, we could just say:
uint8_t product @0;
uint16_t product_subtype @1;
uint16_t product_subtype_2 @3;
etc.
Then we can store and load the entire settings from RAM to EEPROM and vice versa with a simple for loop and do the same with the configuration software. We are very new to STM32Cube and the GCC way of doing things, our previous compiler/linker pretty much did it all without us needing to mess with .ld files or anything.g
Thank you!
