cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H747IGT6 Flash read leading to hardfault

SH.3
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

1 REPLY 1

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