cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H523 classic USB CDC library

SlawomirZ98
Associate

Hi,

I am creating a project using the STM32H523 microcontroller. One of the planned functionalities is USB CDC communication with a computer (as a virtual COM port device). Since I do not plan to use RTOS, I would like to use the classic USB library.

Initially development was done on the Nucleo board with STM32H503. Using this guide I managed to implement everything.

https://community.st.com/t5/stm32-mcus/how-to-use-stmicroelectronics-classic-usb-device-middleware-with/ta-p/599274

Problems appeared when switching to the target platform (STM32H523). The hardware was connected as on Nucleo (D+ to pin PA12, D- to PA11). CubeMX was configured analogously, the rest of the code was transferred. Unfortunately, after connecting to the computer there is no reaction, the USB device is not detected.

Does anyone have an idea what could be wrong? Is it also necessary to connect the VDET pin, and if so, where is the pin configuration in the code?

I tried to debug the problem on the HW side. There is no communication on the D+ and D- lines after connecting to the computer (the lines have GND level). I tried to manually add a 1.5k resistor between the D+ line and 3.3V. After that, the oscilloscope showed that some communication occurred, but the computer after a while displays the message "USB device not recognized". I tried different clock sources, different configurations in CubeMX, but the effect is still the same.

I will be grateful for any information and suggestions :)

Regards

1 REPLY 1
gbm
Lead III

Check the content of PWR->USBSCR register. USB33SV bit should be set to 1.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice