SPIFFS, Partion, external Flash, Bootloading, Bitmaps

E_SCH.
Posts: 10
Joined: Mon Jul 19, 2021 11:16 am

SPIFFS, Partion, external Flash, Bootloading, Bitmaps

Postby E_SCH. » Wed Dec 01, 2021 6:45 pm

Is there a possibility to save data directly in an external SPI flash during bootloading?
I would like to save graphic elements, e.g. bitmaps and fonts, in a SPIFFS partition in an external SPI flash.
How can I save the data directly in the external flash at flashing or bootloading?
Comparable to a partition in main flash, which I can define in partitions.csv.
I am using an ESP32-S2 wrover module with an additional external SPI-Flash W25Q64JVSSIM from Winbond.
Thanks for your support.

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: SPIFFS, Partion, external Flash, Bootloading, Bitmaps

Postby ESP_igrr » Wed Dec 01, 2021 8:27 pm

Hi E_SCH,

Currently there is no "nice" interface for automatically uploading data to external flash. There is a feature request for this at https://github.com/espressif/esp-idf/issues/6337. Please leave a comment there if you are interested. In the meantime you can try to do this manually using esptool.py.

esptool.py has a --spi-connection argument, see the documentation ("Custom SPI Pin Configuration" section).

Note that due to a long-standing issue, you need to also pass --no-stub argument to esptool in this case.

Using esptool.py with the above mentioned arguments and its write_flash command, you should be able to upload data to external flash.

Unlike the main flash, currently there is no configuration file for the partitions in external flash. You need to define partitions at run time in your code, as shown in this example: https://github.com/espressif/esp-idf/bl ... ain.c#L142

E_SCH.
Posts: 10
Joined: Mon Jul 19, 2021 11:16 am

Re: SPIFFS, Partion, external Flash, Bootloading, Bitmaps

Postby E_SCH. » Thu Dec 02, 2021 2:34 pm

Hi ESP_igrr,

Thank you for the fast information.
I will test it.
But I have another question that you might be able to help with.
Is it possible to connect an SPI display to the ESP32-S2 on the SPI-Bus to which the external flash is connected?
I use the following GPIO:
GPIO36: SPI-CLK
GPIO37: SPI-MISO
GPIO35: SPI-MOSI
GPIO34: CS-DISPLAY
GPIO8: CS-Ext.FLASH
If so, how do I initialize the SPI?
Thanks very much.

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: SPIFFS, Partion, external Flash, Bootloading, Bitmaps

Postby ESP_igrr » Thu Dec 02, 2021 8:14 pm

No, unfortunately sharing a single SPI bus between flash chips and other devices is not supported now, see note in this section of the docs: https://docs.espressif.com/projects/esp ... ash-device.

E_SCH.
Posts: 10
Joined: Mon Jul 19, 2021 11:16 am

Re: SPIFFS, Partion, external Flash, Bootloading, Bitmaps

Postby E_SCH. » Fri Dec 17, 2021 12:52 pm

Hi ESP_igrr,
I checked the documentation.
It looks like the argument "Custom SPI Pin Configuration" is not supported on the ESP32-S2.
Can you confirm it?
I also checked the esptool.py code, it says:
if esp.CHIP_NAME! = "ESP32": raise FatalError ("Chip% s does not support --spi-connection option."% esp.CHIP_NAME).
Is there any other way of writing data to an external SPI flash with an ESP32-S2 during flashing / bootloading?
Thank you for your help.

Who is online

Users browsing this forum: No registered users and 118 guests