Closed Gibbz closed 1 hour ago
have you flashed the softdevice accoridng to these instructions? https://github.com/embassy-rs/nrf-softdevice?tab=readme-ov-file#running-examples
note the erase before flashing it is important.
Yes ive flashed to 7.3.0. Im wondering if the issue is with the memory.x file. I have the one from the examples for 52840 7.1.0. But I have version 7.3.0
MEMORY
{
/* NOTE 1 K = 1 KiBi = 1024 bytes */
/* NRF52840 with Softdevice S140 7.0.1 */
FLASH : ORIGIN = 0x00027000, LENGTH = 868K
RAM : ORIGIN = 0x20020000, LENGTH = 128K
}
that shouldn't be an issue, memory.x
is the same for all 7.x softdevices.
Have you first erased the entire chip then flashed the softdevice? Just flashing can break if there was some firmware before.
Also, if you flash an unmodified example from this repo, does it work?
Okay. Ive tried a different firmware no change. When I tried an example it works fine. Any idea what could be missing? It must be some configuration issue.
Edit: I have copied the example file into my project, and it runs fine from there also! So it cant be the toml file or any other config. Ill try strip back the source code and see if I can find whats going on....
Okay, the issue is still with the interrupts. How can I fix this? Specifically the temp one.... Is this one of those devices that are off limits with the softdevice?
use crate::signals;
use embassy_nrf::{peripherals::TEMP, temp::Temp};
use embassy_time::Timer;
use embassy_nrf::{bind_interrupts, interrupt};
use embassy_nrf::interrupt::InterruptExt;
use embassy_nrf::temp;
use defmt::*;
const TASK_ID: &str = "TEMPERATURE";
#[embassy_executor::task]
pub async fn temperature (
temp: TEMP
) {
//return;
info!("{}: start", TASK_ID);
bind_interrupts!(struct Irqs {TEMP => temp::InterruptHandler;});
interrupt::TEMP.set_priority(interrupt::Priority::P3);
let mut t = Temp::new(temp, Irqs);
let pub_temperature = signals::TEMPERATURE.publisher().unwrap();
loop {
let value: u16 = t.read().await.to_num::<u16>();
//info!("{}", value);
pub_temperature.publish_immediate(value); // in degrees C, no decimals
Timer::after_secs(60).await;
}
}
Ive been trying to get the softdevice working. Now that I got past the priority issues, i'm having a new error. It flashes and builds fine. But when running it crashes.
It occurs on the line:
My bluetooth modified example:
My toml: