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

Parents Reply Children
  • Hello   and  ,

    By the moment we are using the nrf9160dk so we do not have a external flash. However, using the 1MB internal flash should be enough, if you have a look to the memory layout of the Asset Tracker, there is a lot of free space:

    We are in a early stage, so, we do not need FOTA now as well as I did not start with the project optimisations, as I said, I only included some dependencies to Asset Tracker, I did not include any development yet. If I have to start with optimisations now.... it is not promising.

    What is AT2?

    As I understood, Partition Manager is deprecated, no? Asset Tracker uses the information of the Device Tree to allocate each partition, no? Once I built the application, I see build/partitions.yml but I do know how can I configure it.

    Regards

  • jfpastrana said:
    As I understood, Partition Manager is deprecated, no?

    Partition Manager is not deprecated.
    If you add MCUboot, partition manager will be enabled to include it as a child image.

    jfpastrana said:
    We are in a early stage, so, we do not need FOTA now as well as I did not start with the project optimisations, as I said, I only included some dependencies to Asset Tracker, I did not include any development yet. If I have to start with optimisations now.... it is not promising.

    When using Partition Manager, the build will be split into multiple images.
    The flash overflow can be either in the application or in a child image.
    Can you check which part of the build gets the error?

    jfpastrana said:
    Once I built the application, I see build/partitions.yml but I do know how can I configure it.

    Do you mean that you do not know how?
    In that case, you do so by using pm_static.yml.

    jfpastrana said:
    By the moment we are using the nrf9160dk so we do not have a external flash.

    If you want to test using external flash with thenRF9160DK, you can.
    But you need to reconfigure the DK first though.
    Let me know if you want instructions on how to do this.

    Regards,
    Sigurd Hellesvik

  • That free space is for the FOTA Image to be stored. 

    AT2 = Asset Tracker 2 (sorry) 

    If you are not going to upgrade the boot loader (in the field), you can turn off the first stage bootloader in your prj.conf

    #we are never going to upgrade the bootloader in the field.

    CONFIG_SECURE_BOOT=n
    CONFIG_BUILD_S1_VARIANT=n
    I'm using the dynamic partition manager, so it all gets a bit opaque, as to how to disable the image second slot, (as I just moved mine to external flash), but it should be doable. 
    perhaps this is a place to start. 
    CONFIG_FOTA_DOWNLOAD=n
  • Hello  ,

    I mistake Partition Manager with Secure Partition Manager, which is in deprecated status.

    I have included MCUBoot.

    The image which is failing during the linking stage is "tfm". By the moment, I will follow your recommendations of reducing the code size as well as removing unnecessary dependencies. 

    Therefore, If I understood well, Partition Manager is configuring automatically each partition, no? Then, the only way that I have now to solve this is issue is reducing the size or going to a static approach. 

    What do you recommend?

    Regards

  • jfpastrana said:
    Therefore, If I understood well, Partition Manager is configuring automatically each partition, no?

    That is correct.

    jfpastrana said:
    Then, the only way that I have now to solve this is issue is reducing the size or going to a static approach. 

    There might be some Kconfig options you can use instead. It depends.

    jfpastrana said:
    What do you recommend?

    First:
    Is the flash space limitation in the application or a child image?

    Regards,
    Sigurd Hellesvik

Related