Adding static partition between mcuboot and mcuboot_pad/app

I'm trying to add a static partition that lies between the mcuboot and mcuboot_pad/app ones, but even though my solution builds correctly, mcuboot is stuck in a loop. This is how my static partition yaml looks like:

mcuboot:
  address: 0x0
  region: flash_primary
  size: 0x10000

my_partition:
  address: 0x10000
  region: flash_primary
  size: 0x200

mcuboot_pad:
  address: 0x10200
  region: flash_primary
  size: 0x800

app:
  address: 0x10A00
  region: flash_primary
  size: 0x144600
  
  mcuboot_primary:
  orig_span: &id001
  - mcuboot_pad
  - app
  span: *id001
  address: 0x10200
  region: flash_primary
  size: 0x144600

mcuboot_primary_app:
  orig_span: &id002
  - app
  span: *id002
  address: 0x10A00
  region: flash_primary
  size: 0x144600

settings_storage:
  address: 0x173000
  region: flash_primary
  size: 0xa000

It seems like mcuboot is trying to jump to 'my_partition' instead of to 'mcuboot_pad'. I tried adding partition ids, but it didn't change. Can't find it in the documentation or similar examples. How do I achieve this using static partitions?

I'm configuring mcuboot via sysbuild, if that's important.

Parents
  • Hi, thanks for the reply.

    The motivation comes from a project requirement to have a common area in the flash to store some special data regardless if we build our application for L05, L10 or L15 variant in a way that we could use L15 hardware, for example, but flash a stripped down version of the software that would be only for L05. It's the most I could tell without going into much details.
    This cannot be at the end of the flash due to their size difference, therefore my partitioning idea.

    It's quite straightforward to tell mcuboot to jump to a certain address when working outside NCS/Zephyr, so I thought it would be possible to tell the build system: "My app starts here" and it would figure it out.

  • Hi

    Anderson Felippe said:
    L05, L10 or L15 variant in a way that we could use L15 hardware, for example, but flash a stripped down version of the software that would be only for L05. It's the most I could tell without going into much details.

    No worries, that makes more than enough sense for me.

    A couple of suggestions then:

    Make sure the padding size is 0x800 and not 0x200

    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm.html#tf-m_partition_alignment_requirements gives some good hints (even if you're not going to use TF-M): The bootloader has to be a part of the SPU and this flash area needs to be page aligned in a multiple of 4kB. 

    This means that 

    MCUboot
    Custom partition
    MCuboot padding
    End of secure part
    
    App 

    Does not work due to the custom partition being forced inside of the Secure domain, where you need the 4k alignment granularity.

    but

    MCUboot
    MCUboot padding 
    
    End of secure
    
    Custom partition
    App

    should work.

    Kind regards,
    Andreas

Reply
  • Hi

    Anderson Felippe said:
    L05, L10 or L15 variant in a way that we could use L15 hardware, for example, but flash a stripped down version of the software that would be only for L05. It's the most I could tell without going into much details.

    No worries, that makes more than enough sense for me.

    A couple of suggestions then:

    Make sure the padding size is 0x800 and not 0x200

    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm.html#tf-m_partition_alignment_requirements gives some good hints (even if you're not going to use TF-M): The bootloader has to be a part of the SPU and this flash area needs to be page aligned in a multiple of 4kB. 

    This means that 

    MCUboot
    Custom partition
    MCuboot padding
    End of secure part
    
    App 

    Does not work due to the custom partition being forced inside of the Secure domain, where you need the 4k alignment granularity.

    but

    MCUboot
    MCUboot padding 
    
    End of secure
    
    Custom partition
    App

    should work.

    Kind regards,
    Andreas

Children
Related