Wrong RAM size in NRF52832 linker script

Sysprogs forums Forums VisualGDB Wrong RAM size in NRF52832 linker script

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28754
    wtywtykk
    Participant

    Hi,

    The RAM size in NRF52832 linker script is wrong.

    For example, in nRF52832_XXAA_s113.lds,

    GROUP(S113_softdevice.o)
    MEMORY
    {
    FLASH_SOFTDEVICE (RX) : ORIGIN = 0x00000000, LENGTH = 0x0001c000
    FLASH (rx) : ORIGIN = 0x1c000, LENGTH = 0x64000
    SRAM_SOFTDEVICE (RWX) : ORIGIN = 0x20000000, LENGTH = 0x0000260c
    RAM (rwx) : ORIGIN = 0x2000260c, LENGTH = 0x1d9f4
    }

    which means the RAM is 0x0000260c+0x1d9f4 = 128K

    However, according to the datasheet, it should be 64K. The wrong RAM size leads to a wrong stack address, and the program crashes immediately after reset.

     

    Also, in nRF52832_XXAA_nosoftdev.lds , the RAM size is 0x1d9f4, which simply removes the SRAM_SOFTDEVICE part. But if there is no softdevice, the whole ram should be accessible to the user code.

    • This topic was modified 4 years, 3 months ago by wtywtykk.
    #28756
    support
    Keymaster

    Thanks for reporting this.

    We have investigated the issue and found the root cause. The Nordic nRF5x SDK 16.0 indeed does not contain linker scripts for the following MCU/softdevice combinations:

    • nRF52810/S113
    • nRF52811/S113
    • nRF52832/S113

    Our BSP generation tool incorrectly substituted the missing linker scripts with the S113 scripts for nRF52833 and other devices, that indeed contained invalid memory sizes.

    We have updated our BSP generation tool to skip the missing scripts for now. We have also updated it to generate the correct memory size for the nosoftdev option.

    As the issue only affects the device/softdevice combinations that are not directly supported by the Nordic SDK, we will not release an update to the current Nordic BSP, however we will take it into account in the next BSP release based on the 17.0 SDK (expected in a couple of months from now).

    You should be able to use the S113 softdevice with nRF52832 by patching the linker script manually, however we generally advise using the device/softdevice combinations that are directly covered by the Nordic SDK examples, as they should behave more reliably.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.