Using LittleFS with custom partition table

Hi,

I have troubles with the Arduino Nano ESP32 using LittleFS with larger partitions, than what the single option in the IDE allows (Version 2.3.2).

Let me summarize the steps I did up till now:

  • I bought 10 pieces ARDUINO Nano ESP32
  • I took them out from their boxes and tried to run on them the Arduino Littlefs test from the Adruino 2.3.2 IDE examples. Result: LittleFS mount failed on each of them
  • I executed the Reset procedure, what Arduino suggests (https://support.arduino.cc/hc/en-us/articles/9810414060188-Reset-the-Arduino-bootloader-on-the-Nano-ESP32
  • I downloaded the test again and now it run
  • I downloaded the same test again, but now from the Platformio IDE. The test was still ok
  • I downloaded another program to write out the actual partitions: it found 2 pieces 1MB app and an 1.6MB spiffs partitions (besides the other necessary partitions). By the way, the ESP32S3 has 16 MB flash, so I do not really understand why the only available partition scheme in the IDE allows to use 4 MB only?
  • 1MB for the app is not enought for my application, therefore I tried to change the content of the partition table. I tried many ways, but nothing changed, the partitions remained the same
  • I installed the Espressif IDF, created a simple Hello-world program and downloaded it: success
  • I modified the partition table (created a custom partitions.csv) for the Hello-world project and downloaded it. As the Espressif writes out (between other informations) the actual partition table at booting, I could checked, that the table had changed to the one, what I expected
  • I returned to the Platformio IDE, copied the partitions.csv from the Espressif IDF, downloaded a partition-report program and got the following result:

Name | Type | SubType | Offset | Size
---------------------±------±--------±-----------±----------
nvs | 0x01 | 0x02 | 0x00009000 | 0x00005000
otadata | 0x01 | 0x00 | 0x0000e000 | 0x00002000
app0 | 0x00 | 0x10 | 0x00010000 | 0x00300000
app1 | 0x00 | 0x11 | 0x00310000 | 0x00300000
spiffs | 0x01 | 0x82 | 0x00610000 | 0x00960000
factory | 0x00 | 0x00 | 0x00f70000 | 0x00080000
coredump | 0x01 | 0x03 | 0x00ff0000 | 0x00010000

So far so good. The only problem is however, that running the LittleFS test program after this fails again with the same way (Littlefs mounting failed). I dig into the details and printed out the error code for this fail, it is 0x105, which means: [ESP_ERR_NOT_FOUND] : Requested resource not found. I have no idea what this could mean?
But, after returning to the Arduino IDE, processing the Reset procedure again and downloading the littlefs test, it runs again correctly, of course returning to the original 2*1 MB partitions.
I tried this procedure a couple of boards, with exactly the same results.
So currently I have to live with applications smaller, than 1MB or I can't use the littlefs.
Is there any solution to modify the partition scheme to get the above mentioned partitions AND keeping the littlefs functionality?

Thx in advance!