diff --git a/Makefile b/Makefile index ba23392c..bb79aedd 100644 --- a/Makefile +++ b/Makefile @@ -226,8 +226,6 @@ smoketest: @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=microbit examples/microbit-blink @$(MD5SUM) test.hex - $(TINYGO) build -size short -o test.hex -target=microbit-v2 examples/microbit-blink - @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=pca10040 examples/pininterrupt @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=pca10040 examples/serial @@ -256,6 +254,10 @@ smoketest: @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=microbit-s110v8 examples/echo @$(MD5SUM) test.hex + $(TINYGO) build -size short -o test.hex -target=microbit-v2 examples/microbit-blink + @$(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=nrf52840-mdk examples/blinky1 @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=pca10031 examples/blinky1 diff --git a/src/runtime/runtime_nrf_softdevice.go b/src/runtime/runtime_nrf_softdevice.go index 03ec2be3..165712fa 100644 --- a/src/runtime/runtime_nrf_softdevice.go +++ b/src/runtime/runtime_nrf_softdevice.go @@ -27,7 +27,7 @@ func waitForEvents() { if nrf.DEVICE == "nrf51" { // sd_app_evt_wait: SOC_SVC_BASE_NOT_AVAILABLE + 29 arm.SVCall0(0x2B + 29) - } else if nrf.DEVICE == "nrf52" || nrf.DEVICE == "nrf52840" { + } else if nrf.DEVICE == "nrf52" || nrf.DEVICE == "nrf52840" || nrf.DEVICE == "nrf52833" { // sd_app_evt_wait: SOC_SVC_BASE_NOT_AVAILABLE + 21 arm.SVCall0(0x2C + 21) } else { diff --git a/targets/microbit-v2-s113v7.json b/targets/microbit-v2-s113v7.json new file mode 100644 index 00000000..9ef359ab --- /dev/null +++ b/targets/microbit-v2-s113v7.json @@ -0,0 +1,3 @@ +{ + "inherits": ["microbit-v2", "nrf52833-s113v7"] +} diff --git a/targets/nrf52833-s113v7.json b/targets/nrf52833-s113v7.json new file mode 100644 index 00000000..3e79e83e --- /dev/null +++ b/targets/nrf52833-s113v7.json @@ -0,0 +1,7 @@ +{ + "build-tags": ["softdevice", "s113v7"], + "linkerscript": "targets/nrf52833-s113v7.ld", + "ldflags": [ + "--defsym=__softdevice_stack=0x700" + ] +} diff --git a/targets/nrf52833-s113v7.ld b/targets/nrf52833-s113v7.ld new file mode 100644 index 00000000..c6913792 --- /dev/null +++ b/targets/nrf52833-s113v7.ld @@ -0,0 +1,14 @@ + +MEMORY +{ + FLASH_TEXT (rw) : ORIGIN = 0x00000000 + 0x1C000, LENGTH = 0x80000 - 0x1C000 + RAM (xrw) : ORIGIN = 0x20000000 + 0x1e20, LENGTH = 0x20000 - 0x1e20 +} + +_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"