Skip to main content
m4l490n
Associate III
Dec 9, 2024 7:34 PM UTC
Solved

create custom USB DFU program using libusb instead of STM32CubeProgrammer?

Hello,

First I want to clarify that STM32CubeProgrammer is a very cool and useful software.

The purpose of my question is that in my company we need to integrate a "Firmware Flasher" into one of our Software products since we are not going to indicate our customers to download, install, and use STM32CubeProgrammer to update their device's firmware.

I was wondering if there is a sample project or code that uses libusb (preferably in C or C++), that I can use as a reference to develop a firmware flasher. I say ideally in C and C++ but if it is not in any of these languages that is ok. I can just translate it from whatever to C++ using ChatGPT.

Thanks!

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Dec 9, 2024 9:06 PM UTC

Try Github? Likely to be a place to find USB DFU code, ST or otherwise.

https://www.st.com/resource/en/application_note/an3156-usb-dfu-protocol-used-in-the-stm32-bootloader-stmicroelectronics.pdf

 

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

5 replies

m4l490n
m4l490nAuthor
Associate III
Dec 9, 2024 7:30 PM UTC

Duplicate thread merged.


Hello,

First I want to clarify that STM32CubeProgrammer is a very cool and useful software.

The purpose of my question is that in my company we need to integrate a "Firmware Flasher" into one of our Software products since we are not going to indicate our customers to download, install, and use STM32CubeProgrammer to update their device's firmware.

I was wondering if there is a sample project or code that uses libusb (preferably in C or C++), that I can use as a reference to develop a firmware flasher. I say ideally in C and C++ but if it is not in any of these languages that is ok. I can just translate it from whatever to C++ using ChatGPT.

Thanks!

Tesla DeLorean
Guru
Dec 9, 2024 9:08 PM UTC

Dupe  https://community.st.com/t5/stm32cubeprogrammer-mcus/is-there-an-example-of-how-to-use-libusb-to-create-a-custom-usb/td-p/752096

Perhaps you can find SW engineers with Windows, USB experience on places like Fiverr ?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Dec 9, 2024 9:06 PM UTC
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
m4l490n
m4l490nAuthor
Associate III
Dec 9, 2024 9:16 PM UTC

@Tesla DeLorean 

Ok, I have heard about the USB DFU protocol before but I wasn't sure if the STM32 USB DFU implementation is just regular USB DFU or a custom version created by ST that they just called USB DFU.

I'll search for any USB DFU protocol examples. Thanks!

Pavel A.
Dec 9, 2024 11:32 PM UTC

The ST implementation also is known as "DfuSe".