Using the pm_static.yml with an external flash

Hi,

I am looking to create use a pm_static.yml to create a partition table for MCUBoot, which have the internal flash as the primary boot partition and the external SPI flash as the secondary partition.  As I know XIP only can be performed on QSPI, can this be done.  If so, how can I do this via SPI?

Here's my current pm_static.ym;

# Internal Flash Partitions
EMPTY_0:
address: 0xe000
end_address: 0x10000
placement:
before:
- mcuboot_pad
region: flash_primary
size: 0x2000
app:
address: 0x18000
end_address: 0x100000
region: flash_primary
size: 0xe8000
external_flash:
address: 0x100000
end_address: 0x800000
region: external_flash
size: 0x700000
littlefs_storage:
address: 0xf0000
device: DT_CHOSEN(nordic_pm_ext_flash)
end_address: 0x100000
placement:
before:
- tfm_storage
- end
region: external_flash
size: 0x10000
mcuboot:
address: 0x0
end_address: 0xe000
placement:
before:
- mcuboot_primary
region: flash_primary
size: 0xe000
mcuboot_pad:
address: 0x10000
end_address: 0x10200
placement:
align:
start: 0x4000
before:
- mcuboot_primary_app
region: flash_primary
size: 0x200
mcuboot_primary:
address: 0x10000
end_address: 0x100000
orig_span: &id001
- mcuboot_pad
- tfm
- app
region: flash_primary
size: 0xf0000
span: *id001
mcuboot_primary_app:
address: 0x10200
end_address: 0x100000
orig_span: &id002
- app
- tfm
region: flash_primary
size: 0xefe00
span: *id002

# External Flash Region (e.g., MX25R64 or similar)
external_flash:
address: 0x00000000
size: 0x00800000 # 8 MB
region: external_flash
mcuboot_secondary:
address: 0x00000000
size: 0x00800000 # Same size as primary
orig_span: &id003
- mcuboot_pad
- tfm
- app
region: external_flash
size: 0xf0000
mcuboot_secondary_app:
address: 0x10200
end_address: 0x100000
orig_span: &id004
- app
- tfm
region: flash_primary
size: 0xefe00
span: *id002
After flashing it to my nrf7002DK, I get the following message.

I am using NCS v3.1.0 and I am basing off of the sample smp_svr.  Any help would be greatly appreciated.

Tom

Parents Reply Children
  • Hi Tom, 

    Have you tried to build the \ncs-inter-main\l9\l9_e3_sol\spi from https://github.com/NordicDeveloperAcademy/ncs-inter

    I changed app_mx.overlay to app.overlay and mcuboot_mx.overlay to mcuboot.overlay (because the nRF7002dk uses MX25R64) and build the application for nRF7002dk/nRF5340/cpu_app. 
    It built fine and after I flashed the firmware it seems to be fine with the partition. 



    Could you take a look at the attached project and the partitions.yml in build folder . You may want to have something similar in your pm_static.yml. 

    app:
      address: 0x10200
      end_address: 0x100000
      region: flash_primary
      size: 0xefe00
    external_flash:
      address: 0xf0000
      end_address: 0x800000
      region: external_flash
      size: 0x710000
    mcuboot:
      address: 0x0
      end_address: 0x10000
      placement:
        align:
          end: 0x1000
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0x10000
    mcuboot_pad:
      address: 0x10000
      end_address: 0x10200
      placement:
        align:
          start: 0x4000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0x10000
      end_address: 0x100000
      orig_span: &id001
      - mcuboot_pad
      - app
      region: flash_primary
      size: 0xf0000
      span: *id001
    mcuboot_primary_app:
      address: 0x10200
      end_address: 0x100000
      orig_span: &id002
      - app
      region: flash_primary
      size: 0xefe00
      span: *id002
    mcuboot_secondary:
      address: 0x0
      device: DT_CHOSEN(nordic_pm_ext_flash)
      end_address: 0xf0000
      placement:
        align:
          start: 0x4
      region: external_flash
      share_size:
      - mcuboot_primary
      size: 0xf0000
    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
    sram_primary:
      address: 0x20000000
      end_address: 0x20070000
      region: sram_primary
      size: 0x70000
    
    5481.spi.zip

  • I will take a look and let you know.  That was what I was building previously (ncs-inter) l9_e3.

  • Hi Hung,  the example you gave me is what I want.  I see that there are mcumgr and mcumgr-client to upload an image file to the device.  Which is the right one to use?  I have built both but none of them seems to act appropriately.  Sorry, I am new to the MCUboot upgrading scheme.

  • Hi Tom, 
    mcumgr-client is a replacement for mcumgr.exe on PC. You can use both. 
    But to get started I would suggest to use Auterm. Please try follow the tutorial here:
    academy.nordicsemi.com/.../

Related