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

msd_Close causes the calculator to freeze with certain flashdrives. #477

Open
TheMiningTeamYT opened this issue Feb 1, 2024 · 4 comments
Assignees

Comments

@TheMiningTeamYT
Copy link

          I think you've convinced me - hopefully in your program you can work around it your code for now until I get the time to fix it. Yes, please make another issue and document the drive you are using (maybe an Amazon link too)

Originally posted by @mateoconlechuga in #475 (comment)

Well then.
If you initialize a USB flash drive using USBDRVCE and msd_Open from MSDDRVCE, then try to deinitialize that flash drive using msd_Close, with some flash drives, it will freeze and require the calculator to be reset. If you remove the msd_Close call, the calculator will not freeze.
The drive I'm using is a SanDisk Cruzer Micro U3 16GB (something like this) The code I experienced this issue with can be found here. As it stands, accessing the flash drive doesn't cause the calculator to freeze, however, if you uncomment the msd_Close call in closeUSB in usb.c and rebuild, the calculator will freeze every time after the drive is accessed, when closeUSB is called.
I personally suspect this error is specific to this 1 ancient flash drive, so if there's anything you'd like me to do, any data you'd like me to collect, let me know.

@TheMiningTeamYT
Copy link
Author

TheMiningTeamYT commented Feb 1, 2024

By the way, I noticed in your list of supported flash drives, you have a SanDisk Ultra 32GB listed. However, when I tried plugging one of my SanDisk Ultra 32GB drives into my calculator, it caused the calculator to stop responding until I unplugged it. (As in, I was in Cesium, I plugged in the flash drive, then it stopped responding to the keyboard until the instant I unplugged it). I wonder what's up with that. I'm plugging the flash drive directly into my calculator using a USB on the go mini B to full A adapter, if that helps.

@TheMiningTeamYT
Copy link
Author

Ok update, while attempting to gather some data on what exactly is going on, I discovered that:
A: The file does actually get written to the flash drive successfully and
B: The calculator does reset on it's own after a strangely long time (Possibly minutes -- I didn't catch exactly when it reset)

@TheMiningTeamYT
Copy link
Author

More updates:
I have an msd_Close call in my USB_DEVICE_DISCONNECTED_EVENT handler, as shown in the FATDRVCE examples. If I remove that, calling msd_Close no longer causes the calculator to hang until you reset, only hang until you unplug the flash drive (which is the same behavior with this flash drive in Cesium) (this is different from the behavior I observed with my SanDisk Ultra. That causes the calculator to hang as soon as it is plugged in, whereas here it's hanging when the flash drive is uninitialized.)

@mateoconlechuga
Copy link
Member

I have ordered a SanDisk Cruzer Micro U3 16GB and will update this issue with findings once I get it on the 15th

@mateoconlechuga mateoconlechuga self-assigned this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants