stm32wb-hal icon indicating copy to clipboard operation
stm32wb-hal copied to clipboard

Cannot compile without `rt` feature

Open rubdos opened this issue 5 years ago • 3 comments

stm32wb-hal = { version = "0.1.2", default-features = false, features = ["xG-package", "rt"]}

compiles, but

stm32wb-hal = { version = "0.1.2", default-features = false, features = ["xG-package"]}

does not:

error[E0433]: failed to resolve: could not find `interrupt` in `stm32wb_pac`
  --> /home/rsmet/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32wb-hal-0.1.2/src/ipcc.rs:60:61
   |
60 |             cortex_m::peripheral::NVIC::unmask(stm32wb_pac::interrupt::IPCC_C1_RX_IT);
   |                                                             ^^^^^^^^^ could not find `interrupt` in `stm32wb_pac`

error[E0433]: failed to resolve: could not find `interrupt` in `stm32wb_pac`
  --> /home/rsmet/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32wb-hal-0.1.2/src/ipcc.rs:61:61
   |
61 |             cortex_m::peripheral::NVIC::unmask(stm32wb_pac::interrupt::IPCC_C1_TX_IT);
   |                                                             ^^^^^^^^^ could not find `interrupt` in `stm32wb_pac`

I'm not too acquainted yet with embedded systems, but it would be nice to get a warning what went wrong, especially because I just wanted to select the specific chip.

rubdos avatar Dec 05 '20 12:12 rubdos

Hello and thank you for noticing this. I never compiled this crate without the rt feature since I was always needed interrupts. I'll put behind a feature gate all parts of the code that uses stuff provided by PAC's rt feature.

eupn avatar Dec 05 '20 16:12 eupn

I'd say you could note somewhere that rt is something that's quite needed, but apparently that's also the convention in the Rust embedded world.

Thanks for coming back to it quickly. I'll be filing a PR for SPI support soon™.

rubdos avatar Dec 08 '20 10:12 rubdos

Ok, I'll keep this open until it's documented that rt is needed for the parts of the HAL that use interrupts (like mbox).

eupn avatar Dec 08 '20 10:12 eupn