From 31543f38ec05965b0903c7da0854b375ac6a3d1c Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 8 Dec 2025 11:28:54 +0100 Subject: feat: add support for nrf54 to embassy-boot examples --- examples/boot/application/nrf/src/bin/a.rs | 13 ++++++++++--- examples/boot/application/nrf/src/bin/b.rs | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'examples/boot/application/nrf/src') diff --git a/examples/boot/application/nrf/src/bin/a.rs b/examples/boot/application/nrf/src/bin/a.rs index 2c1d1a7bb..f317414fc 100644 --- a/examples/boot/application/nrf/src/bin/a.rs +++ b/examples/boot/application/nrf/src/bin/a.rs @@ -27,6 +27,11 @@ async fn main(_spawner: Spawner) { let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); let mut led_reverted = Output::new(p.P0_14, Level::High, OutputDrive::Standard); + // nRF54 DK + // let mut button = Input::new(p.P1_13, Pull::Up); + // let mut led = Output::new(p.P1_14, Level::Low, OutputDrive::Standard); + // let mut led_reverted = Output::new(p.P2_09, Level::High, OutputDrive::Standard); + //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); //let mut button = Input::new(p.P1_02, Pull::Up); @@ -40,8 +45,8 @@ async fn main(_spawner: Spawner) { // the watchdog will cause the device to reset as per its configured timeout in the bootloader. // This helps is avoid a situation where new firmware might be bad and block our executor. // If firmware is bad in this way then the bootloader will revert to any previous version. - let wdt_config = wdt::Config::try_new(&p.WDT).unwrap(); - let (_wdt, [_wdt_handle]) = match Watchdog::try_new(p.WDT, wdt_config) { + let wdt_config = wdt::Config::try_new(&p.WDT0).unwrap(); + let (_wdt, [_wdt_handle]) = match Watchdog::try_new(p.WDT0, wdt_config) { Ok(x) => x, Err(_) => { // Watchdog already active with the wrong number of handles, waiting for it to timeout... @@ -51,11 +56,13 @@ async fn main(_spawner: Spawner) { } }; + // RRAMC for nRF54 + // let nvmc = Nvmc::new(p.RRAMC); let nvmc = Nvmc::new(p.NVMC); let nvmc = Mutex::new(BlockingAsync::new(nvmc)); let config = FirmwareUpdaterConfig::from_linkerfile(&nvmc, &nvmc); - let mut magic = [0; 4]; + let mut magic = [0; 16]; let mut updater = FirmwareUpdater::new(config, &mut magic); let state = updater.get_state().await.unwrap(); if state == State::Revert { diff --git a/examples/boot/application/nrf/src/bin/b.rs b/examples/boot/application/nrf/src/bin/b.rs index de97b6a22..7ed78ea85 100644 --- a/examples/boot/application/nrf/src/bin/b.rs +++ b/examples/boot/application/nrf/src/bin/b.rs @@ -15,6 +15,8 @@ async fn main(_spawner: Spawner) { // nRF91 DK // let mut led = Output::new(p.P0_02, Level::Low, OutputDrive::Standard); + // nrf54l15 dk + // let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); loop { led.set_high(); -- cgit