Create External Flash Partition for nRF5340 in Thingy:91x is failed

I want to use the nRF5340 in Thingy:91x to control the external flash (256M bit) and pariition it as LittleFS. I can be sucessfully create partition in nRF5340DK but cancan achieve in Thingy:91x. I tried many ways to modify the pm_static.yml and thing91x_nrf5340 board overlay and cannot acheive it. I want some example so that I know how to create partitiion of the external flash for nRF5340 in Thingy:91x. Please help. Thanks.

Parents Reply
  • Hi Amanda, thank you for your support. I had tried the examples you provided in V3.4.0. I can create a partition in external flash. However, I cannot using the partition in external flash as LittleFS partition. When I mount it as LittleFS partition, it always have <err> test: FAIL: unable to find flash area 0: -2 and <err> test: Mount LittleFS Error -2. Could you provide the example showing how to define LittleFS partition for external flash for nRF5340 in Thingy:91x by using Sysbuild in ncs V3.4.0. Thanks.

Children
  • The error FAIL: unable to find flash area 0: -2 (where -2 corresponds to -ENOENT / file or entry not found) occurs when Zephyr cannot locate the flash partition or flash area ID at runtime

    There is no dedicated sample demonstrating a LittleFS partition for external flash for nRF5340 in Thingy:91x, but you can refer to nrf52840dk_nrf52840_spi.conf and nrf52840dk_nrf52840_spi.overlay. 

    The Wi-Fi shell overlays you referenced define MCUboot secondary slots on external flash (image-1, image-3). They do not define a LittleFS partition, and they do not wire up a filesystem mount.

  • Hi Amada, I found out that the error was caused by nRF9151 in Thingy:91x, which used SPI and external flash as well. When I erase the program for nRF9151, nRF5340 can access the external flash as LittleFS. The current issue is how to make the MCUBoot in nRF9151 not to use external flash. I tried but not sucessful. The default sysbuild for nRF9151 in Thingy:91x is need to put MCUBoot in external flash. Any example which showed how to make nRF9151 only use internal flash for MCUBoot and not to use external flash anymore?

  • Billy Wan said:
    The default sysbuild for nRF9151 in Thingy:91x is need to put MCUBoot in external flash.

    The MCUboot bootloader image itself always lives in internal flash. That part is not placed on external flash.

    Thingy:91 X default sysbuild layout places the DFU secondary slot (mcuboot_secondary / slot1_partition) on the external flash. 

    Billy Wan said:
    Any example which showed how to make nRF9151 only use internal flash for MCUBoot and not to use external flash anymore?

    Unfortunately, no, but you can understand the external flash setup (then invert it). 

    Please keep in mind that the Internal flash of nRF9151 is 1 MiB total. With NSIB + TF-M + MCUboot, a full dual-slot layout leaves very little room for the app.  I suggest you keep the DFU secondary slot (mcuboot_secondary / slot1_partition) on the external flash to leave more space for your application. 

Related