Make software compatible with commonsense-hw

This commit is contained in:
Andreas Tsouchlos 2025-09-30 00:50:14 +02:00
parent 05dd72f55c
commit 117a9816ed
7 changed files with 6328 additions and 22 deletions

View File

@ -1,6 +1,6 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# replace nRF82810_xxAA with your chip as listed in `probe-rs chip list`
runner = "probe-rs run --chip nRF52832_xxAA"
runner = "probe-rs run --chip nRF52810_xxAA"
[alias]
rr = "run --release"

12
Cargo.lock generated
View File

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "Inflector"
@ -140,7 +140,7 @@ dependencies = [
"futures",
"heapless",
"nrf-softdevice",
"nrf-softdevice-s132",
"nrf-softdevice-s112",
"panic-probe",
"static_cell",
]
@ -733,8 +733,8 @@ dependencies = [
"futures",
"heapless",
"nrf-softdevice-macro",
"nrf-softdevice-s132",
"nrf52832-pac",
"nrf-softdevice-s112",
"nrf52810-pac",
"num_enum",
]
@ -753,10 +753,10 @@ dependencies = [
]
[[package]]
name = "nrf-softdevice-s132"
name = "nrf-softdevice-s112"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9c4f582065c2adbfcfe8feb23ba32b12a599d9fffbf6da78fd5ae89763ae48b"
checksum = "115defd955aae68bd34adf90411402be260dbfa01951606a5ca2ab0715fd4eb9"
[[package]]
name = "nrf51-pac"

View File

@ -11,7 +11,7 @@ defmt = "0.3.8"
defmt-rtt = "0.4.1"
embassy-executor = { version = "0.6.1", features = ["task-arena-size-8192", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
embassy-futures = "0.1.1"
embassy-nrf = { version = "0.2.0", features = ["defmt", "nrf52832", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
embassy-nrf = { version = "0.2.0", features = ["defmt", "nrf52810", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
embassy-sync = { version = "0.6.0", features = ["defmt"] }
embassy-time = { version = "0.3.2", features = ["defmt", "defmt-timestamp-uptime"] }
embedded-storage = "0.3.1"
@ -19,7 +19,7 @@ embedded-storage-async = "0.4.1"
fixed = "1.28.0"
futures = { version = "0.3.31", default-features = false }
heapless = "0.8.0"
nrf-softdevice = { version = "0.1.0", features = ["defmt", "ble-peripheral", "ble-central", "critical-section-impl", "nrf52832", "s132"] }
nrf-softdevice-s132 = "0.1.2"
nrf-softdevice = { version = "0.1.0", features = ["defmt", "ble-peripheral", "critical-section-impl", "nrf52810", "s112"] }
nrf-softdevice-s112 = "0.1.2"
panic-probe = { version = "0.3.2", features = ["print-defmt"] }
static_cell = "2.1.0"

View File

@ -55,7 +55,7 @@ softdevice has to flashed to the chip.
https://users.rust-lang.org/t/probe-rs-fails-to-work-after-first-time-use-successful/103234
- This may be useful for unit testing: https://crates.io/crates/embedded-test
- Currently this project is being developed on the nrf52-dk board with the
nrf52832 chip. What mature enough, it will be ported to the nrf52810 to run
nrf52832 chip. When mature enough, it will be ported to the nrf52810 to run
on the actual hardware. Locations to modify:
- `memory.x` - consult the
[nrf-softdevice](https://github.com/embassy-rs/nrf-softdevice)
@ -66,3 +66,4 @@ softdevice has to flashed to the chip.
proprietary)
- If the device locks up, use the
[nrf-recover](https://docs.rs/crate/nrf-recover/latest) utility
- [Pinning to use nRF52DK as programmer](https://devzone.nordicsemi.com/f/nordic-q-a/14058/external-programming-using-nrf52-dk)

View File

@ -1,13 +1,8 @@
/*MEMORY
{
FLASH : ORIGIN = 0x00000000, LENGTH = 256K
RAM : ORIGIN = 0x20000000, LENGTH = 24K
}*/
MEMORY
{
/* NOTE 1 K = 1 KiBi = 1024 bytes */
/* NRF52832 with Softdevice S132 7.x and 6.x */
FLASH : ORIGIN = 0x00026000, LENGTH = 512K - 152K
RAM : ORIGIN = 0x20000000 + 30K, LENGTH = 64K - 30K
/* NOTE 1 K = 1 KiB = 1024 bytes */
/* These values correspond to the NRF52810 with SoftDevice S112 v7.x */
FLASH : ORIGIN = 0x00000000 + 100K, LENGTH = 192K - 100K
RAM : ORIGIN = 0x20000000 + 6K, LENGTH = 24K - 6K
}

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ use nrf_softdevice::{raw, Softdevice};
#[embassy_executor::main]
async fn main(_spawner: Spawner) {
let p = embassy_nrf::init(Default::default());
let mut led = Output::new(p.P0_18, Level::Low, OutputDrive::Standard);
let mut led = Output::new(p.P0_20, Level::Low, OutputDrive::Standard);
info!("Starting blinky");
@ -20,6 +20,7 @@ async fn main(_spawner: Spawner) {
Timer::after_millis(300).await;
led.set_low();
Timer::after_millis(300).await;
info!("Blinked");
}
}