cancel
Showing results for 
Search instead for 
Did you mean: 

How Erase Flash memory with stm32h750VB?

CopaCabana_ Reemer
Associate II

Hi everyone,

My project consist, in a bootloader with USB MSC, and the size of flash of this uC is 128k bytes, that is, there is only one sector.

I had some problems with bootloader of this uC. If i program first time, all right, but if i program second time with different application failure, because two things. First, i cant erase the flash memory never and second, if i try to overwrite, the memory already written once the system define the FLASH status register for bank 1, bit 25(SNECCERR1), and i cant continue to overwrite.

i saw this post https://community.st.com/s/question/0D50X00009yGrEASA0/is-eeprom-emulation-possible-on-the-stm32h750 , and i want to know if i have no other choice, to make this bootloader work properly, or if someone have suggestion for this. On all documentation dont have anything , about this.

2 REPLIES 2

Most STM32 will not let you overwrite multiple times, you get one shot at the words due to it carrying ECC bits along with your programmed word.

My expectation is you're going to have to write 256-bit words, and align structures based on that.

STM32Cube_FW_H7_V1.3.0\Projects\STM32H743ZI-Nucleo\Examples\FLASH\FLASH_EraseProgram\Src\main.c

Nobody has provided me with H750 parts, I have no specific reason to test/analyze.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andreas Bolsch
Lead II

It should be obvious that the internal flash is *NOT* going to be sufficient. I'd suggest you use it for a bootloader / update firmware only, whereas the main application goes to an external flash. That's the idea behind the 'value line'. Maybe the production yield of the full flash version is too low, or it's too expensive for most customers. An external flash makes life easier, as it can be freely erased and programmed by code running from internal flash, no need to worry about dual-bank etc.

If your complete application (including bootloader / update fw) really fits into just 128k, and you definitely don't want an external flash, the only feasible option seems to be to update via internal RAM. I. e. move the new app to RAM, prepare programming procedure in RAM and jump there. This procedure would erase the whole flash, program the new app and that's it. However, if anything goes wrong ...