Skip to main content
Graduate II
January 19, 2024
Solved

How to do USB DFU from a custom MS visual studio application?

  • January 19, 2024
  • 2 replies
  • 1844 views

Hi all,

I'm investigating what I need to be able to update the firmware on my custom STM32 board (with either an STM32H7 or STM32F7 MCU) from a C#/C++ Microsoft Visual studio application via USB. This is for Windows 7/10/11.


I found STSW-STM32080 but it says not recommended for new designs and that it was replaced by STM32CubeProgrammer (CLI specifically). I want my application to do the upgrading of the firmware without the customer having to install any additional software (like STM32CubeProgrammer).

Does STM32CubeProgrammer have any redistributable libraries to do this? Is there a better way to do this?

Thanks

    This topic has been closed for replies.
    Best answer by TDK

    > Does STM32CubeProgrammer have any redistributable libraries to do this? Is there a better way to do this?

    A few options:

    • STM32CubeProgrammer has a C++ API you can use. See the STM32CubeProgrammer/api/doc folder for documentation.
    • You could make your own bootloader and use whatever protocol you like.
    • You could make your own DFU code.

    2 replies

    TDKAnswer
    Super User
    January 19, 2024

    > Does STM32CubeProgrammer have any redistributable libraries to do this? Is there a better way to do this?

    A few options:

    • STM32CubeProgrammer has a C++ API you can use. See the STM32CubeProgrammer/api/doc folder for documentation.
    • You could make your own bootloader and use whatever protocol you like.
    • You could make your own DFU code.
    Super User
    January 19, 2024

    But note that the STM32CubeProgrammer API DLL has dependency on Qt.5 redistributable DLLs, further redistribution rights on these are not clear.