The partition of nrf5340 audio application

During my test of the nrf5340 audio application which in the V2.6.0 SDK, Because of i need to store at least 13K data to the flash.

But when i build the project, i found the "\build\partitions.yml" file shows that.

EMPTY_0:
  address: 0xfe000
  end_address: 0x100000
  placement:
    after:
    - settings_storage
  region: flash_primary
  size: 0x2000
app:
  address: 0x0
  end_address: 0xf6000
  region: flash_primary
  size: 0xf6000
nvs_storage:
  address: 0xf6000
  end_address: 0xfc000
  placement:
    before:
    - end
  region: flash_primary
  size: 0x6000
otp:
  address: 0xff8100
  end_address: 0xff83fc
  region: otp
  size: 0x2fc
rpmsg_nrf53_sram:
  address: 0x20070000
  end_address: 0x20080000
  placement:
    before:
    - end
  region: sram_primary
  size: 0x10000
settings_storage:
  address: 0xfc000
  end_address: 0xfe000
  placement:
    align:
      start: 0x4000
    before:
    - end
  region: flash_primary
  size: 0x2000
sram_primary:
  address: 0x20000000
  end_address: 0x20070000
  region: sram_primary
  size: 0x70000
You can see there is only 0x2000 size for "EMPTY_0", but the app size is almost close to 1M.
But i want i can use at least 0x4000 size, But I dare not use 'settings storage' because I think the project may have used this partition to store some settings.
And i found that seems like the project enable the "USE_PARTITION_MANAGER", which i guess that makes the partition for flash0 in the device tree files invalid.
And I can't find where to adjust the size of these partitions. If i can, I think maybe I can reduce the sizd of app partitions appropriately.
So if i do not want to use the external flash, what should i do now?
Parents
  • And i found that seems like the project enable the "USE_PARTITION_MANAGER", which i guess that makes the partition for flash0 in the device tree files invalid.

    Yep

    And I can't find where to adjust the size of these partitions. If i can, I think maybe I can reduce the sizd of app partitions appropriately.

    If you use static partitioning, it will be exactly like that. You can change the pm_static.yml file though.

    So if i do not want to use the external flash, what should i do now?

    You need to get the space from somewhere.

    If you cannot take it from the app, try to use parts of the EMPTY_0 (this is not used for anyhing else), NVS or the setting partition.

    For the last two, you should be a bit careful, but maybe you can do some tests to see how much of them are used in an example?

  • Hello Sigurd

    Thank you very much. Your reply is very helpful to me.

    You can change the pm_static.yml file though.

    I also want to find the yml file, but in the project i can not find any yml files, and i have not enable the DFU, so i think the yml file in dfu folder is not enabled. I am still searching in the SDK folder, but I am still unable to determine which yml file it is, it seems that none of the yml files have been called by this project because the partitions cannot correspond one-to-one with the "partitions. yml" generated in the build folder.

    Thank you very much and looking forward to your reply!

  • Right, I read wrong for the file-name.

    pm_static.yml will statically freeze your partitioning. When you are done with your project, you can copy build/partitions.yml to pm_static.yml, to make sure partitioning never changes (cause that could break DFU).

    For a custom partition, make pm_static.yml, but only define the one partition you need.

    For other partitions, use Kconfig options, as explained here.

    To learn more, see our corse over at https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-bootloaders-and-dfu-fota/topic/multi-image-builds-and-the-partition-manager/

  • Hello Sigurd

    Thank you!

    After reading your reply, I think I understand a bit now.

    So does this mean that as long as I enable "USE_PARTITION_MANAGER" and do not use "pm_datic. yml" to statically set partitions, there may be a situation where the partition position and size will change according to the relevant configuration of my project after each build?

    So may be i can use the "partitions.yml" file to make a "pm_static.yml" to statically set partitions? And if there are no issue of the size, i can modify something in this file too?

    Thank you very much and looking forward to your reply!

Reply
  • Hello Sigurd

    Thank you!

    After reading your reply, I think I understand a bit now.

    So does this mean that as long as I enable "USE_PARTITION_MANAGER" and do not use "pm_datic. yml" to statically set partitions, there may be a situation where the partition position and size will change according to the relevant configuration of my project after each build?

    So may be i can use the "partitions.yml" file to make a "pm_static.yml" to statically set partitions? And if there are no issue of the size, i can modify something in this file too?

    Thank you very much and looking forward to your reply!

Children
  • huma said:
    So does this mean that as long as I enable "USE_PARTITION_MANAGER"

    USE_PARTITION_MANAGER is not user-configurable, but set indirectly by other configurations, such as CONFIG_BOOTLOADER_MCUBOOT.

    huma said:
    So does this mean that as long as I enable "USE_PARTITION_MANAGER" and do not use "pm_datic. yml" to statically set partitions, there may be a situation where the partition position and size will change according to the relevant configuration of my project after each build?

    Yes.

    huma said:
    So may be i can use the "partitions.yml" file to make a "pm_static.yml" to statically set partitions? And if there are no issue of the size, i can modify something in this file too?

    Yes. But in my experience it is hard to change parititons manually, cause you must make sure all other partitions change accordingly.
    If you for example make a partition bigger, something else have to become smaller. And the math must check out.

Related