jonas-schievink / rubble

(going to be a) BLE stack for embedded Rust
BSD Zero Clause License
397 stars 56 forks source link

Update pacs for rubble-nrf5x #185

Closed caemor closed 2 years ago

caemor commented 2 years ago

This update would allow the update of microbit: https://github.com/nrf-rs/microbit/pull/67 Which in turn would allow the discovery book to be fixed: https://github.com/rust-embedded/discovery/pull/407

This seems to break the demos after updating the hal there as well: Updating cortex-m-rtic to the current 0.6.rc2 doesn't solve the issue sadly (just changes it)

❯ cargo build --features 52810
   Compiling nrf52-beacon v0.0.0 (/home/caemor/git/rubble/demos/nrf52-beacon)
error[E0277]: the trait bound `Interrupt: Nr` is not satisfied
   --> demos/nrf52-beacon/src/main.rs:30:1
    |
30  | #[rtic::app(device = crate::hal::pac, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Nr` is not implemented for `Interrupt`
    | 
   ::: /home/caemor/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rtic-0.5.9/src/lib.rs:181:8
    |
181 |     I: Nr,
    |        -- required by this bound in `pend`
    |
    = note: this error originates in the attribute macro `rtic::app` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Interrupt: Nr` is not satisfied
  --> demos/nrf52-beacon/src/main.rs:30:1
   |
30 | #[rtic::app(device = crate::hal::pac, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Nr` is not implemented for `Interrupt`
   |
   = note: this error originates in the attribute macro `rtic::app` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `nrf52-beacon` due to 2 previous errors

Therefore I am unsure if this PR should be accepted currently.

jonas-schievink commented 2 years ago

Rubble doesn't really interact with HALs, so I'm not sure why microbit is pulling in the dependency. Apparently it's just for this example, which might as well be integrated into Rubble's nrf52-beacon demo.

Still, updating the PACs seems like a good idea regardless.

caemor commented 2 years ago

The PR should be ready now. I needed to activate the cortex-m-7 feature inside rtic to fix the following compatibility issue: https://github.com/rtic-rs/cortex-m-rtic#crate-cortex-m-06-vs-07-in-rtic-05x