How to configure memory layout in Asset Tracker v2 app

Hello,

We are currently using NRF Connect SDK 2.2.0 and even more specifically the Asset Tracker v2 application in nrf9160dk board. By the moment we are only including some dependencies which our future application will need. This dependencies include new kernel modules and new application libraries (only modified CMakeList).

After building the application, when is time to link we have the following error:

"zephyr/zephyr_pre0.elf section `rodata' will not fit in region `FLASH'"

I saw other posts related to mine like this one MCUBootloader won't build for custom board - zephyr/zephyr_pre0.elf section `text' will not fit in region `FLASH' but not sure if we have the same issue.

Therefore, How can i modified the memory layout of Asset tracker application in order to give it more space to the APP? 

This is my current memory layout:

Best regards,

Javier

  • jfpastrana said:

    As  can see in the error the flash_primary_size is 0x100000, therefore it is not going to fit. PM is not taking into consideration the ending addrees.

    How can I increase this region? as I can see here, we have lot of space available.

    I think the figure you are looking at can be misleading.

    The nRF9160 has a 1024 kB flash, which is 1MB = 0x0-0x100 000. For a source on the converting, I can give stack overflow.

    So this is correct:

    jfpastrana said:
    flash_primary_size is 0x100000

    Regards,
    Sigurd Hellesvik

  • Hello  ,

    Thanks for the clarification, I misunderstood this size due to the following image:

    My mistake.

    Is there any possibility to place the app in the external flash? The other possibility what I am considering is to flash only the Application without bootloader, I am doing a proof of concept and I do not need it now. Does it possible in AT2?

    Thank you very much for the support,

  • Hi,

    jfpastrana said:
    Is there any possibility to place the app in the external flash?

    Placing the app in an external flash could be possible using Execute In Place (XIP), but it is not recommended.

    Instead, start by moving secondary and storage partitions to external flash.

    jfpastrana said:
     Below you can find the static configuration of my application:

    From this, I would suggest placing mcuboot_secondary and nonsecure_storage in external flash as a start.
    Let me know how the flash space looks after that.

    Regards,
    Sigurd Hellesvik

Related