Skip to main content
Visitor II
May 12, 2025
Question

HAL_FLASH_Program problem on STM32C071CB

  • May 12, 2025
  • 4 replies
  • 596 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.

    4 replies

    Graduate II
    May 12, 2025

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

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

    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

    Graduate II
    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.

    Super User
    May 14, 2025

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

     

    FLASH_SR shows no error codes.

    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.