2025-09-12 7:36 PM - last edited on 2025-09-16 5:54 AM by Andrew Neil
I want to use the EMMC as USB storage space, but I encountered another issue: I am trying to access the EMMC via SDMM1, and after implementing the MSC-related functions (read, write, USBD_STORAGE_GetMediaLastLba, USBD_STORAGE_GetMediaBlocklength) in ux_device_msc.c, the formatting operation on the PC side fails. The error message says: "Please insert a disk into the removable disk."
I have already verified that after initializing SDMM1, the EMMC can be accessed and read/write operations are successful.
What could be the reason for this issue?
The attached file is my project.
ux_device_msc.c:
Solved! Go to Solution.
2025-09-19 7:42 AM
Hi @tod
Honestly it took me sometime to realize to never use status = UX_SUCCESS; and use status = UX_STATE_NEXT; instead !
Now, here is a working example for eMMC !
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-09-12 7:40 PM
2025-09-14 12:22 AM
Hi @FBL
I can see an unallocated Disk 3 in Disk Management(3.64GB), but when trying to format it(FAT,size=512), I get the error: "The request could not be performed because of an I/O device error."
2025-09-14 11:18 AM
2025-09-14 7:07 PM
Hi @FBL
You can use the project I provided (attachment: MSC_FIN.7z) to reproduce the issue.
I will check and try according to your suggestions and provide feedback.
Thank you very much!
2025-09-15 5:53 PM
Hi @FBL
I modified the read and write functions in ux_device_msc.c, but the formatting still cannot be performed correctly. Through GDB debugging, I found that during formatting, write operations are executed and the data is written correctly, but the formatting still fails.
2025-09-16 5:13 AM
Hi @FBL
Did you reproduce the issue? Is it a problem with my configuration or a bug in the code?
2025-09-17 4:51 PM
2025-09-19 12:19 AM
Hi @FBL
I've tried different USB ports, replaced the data cable, and even used a different computer, but I still can't format it properly.
Please help me ! Thank you so much!
2025-09-19 7:42 AM
Hi @tod
Honestly it took me sometime to realize to never use status = UX_SUCCESS; and use status = UX_STATE_NEXT; instead !
Now, here is a working example for eMMC !
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.