Updating Nucleo-32 firmware with com.st.STM32CubeIDE

Hello everyone,

I’ve installed STM32CubeIDE using flatpak and ran into a problem when flashing to my Nucleo-32 board. First the IDE asks me to update the Firmware of the detected board but when I press “Open in update mode” I get the error:

Unexpected error during opening (1).
Device 004E...3538 not found. No device connected."

I investigated and found this information on the app’s page on flathub:

For flashing to work properly you will need to add udev rules according to your device. If your device has an id of 0483:374b (check lsusb), you will need to create a file in /etc/udev/rules.d/ with the contents: SUBSYSTEMS==“usb”, ATTRS{idVendor}==“0483”, ATTRS{idProduct}==“374b”, GROUP=“users”, MODE=“0666” and either reboot or run: sudo udevadm control --reload

So I checked the board’s ID, created the udev-rule, ran the command, rebooted, did just about everything but the problem persists. First I see the board then it disappears when trying to “open in update mode”.

Meanwhile this is the output of the console running flatpak:

libusb: error [get_usbfs_fd] File doesn't exist, wait 10 ms and try again
libusb: error [get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/001/005, errno=2

I run Arch Linux, here’s the content of my 99-usb.rules:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", GROUP="users", MODE="0666"

I’ve renamed the file trying many different numbers just for the heck of it, but to no avail. Permissions on the rule file are 644.

I’m obviously not familiar with udev-rules so any help would be appreciated.

I’m not familiar with the specific app, but depending on the usb connection implementation - in some apps, I need to restart the flatpak after plugging in a usb device. Otherwise it doesn’t get found.

Thanks for the hint, but the device is found everytime and then gets lost when I try to update the firmware… But I just tried flashing a build, which worked. so I can flash a build but not update the firmware. I’ve changed the topic accordingly.

My guess would be, that it restarts to get into a bootloader mode? Some apps allow to set No restart - not sure if this one can.

You mean a setting in the IDE or some sort of flatpak-parameter? Could you elaborate?

In the IDE, that’s why I don’t know, if it has this.

Apps like betaflight have toggles for this for e.g. and they are flashing similar boards (but that setting is also needed for some cases - without flatpak being involved)

So I’ve had the same problem with the STM32F407G-Discovery-Board which also denies flashing without the firmware-update. On a hunch I ran the update manually et voila, this worked! It threw an error about not being able to exit the update-mode but I can now flash the Discovery-Board. Don’t have the Nucleo-32 on me right now but I’m hoping that will be the same.

I will mark this as solved as soon as I can verify it also works with the Nucleo-32.