From 8047986061db0fb6fd9d61feaedd5eee07bc1e20 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Thu, 3 Sep 2020 22:07:01 +0200 Subject: [PATCH] Add --nmagic linker arg, for unaligned flash origin support. Without this, the linker places some extra program header entries that can confuse flashing tools. Many thanks to @jonas-schievink for pointing me to this flag in Matrix. --- .cargo/config | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.cargo/config b/.cargo/config index fa909f5..7241c1a 100644 --- a/.cargo/config +++ b/.cargo/config @@ -10,6 +10,10 @@ # runner = "gdb -q -x openocd.gdb" rustflags = [ + # This is needed if your flash or ram addresses are not aligned to 0x10000 in memory.x + # See https://github.com/rust-embedded/cortex-m-quickstart/pull/95 + "-C", "link-arg=--nmagic", + # LLD (shipped with the Rust toolchain) is used as the default linker "-C", "link-arg=-Tlink.x",