USB enumeration not working with custom F103C8 board

STM32duino bootloader aka Maple bootloader
Post Reply
axel
Posts: 8
Joined: Sun Oct 04, 2020 8:12 pm

USB enumeration not working with custom F103C8 board

Post by axel »

Hello

I am trying to configure a custom board to use Roger's bootloader. I've confirmed the USB hardware works with a sketch uploaded directly to the board via STLink, however I've been unable to properly configure the bootloader to enumerate. The bootloader does appear to run fine (fast flashing LED followed by a slower flash) but nothing appears in device manager which leads me to believe there's something wrong with the USB enumeration code.

I have pin PB15 configured as an enumeration pin, connected to USB D+ via a 1.5kΩ resistor:

Image

And I have configured an entry in the bootloader makefile for my hardware configuration:

Code: Select all

#elif defined TARGET_DEKO32
/*
    Status LED on PC13
    USB ENUM pin PB15
    No user button
*/

    #define HAS_MAPLE_HARDWARE  1
    #define LED_BANK            GPIOC
    #define LED_PIN             13
    #define LED_ON_STATE        1
    #define USB_DISC_BANK       GPIOB
    #define USB_DISC_PIN        15
In theory this should be all that's needed to get the bootloader to work - but other than the LED flashing correctly the USB interface appears to be totally non-functional. Does anyone know what could be wrong?
ag123
Posts: 1909
Joined: Thu Dec 19, 2019 5:30 am
Answers: 30

Re: USB enumeration not working with custom F103C8 board

Post by ag123 »

USB enumeration is triggered by a *usb reset*
which is a single-ended-zero (i.e. both d- d+ low ) > 2.5 uS
https://www.engineersgarage.com/signal- ... -part-5-6/

many times when things don't work, it could be a defective usb cable (more common)

to proof if it is after all enumerating, i.e. that usb reset works
in linux it is usbreset
https://github.com/jkulesza/usbreset
in windows, it is to disable and enable the usb device in device manager.
doing this alone will start the host doing probe and enumeration.
and if this don't work, check / change the cables.

the old maple mini, has a transistor circuit at d+ / d- purposely to set them low to trigger a usb-reset
https://github.com/leaflabs/maplemini/b ... lemini.pdf

and USB D+ is PA12 and USB D- is PA11
that is different on your schematic
axel
Posts: 8
Joined: Sun Oct 04, 2020 8:12 pm

Re: USB enumeration not working with custom F103C8 board

Post by axel »

Apologies, I should've been more clear with that schematic - the A/B6/7 pins are on the USB-C connector, not the STM32

Regardless, I switched to the stm32-tkg-hid-bootloader using the same defines as I posted above, and it's working perfectly fine with my custom board.
Post Reply

Return to “USB bootloader”