Page 1 of 1

Multi-flash chips, how to select?

Posted: Thu May 21, 2020 10:17 am
by mryboy
My MCU is ESP32 PICO D4. There are two flash chips on my board(Include the intergrated one). Just the CS# connects with different pins( GPIO16 and GPIO15). Now, the GPIO16 chip is the main chip(download and boot on this chip) . How to make the GPIO15 chip as the main chip? Or, how to map two chips' address to the system partition address?

Re: Multi-flash chips, how to select?

Posted: Fri May 22, 2020 3:36 am
by ESP_Angus

It's not possible to configure ESP32-PICO-D4 to boot from the external flash, this SPI configuration is programmed into the chip's OTP efuse bits.

It's also not possible for both the SPI flash chips to be mapped into the address space at the same time, unfortunately. It's technically possible in the hardware to switch the flash cache from using the internal to the external flash chip (meaning all instruction & data flash mappings would move to this chip), but this isn't a configuration we support in ESP-IDF.

ESP-IDF includes an example for mounting a filesystem on an external flash chip on a different SPI bus: ... lash_fatfs

This example uses all different pins for the external SPI bus, so none of the pins from the main SPI flash chip are shared with the second flash chip.

In ESP-IDF v4.2 we have added support for attaching additional SPI devices on the same bus as the main SPI flash (this bus is SPI1), sounds the same as what you have. However please note that the main SPI flash cache needs to be disabled whenever the second device is accessed - this can slow down execution if there is a lot of access to the second device. You can read more about this feature here. However as the documentation notes, this is a feature for advanced developers.

Re: Multi-flash chips, how to select?

Posted: Fri May 29, 2020 5:38 am
by mryboy
What a pity. Thanks for your answer.