Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider support for SD card insertion/removal in MSC #27

Open
syoshida0318 opened this issue Apr 12, 2024 · 5 comments
Open

Consider support for SD card insertion/removal in MSC #27

syoshida0318 opened this issue Apr 12, 2024 · 5 comments

Comments

@syoshida0318
Copy link

Using the evaluation board(MIMXRT1064-EVK), I am considering a project that incorporates MSC.
I added support for SD card insertion and removal to the sample project(evkmimxrt1064_dev_msc_disk_freertos).
SD card insertion/removal is coded based on the sample project(evkmimxrt1064_sdcard_fatfs_freertos).
It worked, but there is a problem.
When an SD card is reinserted, the PC may recognize the drive immediately or it may take a very long time.

I attach the code I created, please show me what the problem is.
The project is for gui guider. The attached files are compressed file in the gui guider folder.
Since the ZIP file is too large, I attache a 7z file renamed .TXT.
guiguider_training_01_2.7z.txt

@mcuxsusan
Copy link
Contributor

Thanks for sharing the modified project. I have forwarded internal team to have a check, the feedback could be delayed and appreciate for your patience.

@AidenHu
Copy link

AidenHu commented May 9, 2024

Hi @syoshida0318
Normally we should not remove sdcard during USB connection. Guess the reason why PC takes a very long time to recognize is that PC try to recover from the last failed condition before the SD card is reinserted.
The key point is that PC should know your SDcard is removed. Actually, we have provided this way. You can set g_msc.stop flag when sdcard is removed in your code and clear it when your sdcard is ready. Host sends TestUnitReady request by 1s interval. When g_msc.stop flag is set, device will return sense key using 0x20 (NOT READY, see Table 50 - Sense Key Descriptions in usbmass-ufi10.pdf)

@syoshida0318
Copy link
Author

syoshida0318 commented May 10, 2024 via email

@AidenHu
Copy link

AidenHu commented Jun 4, 2024

@syoshida0318, what is the current progress?

@syoshida0318
Copy link
Author

syoshida0318 commented Jun 4, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants