Skip to content

Commit

Permalink
fix(example): fix linker script for nrf52840
Browse files Browse the repository at this point in the history
Signed-off-by: Haobo Gu <[email protected]>
  • Loading branch information
HaoboGu committed Feb 1, 2024
1 parent 8f8298d commit 853f0bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions boards/nrf52840/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# Have to use simmsb's elf2uf2 fork to flash https://github.com/simmsb/elf2uf2-rs
runner = "elf2uf2-rs -d"
# runner = "probe-rs run --chip nRF52840_xxAA"
# runner = "elf2uf2-rs -d"
runner = "probe-rs run --chip nRF52840_xxAA"

rustflags = [
# Previously, the linker arguments --nmagic and -Tlink.x were set here.
Expand Down Expand Up @@ -35,4 +35,4 @@ target = "thumbv7em-none-eabi" # Cortex-M4 and Cortex-M7 (no FPU)
# target = "thumbv8m.main-none-eabihf" # Cortex-M33 (with FPU)

[env]
DEFMT_LOG = "error"
DEFMT_LOG = "trace"
8 changes: 4 additions & 4 deletions boards/nrf52840/memory.x
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
MEMORY
{
/* NOTE 1 K = 1 KiBi = 1024 bytes */
/* FLASH : ORIGIN = 0x00000000, LENGTH = 1024K
RAM : ORIGIN = 0x20000000, LENGTH = 256K */
FLASH : ORIGIN = 0x00000000, LENGTH = 1024K
RAM : ORIGIN = 0x20000000, LENGTH = 256K

/* These values correspond to the NRF52840 with Softdevices S140 7.3.0 */
FLASH : ORIGIN = 0x00027000, LENGTH = 868K
RAM : ORIGIN = 0x20020000, LENGTH = 128K
/* FLASH : ORIGIN = 0x00027000, LENGTH = 868K
RAM : ORIGIN = 0x20020000, LENGTH = 128K */

}
3 changes: 0 additions & 3 deletions boards/nrf52840/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ const EEPROM_SIZE: usize = 128;

#[embassy_executor::main]
async fn main(_spawner: Spawner) {
// if cfg!(debug_assertions) {
// rtt_logger::init(log::LevelFilter::Info);
// }
info!("RMK start!");
// Initialize peripherals
let p = embassy_nrf::init(Default::default());
Expand Down

0 comments on commit 853f0bf

Please sign in to comment.