I want to use the external flash on the nRF5340 DK using SPI as the board I'm developing for will not have QSPI. I used the littlefs sample which has a lot of the settings I need, like those in the spi_flash sample:
CONFIG_STDOUT_CONSOLE=y CONFIG_FLASH=y CONFIG_SPI=y
Which gives me:
*** Booting nRF Connect SDK v3.5.99-ncs1-1 *** mx25r6435f@0 SPI flash testing ========================== Perform test on single sector Test 1: Flash erase Flash erase succeeded! Test 2: Flash write Attempting to write 4 bytes Data read matches data written. Good!!
I see it's using external flash because of the flash_dev->name print.
Now if I add add CONFIG_SPI=y to the littlefs sample I get:
*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
Sample program to r/w files on littlefs
Area 5 at 0xf8000 on flash-controller@39000 for 32768 bytes
I: LittleFS version 2.5, disk version 2.0
I: FS at flash-controller@39000:0xf8000 is 8 0x1000-byte blocks with 512 cycle
I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
/lfs mount: 0
/lfs: bsize = 16 ; frsize = 4096 ; blocks = 8 ; bfree = 5
Listing dir /lfs ...
[FILE] boot_count (size = 1)
[FILE] pattern.bin (size = 547)
/lfs/boot_count read count:11 (bytes: 1)
/lfs/boot_count write new boot count 12: [wr:1]
------ FILE: /lfs/pattern.bin ------
0c 55 55 55 55 55 55 55 0d 55 55 55 55 55 55 55
I've got another ticket open for a number of things I'm trying to do but just wanted to see if I could get external flash using spi and littlefs and I'm having trouble with this.