Closed charlespax closed 7 years ago
STM32F103 doesn't have built in USB DFU bootloader, so it would be dependant on a separate bootloader like https://github.com/rogerclarkmelbourne/STM32duino-bootloader See the notes there in README.md as there are a few implementation options for the disconnect feature
Moved to firmware repo.
For the more modern chips with USB DFU, you should just need a way to control BOOT0 (and possibly RESET) to start the bootloader.
If you have a spare I/O pin, you can do a nifty firmware trick by connecting that to BOOT0 along with a small capacitor. To enter the bootloader, the firmware pulls the I/O pin high to charge the cap, and then does a reset while the cap holds BOOT0 high (slowly discharging through a pulldown).
PC1 is currently not used and is a good candidate. It could easily be routed over.
I think this circuit would work. I would just connect PC1 to BOOT0 and add a cap across the 10k pulldown resistor. Not sure what value.
I would have to change the BOOT1 circuit. Right now it's normally high, which would make the device boot from SRAM. Making BOOT1 normally low would have the system default to system memory (hardware bootloader) if BOOT0 is high.
Since at lease some chips require a 1.5k pullup on USB_DP, we should implement the circuit. Here is an except from AN2606
Actually, the board already has the 1.5K pullup. I think the pullup is to indicate to the host if the device is full-speed or high-speed (see also #55 ).
Yes, the 1.5k pullup on DP is to indicate full-speed. It is also the same circuit to indicate high-speed.
Change made to the BOOT1 switch.
PC1 connected to BOOT0.
Capacitor added in parallel with the BOOT0 pulldown.
Done. Closing issue.
What do we need for enabling the bootloader to flash over USB? See AN2606 p. 26.