Skip to main content
Visitor II
August 18, 2022
Solved

How do I transfer data over 0x80000 from USB DEVICE?

  • August 18, 2022
  • 1 reply
  • 1042 views

I made a High Speed USB DEVICE using USB PHY with STM32F207.

A data transmission test to the host is in progress, and transmission is possible up to the size of 0x7FFFF, but it cannot transmit more than that.

When referring to stm32f2xx_ll_usb.c, the maximum transfer size can be specified up to 0x7FFFF.

#define USB_OTG_DIEPTSIZ_XFRSIZ (0x7FFFFUL << 0U)

USBx_INEP(epnum)->DIEPTSIZ |= (USB_OTG_DIEPTSIZ_XFRSIZ & ep->xfer_len);

What should I do if I want to transmit more than 0x80000 data?

For example

Transmit data below 0x7FFFF -> Wait for transmission completion -> Transmit data below 0x7FFFF -> Wait for transmission completion -> ... -> Transmit the last data -> Wait for transmission completion -> Done

Is it possible to transmit only in this way?

    This topic has been closed for replies.
    Best answer by waclawek.jan

    > Is it possible to transmit only in this way?

    Yes.

    At the end of the day, the actual transfers happen in maxpacket sizes, anyway.

    JW

    1 reply

    Super User
    August 18, 2022

    > Is it possible to transmit only in this way?

    Yes.

    At the end of the day, the actual transfers happen in maxpacket sizes, anyway.

    JW

    mcho.19Author
    Visitor II
    August 22, 2022

    Thank you for answer