Partition conflict when enabling littlefs in both mcuboot and app simultaneously?

I successfully enabled littlefs in mcuboot and read/write it successfully (due to project requirements), and then tried to enable littlefs in both mcuboot and app, operating on the same lfs partition. However, I received an error message during the build process, indicating that the partition does not meet the requirements? Or something else. I have tried to make a static partition table with LFS enabled separately in mcuboot or in the app, but there has been no improvement. How can I solve the problem of this partition not meeting the requirements?

In addition, I have made many different attempts based on the error content, and personally think it may be related to TFM? Could it be because mcuboot and the app run in different trust zones that their littlefs zones conflict?

Parents
  • Hi llly,

    Could you please share more details about your setup, and also the static configuration attempt?

    Hieu

    Update**: There is an important warning I would like to add to this first reply:

    Hieu said:

    Bootloaders are immutable for the lifetime of a product and it's imperative that they do not have security vulnerabilities or a large attack surface because if you compromise a bootloader, you compromise. Adding LittleFS read/write both adds a vulnerability and increases the attack surface.

    We highly recommend that the bootloader stay minimally simple. Giving both the application and the bootloader access to the same file system is especially recommended against.

  • Hi Hieu
    This is a dynamic partition table that I built when only enabling LFS in mcuboot or app (my project requires a single slot, so there is no mcuboot secondary partition, and I initially thought that the insufficient size of the mcuboot partition affected the activation of LFS, so I set it to 100k)

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    EMPTY_0:
    address: 0x19000
    end_address: 0x20000
    placement:
    before:
    - mcuboot_pad
    region: flash_primary
    size: 0x7000
    app:
    address: 0x28000
    end_address: 0x80000
    region: flash_primary
    size: 0x58000
    littlefs_storage:
    address: 0x80000
    end_address: 0x100000
    inside:
    - nonsecure_storage
    placement:
    align:
    start: 0x8000
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Then I copied this dynamic partition table into a static partition table and enabled LFS in both mcuboot and app, and the above error occurred.

    I have temporarily solved this problem, but I don't think it's the right way.

    I opened the file ncs\v2.6.1\nrf\scripts\partition_manager.py, found the error line, and commented out this part of the code. The build can be completed, and the code is currently running normally. But I don't know if there's any hidden danger in this.

    If you need any other detailed information, please let me know. I am not sure what can help you analyze this issue

  • Hi llly,

    Nothing stands out to me from the YAML file.

    Could you please share the spot in partition_manager.py where the issue happened?

Reply
  • Hi llly,

    Nothing stands out to me from the YAML file.

    Could you please share the spot in partition_manager.py where the issue happened?

Children
  • Hi Hieu

    This is where I made the changes in partition_manager.py.

    I simply commented out the code that prompted the error message, and then it can be built normally. Currently, there seems to be no problem, but I think there will be a better solution?

  • There should be better solutions than commenting out a check. I will investigate this and come back to you next week.

  • Look forward to your reply

  • Sorry I wasn't able to figure this out last week. I will continue this week and keep you updated.

  • It's okay. Thank you for your help