cancel
Showing results for 
Search instead for 
Did you mean: 

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

Jtron.11
Senior

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.

15 REPLIES 15

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.11
Senior

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.

Hello @Jtron.1​ 

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

Thanks in advance.

BeST Regards,

Walid

Jtron.11
Senior

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

Jtron.11
Senior

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?

Hello @Jtron.1​ 

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

BeST Regards,

Walid

Hello @Jtron.1​ 

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

BeST Regards,

Walid

Jtron.11
Senior

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.

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