Reset HID Bootloader on the Blue Pill (?)

Working libraries, libraries being ported and related hardware
Post Reply
Llama
Posts: 12
Joined: Sun Oct 22, 2023 4:35 pm

Reset HID Bootloader on the Blue Pill (?)

Post 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?
ElektroZebra
Posts: 2
Joined: Wed Mar 13, 2024 10:51 pm

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

Post 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.
User avatar
Vassilis
Posts: 23
Joined: Wed Dec 18, 2019 3:04 pm
Location: Thessaloniki, Greece
Contact:

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

Post 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.
Vassilis Serasidis
https://www.serasidis.gr
ElektroZebra
Posts: 2
Joined: Wed Mar 13, 2024 10:51 pm

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

Post by ElektroZebra »

Mine is a STM32F103C8T6.
User avatar
Vassilis
Posts: 23
Joined: Wed Dec 18, 2019 3:04 pm
Location: Thessaloniki, Greece
Contact:

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

Post 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.
Vassilis Serasidis
https://www.serasidis.gr
Post Reply

Return to “Libraries & Hardware”