USB not enumerating on F205 board Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

archbishop
Posts: 2
Joined: Sat Jan 30, 2021 11:55 pm
Has thanked: 1 time

USB not enumerating on F205 board

Postby archbishop » Sun Jan 31, 2021 1:57 am

I have a Adafruit Feather board which has an STM32F205 on it which I acquired for an old project. I want to use it for something new. I'm trying to get ChibiOS running, and I've gotten most of the way there, but USB isn't working right. (I expect I won't be able to use the WiFi radio, but I'm ok with that.)

As a baseline, when I use the stock firmware (which is not fully open, which is making it hard for me to set up how I want), USB works. I have an app which creates a USB serial port and sends stuff. The host enumerates, I can connect to the port, and I can see the data it's sending. So the hardware is working.

I cloned ChibiOS from GitHub and checked out version 20.3.2. The testhal/STM32/STM32F2xx/USB_CDC app seemed like a good place to start. There's no native support for my board, so I decided to start tweaking the ST_NUCLEO144_F207ZG as it's pretty close. You can see the changes I made relative to GitHub commit ffe54d63c here: https://pastebin.com/ZChgKC2A

    * The board has an LED on A15, so I changed that pin's configuration.
    * The board uses PB14/PB15 for the USB port according to the schematics, which correspond to OTG2 on the datasheet, so I set up the alternate behavior on those pins, and tweaked the app to use USBD2 instead of USBD1.
    * According to the documentation of the WICED module, there's an onboard 26mhz crystal, so I set up the clock and PLL configuration for that.
    * I made it possible to set RTCPRE to 0 (more on this below)
I am able to build the app and flash it onto the chip. The led flashes, so the app is running. But, the host doesn't see any device. Both for programming and as the USB host, I'm using macOS.

I have a ST Link and I can connect to the board with gdb, so I can inspect things, both with the stock firmware, and the ChibiOS demo.
For the PLL config, I was able to connect to the running board with an ST Link and read out the RCC registers. I configured ChibiOS to behave identically. (In particular, the stock firmware sets RCC_PLLCFGR PLLM to 26, which is consistent with the module documentation, so I do the same.) This did require changing some of the validity checks in hal_lld.h. This seems safe, as RTCPRE is (according to the datasheet) only used when RCC_BDCR RTCSEL is set to HSE, but in my configuration, it is set to NOCLOCK, same as the stock firmware does.

I also confirmed the GPIOB_* register bits for PB14 and PB15 are identical.

I tried setting breakpoints in the interrupt handler, and ask far as I can tell, the reset interrupt gets set, but then no other interrupts ever happen. In particular, GINTSTS_ENUMDNE is never set.

At this point, I'm stumped. How should I proceed to debug why USB isn't working? I don't have any kind of hardware capable of debugging the USB traffic itself, so that isn't an option. Is there something else I should try?

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: USB not enumerating on F205 board

Postby Giovanni » Sun Jan 31, 2021 6:31 am

Hi,

Hard to tell, make sure to set the USB alternate only on a single couple (do not set the alternate on multiple pins).

Is the host initiating the enumeration procedure? any error message or the board is just ignored?

Giovanni

joaquin
Posts: 38
Joined: Sat Jan 22, 2011 8:44 pm
Has thanked: 1 time
Been thanked: 3 times

Re: USB not enumerating on F205 board  Topic is solved

Postby joaquin » Sun Jan 31, 2021 7:37 am

If your board is Adafruit WICED Feather WiFi, it seems that it hasn't the pull-up resistor conected to D+ pin. Have you tried to set BOARD_OTG_NOVBUSSENS on halconf.h?

archbishop
Posts: 2
Joined: Sat Jan 30, 2021 11:55 pm
Has thanked: 1 time

Re: USB not enumerating on F205 board

Postby archbishop » Sun Jan 31, 2021 9:21 am

joaquin, that's the board, and that was exactly the problem. I added it, and now I can interact with the ChibiOS/RT Shell over USB serial.

Thanks so much for your help!

Giovanni, are you interested in a patch to enable support for this board?

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: USB not enumerating on F205 board

Postby Giovanni » Sun Jan 31, 2021 10:20 am

Hi,

Post the board files and the chcfg file in "bug reports".

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 23 guests