cancel
Showing results for 
Search instead for 
Did you mean: 

Error When Trying to Flash STM32F405

Rogers.Gary
Senior II
Posted on June 19, 2015 at 01:12

Hello:

I have the STM32F405 target connected via ST-Link pod (using IAR EWARM) This is the second of 2 identical boards, the other flashes OK.

The ST-Link connects with no problem. When I initially just tried loading the program from EWARM, it reported a ''Flash Error'' and exited.

I then used ST-Link utility to look further. I selected ''Program & Verify'', then it said protection was enabled, and I selected ''Yes'' to disable it. The download dialogue pops up, and then another dialog pops up indicating an error:

''Programming error @ 0x2000098C'' (!)... a screen capture is attached.

I've tried both setting and unsetting Level 0 & 1 option bytes. Each time it says ''Could not set option bytes! Please reset the target and retry''

All pin voltages seem normal: the Vcap 1 and Vcap 2 voltages are 1.2V. See screen shot attached.

Any suggestions as to what is going on?

4 REPLIES 4
Posted on June 19, 2015 at 04:33

Before this it's complaining about Read Out Protection being enabled. Suggest you try to Mass Erase the part and start over.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Rogers.Gary
Senior II
Posted on June 22, 2015 at 16:50

Not sure what you mean by ''Mass Erase''. I have ''Erase Chip'' and ''Erase Sectors'' Trying either of those elicits a response that says '' Read out protection is activated''

Then, when I try setting ''Target->Option Bytes'' and disble all read protection bytes, (level 0 or 1) I get a message: ''Could not set the Option bytes! Please reset the target and retry.''

However, resetting (disconnect, reconnect, whatever...) doesn't do anything. In any case, I've used read protection level 1 before. It will switch it off automatically when you slect ''Target->Program & Verify'' and request confirmation to disable it. When trying this, it simply says it cannot disable read protection.

Does this clarify it? Hope someone can now explain just what to try next. Replace the device? Is it factory-toasted? This happened on the first power up.

Thanks...

Posted on June 22, 2015 at 17:14

It's more indicative that it's not connected properly, or there's a board level issue, than the chip came pre-fried.

I would use the Flash Demonstrator, or talk to the System Loader, directly via the USART1 (PA9/PA10), and see if it reported similar issues, and try to mass erase (everything in one step) or change the protection level from there.

http://www.st.com/web/en/resource/technical/document/application_note/CD00264342.pdf

Find ''mass erase''

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Rogers.Gary
Senior II
Posted on June 22, 2015 at 17:24

alright, thanks clive1. I will read that document and post when I discover something one way or another.