2024-05-15 05:01 AM
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.
Afterwards i solved the clock issue using the HSI48RC clock for usb.
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.
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.
Solved! Go to Solution.
2024-05-15 05:59 AM
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.
2024-05-15 05:59 AM
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.