Hi.
I was trying to protect my custom bootloader pages but the call
FLASH_EnableWriteProtection
always returned with error, so I followed the advice at
www.st.com/.../forums-cat-8438-23.html
and found that
returned SUCCESS if called after
FLASH_EraseOptionBytes
Sice then however, I'm not able to re-program the board (MCBSTM32) and i always get the message:
Error: Flash Download failed - "Cortex-M3"
I tried the suggestion at
http://www.keil.com/support/docs/3342.htm
but it didn't works (not much related to my problem because if I try to program a different board - another MCBSTM32 - I have no problems).
Maybe I should have restored the content of the option register after the call to
??
Is the micro lost forever ??
Thaks in advance
You should be able to remove the Flash protection with uVision and ULINK.
- open project Keil\ARM\Boards\Keil\MCBSTM32\Blinky in your MDK installation - change target to "MCBSTM32 + OPT" (programs also option bytes) - optionally edit the STM32F10xOPT.s file using the Configuration Wizard (default values will already remove Flash Write Protection) - program flash (Blinky application together with option keys) or just execute Flash\Erase
Robert,
I opened the blinky project and noticed that under ''utilities'' it uses Signum system JTAGjet. The debug instead is correctly set to ULINK Cortex Debugger. If I use this project without changes the debugger starts and the propgram seems to works(all the board leds turn on in sequence). The Flash menu commands don't work and they cause the following error:
Emu=JTAGGjet;Port=USB emulator canot be found
Anyway, after that I turned back to my project and found the same old problem (Error: Flash Download failed - "Cortex-M3"). I was thinking about including option keys programing in my project but I noticed that if I change the target driver to ULINK Cortex Debugger (the right one for me) in the blinky project I have the same error (Error: Flash Download failed - "Cortex-M3") with BOTH debugger and flash commands.
I'm confused :-)
You need to use ULINK Cortex Debugger and erase the Flash.
Yes, I also tried that. The flash erase returns ok (Full Chip Erase Done), but then if I try to Download or to start the debugger I get the usual error (Error: Flash Download failed - "Cortex-M3"), both with blinky project any my. I included the option key programming file and its algorithm in my project and then selected Erase Sectors instead of Erase Full Chip as stated in infocenter.arm.com/.../index.jsp It seems to works! Thanks a lot!