cancel
Showing results for 
Search instead for 
Did you mean: 

Programmer on Linux fails with: "Error: flash loader cannot be loaded. FlashLoaderPath = /opt/stm32cubeprog/bin/FlashLoader/0x

Janek1
Associate II

Hey,

I'm trying to flash some boards, same as i've done thousands of times with this PC and ST-Link, but Cube Programmer does not load the FlashLoader properly. I'm not using a custom loader or anything, just the default loader for my STM32F051 boards. I'll attach the logs below.

I can rule out a defective ST-Link since it happens with other ST-Links as well and the boards are functional as well. A colleague is able to flash them without issues, but using the same ST-Link than him i cannot on my System. I am also able to use the ST-Link normally for flashing and debugging through probe-rs, it just malfunctions in Cube Programmer.

It is also not a problem with option bytes as we never set them and all of them are in the default state, i can also confirm this in Cube Prog.

I have used STM32CubeProgrammer v 2.19.1 and have since upgraded to 2.20.0 without success. The ST-Link was running Firmware Version V3J16M7B5S1, which i have upgraded to V3j16M8B5S1, again without success.

 

My System is running on Arch Linux and i've installed CubeProgrammer through the AUR package (https://aur.archlinux.org/packages/stm32cubeprog). Any help on this would be greatly appreciated since flashing devices is something i need to do regularly for my job and CubeProgrammer should be a "just works" in my opinion.

 

3 REPLIES 3
Ozone
Principal

I can't comment to to the Cube-Programmer itself, I never used it.

> Programmer on Linux fails with: "Error: flash loader cannot be loaded. FlashLoaderPath = /opt/stm32cubeprog/bin/FlashLoader/0x

Is this a command line error message ?
Have you checked the executable exists, and is actually executable (x-flag set) ?

Have you tried with sudo ?
You might need to add your user to some groups to allow access to serial ports and USB, if you don't want to use sudo/root privileges each time.

> My System is running on Arch Linux  ...

I don't know if ST supports Arch Linux officially for Cube. 
The list of supported distros is d**n short, actually - and mine is not on the list either.


@Ozone wrote:

> Programmer on Linux fails with: "Error: flash loader cannot be loaded. FlashLoaderPath = /opt/stm32cubeprog/bin/FlashLoader/0x

Is this a command line error message ?
Have you checked the executable exists, and is actually executable (x-flag set) ?

Have you tried with sudo ?
You might need to add your user to some groups to allow access to serial ports and USB, if you don't want to use sudo/root privileges each time.


It's an error message, appears in a popup and in the log window.

The executable does not exist, i'm assuming that 0x is just the prefix and that cube prog should find the correct loader based on the connected chip, which in my case should be 0x440.stldr since 0x440 the device ID of my chip. Anyway this is the contents of the FlashLoader directory:

❯ ls -al /opt/stm32cubeprog/bin/FlashLoader
total 3032
drwxr-xr-x  2 root root  4096 Aug 25 12:22 .
drwxr-xr-x 19 root root  4096 Aug 25 12:22 ..
-rw-r--r--  1 root root 15836 Aug 25 12:21 0x1E.stldr
-rw-r--r--  1 root root 15656 Aug 25 12:21 0x27.stldr
-rw-r--r--  1 root root 15608 Aug 25 12:21 0x28.stldr
-rw-r--r--  1 root root 16628 Aug 25 12:21 0x32.stldr
-rw-r--r--  1 root root 37780 Aug 25 12:21 0x410.stldr
-rw-r--r--  1 root root 36832 Aug 25 12:21 0x411.stldr
-rw-r--r--  1 root root 33016 Aug 25 12:21 0x412.stldr
-rw-r--r--  1 root root 38752 Aug 25 12:21 0x413.stldr
-rw-r--r--  1 root root 37780 Aug 25 12:21 0x414.stldr
-rw-r--r--  1 root root 40928 Aug 25 12:21 0x415.stldr
-rw-r--r--  1 root root 42016 Aug 25 12:21 0x416.stldr
-rw-r--r--  1 root root 41636 Aug 25 12:21 0x417.stldr
-rw-r--r--  1 root root 37780 Aug 25 12:21 0x418.stldr
-rw-r--r--  1 root root 49628 Aug 25 12:21 0x419.stldr
-rw-r--r--  1 root root 37788 Aug 25 12:21 0x420.stldr
-rw-r--r--  1 root root 38928 Aug 25 12:21 0x421.stldr
-rw-r--r--  1 root root 28920 Aug 25 12:21 0x422.stldr
-rw-r--r--  1 root root 39300 Aug 25 12:21 0x423.stldr
-rw-r--r--  1 root root 31800 Aug 25 12:21 0x425.stldr
-rw-r--r--  1 root root 36100 Aug 25 12:21 0x427.stldr
-rw-r--r--  1 root root 37788 Aug 25 12:21 0x428.stldr
-rw-r--r--  1 root root 27120 Aug 25 12:21 0x429.stldr
-rw-r--r--  1 root root 69700 Aug 25 12:21 0x430.stldr
-rw-r--r--  1 root root 38928 Aug 25 12:21 0x431.stldr
-rw-r--r--  1 root root 29564 Aug 25 12:21 0x432.stldr
-rw-r--r--  1 root root 40652 Aug 25 12:21 0x433.stldr
-rw-r--r--  1 root root 50336 Aug 25 12:21 0x434.stldr
-rw-r--r--  1 root root 32564 Aug 25 12:21 0x435.stldr
-rw-r--r--  1 root root 43244 Aug 25 12:21 0x436.stldr
-rw-r--r--  1 root root 31992 Aug 25 12:21 0x437.stldr
-rw-r--r--  1 root root 28904 Aug 25 12:21 0x438.stldr
-rw-r--r--  1 root root 28952 Aug 25 12:21 0x439.stldr
-rw-r--r--  1 root root 25404 Aug 25 12:21 0x440.stldr
-rw-r--r--  1 root root 45968 Aug 25 12:21 0x441.stldr
-rw-r--r--  1 root root 28708 Aug 25 12:21 0x442.stldr
-rw-r--r--  1 root root 29388 Aug 25 12:21 0x443.stldr
-rw-r--r--  1 root root 28832 Aug 25 12:21 0x444.stldr
-rw-r--r--  1 root root 28708 Aug 25 12:21 0x445.stldr
-rw-r--r--  1 root root 28804 Aug 25 12:21 0x446.stldr
-rw-r--r--  1 root root 33616 Aug 25 12:21 0x447.stldr
-rw-r--r--  1 root root 28708 Aug 25 12:21 0x448.stldr
-rw-r--r--  1 root root 39680 Aug 25 12:21 0x449.stldr
-rw-r--r--  1 root root 34048 Aug 25 12:21 0x44C.stldr
-rw-r--r--  1 root root 25760 Aug 25 12:21 0x44D.stldr
-rw-r--r--  1 root root 17528 Aug 25 12:21 0x450.stldr
-rw-r--r--  1 root root 51708 Aug 25 12:21 0x451.stldr
-rw-r--r--  1 root root 33536 Aug 25 12:21 0x452.stldr
-rw-r--r--  1 root root 29400 Aug 25 12:21 0x453.stldr
-rw-r--r--  1 root root 25984 Aug 25 12:21 0x454.stldr
-rw-r--r--  1 root root 32416 Aug 25 12:21 0x455.stldr
-rw-r--r--  1 root root 34312 Aug 25 12:21 0x456.stldr
-rw-r--r--  1 root root 29940 Aug 25 12:21 0x457.stldr
-rw-r--r--  1 root root 27868 Aug 25 12:21 0x458.stldr
-rw-r--r--  1 root root 31748 Aug 25 12:21 0x459.stldr
-rw-r--r--  1 root root 32852 Aug 25 12:21 0x460.stldr
-rw-r--r--  1 root root 35432 Aug 25 12:21 0x461.stldr
-rw-r--r--  1 root root 35792 Aug 25 12:21 0x462.stldr
-rw-r--r--  1 root root 45032 Aug 25 12:21 0x463.stldr
-rw-r--r--  1 root root 35808 Aug 25 12:21 0x464.stldr
-rw-r--r--  1 root root 30992 Aug 25 12:21 0x466.stldr
-rw-r--r--  1 root root 34488 Aug 25 12:21 0x467.stldr
-rw-r--r--  1 root root 39652 Aug 25 12:21 0x468.stldr
-rw-r--r--  1 root root 31364 Aug 25 12:21 0x469.stldr
-rw-r--r--  1 root root 27916 Aug 25 12:21 0x470.stldr
-rw-r--r--  1 root root 37224 Aug 25 12:21 0x471.stldr
-rw-r--r--  1 root root 28804 Aug 25 12:21 0x472.stldr
-rw-r--r--  1 root root 28308 Aug 25 12:21 0x474.stldr
-rw-r--r--  1 root root 24804 Aug 25 12:21 0x476.stldr
-rw-r--r--  1 root root 27748 Aug 25 12:21 0x478.stldr
-rw-r--r--  1 root root 33884 Aug 25 12:21 0x479.stldr
-rw-r--r--  1 root root 30888 Aug 25 12:21 0x480.stldr
-rw-r--r--  1 root root 27524 Aug 25 12:21 0x481.stldr
-rw-r--r--  1 root root 25872 Aug 25 12:21 0x482.stldr
-rw-r--r--  1 root root 20748 Aug 25 12:21 0x483.stldr
-rw-r--r--  1 root root 36020 Aug 25 12:21 0x484.stldr
-rw-r--r--  1 root root 25088 Aug 25 12:21 0x485.stldr
-rw-r--r--  1 root root 31812 Aug 25 12:21 0x489.stldr
-rw-r--r--  1 root root 22436 Aug 25 12:21 0x492.stldr
-rw-r--r--  1 root root 35608 Aug 25 12:21 0x493.stldr
-rw-r--r--  1 root root 21940 Aug 25 12:21 0x494.stldr
-rw-r--r--  1 root root  8192 Aug 25 12:21 0x494_FUS_Operator.bin
-rw-r--r--  1 root root 22588 Aug 25 12:21 0x494_nonSecure.stldr
-rw-r--r--  1 root root 24828 Aug 25 12:21 0x495.stldr
-rw-r--r--  1 root root  8192 Aug 25 12:21 0x495_FUS_Operator.bin
-rw-r--r--  1 root root 20956 Aug 25 12:21 0x495_nonSecure.stldr
-rw-r--r--  1 root root 32652 Aug 25 12:21 0x496-nonSecure.stldr
-rw-r--r--  1 root root 33844 Aug 25 12:21 0x496.stldr
-rw-r--r--  1 root root  8508 Aug 25 12:21 0x496_FUS_Operator.bin
-rw-r--r--  1 root root 40236 Aug 25 12:21 0x497.stldr
-rw-r--r--  1 root root 27548 Aug 25 12:21 0x4B0.stldr
-rw-r--r--  1 root root 30116 Aug 25 12:21 0x500.stldr

Note that the loaders are not executable, i have tested with them being executable though and nothing changes.

I also highly doubt that it is a permission problem due to multiple reasons:

1. It worked for years and i did not change anything in my permissions/groups

2. I can access the ST-Link, i can read out the flash and read option bytes. Just erasing/flashing does not work.

3. I tried as super user without success.

> It's an error message, appears in a popup and in the log window.

As I expected, you talk about a GUI application. Just to rule this possibility out.

> The executable does not exist, i'm assuming that 0x is just the prefix and that cube prog should find the correct loader based on the connected chip, ...

Why the application can't find it I can't say.
I'm no Cube user.

But supposedly it could be either an installation issue, or a version issue.
In other words, the installation could be broken or incomplete, or the installed version does not support the debug pod or target.
But these are the things the ST staff is supposed to know.