This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NRF5340 How to use FAT FS with external flash

I am trying to use the external flash on my NRF5340dk to store and read data files. Raw IO from the spi_flash sample seems to be working fine, but I'm not sure how to mount the FAT file system. fs_sample says that FAT FS with external flash should work, but only nrf52840dk/nrf52840 and nrf52840dk_nrf52840_qspi are compatible. I have an old version of the project that uses NRF5 and FAT is working correctly there.

I tried to get fs_sample working with my board by copying the configs and overlays from the compatible boards and also trying just:

/ {
    chosen { 
         nordic,pm-ext-flash = &mx25r64;
    };
};

in the overlay, but all of these approaches led to this error:

*** Booting nRF Connect SDK v2.5.2 ***
[00:00:00.460,388] <err> main: Storage init ERROR!
[00:00:00.460,418] <err> fs: fs mount error (-5)
Error mounting disk.
[00:00:00.460,449] <err> fs: fs not mounted (mp == 0x20000000)

  • Hi,

     

    Here's a quick configuration example showing how to run with mcuboot/multi-image build for the nrf5340dk_nrf5340_cpuapp board:

     ncs_253_fs_sample_nrf5340_ext_flash.zip

     

    To place the fatfs_storage in external flash, there's an "affiliation" tag in the pm_static.yml entry, as well as mcuboot/board configurations.

     

    Kind regards,

    Håkon

  • Hi,

    I tried to build and flash the above code that Hakon provides, but when I do I get in putty when connecting to the board:

    *** Booting nRF Connect SDK 3758bcbfa5cd ***
    [00:00:00.757,232] <err> sd: Card error on CMD0
    [00:00:00.757,232] <err> main: Storage init ERROR!
    [00:00:00.762,939] <err> sd: Card error on CMD0
    [00:00:00.762,939] <err> fs: fs mount error (-5)
    Error mounting disk.
    [00:00:00.762,969] <err> fs: fs not mounted (mp == 0x20000000)

    To describe my layout, I am using a nrf5340 development kit with no sd card. I am trying to save some data on the mx25r6435f memory that exists on the nrf5340 dev kit. What do I need to modify? Please reply asap cause I have a deliverable on Monday 30/9/24.


    Thank you

  • Hi,

     

    I would recommend that you create a new thread on this matter.

    Be sure to include your configurations and overlay, as it seems that you're using a SD-card for storage, and not the external flash.

     

    Kind regards,

    Håkon

Related