[STM32F405 custom board] USB does not show up

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
Gordon_Hardman
Posts: 68
Joined: Sat May 03, 2014 11:31 pm

[STM32F405 custom board] USB does not show up

Post by Gordon_Hardman » Thu Oct 04, 2018 9:15 pm

I have a custom designed board using exactly the same chip as in the PyBoard, ARM STM32F405RGT6. My hope is that it will run the Pyboard code with no modifications. But there is a problem with the USB not showing up. Here are the symptoms:

1. The device shows up in DFuseDemo, and I can upload the latest image to it. I can unplug it, plug it back in and do a successful verify. So the USB connection is definitely there.
2. When I connect the USB to my PC (Windows 10) there is no activity at all- nothing changes in Device Manager.
3. I have checked all the important pins- Boot0, Boot1, NRST, DFU Mode, USB ID. All are identical between my custom board and the PyBoard.
4. The clock is running. Verified levels and frequency with an oscilloscope.
5. The green LED pulses on power-up or when reset is pushed.
6. The binary-select-boot-mode does the same green/orange/orange+green dance, I can stop it on any of these.
7. The only difference is when I press and hold Reset, the red and yellow LEDs are on, not the red and blue like the PyBoard.
8. USB DM and DP are always zero, there is no activity on either of them at any time.

I have tried three different PCs, all running Windows 10. I am using the same cable for the PyBoard and my custom board. It is the cable that I used with DFuseDemo. I have made several custom boards along these lines with no problems, so I don't know what I missed on this one! It looks like the ARM is booting up, but not initializing the USB.
Anyone have any ideas?

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: [STM32F405 custom board] USB does not show up

Post by jickster » Thu Oct 04, 2018 9:49 pm

Can you hook-up a C-debugger?

Gordon_Hardman
Posts: 68
Joined: Sat May 03, 2014 11:31 pm

Re: [STM32F405 custom board] USB does not show up

Post by Gordon_Hardman » Thu Oct 04, 2018 10:51 pm

I found the problem. Even though I am not using the 5V that comes in with the USB, it must still be connected to PA9-VBUS. This is so the chip can tell when the USB is plugged in, and when it is removed.

Duh! Slap forehead.

Sorry for the bandwidth, but maybe this will help someone!

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: [STM32F405 custom board] USB does not show up

Post by dhylands » Sat Oct 06, 2018 3:25 am

This is actually configurable. Not all boards wire this through.

This line:
https://github.com/micropython/micropyt ... oard.h#L98
says that the USB VBUS line is connected to PA9. If you comment out that line in your board configuration, then it reconfigures the USB to not look for VBUS.

Post Reply