I want to have a persistent (non-volatile) storage for my SYSCFG:
parameters, like SPI clock speed, SPI mode, IP address of MCU... should be stored and loaded when a reset/power-up cycle is done,
from a non-volatile memory (like from an external I2C flash memory).
MaaXBoard-RT does not have an external I2C flash memory, but it has the Hyperflash.
How could I "reserve" a sector in Hyperflash (256 * 4bytes is enough, a "sector/page") and save there my SYSCFG?
I have studied the API, the FW code, SDK examples (which might not help due to a different flash device used), but I cannot find any API (code, function) which would allow me to write and read a sector (piece of memory)
to/from Hyperflash during runtime.
All seems to be related only to flash your FW (done by debugger), but not possible to create a "user sector" there, to write and read from it during runtime (when my FW is running and doing it "itself").
Options:
OK, it would be fine to have "backup" registers, so that I can do a FW Reset (restart via SW command, but not a power cycle), and these registers are
not cleared on reset. Other MCUs (STM32H7xx) have "backup registers" in RTC which are not cleared on Reset (cool). But missing here (maybe I could "hijack" the Year, Month, Date registers in RTC, but not ticking/using the RTC).
I found some "general purpose registers", e.g. GPR_SHARED[8] in CCM module.
They could help, just not so much as I need (just 8, plus PRIVATE, also 8, but I need potentially up to 64 x 32bit registers which would survive a reset):
I want to start-over entire FW from startup ("SW Reset") but with modified SYSCFG.
Let's see.
If you have any idea how to have a persistent memory which would at least "survive" a reset,,,
(not initialized SRAM, DTCM might do as well, but not SDRAM (it does not "survive" a reset)).
Other option is to use I2C and connect an external I2C flash memory. OK: just a HW extension needed (PCB, e.g. like a HAT).
To use the Hyperflash for this feature would be great:
- but no idea how to use Hyperflash when FW is running (for erase/write/read a sector from there, also to make sure the next FW flash does not rip out my SYSCFG
Do you have any idea?
Thank you.