Skip to main content
Graduate II
June 13, 2021
Solved

How can I send data with USB FS at STM32F373?

  • June 13, 2021
  • 2 replies
  • 1553 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

    2 replies

    Super User
    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.

    DMårtAuthor
    Graduate II
    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.

    TDKAnswer
    Super User
    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

    DMårtAuthor
    Graduate II
    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.