This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Softdevice s332 v5

Hello,

I'm trying to switch from softdevice s332 v2 to s332 v5 (tried also v4), but I get this error: "region RAM overflowed with stack". I'm guessing the problem is in the linker file configuration, but I can't find the proper values of RAM and FLASH.

For example ANT documentation for v5 says: Flash 0x2D000 and RAM 0x1F30, so I set:

MEMORY
{
   FLASH (rx) : ORIGIN = 0x2D000, LENGTH = 0x53000
   RAM (rwx) :  ORIGIN = 0x2000E0D0, LENGTH = 0x1F30
 }

and for v4: Flash 0x29000 and RAM 0x1E30, so:

MEMORY
{
   FLASH (rx) : ORIGIN = 0x29000, LENGTH = 0x57000
   RAM (rwx) :  ORIGIN = 0x2000e1d0, LENGTH = 0x1e30
 }

Is this the problem? Am I setting the wrong values?

Thank you very much,

Francesco

Parents
  • Hi,

    It seems you have mixed up with the softdevice RAM size with the application RAM size, that you set in the linker file.

    To maximize the available RAM for application, the RAM ORIGIN should be set to 0x20000000 + softdevice_ram_size, and the length should be set chip_ram_size - ram_origin. For your setup, the MEMORY settings in the linker file should look like this (for nRF52832_xxAA chip):

    MEMORY
    {
       FLASH (rx) : ORIGIN = 0x2D000, LENGTH = 0x53000
       RAM (rwx) :  ORIGIN = 0x20001F30, LENGTH = 0xE0D0
    }
    

    Note that this RAM setting is the minimum required RAM size, your application will most likely need more. I would recommend setting the ORIGIN to 0x20004000 or 0x20005000, and check the minimum start value returned in p_app_ram_base by sd_ble_enable(). You can then change the RAM ORIGIN to this value.

    Best regards,

    Jørgen

Reply
  • Hi,

    It seems you have mixed up with the softdevice RAM size with the application RAM size, that you set in the linker file.

    To maximize the available RAM for application, the RAM ORIGIN should be set to 0x20000000 + softdevice_ram_size, and the length should be set chip_ram_size - ram_origin. For your setup, the MEMORY settings in the linker file should look like this (for nRF52832_xxAA chip):

    MEMORY
    {
       FLASH (rx) : ORIGIN = 0x2D000, LENGTH = 0x53000
       RAM (rwx) :  ORIGIN = 0x20001F30, LENGTH = 0xE0D0
    }
    

    Note that this RAM setting is the minimum required RAM size, your application will most likely need more. I would recommend setting the ORIGIN to 0x20004000 or 0x20005000, and check the minimum start value returned in p_app_ram_base by sd_ble_enable(). You can then change the RAM ORIGIN to this value.

    Best regards,

    Jørgen

Children
No Data
Related