Skip to content

Running example/rpi.rs on raspberry pi zero multiple times causes program to hang indefinitely. #29

@MechanicalPython

Description

@MechanicalPython

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`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions