cancel
Showing results for 
Search instead for 
Did you mean: 

Seeking Guidance on Implementing USB CDC in STM32F446RE

HEE
Associate

Hello STM32 community!

I'm relatively new to the embedded field and have been diving into communication protocols through small projects. Currently, I'm working on implementing USB CDC on an STM32F446RE, and I've been facing challenges for the past two months.

I've extensively searched the internet and followed various tutorials, but unfortunately, none of them seem to work.
One of the tutorial that I followed: https://controllerstech.com/usb-cdc-device-and-host-in-stm32/

Regarding my hardware setup, I've cut a USB 2.0 cable, connected the power wire to 5V pin(with the jumper changed to E5V), and linked D+ and D- to their respective configured pins on the board.
I am getting the code 43: unrecognized device error

I would greatly appreciate it if anyone who has successfully implemented USB CDC on STM32 Nucleo boards could share the exact steps they took.

Your insights and guidance would be invaluable to me. Thank you in advance for any assistance you can provide!

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

As @TDK wrote, the STM32 on Nucleo board gets its clock from the ST-LINK part by default. So ensure that the ST-LINK is powered and runs. The USB device examples are available for this Nucleo; guidance how to connect the USB pins to host should be available too, look in the documentation section of the Nucleo product page.

View solution in original post

4 REPLIES 4
TDK
Guru

There is a CDC_Standalone in the CubeMX examples that will work. You'll need to adjust the clocks to work from your board. Nucleo is clocked from 8 MHz HSE bypass.

Have USB signals over jumper wires isn't ideal but will probably work at 12 MHz (USB FS).

If you feel a post has answered your question, please click "Accept as Solution".
Pavel A.
Evangelist III

As @TDK wrote, the STM32 on Nucleo board gets its clock from the ST-LINK part by default. So ensure that the ST-LINK is powered and runs. The USB device examples are available for this Nucleo; guidance how to connect the USB pins to host should be available too, look in the documentation section of the Nucleo product page.

Try putting the mcu to bootloader mode, to activate the DFU bootloader. If it works, problem is your software, if it does not, problem is your hardware. (DFU bootloader probably works only on one of the two USB modules on the 'F446, see AN2606).

JW

The available examples are also not working and I have adjusted the clock frequency - 48MHz to USB and configured to USB OTG FS in Device mode only.