Skip to main content
Explorer II
March 25, 2023
Solved

Hi i am Roberto, For my project i need to update the firmware from USB port so i need to use internal bootloader. The MCU is contained into a close box so i can't set BOOT0 pin manually. Do you have any idea ?

  • March 25, 2023
  • 3 replies
  • 1587 views

My idea is that:I want to put a resistor and a capacitor on BOOT0 pin.

When normal code is running and i will go to update the firmware, i will send a command to USB. When MCU will receive this command, MCU will set BOOT0 pin to high state and charge the capacitor. After that MCU will runs an autoreset command.

Could be it works?

How much time BOOT0 pin must be stay high for entering in boot mode?

Thank you for all.

    This topic has been closed for replies.
    Best answer by MM..1

    Your Idea BOOT0 capacitor may work only for combined pins with PIO. But if you can control this with prepared code, then this is complication. More simple is jump from code directly into bootloader , when you need it.

    Second choice is when you use USB only for update, then connect VBUS to BOOT0 over R...

    3 replies

    Super User
    March 25, 2023

    if you can power off/on the thing, could use my way:

    boot0 pin has pulldown to gnd. ok, and resistor to 5v usb pin.

    so when usb is plugged in at power up, bootloader starting...

    if not , normal start. if connect usb later, can use it by program normal,

    because bootloader check is only some clocks after reset/power up.

    RCola.2Author
    Explorer II
    March 26, 2023

    It’s a nice way !

    thank you!

    MM..1Answer
    Graduate II
    March 25, 2023

    Your Idea BOOT0 capacitor may work only for combined pins with PIO. But if you can control this with prepared code, then this is complication. More simple is jump from code directly into bootloader , when you need it.

    Second choice is when you use USB only for update, then connect VBUS to BOOT0 over R...

    RCola.2Author
    Explorer II
    March 26, 2023

    Oh is possibile jump to bootloader directly? How?

    thank you for your reply.

    Graduate II
    March 29, 2023
    Graduate II
    March 25, 2023

    Which STM32 ?

    RCola.2Author
    Explorer II
    March 26, 2023

    Stm32F207