cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H755zit6 flash sector corrupt

Arshath
Associate

Hi,

I am using the STM32H755ZIT6 dual-core microcontroller.
The internal Flash memory has a sector size of 128 KB and a page size of 4 KB.

In my application, I perform erase and write operations on a specific Flash sector. If a power failure occurs while the erase or write operation is in progress, I occasionally observe that:

  • The Flash sector being accessed becomes corrupted

  • The sector cannot be read by the application

  • The same sector also becomes inaccessible in STM32CubeProgrammer 

This issue does not occur every time and seems to happen randomly during power loss.

After full chip erasing it I can access the sector region.

I would like to understand:

  • The possible reason for this Flash corruption during power failure

  • Whether this behavior is expected for STM32H7 Flash memory

  • Recommended software or hardware methods to avoid or recover from this situation

Any guidance would be appreciated.

Thank you.

1 REPLY 1
TDK
Super User

When you do firmware upgrades on devices, do you ever recall getting messages like "please do not turn off your device"? This is why. Cutting power while writes are in progress can lead to corrupt states. This is expected.

The recommendation is to not cut power during a critical section, or to implement ways to recover gracefully.

 

If storing data, use two flash sectors and roll back to the previous configuration if data is corrupted. This is what the EEPROM emulation library does.

How to use EEPROM emulation on STM32 MCUs - Application note

If you feel a post has answered your question, please click "Accept as Solution".