2024-02-13 08:32 AM
Hello everyone,
I intend to migrate an LPC development to the new stm32h5 family, I find the versatility that its flash offers very interesting. Being able to separate a set of memory into two blocks to run the main program without the need for an IAP firmware. but I have doubts.
In my old LPC I had an EEPROM memory clearly separated from the memory block. In the new stm32h5 there is talk of a high-cycling Flash capability that can function as a kind of EEPROM. My question is, can I dedicate the bank 1 portion of the Flash to EEPROM emulation and still maintain the ability to swap between banks for software updates?
Thanks in advance!
Victor
2024-02-14 06:31 AM
Yes - but don't dedicate 'a' bank for EEPROM_Emul. Use both whereby each bank opposite to the operating bank is used for EEPROM emulation (RWW capability).
I have bank switching working working for fw updates + emulated eeprom for NV parameter storage using the Nucleo-H563. My PC FOTA app transfers the new fw image to the massive SRAM3 region using TCP, validates the image, programs the inactive bank, and then flips the bank (process is mediated by a ModbusTCP register). My only concern was for the high-cycle flash bank switching - what will happen to my NV data after the switch? Would I have to explicitly copy over my data before the swap? Sec 7.3.10 of the RM simply states that the swap works for the high-cycle region, but I didn't quite understand what that meant. In my tests, I can switch the banks back and forth using my Modbus reg and can see the parameter changes that I make in one bank propagate to the other - magic!
I based my EEPROM emulation on the official package provided by ST (en.x-cube-eeprom-v6-1-0.zip) with some adjustments to the header file macros for bank switching.
2024-02-14 06:44 AM - edited 2024-02-14 08:54 AM
Hello,
You didn't mention which H5 part number you're using.
But in the case of STM32H56x and STM32H573, there is a dedicated part from the flash which can be used for EEPROM emulation. 48KB per bank:
2024-02-14 06:54 AM
I'm using the MCU part that comes with the Nucleo-H563ZI board.
My first step was to run the ST emulated eeprom project for that board - works well though I haven't got around to doing power interruption testing. I then added the H5 specific components of that project over to my app that does the FOTA bank switching without knowing how the high-cycle flash would behave after the bank swap. I was pleasantly surprised to see data changes to one bank propagate automatically to the other between swaps. My hat is off to the ST engineering team!
2024-02-14 09:26 AM
Thank you for your response robmilne, it has been very clarifying, it serves as a guide for me to develop my application. I see you have done a great job using Flash.
Thanks for your response SofLit, I am using the Nucleo-H563. Using MXCube, the detail of the description led me to confusion