2020-01-08 04:18 AM
So I am using Nucleo64 (303RE) board for USB HID mouse project.
As you know, it does not have second USB port for USB applications but it does have PINS that can act as DM, DP (USB minus, plus data).
When I configured everything, I run debug and it was telling me that packet has been send successfully, but I could not see any signal on oscilloscope. NOTE that I checked clock output for USB and it was a good looking 48MHz clock.
Can anybody tell me what am I doing wrong ? Maybe its necessary that board has another USB port and these GPIO pins cannnot be directly used in that way. To be honest I am frustrated and this thread is my last hope.
2020-01-08 06:43 AM
Hello hastala,
I am not sure if you would have seen my post about USB and the Nucleo - F401. If not take a look at the following link.
https://community.st.com/s/question/0D50X00009XkWDLSA3/usb-hid-host-pcwindows-application
I tried to document some of what I figured out.
With a nucleo-F401RE, I was able to just create a tiny USB cable that plugged into the female headers on the board, for my cable I used:
PA9 - VBUS
PA11 - USB DM
PA12 - UBS DP
And of course a ground connection.
It was pretty crude but it served its purpose.
I used VBUS on my 401 but looking at the 303 it doesn't look like that is available.
If you are using STM32CubeMX (which I would suggest), did you enable the various USB elements? Take a look at the images.
I created a project in the latest version of STM32CubeMX and attached it. I don't have a F303 to test with so you will have to give it a try.
If you are using STM32CubeMX are there examples for USB for the F303. You should be able to see a large list of example project by accessing the project list. It should be at a location similar to below. This is what I see for the F4 devices, I don't know what exists for the F303.
file:///C:/Users/YourNAME/STM32Cube/Repository/STM32Cube_FW_F4_V1.24.1/Projects/STM32CubeProjectsList.html
There are a bunch of USB examples for the F4.
I would also suggest using USB View. It is a good application that gives you some insight into what is plugged into your computer via USB. The direct link can be found here https://www.ftdichip.com/Support/Utilities/usbview.zip
If you want to read about USB or other USB applications look here. https://www.ftdichip.com/Support/Utilities.htm
You will probably also want to take a look at some of the training videos from ST regarding USB. Unfortunately there is just a ton to learn about USB.
I did find some examples in there and some helpful things in the USB course.
Best of luck.
2020-01-09 12:08 AM
Hello Josh
Thank you for your amazing reply.
Even though I think I enabled every USB component (enabling FS and HID from CubeMX, then externing USB struct and including appropriate library files.) I will definitely have close look at your recommendations.
Cheers!
2020-01-09 05:27 AM
Hello hastala,
To be honest in the end for me it wasn't that difficult to get my board to connect to a PC and then see that it shows up. I am working on a USB custom HID device so i had to build the PC app side as well and then work on communicating back and forth. My suggestion is to watch the MOOC usb classes from ST (as I previously listed in the other post) and then try some examples.
I forgot to mention that I ended up putting an external 4MHZ crystal on my board and then attempting to use that as my clock source. Through a bit of debugging, I found that (atleast with the F401) that the device was still able to use the internal oscillator (HSI) to run the USB.
I believe if you can demonstrate that an example from ST works, then you can work to modify your project/application and get some form of communication going.
Best of luck