Page 1 of 1

Reset HID Bootloader on the Blue Pill (?)

Posted: Wed Nov 29, 2023 5:26 am
by Llama
Hi,

I'm regularly breaking my HID bootloader. The typical workflow looks like this:

1. Uploading a buggy sketch, unsuccessfully.

2. The bootloader becomes generally unresponsive.

3. Trying to flash it back with stlink. It reports success, but it isn't true. Then I move BOOT0 to 1, erase the memory with stlink, move the BOOT0 back, flash the bootloader again. Success.

Is it the only way? Is it possible that the bootloader is actually intact, and I just have to do some reset procedure on my Blue Pill?

Re: Reset HID Bootloader on the Blue Pill (?)

Posted: Thu Mar 14, 2024 7:56 am
by ElektroZebra
Thanks for your tip, thanks to it I was able to get my bricked BluePill working again!
My BluePill showed the same behavior, the upload did not work anymore. I was able to flash the bootloader including verify (I use STM Flash Loader Demo with serial connection to A10 and A9). However, the LED would not flicker on reboot. Only when I performed a global erase before flashing did the board work again (my order differs from your: move BOOT0 to 1, erase the memory, flash the bootloader, THEN move the BOOT0 back to 0 and reboot).
I have no idea about the cause and whether the problem can be solved differently, I have only been using the HID bootloader for two days.

Re: Reset HID Bootloader on the Blue Pill (?)

Posted: Fri Mar 15, 2024 8:16 am
by Vassilis
Is your MCU the STM32F103C8T6 (64 kB Flash, 20 kB RAM) ?
Some Bluepills are marketed with STM32F103C6 and only have 32kB Flash and 10kB RAM.

Re: Reset HID Bootloader on the Blue Pill (?)

Posted: Fri Mar 15, 2024 2:37 pm
by ElektroZebra
Mine is a STM32F103C8T6.

Re: Reset HID Bootloader on the Blue Pill (?)

Posted: Mon Mar 18, 2024 10:50 am
by Vassilis
In general, HID bootloader uses the USB Serial port (CDC) to put the STM32 in HID bootloader mode. If you burn the STM32 with a sketch file that the USB Serial is not enabled from Arduino IDE menu, then the hid-flash.exe cannot reboot the STM32 in HID bootloader mode.