Skip to main content
Explorer II
October 5, 2021
Question

USB Full Speed MSC using uSD (SMMC2) and FatFs took so long to enumerate

  • October 5, 2021
  • 13 replies
  • 2485 views

I am using STM32F722ZE MCU. I am successfully implemented micro SD FATFS USB Full Speed MSC.

The problem is every time I plug the board to PC, it took so long, up to 40 seconds, for the USB enumeration to be completed.

Can anyone help me to point out for me there is something that I missed or any way to speed it up?

I used the same board and create USB Full Speed MSC using MCU's RAM and the USB enumeration happened as soon as I plugged the USB in the PC host.

    This topic has been closed for replies.

    13 replies

    Visitor II
    October 19, 2021

    Hello @Jtron.1​ ,

    Can you try using another wire and let me know if that solves your problem?

    Thanks in advance.

    BeST Regards,

    Walid

    Jtron.11Author
    Explorer II
    October 19, 2021

    Walid,

    Thank you for your reply. "Another wire" meaning another USB cable? I tried different cables and the behavior is the same. The behavior is already coming from the first day when I tried the Evaluation board to connect to the external uSD. I thought the problem from the cables wiring from Nucleo eval to external uSD module. But when I have my PCBA done, the issue is still exist.

    Visitor II
    October 19, 2021

    Hello @Jtron.1​ 

    Could you please provide your project so that we can reproduce your issue?

    Thanks in advance.

    BeST Regards,

    Walid

    Jtron.11Author
    Explorer II
    October 19, 2021

    Could you please tell me how can I send you the message privately?

    Jtron.11Author
    Explorer II
    October 21, 2021

    Walid,

    Can you please let me know if you are able to see the issue from my sent code to you?

    Do you have any update for the problem?

    Visitor II
    October 22, 2021

    Hello @Jtron.1​ 

    Your issue is under investigation. I will keep you updated as soon as possible.

    BeST Regards,

    Walid

    Visitor II
    October 25, 2021

    Hello @Jtron.1​ 

    Can you please provide the size and the model of µSD used?

    BeST Regards,

    Walid

    Jtron.11Author
    Explorer II
    October 25, 2021

    I have been testing with Kingston 8GB Micro SD, N0538-004 A00LF.

    The capacity of the uSD is always correct and read/write to the uSD has no issue.

    The only problem is it took very long time for USB to enumerate.

    Visitor II
    October 25, 2021

    Hello @Jtron.1​ 

    Improving the USB performance may solve your issue. Setting MSC_MEDIA_PACKET to 8 * 1024U instead of 512U should help:

    #define MSC_MEDIA_PACKET 512U -> (8 *1024U)

    Heavy read/write operations can also cause latencies. The application is in FS mode (max data rate around 900 KB/s) and FS checks could issue read request to FAT sectors that coincide with the enumeration windows. In this case, latencies are to be expect and enumeration may not work at the first try.

    Your feedback on these modifications would be appreciated. Would you please test the above modification and report your results back?

    BeST Regards,

    Walid

    Jtron.11Author
    Explorer II
    October 25, 2021

    Thank you. I will give it a try and let you know

    Jtron.11Author
    Explorer II
    October 25, 2021

    Walid,

    Just a side question, do you know if STM32H7 is able to support the USB's hub when I configure STM32 it to USB Host?

    Jtron.11Author
    Explorer II
    October 26, 2021

    Hi Walid,

    Unfortunately, changing the sise of the MSC_MEDIA_PACKET won't work, I think the 512 bytes is coupling with uSD's sector size. This is just my guess. I don't know if that is correct. So I dial down from 8*1024 till 512 and only 512 for MSC_MEDIA_PACKET is working.

    Instead of uSD, I used RAM to be the storage and I don't see this delay USB enumeration. Is the problem laying with SDMMC communications?