am trying to mount little fs example with my external flash winbond w25q256 but my nrf52840 board taking internal memory and am using qspi
it get automount and writing in internal memory (mx25r64) and this is my overlay
i have tried with little fs example
/ {
aliases {
qspi-flash0 = &w25q256;
ext-flash = &w25q256;
};
chosen {
zephyr,flash-controller = &w25q256;
};
fstab {
compatible = "zephyr,fstab";
lfs1: lfs1 {
compatible = "zephyr,fstab,littlefs";
mount-point = "/lfs";
partition = <&lfs1_part>;
automount;
read-size = <16>;
prog-size = <16>;
cache-size = <64>;
lookahead-size = <32>;
block-cycles = <512>;
};
};
};
/delete-node/ &storage_partition;
/delete-node/ &mx25r64;
&qspi {
status = "okay";
pinctrl-0 = <&qspi_custom>;
pinctrl-1 = <&qspi_sleep_custom>;
pinctrl-names = "default", "sleep";
w25q256: w25q256@0 {
compatible = "nordic,qspi-nor";
reg = <0>;
size = <DT_SIZE_M(32)>;
sck-frequency = <8000000>;
writeoc = "pp4o";
readoc = "read4io";
jedec-id = [ef 40 19];
has-dpd;
t-enter-dpd = <3000>;
t-exit-dpd = <30000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* Raw flash area for test writes (0-2MB) */
test_partition: partition@0 {
label = "test-area";
reg = <0x00000000 DT_SIZE_M(2)>;
};
/* LittleFS partition (2MB-4MB) */
lfs1_part: partition@200000 {
label = "littlefs-storage";
reg = <0x00200000 DT_SIZE_M(2)>;
};
/* Reserve remaining space for future use (4MB-32MB) */
storage_partition: partition@400000 {
label = "storage";
reg = <0x00400000 DT_SIZE_M(28)>;
};
};
};
};
&pinctrl {
qspi_custom: qspi_custom {
group1 {
psels = <NRF_PSEL(QSPI_SCK, 0, 19)>,
<NRF_PSEL(QSPI_IO0, 0, 14)>,
<NRF_PSEL(QSPI_IO1, 0, 23)>,
<NRF_PSEL(QSPI_IO2, 0, 11)>,
<NRF_PSEL(QSPI_IO3, 1, 0)>,
<NRF_PSEL(QSPI_CSN, 0, 16)>;
nordic,drive-mode = <NRF_DRIVE_H0H1>;
};
};
qspi_sleep_custom: qspi_sleep_custom {
group1 {
psels = <NRF_PSEL(QSPI_SCK, 0, 19)>,
<NRF_PSEL(QSPI_IO0, 0, 14)>,
<NRF_PSEL(QSPI_IO1, 0, 23)>,
<NRF_PSEL(QSPI_IO2, 0, 11)>,
<NRF_PSEL(QSPI_IO3, 1, 0)>,
<NRF_PSEL(QSPI_CSN, 0, 16)>;
low-power-enable;
};
};
};
prj.conf
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=3
# Enable flash subsystem
CONFIG_FLASH=y
# Enable QSPI NOR flash driver
CONFIG_SPI=y
CONFIG_NORDIC_QSPI_NOR=y
# Enable flash page layout
CONFIG_FLASH_PAGE_LAYOUT=y
# Increase stack sizes for continuous operations
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
# Enable Nordic specific configurations
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
# Optimize for reliability
CONFIG_NORDIC_QSPI_NOR_INIT_PRIORITY=80
# Debug options
CONFIG_DEBUG=y
CONFIG_DEBUG_INFO=y
# Optimize for continuous operation
CONFIG_SIZE_OPTIMIZATIONS=y
# Increase logging buffers
CONFIG_LOG_BUFFER_SIZE=4096
CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=2048
# Enable file system support
CONFIG_FILE_SYSTEM=y
# Enable LittleFS
CONFIG_FILE_SYSTEM_LITTLEFS=y
# Enable filesystem formatting support
CONFIG_FILE_SYSTEM_MKFS=y
# LittleFS configuration
CONFIG_FS_LITTLEFS_NUM_FILES=10
CONFIG_FS_LITTLEFS_NUM_DIRS=5
CONFIG_FS_LITTLEFS_CACHE_SIZE=4096
CONFIG_FS_LITTLEFS_LOOKAHEAD_SIZE=32
CONFIG_FS_LITTLEFS_BLOCK_CYCLES=512
CONFIG_FS_LITTLEFS_FMP_DEV=y
# Flash map support for LittleFS
CONFIG_FLASH_MAP=y
# Increase heap for filesystem operations
CONFIG_HEAP_MEM_POOL_SIZE=16384
# Remove problematic POSIX configurations that cause build errors
# CONFIG_POSIX_API=n
# Additional memory for LittleFS operations
CONFIG_IDLE_STACK_SIZE=1024