Difference between revisions of "Flashing Blue Pill (STM32F103) bootloader"

From Tom's notes
Jump to navigation Jump to search
(Created page with "Started off using following guide: https://medium.com/@paramaggarwal/programming-an-stm32f103-board-using-usb-port-blue-pill-953cec0dbc86 However, still didn't seem to work,...")
 
Line 28: Line 28:
 
</source>
 
</source>
 
Keep BOOT0=1 and BOOT1=0. Reset between each step just in case.
 
Keep BOOT0=1 and BOOT1=0. Reset between each step just in case.
 +
 +
Using 5V power seems to be working better on the Maple board (BluePill seems to work with 3.3V as well).
 +
Connect rx to PA9, tx to PA10.
  
 
When resetting bot jumpers to 0 and resetting the fast/slow flashing worked and the device was seen on USB.
 
When resetting bot jumpers to 0 and resetting the fast/slow flashing worked and the device was seen on USB.

Revision as of 00:02, 18 December 2018

Started off using following guide: https://medium.com/@paramaggarwal/programming-an-stm32f103-board-using-usb-port-blue-pill-953cec0dbc86

However, still didn't seem to work, always got following errors in dmesg:

usb 3-1: new full-speed USB device number 122 using xhci_hcd
usb 3-1: device descriptor read/64, error -71
usb 3-1: device descriptor read/64, error -71
usb 3-1: new full-speed USB device number 123 using xhci_hcd
usb 3-1: device descriptor read/64, error -71
usb 3-1: device descriptor read/64, error -71
usb 3-1: new full-speed USB device number 124 using xhci_hcd
usb 3-1: Device not responding to setup address.
usb 3-1: Device not responding to setup address.
usb 3-1: device not accepting address 124, error -71
usb 3-1: new full-speed USB device number 125 using xhci_hcd
usb 3-1: Device not responding to setup address.
usb 3-1: Device not responding to setup address.
usb 3-1: device not accepting address 125, error -71
usb usb3-port1: unable to enumerate USB device

Workaround was to first perform an erase step and follow it up with a verify just for good measure:

python ./stm32loader -p /dev/tty.SLAB_USBtoUART -e ./generic_boot20_pc13.bin
python ./stm32loader -p /dev/tty.SLAB_USBtoUART -w ./generic_boot20_pc13.bin
python ./stm32loader -p /dev/tty.SLAB_USBtoUART -v ./generic_boot20_pc13.bin

Keep BOOT0=1 and BOOT1=0. Reset between each step just in case.

Using 5V power seems to be working better on the Maple board (BluePill seems to work with 3.3V as well). Connect rx to PA9, tx to PA10.

When resetting bot jumpers to 0 and resetting the fast/slow flashing worked and the device was seen on USB.

Direct links:

Make sure to verify the bootloader was downloaded and not just some HTML page.