diff options
author | cos <cos> | 2022-10-20 10:35:00 +0200 |
---|---|---|
committer | cos <cos> | 2022-10-20 11:37:58 +0200 |
commit | 18e448f2ef6632fbd63f3b9e7fac7f19f36d4e21 (patch) | |
tree | fefee20666b0ff2806ceab6d9842c1f8489e4f2d | |
parent | 8c42b26fc623f556c865a0f27c7f956b06bedff9 (diff) | |
download | embassy-18e448f2ef6632fbd63f3b9e7fac7f19f36d4e21.zip |
Adapt blinky for nRF52840-DONGLE (PCA10059)
Launching run.sh successfully results in the single color LED to blink.
-rw-r--r-- | examples/nrf/memory.x | 4 | ||||
-rwxr-xr-x | examples/nrf/run.sh | 7 | ||||
-rw-r--r-- | examples/nrf/src/bin/blinky.rs | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/examples/nrf/memory.x b/examples/nrf/memory.x index 9b04edec..faf1a439 100644 --- a/examples/nrf/memory.x +++ b/examples/nrf/memory.x @@ -2,6 +2,6 @@ MEMORY { /* NOTE 1 K = 1 KiBi = 1024 bytes */ /* These values correspond to the NRF52840 with Softdevices S140 7.0.1 */ - FLASH : ORIGIN = 0x00000000, LENGTH = 1024K - RAM : ORIGIN = 0x20000000, LENGTH = 256K + FLASH : ORIGIN = 0x00001000, LENGTH = 1020K + RAM : ORIGIN = 0x20000008, LENGTH = 255K } diff --git a/examples/nrf/run.sh b/examples/nrf/run.sh new file mode 100755 index 00000000..7503a6d5 --- /dev/null +++ b/examples/nrf/run.sh @@ -0,0 +1,7 @@ +#!/bin/sh -eu +SUFFIX=$( ( sed -n 's/.*\(0x[0-9A-F]*\).*/\1/p' < memory.x; + sed -n 's/.*.*\(P[0-9_]*\).*/\1/p' src/bin/blinky.rs) | tr '\n' - ) +cargo build --bin blinky +cp ./target/thumbv7em-none-eabi/debug/blinky \ + ./blinky-${SUFFIX%-} +nrfdfu ./blinky-${SUFFIX%-} diff --git a/examples/nrf/src/bin/blinky.rs b/examples/nrf/src/bin/blinky.rs index 513f6cd8..1890cab5 100644 --- a/examples/nrf/src/bin/blinky.rs +++ b/examples/nrf/src/bin/blinky.rs @@ -10,7 +10,7 @@ use {defmt_rtt as _, panic_probe as _}; #[embassy_executor::main] async fn main(_spawner: Spawner) { let p = embassy_nrf::init(Default::default()); - let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); + let mut led = Output::new(p.P0_06, Level::Low, OutputDrive::Standard); loop { led.set_high(); |