davidgfnet / stm32-dfu-bootloader

A DFU bootloader targeting STM32F103 in just 4KB
GNU General Public License v3.0
109 stars 40 forks source link

USB device not recognised when starting HID application #20

Closed mupfdev closed 10 months ago

mupfdev commented 10 months ago

Hello, The bootloader works perfectly and I can confirm that the written data is binary compatible with my firmware.

I also made sure that the linker script was set up accordingly. checksum.py also reports no problems.

However, when I start my firmware, which acts as a USB-HID device, I get an error:

Windows has stopped this device because it has reported problems. (Code 43)

A request for the USB device descriptor failed.

Everything works perfectly without the bootloader. Any ideas?

This is my project: https://github.com/mupfdev/TrackMAG

Best regards, Michael

mupfdev commented 10 months ago

Could it be that the bootloader has to release the USB properly before starting the application?

Asking because I stumbled across this in another bootloader's source code: https://github.com/viktorvano/STM32-Bootloader/blob/master/STM32F103C8T6_Bootloader/Core/Src/bootloader.c#L206

mupfdev commented 10 months ago

Nevermind, I fixed the problem and I feel stupid. I made a typo in the FLASH offset inside the linker script. The firmware wasn't working at all - I just didn't notice.