From e69131c0d346e74e6f3e7f0dc2dd10d377b48cdd Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sun, 24 May 2020 19:33:50 +0200 Subject: [PATCH] nrf: expose the RAM base address The RAM base address is needed during SoftDevice initialization. So far, the same magic value has been used in aykevl/go-bluetooth and in TinyGo, but this should be configured in only one place. This will have additional benefits in the future: * It is currently set to 0x39c0, which is around 14.5kB. Most nrf51822 chips have only 16kB of RAM, so this is way too much for those chips. * LLD in LLVM 11 allows expressions in the MEMORY part of linker scripts, which will allow overriding the SoftDevice RAM area with a linker flag, which might come in handy. --- targets/nrf52-s132v6.ld | 3 +++ targets/nrf52840-s140v7.ld | 3 +++ 2 files changed, 6 insertions(+) diff --git a/targets/nrf52-s132v6.ld b/targets/nrf52-s132v6.ld index 2515fca8..febac474 100644 --- a/targets/nrf52-s132v6.ld +++ b/targets/nrf52-s132v6.ld @@ -7,4 +7,7 @@ MEMORY _stack_size = 4K; +/* This value is needed by the Nordic SoftDevice. */ +__app_ram_base = ORIGIN(RAM); + INCLUDE "targets/arm.ld" diff --git a/targets/nrf52840-s140v7.ld b/targets/nrf52840-s140v7.ld index dde80182..0ff135bf 100644 --- a/targets/nrf52840-s140v7.ld +++ b/targets/nrf52840-s140v7.ld @@ -7,4 +7,7 @@ MEMORY _stack_size = 4K; +/* This value is needed by the Nordic SoftDevice. */ +__app_ram_base = ORIGIN(RAM); + INCLUDE "targets/arm.ld"