Skip to content

Commit

Permalink
Merge pull request #191 from luisroel91/master
Browse files Browse the repository at this point in the history
Update README.md to add troubleshooting step for interrupt priority issues
  • Loading branch information
Dirbaio authored Aug 16, 2023
2 parents 86a1d02 + 146810b commit 3f57e8f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,26 @@ let peripherals = embassy_nrf::init(config);
## Troubleshooting
If you are sure you have set interrupts correctly, but are still getting an error like below:
```
[ERROR]Location<lib.rs:104>panicked at 'sd_softdevice_enable err SdmIncorrectInterruptConfiguration'
```
Make sure the `defmt` feature is enabled on `embassy_nrf`.
You can then use this code to print whether an interrupt is enabled, and its priority:
```rust
for num in 0..48 {
let interrupt = unsafe { mem::transmute::<u16, Interrupt>(num) };
let is_enabled = InterruptExt::is_enabled(interrupt);
let priority = InterruptExt::get_priority(interrupt);

println!("Interrupt {}: Enabled = {}, Priority = {}", num, is_enabled, priority);
}
```
Interrupt numbers map to what they are in the [`Interrupt` enum](https://docs.embassy.dev/embassy-nrf/git/nrf52832/interrupt/enum.Interrupt.html).
If your SoftDevice is hardfaulting on enable and you think you have everything right, make sure to go back and do a full chip erase or recover, and reflash the SoftDevice again. A few bytes of empty space after the SoftDevice are required to be 0xFF, but might not be if the softdevice was flashed over an existing binary.
If the following linking error occurs
Expand Down

0 comments on commit 3f57e8f

Please sign in to comment.