From e008932d295e046415c15f13b3381723a60bf332 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Thu, 24 Apr 2025 20:45:23 +0200 Subject: [PATCH] targets: add target for Microbit v2 with SoftDevice S140 support for both peripheral and central Signed-off-by: deadprogram --- GNUmakefile | 2 ++ targets/microbit-v2-s140v7.json | 4 ++++ targets/nrf52833-s140v7.json | 7 +++++++ targets/nrf52833-s140v7.ld | 14 ++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 targets/microbit-v2-s140v7.json create mode 100644 targets/nrf52833-s140v7.json create mode 100644 targets/nrf52833-s140v7.ld diff --git a/GNUmakefile b/GNUmakefile index a685c08487..1beddd0b69 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -626,6 +626,8 @@ endif @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=microbit-v2-s113v7 examples/microbit-blink @$(MD5SUM) test.hex + $(TINYGO) build -size short -o test.hex -target=microbit-v2-s140v7 examples/microbit-blink + @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=nrf52840-mdk examples/blinky1 @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=pca10031 examples/blinky1 diff --git a/targets/microbit-v2-s140v7.json b/targets/microbit-v2-s140v7.json new file mode 100644 index 0000000000..500bacbada --- /dev/null +++ b/targets/microbit-v2-s140v7.json @@ -0,0 +1,4 @@ +{ + "inherits": ["microbit-v2", "nrf52833-s140v7"], + "flash-method": "openocd" +} diff --git a/targets/nrf52833-s140v7.json b/targets/nrf52833-s140v7.json new file mode 100644 index 0000000000..6c6323d41f --- /dev/null +++ b/targets/nrf52833-s140v7.json @@ -0,0 +1,7 @@ +{ + "build-tags": ["softdevice", "s140v7"], + "linkerscript": "targets/nrf52833-s140v7.ld", + "ldflags": [ + "--defsym=__softdevice_stack=0x700" + ] +} diff --git a/targets/nrf52833-s140v7.ld b/targets/nrf52833-s140v7.ld new file mode 100644 index 0000000000..d47f5ecdf6 --- /dev/null +++ b/targets/nrf52833-s140v7.ld @@ -0,0 +1,14 @@ + +MEMORY +{ + FLASH_TEXT (rw) : ORIGIN = 0x00000000 + 0x00027000, LENGTH = 0x80000 - 0x00027000 + RAM (xrw) : ORIGIN = 0x20000000 + 0x000039c0, LENGTH = 0x20000 - 0x000039c0 +} + +_stack_size = 4K + __softdevice_stack; + +/* These values are needed for the Nordic SoftDevice. */ +__app_ram_base = ORIGIN(RAM); +__softdevice_stack = DEFINED(__softdevice_stack) ? __softdevice_stack : 0; + +INCLUDE "targets/arm.ld"