-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Cloning mpu9250 onto a pi zero and running cargo run --example rpi follows the same steps consistently:
First time gives: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 13, kind: PermissionDenied, message: "Permission denied" })', examples/rpi.rs:35:5
Sometimes runs correctly 1-3 times.
From then on the program hangs indefinitely on this line: let mut mpu9250 = Mpu9250::marg_default(spi, ncs, &mut Delay).unwrap();
Once the program starts hanging, it never corrects itself. The longest I've let it hang is a few minutes. Reboots don't always work but a power off restart gives the panic, correctly running and then hanging cycle.
Wiring is SPI and follows the guide given at the top of rpi.rs.
I also had to change mpu9250.all().unwrap() to mpu9250.all::<[f32; 3]>().unwrap() on line 49 and 53 due to compile error:
error[E0283]: type annotations needed
--> examples/rpi.rs:49:31
|
49 | println!("{:#?}", mpu9250.all().unwrap());
| ^^^
| |
| cannot infer type for type parameter `T` declared on the method `all`
| help: consider specifying the type argument in the method call: `all::<T>`
|
= note: cannot resolve `_: std::convert::From<[f32; 3]>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0283`.
error: could not compile `mpu9250`.