AnsweredAssumed Answered

I bricked my brand new VLDiscovery board

Question asked by turk.andy on Aug 11, 2012
Latest reply on Aug 28, 2012 by Clive One
About 45 minutes into playing with my new VLDiscovery board, I seem to have bricked it. I downloaded a "bad" program onto the thing and now it's telling me that the device is protected and resists all my attempts to put a "good" program into flash.

I'm doing all this on OS X (Lion) with opened 0.6.0-rc1. Openocd seemed to work well enough to put the bad code down, so I've got to believe there's some magic incantation that will let me use the same setup to get it working again. The board cost less than $10, but it'd be a shame to throw it away because of some bad bits. I'm pretty sure my opened setup is workable because I can successfully flash a STMF4Discovery board with good code. What I'm missing is some way to bring the VLDiscovery board back.

Unfortunately, I don't have access to a windows environment and CrossWorks chokes when I try to install the STM32 packages and thus never sees my board via USB.

The board seems generally hosed now with bogus values coming back for the size of flash memory. Is it just a paperweight now?

$ telnet localhost 4444
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> halt
target was in unknown state when halt was requested
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
> mdw 0 4 
0x00000000: 40000080 00000000 00000000 00000000 
> flash erase_sector 0 0 last
device id = 0x10016420
flash size = 5384kbytes
erased sectors 0 through 5383 on flash bank 0 in 0.029046s
> cd /Users/andy/code/chibios/demos/ARMCM3-STM32F100-DISCOVERY
> flash write_image build/ch.elf
Padding image section 0 with 4 bytes
flash write algorithm aborted by target
target state: halted
target halted due to breakpoint, current mode: Thread 
xPSR: 0x41000000 pc: 0x2000003a msp: 0xfffffffc
flash write failed at address 0x8000002
flash memory write protected
error writing to flash at address 0x08000000 at offset 0x00000000
in procedure 'flash'