HAL_FLASH_Program problem on STM32C071CB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-12 12:10 PM
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.
- Labels:
-
STM32C0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-12 4:56 PM
Crashes or Hard Faults? Where's this Exception# reported?
Is the memory Erased? You get one-shot to program it
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-14 8:21 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-14 8:27 AM
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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-14 8:35 AM - edited ‎2025-05-14 8:36 AM
Are you erasing flash that contains code? Show a complete program which exhibits the problem.
FLASH_SR shows no error codes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-20 9:20 AM
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.
