How to use FATFS with partition manager?

Hi,

I'm using NCS 2.2.0, based on nRF5340 custom board.

My board has a spi nor flash, and i want to use Fatfs to save some sensor data.

I add FATFS to my project without partition manager, it is running, and i can see the file can be opened and closed.

But it is break running while i add Partition Manager to my project.

I debug it, and find the fault is "Get a wrong device when FS mount".

---------------------------------------------------------------------

In my .config file, i can ensure that spi nor flash drive and Partition Manager are added 

CONFIG_PARTITION_MANAGER_ENABLED=y
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_FLASH=y
CONFIG_FLASH_HAS_DRIVER_ENABLED=y

FATFS mount debug details is as follow:

- Thread  call stack

- FATFS mount

- wrong device

- zephyr.map

- my project.config

# low power
CONFIG_PM=y
CONFIG_PM_DEVICE=y

# flash
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y

# spi nor
CONFIG_SPI=y
CONFIG_SPI_NOR_IDLE_IN_DPD=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096

# FATFS
CONFIG_FILE_SYSTEM=y
CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_DISK_DRIVER_FLASH=y
CONFIG_FS_FATFS_MAX_SS=4096

# fs_dirent structures are big.
CONFIG_MAIN_STACK_SIZE=2048

- partitions.yml

So, how to use FATFS with partition manager?

Best regards,

Yang

Parents Reply
  • Hi, Amanda H

    I was added `CONFIG_PM_PARTITION_REGION_NVS_STORAGE_EXTERNAL=y` to my prj.conf, also `CONFIG_NVS=y` and `CONFIG_NVS_LOOKUP_CACHE=y` has benn select.

    But it also select the wrong device, see debug details as follow:

    I want to add FATFS to my project,

    are you sure i should add `CONFIG_PM_PARTITION_REGION_NVS_STORAGE_EXTERNAL=y` to my prj.conf?

    In define device step, i thing it get a wrong device, see here:

    There are pm_config file:

    Regards,

    Yang

Children
Related