Multiple flash chips on same the SPI line

krajaan
Posts: 16
Joined: Mon Mar 20, 2017 5:59 pm

Multiple flash chips on same the SPI line

Postby krajaan » Mon Mar 20, 2017 6:48 pm

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?

ESP_Sprite
Posts: 9014
Joined: Thu Nov 26, 2015 4:08 am

Re: Multiple flash chips on same the SPI line

Postby ESP_Sprite » Tue Mar 21, 2017 6:52 am

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.

krajaan
Posts: 16
Joined: Mon Mar 20, 2017 5:59 pm

Re: Multiple flash chips on same the SPI line

Postby krajaan » Tue Mar 21, 2017 8:13 am

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?

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: Multiple flash chips on same the SPI line

Postby loboris » Tue Mar 21, 2017 8:41 am

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) ?

ESP_Sprite
Posts: 9014
Joined: Thu Nov 26, 2015 4:08 am

Re: Multiple flash chips on same the SPI line

Postby ESP_Sprite » Wed Mar 22, 2017 3:33 am

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.

ChrisKrak
Posts: 1
Joined: Mon Mar 20, 2017 3:53 pm

Re: Multiple flash chips on same the SPI line

Postby ChrisKrak » Wed Mar 22, 2017 5:54 am

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.

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

Re: Multiple flash chips on same the SPI line

Postby ESP_igrr » Wed Mar 22, 2017 6:36 am

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: Google [Bot] and 128 guests