Skip to main content
eric239955_stm1_stmicro
Associate II
May 12, 2025
Question

HAL_FLASH_Program problem on STM32C071CB

  • May 12, 2025
  • 5 replies
  • 620 views

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.

This topic has been closed for replies.

5 replies

Tesla DeLorean
Guru
May 12, 2025

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
eric239955_stm1_stmicro
Associate II
May 14, 2025

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

Tesla DeLorean
Guru
May 14, 2025

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
TDK
May 14, 2025

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""."
eric239955_stm1_stmicro
Associate II
May 20, 2025

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.