AnsweredAssumed Answered

Flash error when programming STM32F407

Question asked by geams13 on May 29, 2013
Latest reply on Jan 13, 2015 by Pac-Man
Hi, I have an STM32F407IE on a custom board and I am programming/debugging with an Olimex ARM-USB-TINY-H using OpenOCD.  I have come across this error with two separate microcontrollers now.  It seems as though the microcontroller enter some type of error state while running (I have not had it attached to the debugger when this error happens).  Once it occurs, I try running it through the debugger and it refuses to run.  When running it through gdb, it gives me the following:

stm32f4x.cpu -- clearing lockup after double fault
Program received signal SIGINT, Interrupt.

Using OpenOCD, I can issue a 'reset halt' command to halt the microcontroller, but when I do a 'flash probe 0', I get the following response:

device id = 0x10016413
MEM_AP_CSW 0x23000051, MEM_AP_TAR 0x1fff7a24
STM32 flash size failed, probe inaccurate - assuming 1024k flash
flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000

If I try to erase the flash and write a new image, I get the following error:

auto erase enabled
stm32x device protected
failed erasing sectors 0 to 7
in procedure 'flash'

I know all of this is specific to OpenOCD, but it seems like this is a hardware issue.  It seems like occasionally something is happening to the flash.  I am not using any flash-specific calls in code from the stm32f4xx_flash.h library.  Does anyone have any suggestions?  Any other logging information that I could provide to help?