cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_FLASH_Program problem on STM32C071CB

I'm using HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, 32-bit-addr, 64-bit-data) and it crashes with an 0xfffffff7 exception.  Has anyone else seen this?  I've checked that the addresses are aligned to 64-bit boundary.

5 REPLIES 5

Crashes or Hard Faults? Where's this Exception# reported?

Is the memory Erased? You get one-shot to program it

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

Yes, that part of Flash is always erased first -- I have had no problem with that.

Here is a screenshot of Cube IDE (1.17) when the crash occurs

Are you break-pointing or single-stepping the code?

Best just to instrument FLASH interaction, to print via serial debug console, reporting progress, variables of interest, internal state, etc.

The debugger can be quite invasive, especially if debug views parked over peripheral registers, or unwritten memory. Blank memory may fault with ECC, so might not be readable from the MCU side.

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

Are you erasing flash that contains code? Show a complete program which exhibits the problem.

 

FLASH_SR shows no error codes.

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

Thanks for all of the helpful replies.  Turned out to be a silly mistake where the flash hadn't actually be properly erased prior to the attempted write/program.  Working now.