Hello Jared,
I have developed a custom board that essentially uses the circuitry of the Feather 9160 on which I have developed most of the firmware. Now, I am facing difficulties with an external QSPI connected to SPI3:
`/ {
aliases {
qspiflash = &w25q32jv;
};
};
&spi3 {
compatible = “nordic,nrf-spim”;
status = “okay”;
cs-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = “default”, “sleep”;
w25q32jv: w25q32jv@0 {
compatible = “jedec,spi-nor”;
reg = <0>;
spi-max-frequency = <40000000>;
// wp-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
// hold-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
size = <0×2000000>;
has-dpd;
t-enter-dpd = <3000>;
t-exit-dpd = <30000>;
jedec-id = [ c2 28 17 ];
};
};
/ {
chosen {
nordic,pm-ext-flash = &w25q32jv;
};
};`
(YAML)
`external_flash:
address: 0×0
end_address: 0×2000000
region: external_flash
size: 0×2000000
littlefs_storage:
address: 0×0
device: W25Q32JV
region: external_flash
size: 0×2000000
`
Using your test program on GitHub:
[https://github.com/circuitdojo/nrf9160-feather-examples-and-drivers/blob/v2.4.x/samples/external_flash/src/main.c](https://)
I got this result in the log:
<inf> littlefs: LittleFS version 2.5, disk version 2.0
[00:00:08.579,559] <inf> littlefs: FS at flash-controller@39000:0xf0000 is 6 0x1000-byte blocks with 512 cycle
[00:00:08.593,200] <inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:00:08.603,393] <err> littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1234: Corrupted dir pair at {0x1, 0x0}
[00:00:08.617,095] <wrn> littlefs: can't mount (LFS -84); formatting
[00:00:08.803,375] <inf> littlefs: /lfs mounted
[00:00:08.811,462] <inf> qspi: bsize = 16 ; frsize = 4096 ; blocks = 6 ; bfree = 4
[00:00:08.822,753] <inf> qspi: Erasing storage!
[00:00:08.830,596] <inf> littlefs: /lfs unmounted
[00:00:08.838,684] <inf> qspi: Area 11 at 0xf0000 for 24576 bytes
[00:00:08.848,236] <inf> qspi: Erasing flash area ...
[00:00:09.378,753] <inf> qspi: Done. Code: 0
[00:00:09.386,383] <inf> littlefs: LittleFS version 2.5, disk version 2.0
[00:00:09.396,697] <inf> littlefs: FS at flash-controller@39000:0xf0000 is 6 0x1000-byte blocks with 512 cycle
[00:00:09.410,308] <inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:00:09.420,532] <err> littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1234: Corrupted dir pair at {0x0, 0x1}
[00:00:09.434,234] <wrn> littlefs: can't mount (LFS -84); formatting
[00:00:09.621,063] <inf> littlefs: /lfs mounted
Is it possible that the size of the QSPI flash is only 24576 bytes?
Thank you for your response and suggestions.