bootsector / stm32-hid-bootloader

Driverless USB HID bootloader and flashing tool for STM32F10X devices
GNU General Public License v3.0
161 stars 48 forks source link

Can't run a USB HID user application on STM32F103C8 Blue Pill #9

Open etale-cohomology opened 1 month ago

etale-cohomology commented 1 month ago

I really like this bootloader; it's super small and it's so little code. I can flash it to my STM32F103C8 Blue Pill and then use the hid-flash CLI program to upload the BLINKER user program, and it runs. I can also play with BOOT1/PB2 to enter or not enter bootloader mode.

However, when I try to use hid-flash to upload a barebones USB HID device application, it doesn't work. What could be going on?

(I can flash the same application directly using an ST-LINK programmer and it does run, so the application itself should be fine. It's basically a minimal example taken from STM32CubeIDE that just sends keyboard keystrokes.)

bootsector commented 5 days ago

You need to redefine the flash start address in the ld script:

https://github.com/bootsector/stm32-hid-bootloader/blob/master/blinker/STM32F103C8T6.ld#L14

and redefine the vector table offset of your application:

https://github.com/bootsector/stm32-hid-bootloader/blob/master/blinker/Makefile#L5