Skip to main content
Lead
June 13, 2021
Solved

How can I send data with USB FS at STM32F373?

  • June 13, 2021
  • 5 replies
  • 2676 views

Hi!

I have STM32F373 and I want to send data with USB FS.

0693W00000Baq3SQAR.pngWhen I generate a project, I get this struct.

PCD_HandleTypeDef hpcd_USB_FS;

What should I do to send data with that struct?

This topic has been closed for replies.
Best answer by TDK

> By the way! This using USB CDC. I'm using USB PCD.

The PCD (peripheral control driver) is not specific to any particular device type. Since you were trying to send data, I assumed you wanted the USB CDC device. All devices, including CDC, are implemented via the PCD.

https://www.st.com/resource/en/user_manual/dm00108129-stm32cube-usb-device-library-stmicroelectronics.pdf

5 replies

TDK
June 13, 2021

The best thing would be to follow a Cube example:

https://github.com/STMicroelectronics/STM32CubeF3/tree/86346f63f25b859f93f9603837dcd5be28e8e7bf/Projects/STM32373C_EVAL/Applications/USB_Device/CDC_Standalone

Be aware that USB is a lot more complex than something like UART.

"If you feel a post has answered your question, please click ""Accept as Solution""."
DMårtAuthor
Lead
June 13, 2021

Thank you. Yes I understand that. I just want to try it out and see if ST's USB is well made.

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-ComputerSTM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer
TDK
TDKBest answer
June 13, 2021

> By the way! This using USB CDC. I'm using USB PCD.

The PCD (peripheral control driver) is not specific to any particular device type. Since you were trying to send data, I assumed you wanted the USB CDC device. All devices, including CDC, are implemented via the PCD.

https://www.st.com/resource/en/user_manual/dm00108129-stm32cube-usb-device-library-stmicroelectronics.pdf

"If you feel a post has answered your question, please click ""Accept as Solution""."
DMårtAuthor
Lead
June 13, 2021

Thank you once again!

I can see now that I need to use HAL_PCD_EP_... HAL-functions such as HAL_PCD_EP_Open, HAL_PCD_EP_Receive, HAL_PCD_EP_Transmit etc to talk to other USB devices such as my computer.

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-ComputerSTM32MP257FAK3 custom board with STM64-OS as operating system: https://github.com/DanielMartensson/STM64-Computer