cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling USB Device CDC on Nucleo F303ZE

LMorr.3
Senior II

I have a Nucleo F303ZE and enabled USB Device middleware along with the USB 'Device FS' Connectivity.  

I also configured the CDC_SET_LINE_CODING and CDC_GET_LINE_CODING  functions in USB_DEVICE/App/usbd_cdc_if.c 

I connect a USB cable to the STLink connector as usual which powers the board.  I then connect a USB cable to the CN13 usb port but the PC does not 'detect' this new USB connection.  I run 'lsusb' on my linux machine and only see the STLink connection, but not the second USB connection.

Any ideas on what I may have missed?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

Hello @LMorr.3 ,

It is mentioned in UM1974 that PG6 is connected to R70 to control USB D+ pull up (NUCLEO-F303ZE).

For that, please make sure that SB186 is shorted and your software sets PG6 appropriately. 

I think this discussion can help you.

Please let me know if the issue is solved.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
KDJEM.1
ST Employee

Hello @LMorr.3 ,

It is mentioned in UM1974 that PG6 is connected to R70 to control USB D+ pull up (NUCLEO-F303ZE).

For that, please make sure that SB186 is shorted and your software sets PG6 appropriately. 

I think this discussion can help you.

Please let me know if the issue is solved.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks.  I had to enable PG6 as you suggest and it worked.  This leads me to a second related question; If I try to enable USB Device in the same way on a STM32F373, will I need to add a pull-up resistor on the USB_DP line between the uC and the USB connector on my board?  I currently use the USB3076 connector with an ESD protection diode on DM and DP. ( no pull-up resistor )

KDJEM.1
ST Employee

Hi @LMorr.3 ,

I advise you, when you designing your own board, to follow section 3 Hardware guidelines for USB implementation in AN4879.

This section describes the hardware requirements for correct operation of the USB peripheral.

I hope this help you!

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

That doc will help, thanks.

KDJEM.1
ST Employee

Glad to know that the issue is solved and that the document can help you :).

Thank you for your contribution in STCommunity @LMorr.3 .

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Just curious; If my uC is using USB Device FS and self-powered, could I get away with just adding a 1k5 pull-up resistor to 3.4V on D+, or do I need to use pin PA9 as input to sense the presence of the Host USB's vbus before enabling the pull-up using an output pin?  Is the VBus sensing only to allow the USB device to know when it can send something to the host?  Just looking to save the 2 pins for other uses if possible.

UPDATE: I now see that if the device is powered from the USB VBus, there is no need to detect VBus voltage before enabling the 1.5k resistor, so no GPIO out pin is needed in that case.  In my case, the device is self powered so I see I need to detect VBus voltage using the PA9 pin to know the HOST is ready to receive.

Thanks,