Skip to main content
POval.1
Associate II
September 13, 2021
Question

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

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/

This topic has been closed for replies.

3 replies

Walid ZRELLI
Visitor II
September 21, 2021

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

POval.1
POval.1Author
Associate II
September 22, 2021

I will try it and inform the output.

Walid ZRELLI
Visitor II
October 5, 2021

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