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

guide to allocate the amount of ram/rom I need

HW: nrf52840

SW: nRF5_SDK_15.2.0_9412b96

Hi,

I would like to learn how allocate Flash, RAM and SRAM setting and how do I find out the total RAM/ROM my application needed via Segger.

Q1:

There are something I dunno why, according to the  nrf52840 datasheet the allocation should be as below.

FLASH_PH_START=0x0

FLASH_PH_SIZE=0x00800000

RAM_PH_START=0x20000000

RAM_PH_SIZE=0x20000000

FLASH_START=0x0

FLASH_SIZE=?? (how to check the flash size for my application using segger)

RAM_START=0x20000000

RAM_SIZE=??(how to check the RAM size for my application using segger)

Q2:

Those setting are so much different from the suggested setting I founded on nordic forum.

The example is as below.

FLASH_PH_START=0x0

FLASH_PH_SIZE=0x100000

RAM_PH_START=0x20000000

RAM_PH_SIZE=0x40000

FLASH_START=0x26000 (may I know why flash start is 0x26000? Was it because of Softdevice firmware allocation?)

FLASH_SIZE=0xda000

RAM_START=0x200022e0 (may I know why the RAM_START start at 0x200022e0? which is extra 0x22e0 from the default RAM start which is at 0x20000000)

RAM_SIZE=0x3dd20

Q3:

And what is the different between the SRAM(0x20000000-0x40000000) vs RAM(0x60000000-0xA0000000) on the Memory map? when I allocate the RAM_PH and RAM_START should I use the SRAM or RAM?

  • Hi.

    I've just posted a tutorial on how to adjust the FLASH and RAM memory, you can find it here.

    I suggest you read that tutorial on how you can set the start addresses.

    To answer quick:

    FLASH_START: The value you choose here is dependent on which SoftDevice you use. The SoftDevice does somethings when you start your Application, and then points to the start address of the Application, which is this address. If you don't use a SoftDevice then the start address is 0x0, if you use only a MBR, then the start address is 0x1000.

    FLASH_SIZE: This is the size of the available FLASH, this size should not exceed FLASH_PH_SIZE

    RAM_START: This value is also dependent on which SoftDevice you use. This value is the minimum value you can use and still run the Application. It may not perform as expected with this value if your SoftDevice uses many features.

    RAM_SIZE: This is the size of the available RAM, (RAM_SIZE + RAM_START) should not be larger than (RAM_PH_START + RAM_PH_SIZE).

    FLASH_SIZE and RAM_PH_SIZE is the size of the FLASH and RAM available on your chip.

    Q3:

    And what is the different between the SRAM(0x20000000-0x40000000) vs RAM(0x60000000-0xA0000000) on the Memory map? when I allocate the RAM_PH and RAM_START should I use the SRAM or RAM?

    The section RAM(0x60000000-0xA0000000) is not used by anything, I think its in the memory map to display how a memory map looks, as you cant find it in the instantiation table below. For allocating the RAM, just look at the tutorial.

    Best regards,

    Andreas

Related