cancel
Showing results for 
Search instead for 
Did you mean: 

Programming a brand-new STM32 chip via USB & integrating DFU into C# software

Raf-Per
Associate

Hi everyone, I’m working on a project involving STM32L476 chip, and I’d appreciate your guidance on a few key points:

  1. Out-of-box USB flashing
    I'll soon have a brand-new STM32 chip that hasn’t been flashed yet, is it possible to use STM32CubeProgrammer to load firmware via USB directly — without using ST-Link or other hardware programmers? Does the internal bootloader support DFU mode by default?
  2. Software-only firmware flashing
    One of our goals is to allow our in-house C# application to flash firmware over USB, without requiring any manual hardware intervention like pulling the BOOT0 pin. Is it feasible to force DFU mode or update firmware entirely via software once the chip is already running a custom firmware? Are there recommended DLLs or APIs that support this in C#?
  3. Recommended libraries/tools
    If software-based flashing is possible, are there any ST-provided or third-party libraries (.DLLs, wrappers, or tools) that are well-suited for integrating STM32 USB flashing with a C# application
  4. DFU reliability and limitations
    Are there any known challenges or quirks with relying solely on DFU for firmware updates in production (e.g., USB enumeration issues, compatibility across STM32 families, bootloader bugs)? Any best practices to ensure robustness?

 

Thanks in advance for any insights or recommendations!

 

 

3 REPLIES 3
TDK
Super User

See AN2606 for bootloader entry and supported pins. USB DFU is possible. STM32CubeProgrammer has a CLI.

Debugging with USB DFU is not feasible and will lead to unproductive and long development time. Use SWD connection instead.

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

 Is it feasible to force DFU mode or update firmware entirely via software once the chip is already running a custom firmware?

STM32L476 has 1MB of internal flash, so you can consider dividing part of it for a custom bootloader/update firmware, using the same USB DFU protocol or whatever you like.