-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32F303RD: USB: unable to enumerate USB device #15112
Comments
@douardda thank you for raising this issue.Please take a look at the following comments: It would help if you could also specify the versions of any tools you are using? NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'. This indicates to us that at least all the fields have been considered. |
In case it helps, I can provide wireshark captures of the usb communications as well as signals captured with a dslogic+ analyzer. (Now I need to watch Ben Eater's videos again to refresh my memory about how USB actually works :-) ) |
H |
@jeromecoutant yes with great pleasure! I'll do that this evening! Thanks a lot. |
So there is improvement, the host can now enumerate the USB device and even see the CDC but the USB device immediately is disconnected:
I'll probably try to test this using a pure mbed toolchain, from the git master (instead of via platformio), including your PR as is, to see if it helps. |
Hi @jeromecoutant In the end the result was the same: the usb device is properly enumerated (thanks to your latest PR) but is immediately disconnected. So looking at the signals (using my dslogic analyzer) I noticed after the handcheck and enumeration, the DP signal went (and stayed) down. So I gave another look at the code in USBPhy_STM32.cpp, I noticed this piece of code (the part I'm concerned with) in
While the initial setup code configure the USB_DP pin as a NoPull input pin, this part of the code put it as an output LOW, but do not reset it to it's normal config. So I've replaced it with:
And now it works! At last!
Not sure this is the best way of reconfiguring the pin (should probably store its actual config before setting as a LOW output then restore it after, but no idea how to do that.) |
Thx @douardda |
@jeromecoutant sorry for the delay, see #15132 for my fix (seems to work for my STM32F303RD). |
Description of defect
I am trying to use the USBSerial on a STM32F303RD based custom board and I cannot make the USB enumerated by the (linux) host.
The USB connection on the PCB seems to be properly done since I'm using it to DFU upload the firmware.
It uses an external 8MHz crystal and runs at 72MHz.
Since there is no official support for the F303RD, I've used the F303RE to inherit from, overloading the rom size.
The board description is
Target(s) affected by this defect ?
STM32F303RD on a custom board.
Toolchain(s) (name and version) displaying this defect ?
I'm using platformio with:
What version of Mbed-os are you using (tag or sha) ?
6.9.0
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
n/a
How is this defect reproduced ?
Since the version of mbed shipped wit platformio does not come with latest fixes related to this problem (as described in #14736 and #14763 and other issues), I've added the to missing lines in USBPhy.c:
But still no luck: any simple example code for the USBSerial like:
ends up with the host giving:
PS: this board is a replacement front panel for the HP34790 I'm working on as described here: https://whatever.sdfa3.org/hp-34970a-data-acquisition-unit-part-5.html
The text was updated successfully, but these errors were encountered: