cancel
Showing results for 
Search instead for 
Did you mean: 

STMG474RE USB FS implementation

j_ic
Associate

Hi together,

i´m trying to set up a communication via usb using the usb cdc class to communicate with additional software via a virtual com port running on a local pc using the Nucleo G474RE board.

However i can't find a sufficient documentation what i do have to implement / settings that have to be done to send and recieve data.

I`ve also watched the youtube tutorial from stm on the topic usb cdc but it didn't help me.

 

I made the following steps until now in the cube ide:

I´ve activated the usb in the communication section and the usb_device in the middleware where i also set the communication device class option.

j_ic_0-1715774325310.pngj_ic_1-1715774344179.png

 

Afterwards i solved the clock issue using the HSI48RC clock for usb.

j_ic_2-1715774369039.png

 

But from that on the next steps are unclear to me. Can i now just use the "uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len)" function to transmit data? This function is located in the usbd_cdc_if.h/c file.

 

j_ic_3-1715774395021.pngj_ic_4-1715774419885.png

 

I tried a short example using this function to send a short hello world char array but it didn't work. So i think i missed something.

I searched in the reference manual, the datasheet and the HAL documentation for any hints but i couldn't find any - have i overlooked something?

Especially for the USB functions i couldn't find any description except in the corresponding h/c files.

I hope this description is sufficient. Thank`s for your help.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Hi @j_ic 


First, you can find in UM1734_STM32Cube.book the documentation for device library. Second, you can have a look a the following example STM32CubeG4/Projects/STM32G474E-EVAL/Applications/USB_Device/CDC_Standalone at master · STMicroelectronics/STM32CubeG4 (github.com) developed for the same chip on eval board. Maybe, your implementation is just missing clock recovery synchronization CRS. 

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.


I'm out of offce with limited access to my emails.
Happy New Year!

View solution in original post

1 REPLY 1
FBL
ST Employee

Hi @j_ic 


First, you can find in UM1734_STM32Cube.book the documentation for device library. Second, you can have a look a the following example STM32CubeG4/Projects/STM32G474E-EVAL/Applications/USB_Device/CDC_Standalone at master · STMicroelectronics/STM32CubeG4 (github.com) developed for the same chip on eval board. Maybe, your implementation is just missing clock recovery synchronization CRS. 

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.


I'm out of offce with limited access to my emails.
Happy New Year!