cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to flash with STM32CubeProgrammer

SimonHuwyler
Associate II

Hi,

I just installed STM32CubeProgrammer v2.17.0 on Linux.

When I connect to the board (tried with several different ones), I get the following error;

flash loader cannot be loaded. FlashLoaderPath = /home/[yadayada]/bin/FlashLoader/0x

I can read the flash, I can do everything, with the exception of flashing. This fails.

I first thought it might be a truncated log message. But when I just copied any of the loader files and gave it the file name "0x", I didn't get the error message. So it really looks for a file named "0x". It looks like in the code, the assembly of the file name (all the files match the pattern 0x*.stldr)

 

I tried to do an software update, but this also fails: "The updater package on server is corrupted"

 

 

7 REPLIES 7
AScha.3
Chief II

Hi,

I have IDE and Cube Programmer on Linux since years, no such problem.

So maybe you do something wrong or the package was damaged ( but very rare ).

So show, what Cube Programmer showing...

Or try full chip erase - if something crazy is there. Check option bytes for protection on some flash areas, set on unprotected then.

If you feel a post has answered your question, please click "Accept as Solution".
SimonHuwyler
Associate II

Thanks for the respone! I tried full erase. Also fails, with an error stating I should check write protection flags. But when I try to unset them, I again get an error. I just installed the program and started it. With and without sudo, no change. But what I do not have yet is the IDE. Maybe this sets an environment variable which is used by the programmer... Will try later today. I mean - what could I do wrong which results in the tool trying to open a flashLoader file named "0x"? It definetly is an error of the assembly of the file name (filename = "0x" + something + ".stldr")

Of course it is probably something with my configuration as it works for you. Maybe the missing IDE, even though it shouldn't.

 

Or do I miss something? Do I have to explicitely configure the FlashFile somewhere?

If you dont have IDE - how you make the program ?

For flash you just need a bin or HEX file, for the cpu you have. No mods needed,.

If you feel a post has answered your question, please click "Accept as Solution".

I am about to install the IDE. I just started with the programmer to check if I can talk to an eval board. That's why I wonder. My tool chain is not even yet installed, and to my understanding the programmer should be standalone. So no real room for me to do things wrong. My best suggestion is some env var provided by the ide, so it works for all who have the IDE installed, which I would consider a bug (production site for example needs a programmer but no IDE. I will try later today

SimonHuwyler
Associate II

Hm, very strange. I installed the IDE, and using it, I can debug my code on the device. Also, after power-cycling the device, I can connect to Cube Programmer, and I see my code. So the IDE can flash without a problem. Just the standalone programmer can't. You sure can also flash your devices with the programmer standalone tool, right? I tried uninstalling, reinstalling - no luck. But at least at the moment I don't really need it as I can flash using the IDE. But it's strange....

SimonHuwyler
Associate II

I have no idea why, but upgrading to Ubuntu 24.04 (from 22.04) resolved the issue.

Jyrki Koivisto
Associate

I have similar problem. These started after I updated STM32CubeProgrammer to v2.17.0.

All works fine if a have that correct flash loader renamed to "0x", MCU flashes and it boots and the code in it works.

 

Here's the log with that "0x" file present

21:34:16:721 : UR connection mode is defined with the HWrst reset mode
21:34:16:760 : ST-LINK SN : 13001200042D363637365744
21:34:16:760 : ST-LINK FW : V2J37S7
21:34:16:760 : Board : --
21:34:16:761 : Voltage : 3.23V
21:34:16:761 : SWD freq : 4000 KHz
21:34:16:761 : Connect mode: Under Reset
21:34:16:761 : Reset mode : Hardware reset
21:34:16:761 : Device ID : 0x431
21:34:16:761 : Revision ID : Rev A
21:34:16:762 : Database: Config 0 is active.
21:34:16:762 : flash loader /home/jyko/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/FlashLoader/0x is loaded <--- Had loader for my MCU (f411) named to "0x" without any extension
21:34:16:762 : Debug in Low Power mode is not supported for this device.
21:34:16:922 : UPLOADING OPTION BYTES DATA ...
21:34:16:922 : Bank : 0x00
21:34:16:922 : Address : 0x40023c14
21:34:16:922 : Size : 8 Bytes
21:34:16:922 : UPLOADING OPTION BYTES DATA ...
21:34:16:923 : Bank : 0x00
21:34:16:923 : Address : 0x40023c14
21:34:16:923 : Size : 8 Bytes
21:34:16:923 : UPLOADING ...
21:34:16:923 : Size : 1024 Bytes
21:34:16:923 : Address : 0x8000000
21:34:16:923 : Read progress:
21:34:16:923 : Data read successfully
21:34:16:923 : Time elapsed during the read operation is: 00:00:00.008
21:34:38:205 : Memory Programming ...
21:34:38:205 : Opening and parsing file: Blackpill_f411.elf
21:34:38:206 : File : Blackpill_f411.elf
21:34:38:206 : Size : 18.78 KB
21:34:38:206 : Address : 0x08000000
21:34:38:206 : Erasing memory corresponding to segment 0:
21:34:38:206 : Memory Erase via FlashLoader!
21:34:38:206 : Memory erase...
21:34:38:206 : halt ap 0
21:34:38:238 : Erasing internal memory sectors [0 1]
21:34:38:238 : Init flashloader...
21:34:38:238 : halt ap 0
21:34:38:241 : run ap 0
21:34:38:242 : halt ap 0
21:34:38:242 : Loader sector erase...
21:34:38:249 : run ap 0
21:34:38:628 : halt ap 0
21:34:38:629 : Download in Progress:
21:34:38:629 : Size : 19232 Bytes
21:34:38:629 : Address : 0x08000000
21:34:38:629 : halt ap 0
21:34:38:649 : Loader write range...
21:34:38:708 : Init flashloader...
21:34:38:709 : halt ap 0
21:34:38:716 : run ap 0
21:34:38:717 : halt ap 0
21:34:38:728 : run ap 0
21:34:38:809 : run ap 0
21:34:38:886 : Segment[0] downloaded successfully
21:34:38:887 : File download complete
21:34:38:900 : Time elapsed during download operation: 00:00:00.682
21:34:43:348 : Disconnected
21:34:43:348 : Disconnected from device.