This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Partition Manager Configuration

Hi,

I'm working with NRF Connect SDK, and once in a while when I add new configuration options to the prj.conf, I get an error that some region overflowed by X bytes,   

for example: 

section `rodata' will not fit in region `FLASH'
/home/vitaliy/tools/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.bfd: region `FLASH' overflowed by 3644 bytes

I'm using the nRF52833 board, so it should have around 500K space,

and as you can see the current usage is:

Memory region Used Size Region Size %age Used
FLASH: 27196 B 48 KB 55.33%
SRAM: 19780 B 128 KB 15.09%
IDT_LIST: 0 GB 2 KB 0.00%

Now, I read about Partition Manager, and I understand that for the main app image the required space is calculated dynamically, based on the components used,
and that the main app thus does not contain a pm.yml (as I see indeed in the project dir) which can define the allocation, so:

1. Why such errors occur?

2. Is there nevertheless any configuration that needs to be applied?

3. How can this be fixed?

Thanks!

Parents
  • Hi,

     

    It looks like 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 (0x80000 - 512kB): 
    +--------------------------------------------------+
    | 0x0: mcuboot (0x10000 - 64kB)                    |
    +---0x10000: mcuboot_primary (0x38000 - 224kB)-----+
    | 0x10000: mcuboot_pad (0x200 - 512B)              |
    +---0x10200: mcuboot_primary_app (0x37e00 - 223kB)-+
    | 0x10200: app (0x37e00 - 223kB)                   |
    +--------------------------------------------------+
    | 0x48000: mcuboot_secondary (0x38000 - 224kB)     |
    +--------------------------------------------------+
    
      sram_primary (0x20000 - 128kB): 
    +--------------------------------------------+
    | 0x20000000: sram_primary (0x20000 - 128kB) |
    +--------------------------------------------+
    
     

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

     

    Kind regards,

    Håkon

  • Hi,

    And thanks for your response.

    1. Not sure that I follow the calculations - I see in the report you shared that app is 223kB, not 224kB?
    Am I reading it in a wrong way?

    2. If I understand your claim correctly, you say that I just run out of space.

    Please Take a look at my report:

    flash_primary (0x80000 - 512kB): 
    +--------------------------------------------------+
    +---0x0: b0_container (0x8000 - 32kB)--------------+
    | 0x0: b0 (0x7000 - 28kB)                          |
    | 0x7000: provision (0x1000 - 4kB)                 |
    +---0x8000: s0 (0xc200 - 48kB)---------------------+
    | 0x8000: s0_pad (0x200 - 512B)                    |
    +---0x8200: s0_image (0xc000 - 48kB)---------------+
    | 0x8200: mcuboot (0xc000 - 48kB)                  |
    +--------------------------------------------------+
    | 0x14200: EMPTY_0 (0xe00 - 3kB)                   |
    +---0x15000: s1 (0xc200 - 48kB)--------------------+
    | 0x15000: s1_pad (0x200 - 512B)                   |
    | 0x15200: EMPTY_1 (0xe00 - 3kB)                   |
    | 0x16000: s1_image (0xc000 - 48kB)                |
    +---0x22000: mcuboot_primary (0x2e000 - 184kB)-----+
    | 0x22000: mcuboot_pad (0x200 - 512B)              |
    +---0x22200: mcuboot_primary_app (0x2de00 - 183kB)-+
    +---0x22200: spm_app (0x2de00 - 183kB)-------------+
    | 0x22200: app (0x2de00 - 183kB)                   |
    +--------------------------------------------------+
    | 0x50000: mcuboot_secondary (0x2e000 - 184kB)     |
    | 0x7e000: settings_storage (0x2000 - 8kB)         |
    +--------------------------------------------------+
    
      sram_primary (0x20000 - 128kB): 
    +--------------------------------------------+
    | 0x20000000: sram_primary (0x20000 - 128kB) |
    +--------------------------------------------+
    

    If I look at it I understand that I should have at least 183kB available for my app,
    so why does the partition manager treat it as if there are only 48kB available?

    3. Can you point me to documentation of this report? I'm not sure what numbers are to sum, and which are just headers.

    Thanks!

Reply
  • Hi,

    And thanks for your response.

    1. Not sure that I follow the calculations - I see in the report you shared that app is 223kB, not 224kB?
    Am I reading it in a wrong way?

    2. If I understand your claim correctly, you say that I just run out of space.

    Please Take a look at my report:

    flash_primary (0x80000 - 512kB): 
    +--------------------------------------------------+
    +---0x0: b0_container (0x8000 - 32kB)--------------+
    | 0x0: b0 (0x7000 - 28kB)                          |
    | 0x7000: provision (0x1000 - 4kB)                 |
    +---0x8000: s0 (0xc200 - 48kB)---------------------+
    | 0x8000: s0_pad (0x200 - 512B)                    |
    +---0x8200: s0_image (0xc000 - 48kB)---------------+
    | 0x8200: mcuboot (0xc000 - 48kB)                  |
    +--------------------------------------------------+
    | 0x14200: EMPTY_0 (0xe00 - 3kB)                   |
    +---0x15000: s1 (0xc200 - 48kB)--------------------+
    | 0x15000: s1_pad (0x200 - 512B)                   |
    | 0x15200: EMPTY_1 (0xe00 - 3kB)                   |
    | 0x16000: s1_image (0xc000 - 48kB)                |
    +---0x22000: mcuboot_primary (0x2e000 - 184kB)-----+
    | 0x22000: mcuboot_pad (0x200 - 512B)              |
    +---0x22200: mcuboot_primary_app (0x2de00 - 183kB)-+
    +---0x22200: spm_app (0x2de00 - 183kB)-------------+
    | 0x22200: app (0x2de00 - 183kB)                   |
    +--------------------------------------------------+
    | 0x50000: mcuboot_secondary (0x2e000 - 184kB)     |
    | 0x7e000: settings_storage (0x2000 - 8kB)         |
    +--------------------------------------------------+
    
      sram_primary (0x20000 - 128kB): 
    +--------------------------------------------+
    | 0x20000000: sram_primary (0x20000 - 128kB) |
    +--------------------------------------------+
    

    If I look at it I understand that I should have at least 183kB available for my app,
    so why does the partition manager treat it as if there are only 48kB available?

    3. Can you point me to documentation of this report? I'm not sure what numbers are to sum, and which are just headers.

    Thanks!

Children
  • Hi,

     

    The partition manager is documented here:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/nrf/scripts/partition_manager/partition_manager.html

     

    The "partition_manager_report" is a helper for visualizing the layout.

     

    Vitaliy Freidovich said:
    1. Not sure that I follow the calculations - I see in the report you shared that app is 223kB, not 224kB?
    Am I reading it in a wrong way?

    The section itself is 224k, which includes a 512b section at the very beginning.

    Vitaliy Freidovich said:
    If I look at it I understand that I should have at least 183kB available for my app,
    so why does the partition manager treat it as if there are only 48kB available?

    You have a different layout than I do, as you have included the immutable bootloader in your project. This means that you have 3 project in total:

    * B0 (immutable bootloader)

    * mcuboot

    * application

    Vitaliy Freidovich said:
    If I look at it I understand that I should have at least 183kB available for my app,
    so why does the partition manager treat it as if there are only 48kB available?

    You are misreading the output here. It is the mcuboot slot that is 48 kB, while the application is 184 kB. The last successfully compiled image was mcuboot, while the one that is failing (due to space issue) is your application image. You could for instance try to disable logging and look for other features that is not strictly required in your application, for instance if you have a optimization level set for debug.

     

    Kind regards,

    Håkon

  • Hi,

    And thanks for your input.

    I don't see in the documentation description of the partition_manager_report visualisation,

    and now I think that I don't understand it at all. Can you please explain how one of the reports should be read?

    Thanks!

  • Hi,

     

    the build target "partition_manager_report" is a visualization of the generated "my-build-folder/partitions.yml" file.

    You can have a look at this file, and the partition manager documentation to see how it sets up each section of your overall flash.

     

    Kind regards,

    Håkon

Related