cancel
Showing results for 
Search instead for 
Did you mean: 

Issues while initializing USB as Communication device class CDC using STM32Cube.

POval.1
Associate II

Hello everyone,

I am trying to use USB on the STM32 NUCLEO-L4RZI-P dev board to work as a Communication device class (CDC).

I have initialized the USB using the Cube IDE.

After initializing, I tried sending data using the " CDC_Transmit_FS( buffer, sizeof(buffer) ); "

This function is being called from the while(1) loop.

But I am facing some issue while doing so. When I tried tracing the issue, I found out that the while initializing, in function "USB_SetCurrentMode()" the HAL_Delay() never returns.

I am following these resources:

https://www.youtube.com/watch?v=h9T0RTu9Muc&list=PLnMKNibPkDnFFRBVD206EfnnHhQZI4Hxa&index=11

https://shawnhymel.com/1795/getting-started-with-stm32-nucleo-usb-virtual-com-port/

3 REPLIES 3

Hello @POval.1​ ,

Try to port the following example provided in our L4 firmware package on your board :

  • Path: Projects\NUCLEO-L452RE\Applications\USB_Device\CDC_Standalone

Please let me know if you still have problems.

BeST Regards,

Walid

I will try it and inform the output.

Hello @POval.1​ 

Are there any updates?

Please click on Select as Best if my post fully answered your question. This will help other customers with the same issue to find the solution faster

BeST Regards,

Walid