cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 - USB Bootloader

VM.7
Associate II

Hello All,

MCU - STM32G0B0RET6 supports USB bootloader.

When I first connect my USB to my PC, it is recognised as "DFU in FS Mode". Then I flashed a simple GPIO control application code (*.elf) through USB, and after restarting the board, my PC no longer detects USB.

Is it necessary to include USB support in the application code to make the USB bootloader to work?

I have no idea what I am missing! Please advise.

Thanks & Regards,

VM

4 REPLIES 4
Uwe Bonnes
Principal III

To get to the USB bootloader you either have to set BOOT0 pin or fuse and reboot, or have a boot switch in the startup code and some way to set this boot switch from the program. If you want to set this boot switch via USB, USB must run in the user code and provide a DFU endpoint.

Hi @uwe Bonnes​,

Thanks for your response.

I done flash erase, then the USB is detected in my PC as "DFU in FS mode" and i can able to program it. I hope this is expected behavior. But i do see issue only after flashing my application code, I can't get into a bootloader mode.

I tied BOOT0 to VDD and then power on the device, even in this case, USB DFU is not detected in my PC. I expected with BOOT0 to HIGH,makes the device into bootloader mode.

Do you have idea why it is not entering into a bootloader mode?


_legacyfs_online_stmicro_images_0693W00000dJwBuQAK.png

VM.7
Associate II

Hi @uwe Bonnes​ ,

Configuring Flash option bytes "nBOOT_SEL (bit) to 0" resolved my issue.

This configuration decides the bootloader mode based on Boot0 pin value.

So, pressing the Boot switch and then triggering the Reset switch, puts the device now in bootloader mode.


_legacyfs_online_stmicro_images_0693W00000dJwZnQAK.png

VM.7
Associate II

Configuring Flash option bytes "nBOOT_SEL (bit) to 0" resolved my issue.