Skip to main content
SH.3
Associate
June 8, 2023
Solved

STM32H747IGT6 Flash read leading to hardfault

  • June 8, 2023
  • 1 reply
  • 4813 views

Hi,

We have written the data in Flash Bank 2 sector 7 successfully. Power cycled the board and trying to read the stored data from Flash Bank 2 sector 7 and found Hadrdfault error at 64th byte.

-> The data stored in the form of char.

-> Using HAL library to for flash read and write

Following image represents the memory layout before reading the data. At 64th byte String had "?" and leading to Hardfault error. Even tried the Flash Bank 2 sector 1 and found the same error.

Quick response is much appreciated.


_legacyfs_online_stmicro_images_0693W00000dDOhuQAG.png 

Regards,

Srinidhi H

This topic has been closed for replies.
Best answer by waclawek.jan

You have to obey the FLASH ECC granularity and write the whole granule at once and only once, otherwise you get an ECC error leading through unhandled NMI to Hardfault.

The 'H7 granule is 256 bits (32 bytes). Read the FLASH chapter in RM.

JW

1 reply

waclawek.jan
waclawek.janBest answer
Super User
June 8, 2023

You have to obey the FLASH ECC granularity and write the whole granule at once and only once, otherwise you get an ECC error leading through unhandled NMI to Hardfault.

The 'H7 granule is 256 bits (32 bytes). Read the FLASH chapter in RM.

JW