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?
Multiple flash chips on same the SPI line
-
- Posts: 9773
- Joined: Thu Nov 26, 2015 4:08 am
Re: Multiple flash chips on same the SPI line
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
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?
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
On custom boards we can use 16MB flash chips, or replace 4MB chip on standard modules (easy enough).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.
Is it not true that ESP32 supports up to 16MByte flash chips (in menuconfig you can select → Serial flasher config → Flash size 16M) ?
-
- Posts: 9773
- Joined: Thu Nov 26, 2015 4:08 am
Re: Multiple flash chips on same the SPI line
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
Hello Sprite,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.
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
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.
Who is online
Users browsing this forum: No registered users and 92 guests