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

Reinitialization support #34

Closed
ost-ing opened this issue May 14, 2021 · 2 comments
Closed

Reinitialization support #34

ost-ing opened this issue May 14, 2021 · 2 comments

Comments

@ost-ing
Copy link
Contributor

ost-ing commented May 14, 2021

Hey, I'm using this library in conjunction with an SDIO SDMMC controller and a removable SDCard.

I would like to be able to reinitialize this library if the user removes the SDCard and reinserts it.

What I am doing is:

  1. Initialize everything, the SDMMC and this library, with SDCard present ✅
  2. Remove the SDCard, and then reinsert it (or another card) ✅
  3. Reinitialize the SDMMC controller ✅
  4. Reinitialize this library ❌

I need to refresh the handles for the Volume, e.g:

let mut volume = self.controller.get_volume(VolumeIdx(0)).unwrap();

But I then encounter the error:

panicked at 'called Result::unwrap() on an Err value: FormatError("Invalid MBR signature")', src/drivers/sdcard.rs:117:67

Proposed solution:

Either allow the Controller and volumes to be reinitialized, or provide a means to relinquish the block device so that the Controller can be reinitialized from scratch.

Kind regards

@thejpster
Copy link
Member

Ah, hot-plug. I would love to see a PR to support this!

@thejpster
Copy link
Member

Closed by #80, I think. You probably need out-of-band support to know when to destroy your VolumeManager though.

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

2 participants