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.
SPIFFS, Partion, external Flash, Bootloading, Bitmaps
Re: SPIFFS, Partion, external Flash, Bootloading, Bitmaps
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
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
Re: SPIFFS, Partion, external Flash, Bootloading, Bitmaps
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.
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.
Re: SPIFFS, Partion, external Flash, Bootloading, Bitmaps
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.
Re: SPIFFS, Partion, external Flash, Bootloading, Bitmaps
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.
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: Baidu [Spider], ESP_Roland and 276 guests