cancel
Showing results for 
Search instead for 
Did you mean: 

Why i get ? when viewing flash content by STM32CubeIDE, and getting HardFault when trying to read from there? Only when i erasing the sector i get F and able to read and write to flash.

DVars.1
Associate II
 
5 REPLIES 5
Uwe Bonnes
Principal III

Check that you real valid memory. A hardfault may point that you access non-existing memory.

It might help to be specific about the specific chip involved, and show a screen shot of the CubeIDE access.

The debugger view may notice the issue and not display data read.

Generally Hard Faults are diagnosed by inspecting the processor registers and code at/approaching the fault location.

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

The address is valid, even the debugger show ? instead of 0 / 1.

DVars.1
Associate II

I am using ST32H743, and working with the second half of the flash from address 0x0810_0000

I am using commands of FLASH_Erase_Sector() while all other commands are HAL , may that be a problem?

Sometimes when i try to read from the memory i get the fault, and when i view the flash memory by the debugger i see ???? instead of 0/1. Only erasing the flash solving the problem until the next time it occures.

I tried to use command HAL_FLASHEx_Erase and it looks like the problem solved. I dont know why but now i am writing and reading without getting the fault errors.

Could be the ECC on the flash lines, getting something partially written or corrupted can cause this.

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