Skip to main content
Visitor II
August 4, 2020
Question

Sending large amount of data with USB

  • August 4, 2020
  • 5 replies
  • 6577 views

I'm currently facing a big problem. I've an MCU (STM32L4) connected to an SD card (SDIO) which stores tons of data (5Gb) from a microphone (ST MEMS). I need to send this data as fast as possible from SD card to my PC. With a serial port this is to slow, since the max baud rate of my MCU is 115kb/s.

How can I solve this? I'm thinking about using an FTDI module but for what I'm reading the speed is always limited by MCU baud rate. Best Regards

    This topic has been closed for replies.

    5 replies

    Super User
    August 4, 2020

    Hardly is there a faster transfer method than to pull the SD card from the STM32 board, and push it into the PC (maybe through a USB-connected reader).

    You can use UART with a UART-USB bridge at few-MHz rate, with s bit of care. There are also parallel-connected FTDI devices, possibly to be connected through FMC (although I'm not sure about the details).

    JW

    Super User
    August 4, 2020

    Eject the card, insert it into PC. Insert new empty card into STM32.

    -- pa

    MAndr.233Author
    Visitor II
    August 4, 2020

    I cant. It must be with usb cable. I just need anything like 5MB/s

    Super User
    August 4, 2020

    If your USB is full speed... good luck. Try to reduce the data before sending out.

    Super User
    August 4, 2020

    There are SD card readers with USB cable. Multiplex the SD card pins between STM32 and the reader.

    JW

    MAndr.233Author
    Visitor II
    August 5, 2020

    Hum... I'm seeing what your are talking https://www.amazon.com/Anker-Portable-Reader-RS-MMC-Micro/dp/B006T9B6R2. Do you have any idea how this modules works to ensure such high speeds?

    Best Regards

    Super User
    August 5, 2020

    > Do you have any idea how this modules works to ensure such high speeds?

    It's a custom chip implementing USB3 SuperSpeed protocol (plus of course the whole USB stack including MSC, plus the SD "master").

    JW

    Super User
    August 5, 2020

    You can get around 100 Mbps with high speed USB. Won't get more than around 6-8 Mbps with full speed.

    Implement USB directly on the chip if you want fast speed. Transferring it over UART to an FTDI chip will be even slower.

    MAndr.233Author
    Visitor II
    August 5, 2020

    Do you have any idea if it will be hard to implement USB on chip. Has ST anything to help me on that. Furthermore, has ST any drivers to install on PC to support USB protocol?

    Super User
    August 6, 2020

    There are example programs in the CubeMX repository. Here are a few of them:

    https://github.com/STMicroelectronics/STM32CubeL4/tree/master/Projects/32L496GDISCOVERY/Applications/USB_Device

    JW makes a good points below about USB speed limitations.

    Super User
    August 6, 2020

    You did not tell us exactly which STM32 you use, but generally, on 'L4, there's only Full Speed USB.

    JW