cancel
Showing results for 
Search instead for 
Did you mean: 

Flash write command error

Tejas Doshi
Associate II
Posted on May 11, 2018 at 22:55

Hello Guys, I am using STM32 L476RG microcontroller. I am trying to program it with ST Link V2 and ST link utility. The utility recognizes my microcontroller however when I try to drag and drop the code, I get a fail.TXT which syas 'Flash Write command failure' I  checked all my connections and they seem to be fine. I dont know where I am going wrong. please help me. it is driving me insane

7 REPLIES 7
Posted on May 12, 2018 at 01:36

The drag-n-drop is an mbed functionality, really don't think it has any relationship to the ST-LINK Utilities.

Can you load the file with the ST-LINK Utilities?

Is this a .BIN or .HEX file?

How large is the file?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 12, 2018 at 03:19

Hello! Thank you for your prompt reply. I tried uploading the code using ST link Utility and was unable to upload the code. I got a 'failed during verification error'. I tried the full chip erase and I got a 'Error during mass flash erase'. The ST link utility detects the MCU correctly but will not upload the code. I tried to play with the different options such as skip flash erase but to no luck. 

Also it is a BIN file. size is 60KB. I am assuming it is not a hardware issue since the ST link detects the MCU. 

Posted on May 12, 2018 at 12:29

Is this a custom board, or a DISCO, NUCLEO or EVAL board I might be familiar with?

Some of the L4 can be in single or dual bank flash modes, you might want to check the options/settings there are coherent.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 12, 2018 at 19:08

hello. This is a custom board. I had designed a different custom board before this and was getting the same error. However after multiple tries the issue was resolved. It was weird. No luck with the new custom board. 

Could you tell me how I can check the flash mode for my L476RG?

Posted on May 12, 2018 at 19:17

Try Target->Options in the ST-LINK Utilities (v4.2.0, also try current ST-LINK firmware), or look at Cube Programmer

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 12, 2018 at 19:36

Just checked. The dual bank mode option is selected but not accessible. Also the ST link utilities is the current version v4.2.0  and the ST link firmware is also upgraded. 

What do I do next?

Posted on May 12, 2018 at 19:48

Have you tried with a NUCLEO-L476RG?

http://www.st.com/en/evaluation-tools/nucleo-l476rg.html

 

If that works you'd want to review what you're doing on your board.

Have you tried using the ROM based System Loader via USART1 PA9/PA10 at 9600 8E1 ? Signs of life would be sending 0x7F byte and getting 0x79 response. You could also try pushing in firmware via Flash Loader Demonstrator (or perhaps Cube Programmer, I think it supposed to support multiple modes of functionality).

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..