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

How to configure memory linker for NRF52382_XXAB?

Hi,

I'm developing and testing the code using the PCA10040, but this board uses the NRF52382_XXAA which contains more memory and I want to use the NRF52382_XXAB. So, how can I configure memory linker for NRF52382_XXAB? Is there any examples on SDK? 

Until now I've used the same as hrs example, but the ram and flash length are higher the available on XXAB: 

MEMORY
{
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
RAM (rwx) : ORIGIN = 0x20002b90, LENGTH = 0xd470
}

Thanks in advance 

PS. I'm using the softdevice S132 6.1.

Parents
  • Hi,

    The only difference between the nRF52832 variants is the flash and RAM size, so the only thing you need to change is the size in your linker configuration like you suggest. I see you use GCC, so that would be the linker configuration file (.ld) you have copied in from.

    The start addresses (ORIGIN) is independent of size for both flash and RAM. the size (LENGTH) depends on the physical size. If you move to a device with less memory, just subtract the difference in size. So if LENGTH used to be 0x5a000 for the 512 kB part, you should subtract 256 kB so that the new length is dec2hex(0x5a000-(256*1024)) = 0x1A000. Similarly for RAM, if the old length was 0xd470 you could find the new by dec2hex(0xd470-(32*1024)) = 0x5470. The other approach is to start from the bottom, finding the start address (if that changes from some sort), and then take the physical size - start address. This may not always be enough though, as you will have to adjust for other uses of the flash, for instance if you have FDS data and/or bootloader etc. in the end of the flash. In that case, looking at the memory layout may be helpful.

  • Understood. But can I use the full 32kb of RAM under length variable? Example:

    RAM (rwx) : ORIGIN = 0x20008000, LENGTH = 0x8000 ? 

    Are there any RAM regions dedicated to softdevice? Is there a mamory layout for RAM?

    Thanks.

  • Hi,

    No, you cannot use the full physical RAM length for the application if you are using the SoftDevice. The RAM usage for the SoftDevice will be the same for both nRF52832 variants as long as the SoftDevice configuration stays the same. If the SoftDevice configuration changes, the RAM usage may change as well, so that you need to update the applications RAM start address and size. See Adjustment of RAM and Flash memory for details.

Reply Children
No Data
Related