Problems related to pm static file for nrf54l15

I am working on project with nrf54l15dk/nrf54l15, and the project runs on cpuapp without utilizing flpr. So, I decided to release the allocated section of flpr on rram_controller to be used by cpuapp. Now, while building the project, it builds successfully and when flashed to nrf54l15dk, it does not provide output on uart, but when same project built and flashed without my pm_static file, it works fine and can see the output on uart. So, there is some issue in my pm_static file. Can, anyone help me solve this.


pm_static_nrf54l15dk_nrf54l15_cpuapp.yaml

mcuboot:
  address: 0x0
  end_address: 0xf000
  region: flash_primary
  size: 0xf000

mcuboot_pad:
  address: 0xf000
  end_address: 0xf800
  region: flash_primary
  size: 0x800

app:
  address: 0xf800
  end_address: 0x165000
  region: flash_primary
  size: 0x157800

mcuboot_primary:
  address: 0xf000
  end_address: 0x165000
  orig_span: &id001
    - mcuboot_pad
    - app
  region: flash_primary
  size: 0x158000
  span: *id001

mcuboot_primary_app:
  address: 0xf800
  end_address: 0x165000
  orig_span: &id002
    - app
  region: flash_primary
  size: 0x157800
  span: *id002

mcuboot_secondary:
  address: 0x165000
  end_address: 0x17d000
  region: flash_primary
  size: 0x18000

settings_storage:
  address: 0x17d000
  end_address: 0x180000
  region: flash_primary
  size: 0x3000

sram_primary:
  address: 0x20000000
  end_address: 0x20040000
  region: sram_primary
  size: 0x40000



nrf54l15.overlay
&rram_controller {
    /delete-node/ cpuflpr_sram;
    /delete-node/ cpuflpr_rram;
};

/* Adjust the cpuapp_sram to include the freed up cpuflpr_sram */
&cpuapp_sram {
    reg = <0x20000000 DT_SIZE_K(256)>;
    ranges = <0x0 0x20000000 0x20040000>;
};

/* Adjust the cpuapp_rram to include the freed up cpuflpr_rram */
&cpuapp_rram {
    reg = <0x0 DT_SIZE_K(1524)>;
};

  • Hi Shivam, 
    Regarding the overlay, I think the sram ranges need to be corrected from  ranges = <0x0 0x20000000 0x20040000>; to ranges = <0x0 0x20000000 40000>; as the last argument should be length, not end address. 
    Could you try to fix that to see if it helps  ?

    Other than that I don't see a problem, could you check if you see any logging when the issue happen ? Could you try to check with our sample in the SDK that we do almost the same thing  ? For example matter light_bulb, or  aws_iot  sample

  • Hi Hung,

    Thanks for this correction, it built successfully but still not worked.

    After flashing it, I cannot see any logs and also the logs during the built time is same as without pm_static file.

    I viewed matter light_buld which is in sample folder and tried that pm_static file and it did not build properly.

    pm_static file

    mcuboot:
      address: 0x0
      region: flash_primary
      size: 0xD000
    mcuboot_pad:
      address: 0xD000
      region: flash_primary
      size: 0x800
    app:
      address: 0xD800
      region: flash_primary
      size: 0x164800
    mcuboot_primary:
      orig_span: &id001
        - mcuboot_pad
        - app
      span: *id001
      address: 0xD000
      region: flash_primary
      size: 0x165000
    mcuboot_primary_app:
      orig_span: &id002
        - app
      span: *id002
      address: 0xD800
      region: flash_primary
      size: 0x164800
    factory_data:
      address: 0x172000
      region: flash_primary
      size: 0x1000
    settings_storage:
      address: 0x173000
      region: flash_primary
      size: 0xA000
    mcuboot_secondary:
      address: 0x0
      orig_span: &id003
        - mcuboot_secondary_pad
        - mcuboot_secondary_app
      region: external_flash
      size: 0x165000
      span: *id003
    mcuboot_secondary_pad:
      region: external_flash
      address: 0x0
      size: 0x800
    mcuboot_secondary_app:
      region: external_flash
      address: 0x800
      size: 0x164800
    external_flash:
      address: 0x165000
      size: 0x69B000
      device: MX25R64
      region: external_flash
    




    build logs(error)
    workdir/zephyr/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c: In function 'img_mgmt_active_slot':
    /workdir/nrf/include/flash_map_pm.h:56:18: error: 'PM_PM_PM_mcuboot_secondary_ID_LABEL_OFFSET' undeclared (first use in this function)
       56 |         UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
          |                  ^~~
    /workdir/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in definition of macro 'UTIL_PRIMITIVE_CAT'
      105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
          |                                    ^
    /workdir/nrf/include/flash_map_pm.h:56:9: note: in expansion of macro 'UTIL_CAT'
       56 |         UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
          |         ^~~~~~~~
    /workdir/nrf/include/flash_map_pm.h:59:39: note: in expansion of macro 'FIXED_PARTITION_DATA_FIELD'
       59 | #define FIXED_PARTITION_OFFSET(label) FIXED_PARTITION_DATA_FIELD(label, _OFFSET)
          |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
    /workdir/zephyr/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c:60:10: note: in expansion of macro 'FIXED_PARTITION_OFFSET'
       60 |         (FIXED_PARTITION_OFFSET(label) == (PM_ADDRESS - PM_ADDRESS_OFFSET))
          |          ^~~~~~~~~~~~~~~~~~~~~~
    /workdir/zephyr/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c:262:13: note: in expansion of macro 'FIXED_PARTITION_IS_RUNNING_APP_PARTITION'
      262 |         if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) {
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /workdir/nrf/include/flash_map_pm.h:56:18: note: each undeclared identifier is reported only once for each function it appears in
       56 |         UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
          |                  ^~~
    /workdir/zephyr/include/zephyr/sys/util_internal.h:105:36: note: in definition of macro 'UTIL_PRIMITIVE_CAT'
      105 | #define UTIL_PRIMITIVE_CAT(a, ...) a##__VA_ARGS__
          |                                    ^
    /workdir/nrf/include/flash_map_pm.h:56:9: note: in expansion of macro 'UTIL_CAT'
       56 |         UTIL_CAT(PM_, UTIL_CAT(UTIL_CAT(PM_, UTIL_CAT(PM_ID(label), _LABEL)), x))
          |         ^~~~~~~~
    /workdir/nrf/include/flash_map_pm.h:59:39: note: in expansion of macro 'FIXED_PARTITION_DATA_FIELD'
       59 | #define FIXED_PARTITION_OFFSET(label) FIXED_PARTITION_DATA_FIELD(label, _OFFSET)
          |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
    /workdir/zephyr/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c:60:10: note: in expansion of macro 'FIXED_PARTITION_OFFSET'
       60 |         (FIXED_PARTITION_OFFSET(label) == (PM_ADDRESS - PM_ADDRESS_OFFSET))
          |          ^~~~~~~~~~~~~~~~~~~~~~
    /workdir/zephyr/subsys/mgmt/mcumgr/grp/img_mgmt/src/img_mgmt.c:262:13: note: in expansion of macro 'FIXED_PARTITION_IS_RUNNING_APP_PARTITION'
      262 |         if (FIXED_PARTITION_IS_RUNNING_APP_PARTITION(slot1_partition)) {
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    [70/84] Building C object modules/nrf/subsys/nrf_security/src/core/nrf_oberon/CMakeFiles/psa_core.dir/workdir/modules/crypto/oberon-psa-crypto/library/psa_crypto.c.obj
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/****-prefix/src/****-stamp/****-build ****/build/'''_nrf54l15_cpuapp_btlog/_sysbuild/sysbuild/images/****-prefix/src/****-stamp/****-build 

  • Hi Shivam, 
    My understanding is that if you don't use pm_static.yml it runs correct ? 
    Could you find the partitions.yml file in build folder ? We can check what's the difference with a working (partitions.yml) and non-working (pm_static.yml) 

  • Hi Hung,
    Here is the partitions.yml file from the build folder which works fine

    partitions.yml

    EMPTY_0:
      address: 0xd800
      end_address: 0xe000
      placement:
        after:
        - mcuboot
      region: flash_primary
      size: 0x800
    EMPTY_1:
      address: 0x17a000
      end_address: 0x17b000
      placement:
        after:
        - mcuboot_secondary
      region: flash_primary
      size: 0x1000
    app:
      address: 0xe800
      end_address: 0xc4000
      region: flash_primary
      size: 0xb5800
    bootconf:
      address: 0xffd080
      end_address: 0xffd084
      region: bootconf
      size: 0x4
    mcuboot:
      address: 0x0
      end_address: 0xd800
      placement:
        align:
          end: 0x1000
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xd800
    mcuboot_pad:
      address: 0xe000
      end_address: 0xe800
      placement:
        align:
          start: 0x1000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x800
    mcuboot_primary:
      address: 0xe000
      end_address: 0xc4000
      orig_span: &id001
      - mcuboot_pad
      - app
      region: flash_primary
      sharers: 0x1
      size: 0xb6000
      span: *id001
    mcuboot_primary_app:
      address: 0xe800
      end_address: 0xc4000
      orig_span: &id002
      - app
      region: flash_primary
      size: 0xb5800
      span: *id002
    mcuboot_secondary:
      address: 0xc4000
      end_address: 0x17a000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x1000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0xb6000
    otp:
      address: 0xffd500
      end_address: 0xffd9fc
      region: otp
      size: 0x4fc
    settings_storage:
      address: 0x17b000
      end_address: 0x17d000
      placement:
        after:
        - app
        align:
          start: 0x1000
        before:
        - end
      region: flash_primary
      size: 0x2000
    sram_primary:
      address: 0x20000000
      end_address: 0x20040000
      region: sram_primary
      size: 0x40000
    




    custom_pm_static.yml file
    # this is partion which stores the MCUboot size in the flash (currect: 60 KB)
    mcuboot:
      address: 0x0
      end_address: 0xf000
      region: flash_primary
      size: 0xf000
    
    mcuboot_pad:
      address: 0xf000
      end_address: 0xf800
      region: flash_primary
      size: 0x800
    
    # this is partion which stores the app size in the flash (currect: 1366 KB)
    app:
      address: 0xf800
      end_address: 0x165000
      region: flash_primary
      size: 0x157800
    
    mcuboot_primary:
      address: 0xf000
      end_address: 0x165000
      orig_span: &id001
        - mcuboot_pad
        - app
      region: flash_primary
      size: 0x158000
      span: *id001
    
    mcuboot_primary_app:
      address: 0xf800
      end_address: 0x165000
      orig_span: &id002
        - app
      region: flash_primary
      size: 0x157800
      span: *id002
    
    mcuboot_secondary:
      address: 0x165000
      end_address: 0x17d000
      region: flash_primary
      size: 0x18000
    
    settings_storage:
      address: 0x17d000
      end_address: 0x180000
      region: flash_primary
      size: 0x3000
    
    sram_primary:
      address: 0x20000000
      end_address: 0x20040000
      region: sram_primary
      size: 0x40000
    

  • Hi Shivam, 

    Do you have any explanation for what you used in pm_static.yml file ? Where did those numbers come from ? 
    I don't think it's correct to have the mcuboot_primary size of 0x158000 when the mcuboot_secondary size is only 0x18000. 
    Generally they should be equal. How do you plan to receive DFU image ? 

    Most often we create the pm_static.yml based on the auto generated partitions.yml and fine tune it for the need. 

Related