I'm writing a wav file from the nrf52840 board to the nor flash w25q128jv with a capacity of 16mb but it seems that I can only operate on the first 2mb, even when dividing the partition, if the starting address is over 2mb, the file mount will fail, and if starting from 0x00, the file can only be written to about 2mb and then I will encounter "file write error (-22)". This is my overlay, do I have any problems with my configuration? i am stuck with it for a long time hope someone can save me from this mess
overlay :
&spi1 {
compatible = "nordic,nrf-spi";
status = "okay";
pinctrl-0 = <&spi1_default>;
pinctrl-1 = <&spi1_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
clock-frequency = <8000000>;
mx25r6435f: w25q128jv@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <8000000>;
status = "okay";
size = <0x1000000>; // 16MB
jedec-id = [ ef 40 18 ]; // mã JEDEC của W25Q128JV
has-dpd;
t-enter-dpd = <10000>;
t-exit-dpd = <30000>;
};
};
&mx25r6435f {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
lfs1_part: partition@0 {
label = "lfs1_storage";
// only 8MB for lfs1(mount error -22)
reg = <0x800000 0x800000>;
// 16MB and mount success but if write more than 2mb will "file write error -5"
// reg = <0x000000 0x1000000>;
};
};
};
mount config :
static struct fs_littlefs lfs1_data = {
.cfg =
{
// .alignment = 4,
.read_size = 256,
.prog_size = 256,
.cache_size = 256,
.lookahead_size = 16,
.block_size = THE_FS_BLOCK_SIZE, // 4096
.block_count = THE_FS_BLOCK_COUNT, // 2048
.block_cycles = 512, // Use default value
},
};
static struct fs_mount_t lfs_mnt = {
.type = FS_LITTLEFS,
.mnt_point = "/lfs1",
.fs_data = &lfs1_data,
.flags = 0,
.storage_dev = (void *)FLASH_AREA_ID(lfs1_storage),
};