Page 1 of 1
Multiple flash chips on same the SPI line
Posted: Mon Mar 20, 2017 6:48 pm
by krajaan
Hi,
we're looking to add more usable memory to a ESP32-WROOM module based board and we have some questions. Is it possible to use multiple Flash chips on the same SPI line to increase available memory (ESP32-s don't have a lot of pins, unfortunately)? Would / Could the new memory chip be memory mapped? How would arbitering the SPI lines work with or without DMA? Are there any concerns we may have overlooked?
Re: Multiple flash chips on same the SPI line
Posted: Tue Mar 21, 2017 6:52 am
by ESP_Sprite
You can add an arbitrary (well, with the current driver, 3 per host) SPI memory devices to the ESP32 and you can access them using DMA transfers. However, only one device can be memory mapped, and you're limited to 4MiB of memory mapped memory. Also, at the moment memory mapping is not supported in any way in esp-idf yet.
Re: Multiple flash chips on same the SPI line
Posted: Tue Mar 21, 2017 8:13 am
by krajaan
Thank you!
That means we can't use partitions either, correct? So any additional flash memory can only be accessed through generic esp-idf SPI drivers?
Re: Multiple flash chips on same the SPI line
Posted: Tue Mar 21, 2017 8:41 am
by loboris
ESP_Sprite wrote:You can add an arbitrary (well, with the current driver, 3 per host) SPI memory devices to the ESP32 and you can access them using DMA transfers. However, only one device can be memory mapped, and you're limited to 4MiB of memory mapped memory. Also, at the moment memory mapping is not supported in any way in esp-idf yet.
On custom boards we can use 16MB flash chips, or replace 4MB chip on standard modules (easy enough).
Is it not true that ESP32 supports up to 16MByte flash chips (in menuconfig you can select → Serial flasher config → Flash size 16M) ?
Re: Multiple flash chips on same the SPI line
Posted: Wed Mar 22, 2017 3:33 am
by ESP_Sprite
Ah, sorry, I thought you meant RAM, not flash. Yes, the ESP32 supports up to 16MiB of flash in one IC. If you have multiple flash ICs, as far as I am aware you can memory map only one, the rest needs to be controlled using the generic SPI DMA drivers.
Re: Multiple flash chips on same the SPI line
Posted: Wed Mar 22, 2017 5:54 am
by ChrisKrak
ESP_Sprite wrote:You can add an arbitrary (well, with the current driver, 3 per host) SPI memory devices to the ESP32 and you can access them using DMA transfers. However, only one device can be memory mapped, and you're limited to 4MiB of memory mapped memory. Also, at the moment memory mapping is not supported in any way in esp-idf yet.
Hello Sprite,
So if I understand correctly, it is possible to use another SPI flash on the same SPI bus as the GD25Q32 is sitting on the WROOM module? Is there going to be a problem writing a big chunk of data (let's say 1MB) to the added SPI flash while the main code is being read from the module flash, which is sitting on the same bus? Wondering if the DMA and SPI arbitration going to take care of the reading from one and writing to the other flash automatically.
Re: Multiple flash chips on same the SPI line
Posted: Wed Mar 22, 2017 6:36 am
by ESP_igrr
The current SPI driver supports using only SPI2 and SPI3 (HSPI and VSPI) peripherals. So you can connect an external flash chip, but not to the same lines which are used by the main flash chip.