Keil Logo

Error: Flash Download failed - "Cortex-M3" after FLASH_EnableWriteProtection

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Marco Donati
Posted
3-Sep-2009 11:25 GMT
Toolset
ARM
New! Error: Flash Download failed - "Cortex-M3" after FLASH_EnableWriteProtection

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

http://www.st.com/mcu/forums-cat-8438-23.html

and found that

FLASH_EnableWriteProtection

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

FLASH_EnableWriteProtection

??

Is the micro lost forever ??

Thaks in advance

Read-Only
Author
Robert Rostohar
Posted
3-Sep-2009 12:30 GMT
Toolset
ARM
New! RE: Error: Flash Download failed - "Cortex-M3" after FLASH_EnableWriteProtection

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

Read-Only
Author
Marco Donati
Posted
3-Sep-2009 13:06 GMT
Toolset
ARM
New! RE: Error: Flash Download failed - "Cortex-M3" after FLASH_EnableWriteProtection

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 :-)

Read-Only
Author
Robert Rostohar
Posted
3-Sep-2009 13:13 GMT
Toolset
ARM
New! RE: Error: Flash Download failed - "Cortex-M3" after FLASH_EnableWriteProtection

You need to use ULINK Cortex Debugger and erase the Flash.

Read-Only
Author
Marco Donati
Posted
3-Sep-2009 13:26 GMT
Toolset
ARM
New! RE: Error: Flash Download failed - "Cortex-M3" after FLASH_EnableWriteProtection

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
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka12723.html
It seems to works!
Thanks a lot!

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.