boards: Add support for the apollo3
Signed-off-by: Alistair Francis <alistair@alistair23.me>
diff --git a/Makefile b/Makefile
index 1467c1a..f1f6dd5 100644
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,14 @@
analyse-stack-sizes:
cargo stack-sizes $(release) --example $(EXAMPLE) $(features) -- -Z emit-stack-sizes
+.PHONY: apollo3
+apollo3:
+ PLATFORM=apollo3 cargo build $(release) --target=thumbv7em-none-eabi --examples $(features)
+
+.PHONY: flash-apollo3
+flash-apollo3:
+ PLATFORM=apollo3 cargo run $(release) --target=thumbv7em-none-eabi --example $(EXAMPLE) $(features)
+
.PHONY: hail
hail:
PLATFORM=hail cargo build $(release) --target=thumbv7em-none-eabi --examples $(features)
diff --git a/boards/layout_apollo3.ld b/boards/layout_apollo3.ld
new file mode 100644
index 0000000..95fde33
--- /dev/null
+++ b/boards/layout_apollo3.ld
@@ -0,0 +1,17 @@
+/* Layout for the Apollo3 MCU, used by the examples in this repository. */
+
+MEMORY {
+ /* The application region is 64 bytes (0x40) */
+ FLASH (rx) : ORIGIN = 0x00040040, LENGTH = 0x0005FFC0
+ SRAM (rwx) : ORIGIN = 0x10002000, LENGTH = 0x2000
+}
+
+/*
+ * Any change to STACK_SIZE should be accompanied by a corresponding change to
+ * `elf2tab`'s `--stack` option
+ */
+STACK_SIZE = 2048;
+
+MPU_MIN_ALIGN = 8K;
+
+INCLUDE layout_generic.ld
diff --git a/tools/flash.sh b/tools/flash.sh
index 7f4c4ea..f24127e 100755
--- a/tools/flash.sh
+++ b/tools/flash.sh
@@ -15,6 +15,11 @@
fi
case "${PLATFORM}" in
+ "apollo3")
+ tockloader_flags=""
+ binary_name=cortex-m4.elf
+ tockload=n
+ ;;
"nrf52"|"nrf52840")
tockloader_flags="--jlink --arch cortex-m4 --board nrf52dk --jtag-device nrf52"
binary_name=cortex-m4.elf