cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer: Error: Flash loader cannot be loaded

EAgui
Associate

Recently, I bought a clone of ST-Link V2.

I am trying to program a RAK5205 board with an STM32L151CB MCU on it, with a basic program for blinking LEDs.

If I use the STM32 ST-Link Utility v 4.5.0.0, open the file RAK5205_Blink.hex and program the MCU, it ends correctly and the program runs without problems on the board. If I want to completely erase the Flash memory, it does it correctly with this indication:

Device ID: 0x429

Device flash Size: 128KBytes

Device family: STM32L100x8xxA / L15xx8xxA

Flash memory erased.

Now, if I open the STM32CubeProgrammer v2.1.0, open the same file RAK5205_Blink.hex, the ST-Link v2 is recognized and connected correctly, read the memory of the MCU without problems, but when I want to program it in the same way than before, it shows the error, "Flash loader can not be loaded".

What is the difference between the ST-Link Utility and the STM32CubeProgrammer regarding device detection and programming? 

What exactly does the error"Flash loader can not be loaded" means?

One difference I noted is that the STM32CubeProgramer, detected the Device as STM32L100x6xxA / STM32L100x8x ... with a Flash Size of 27520 KB instead of 128KB that has the MCU, different from what it is detected with ST-Link Utility.

Sorry if it is an stupid question, I'm a newby trying to lern. I'll appreciate any opinion or suggestion.

My OS is Windows 7 Ultimate.

Thank you

13 REPLIES 13

Well it's consistent at least.

What board is this? A Nucleo or some custom board? Does it have it's own loader code on it? Does that have any protections enabled?

Is NRST wired to the debug interface?

Strap BOOT0 High and try to get whatever is on the device currently erased.

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

Hi, the development board is new from Mikroe type Clicker4 for STM32F767BI (schematic is on the website). The boot0 was low, now I put it to high. Cause it is high the factory program didn't run. The optionbit RDP = FF and must be AA, only bank nWRP11 is unchecked. The NRST pin is connected to the JTAG/SWD with the ST-link. Erase the full chip flash is also impossible like before.

If I type the command "lsusb" in the terminal, the STM32 is not detected (not in the list), ST-link is recognized. When start ST-PRG, the connection with STM32 is established, but unable to change and ST-link led is green and blink 5 times red.

Unfortunately not a board/os/tool combo I'm using.

The flash size reporting and option byte reading looks broken, not sure I can explain that short of a connectivity failure, perhaps try a connection speed below 4 MHz

This is using a authentic external ST-LINK, right?

Have you tried with the stand-alone Windows tools (not the IDE or GDB), guessing not?

Perhaps someone at ST has some insights.

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

Hi,

I try to upload my test program via arduino, it fails also cause of missing packets from the STM32 programmer. I uninstall all STM32 and reinstall the new version 1.6.1

but the problem stay. Must Boot0 by high or low. The STM32F chip is never in the list of USB devices.