2021-02-16 09:20 AM
-Using the HAL in STM32 Cube IDE.
-I can examine the FLASH pointer in the hard fault ISR and the registers appear to be just like when accessing any other page.
-I am unlocking the Flash and the option bytes.
-I have not modified the option bytes.
-It does not matter how many pages I have erased before, whether it is 5 or none, page 21 hard faults.
Thank You
2021-02-16 12:18 PM
Supply voltage too low? Flash already weared out by too many erase cycle? Did you perhaps use that page as EEPROM substitute for some time? Brokken part, do more chips behave that way?
2021-02-16 01:26 PM
What does STLink Utility (or it's cuboid counterpart) say, can they erase/program this sector?
Option bytes are set how?
JW
2021-02-16 05:40 PM
Thanks for responding. To answer both sets of questions:
I am attaching some screenshots of the FLASH registers and the CPU register immediately before and after a sample hard fault.
Flash registers just before hard fault.
CPU registers just before hard fault.
FLASH registers just after hard fault.
CPU registers just after hard fault.
Any help will be greatly appreciated. Thank you.
2021-02-16 06:16 PM
I apologize. My images show FLASH->AR as 0x4400, which is the offset into flash, not the page address. I just re-ran with FLASH->AR as 0x08004400 and got the same hard fault. There is no change before the fault except for FLASH->AR. After the hardfault, the FLASH registers are the same (except AR), but the processor registers are different. Here they are. I apologize for the confusion.
2021-02-16 06:21 PM
Here are the clocks.