cancel
Showing results for 
Search instead for 
Did you mean: 

stm32h5 Flash Dual Bank + EEPROM emulation

VictorGJ
Associate

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

4 REPLIES 4
robmilne
Associate III

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.

SofLit
ST Employee

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:

SofLit_1-1707921839427.png

SofLit_0-1707921650947.png

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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!

VictorGJ
Associate

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

 

VictorGJ_0-1707931297558.png