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

Intermittent BorrowMutError #37

Open
TheZoq2 opened this issue Aug 1, 2021 · 1 comment
Open

Intermittent BorrowMutError #37

TheZoq2 opened this issue Aug 1, 2021 · 1 comment

Comments

@TheZoq2
Copy link

TheZoq2 commented Aug 1, 2021

I'm using this crate in a GPS logging project https://gitlab.com/TheZoq2/sailgps/-/blob/master/src/main.rs which was working fine until yesterday when I started making some unrelated changes (https://gitlab.com/TheZoq2/sailgps/-/commit/ccd1b9b880fb7d3cfada5375badb2700b2b84094). After this change, the device seems to panic after a few minutes of running with

already borrowed: BorrowMutError', /home/frans/.cargo/registry/src/github.com-
1ecc6299db9ec823/embedded-sdmmc-0.3.0/src/sdmmc.rs:416:32

As far as I can tell, this is comming from RefCell, and if I understand it correctly, this error would happen if two mutable borrows happen at the same time. However, since I'm using RTIC, that should be impossible, since my sdmmc struct is a RTIC resource, right?

Could this be a bug in this lib? (I think I may also be fairly close to filling up my RAM on the device, so that might also be an issue)

@thejpster
Copy link
Member

I wouldn't rule out a bug in this library, but I can't immediately think of anywhere the RefCells might be re-borrowed.

In theory RTIC should stop you using SdMmc in two contexts where one can interrupt the other, but I guess it depends on configuration?

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