The max size of RAM and Flash for APP

Hi 

       What is the max size of RAM and Flash for  APP?I looked in the partitions.yml of a sample,I found that there is many region for different use,I don't know which region is necessary and what is the max size of RAM and Flash for  APP?Could you tell me about this?

Parents
  • Hi

    Sorry,I still don't know what is the max size  for app in the ram and flash after I have looked the Partion Manager.Becuse of I do not know which region in the yml file is necessary,Besides app,the customer also need fota,that is all the customer need.

  • Hi, 

    You don't need to manage the partitions.yml because it is generated by the partition manager.  

    If you are building a multi-image project, for instance an app + bootloader (mcuboot), which will then partition your flash into bootloader + primary slot + secondary slot.

    Your application image size will effectively be a little under half of the total flash size.

    Here's an example with hello_world + mcuboot, where I go into the build-folder and write "ninja partition_manager_report":

      flash_primary (0x100000 - 1024kB):
    +--------------------------------------------------+
    | 0x0: mcuboot (0x10000 - 64kB)                    |
    +---0x10000: mcuboot_primary (0x78000 - 480kB)-----+
    | 0x10000: mcuboot_pad (0x200 - 512B)              |
    +---0x10200: mcuboot_primary_app (0x77e00 - 479kB)-+
    | 0x10200: spm (0x10000 - 64kB)                    |
    | 0x20200: app (0x67e00 - 415kB)                   |
    +--------------------------------------------------+
    | 0x88000: mcuboot_secondary (0x78000 - 480kB)     |
    +--------------------------------------------------+
    

    Since the application is dual banked, the total size is now 480k for the application space.

    Regards,
    Amanda

  • Hi

    Thank you very much!

    1、By the way,what is the max size for the app use in the ram  ?The figure below shows the content of partitions.yml file in the hello_world ,does the size: 0x2bb18 show the max size for app use in the ram?I use the size of sram_primary minus the sum size of (nrf_modem_lib_ctrl+nrf_modem_lib_rx+nrf_modem_lib_sram+nrf_modem_lib_tx+spm_sram+sram_nonsecure+sram_secure)in the ram,but the result is negative,So I don't know what

     is the max size the app use in the ram.

       

    2、

    The attachment is the partitions.yml file of hello_world I built,there is a app shown in the figure below,Does the app only contain both  primary slot and secondary slot?

    3、Is the space between the address of 0x0 and the address of 0x10000 used by mcuboot?

  • Hi, 

    You can go into the build-folder and write "ninja partition_manager_report" to get the memory layout. That is easy for you to know the partitions.yml. 

    1. Here's memory used by hello_world, where I go into the build-folder and write "ninja partition_manager_report":

      flash_primary (0x100000 - 1024kB):
    +--------------------------------+
    | 0x0: spm (0x10000 - 64kB)      |
    | 0x10000: app (0xf0000 - 960kB) |
    +--------------------------------+
    
      otp (0x2f4 - 756B):
    +------------------------------+
    | 0xff8108: otp (0x2f4 - 756B) |
    +------------------------------+
    
      sram_primary (0x40000 - 256kB):
    +--------------------------------------------------+
    +---0x20000000: sram_secure (0x8000 - 32kB)--------+
    | 0x20000000: spm_sram (0x8000 - 32kB)             |
    +---0x20008000: sram_nonsecure (0x38000 - 224kB)---+
    +---0x20008000: nrf_modem_lib_sram (0x44e8 - 17kB)-+
    | 0x20008000: nrf_modem_lib_ctrl (0x4e8 - 1kB)     |
    | 0x200084e8: nrf_modem_lib_tx (0x2000 - 8kB)      |
    | 0x2000a4e8: nrf_modem_lib_rx (0x2000 - 8kB)      |
    +--------------------------------------------------+
    | 0x2000c4e8: sram_primary (0x33b18 - 206kB)       |
    +--------------------------------------------------+

    Without mcuboot, the total size is 1024k for the application space.

    2. The app is located in flash_primary.

    3. That's spm configurations 

    The partitions.yml provided seem generated by the hello_world without mcuboot. 

    Please see the memory usuaged of hello_world + mcuboot in my previous reply. 

    Amanda

  • Hi

    Thank you for your reply patiently!

    1、Is the 206kB in the figure below the space of app in the ram?How is the app space in the ram if it have mcuboot? 

    2、

    I typed "ninja partition_manager_report" on the git-cmd.cmd after I had changed the path to v1.7.0\zephyr\samples\hello_world on the git-cmd.cmd.but it logged error.I do not know how to use this way to get the partition report.

     

Reply
  • Hi

    Thank you for your reply patiently!

    1、Is the 206kB in the figure below the space of app in the ram?How is the app space in the ram if it have mcuboot? 

    2、

    I typed "ninja partition_manager_report" on the git-cmd.cmd after I had changed the path to v1.7.0\zephyr\samples\hello_world on the git-cmd.cmd.but it logged error.I do not know how to use this way to get the partition report.

     

Children
  • Hi, 

    1. App and mcuboot would not use that space. See the memory layout of hello_world + mcuboot: 

      flash_primary (0x100000 - 1024kB):
    +--------------------------------------------------+
    | 0x0: mcuboot (0xc000 - 48kB)                     |
    | 0xc000: EMPTY_0 (0x4000 - 16kB)                  |
    +---0x10000: mcuboot_primary (0x78000 - 480kB)-----+
    | 0x10000: mcuboot_pad (0x200 - 512B)              |
    +---0x10200: mcuboot_primary_app (0x77e00 - 479kB)-+
    | 0x10200: spm (0x10000 - 64kB)                    |
    | 0x20200: app (0x67e00 - 415kB)                   |
    +--------------------------------------------------+
    | 0x88000: mcuboot_secondary (0x78000 - 480kB)     |
    +--------------------------------------------------+
    
      otp (0x2f4 - 756B):
    +------------------------------+
    | 0xff8108: otp (0x2f4 - 756B) |
    +------------------------------+
    
      sram_primary (0x40000 - 256kB):
    +--------------------------------------------------+
    +---0x20000000: sram_secure (0x8000 - 32kB)--------+
    | 0x20000000: spm_sram (0x8000 - 32kB)             |
    +---0x20008000: sram_nonsecure (0x38000 - 224kB)---+
    +---0x20008000: nrf_modem_lib_sram (0x44e8 - 17kB)-+
    | 0x20008000: nrf_modem_lib_ctrl (0x4e8 - 1kB)     |
    | 0x200084e8: nrf_modem_lib_tx (0x2000 - 8kB)      |
    | 0x2000a4e8: nrf_modem_lib_rx (0x2000 - 8kB)      |
    +--------------------------------------------------+
    | 0x2000c4e8: sram_primary (0x33b18 - 206kB)       |
    +--------------------------------------------------+
    

    2. That's for v1.9. For v1.7, you could use 

    $ west build -p -b nrf9160dk_nrf9160_ns
    $ west build -t rom_report // Ninja build target to display flash layout as shown below

    -Amanda

  • Hi 

    Sorry,I still don‘t understand which space is for app in the ram from the memory layout you showed.Could you point out it?

  • Yes, you are right. They will use sram_primary. You also can run Build Target: ram_report to get the detailed RAM usage of the app. 

    -Amanda

Related