Page 1 of 1

SPI Memory selection

Posted: Sun Oct 30, 2016 6:03 pm
by Singe12
Hi all,

I want to ask if there's particular requirements to choose compatible SPI Flash to replace flash memory that is on module.

In particular I want to ask:
- Max. supported SPI flash clock (80Mhz is ESP32 top limit or should I choose a faster SPI flash?)
- Particular istruction commands that must not be changed (like quad read istruction etc..)
- Compatible brands

Thank you!

Re: SPI Memory selection

Posted: Tue Nov 01, 2016 1:01 am
by ESP_Angus
Hi Singe12,

You're correct that max supported SPI flash clock is 80MHz.

Most common SPI NOR flash should be supported, although there isn't a standard (to my knowledge) there is a set of commands that most manufacturers have supported.

Via the settings encoded in the bootloader (chosen in esp-idf menuconfig, and passed as a parameter to "esptool.py elf2image") the SPI speed and mode (dual I/O, dual-out, quad I/O, quad-out) are configured in the software image, and the bootloader sets the SPI mode accordingly when loading.

(There are also ways to deal with rarer SPI flash chips that need special initialisation sequences before they accept standard comands. We don't have documentation or tooling for this yet, but let us know if it turns out you might need it.)

Regarding chips that are known to work, any SPI flash used on ESP8266 should work on ESP32 (including common brands like WinBond, Gigadevice, etc.).

Size can be any of 1MB (8 megabits), 2MB, 4MB, 8MB, 16MB. Accessing more than 16 megabytes is not possible due to the 24 bit addressing limit of the standard SPI flash commands. Some larger chips may still work (as the they support 24 bit address commands also), but you'd only be able to operate on offsets above 16 megabytes via custom SPI commands (can't execute code from there, etc.)

Current ESP-WROOM32 modules are using Gigadevice GD25Q32, older modules have Fudan Micro FD25Q32. These are both 4MB (32 megabit) flashes.

Re: SPI Memory selection

Posted: Mon Nov 14, 2016 12:45 am
by ESP_Angus
Just a small additional note, Gigadevice flash (as opposed to WinBond or some other common brands) requires special commands to enter Quad I/O mode. For this reason ESP-WROOM32 currently runs in Dual I/O mode only, however Quad I/O mode support will be added via esp-idf in the near future.

If you use some other flash brands then you should be able to use Quad I/O mode in esp-idf now.

Re: SPI Memory selection

Posted: Wed Nov 16, 2016 7:30 am
by uhrheber
ESP_Angus wrote:Just a small additional note, Gigadevice flash (as opposed to WinBond or some other common brands) requires special commands to enter Quad I/O mode. For this reason ESP-WROOM32 currently runs in Dual I/O mode only, however Quad I/O mode support will be added via esp-idf in the near future.
ESP_Angus,

I noticed that currently only DIO is used, and was wondering, why.
Now I know .-)
How much of a difference does it make?

cu
Uhrheber

Re: SPI Memory selection

Posted: Wed Nov 16, 2016 9:42 pm
by ESP_Angus
uhrheber wrote: How much of a difference does it make?
Hi Uhrheber,

It really depends on the workload. When reading from flash, quad I/O is almost double the speed (because the data for each read command can be sent over 4 data pins instead of 2). However, because flash contents is cached inside the device the extent that this effects performance depends on the number of cache misses.

Angus

Re: SPI Memory selection

Posted: Sun Dec 11, 2016 8:16 pm
by LordCommander
Hi Angus,

I'm trying to use microchip QIO memory 26VF032B-104I/SM from microchip.
Datasheet: http://www.tme.eu/en/Document/ca742f4b8 ... VF016B.pdf

Unfortunately I'm not able to write to it:

Code: Select all

Flashing binaries to serial port /dev/tty.usbserial-DQ00537H (app at offset 0x10000)...
esptool.py v2.0-dev
Connecting...
Uploading stub...
Running stub...
Stub running...
Attaching SPI flash...
Configuring flash size...
Compressed 5936 bytes to 3516...
Wrote 5936 bytes (3516 compressed) at 0x00001000 in 0.3 seconds (effective 148.3 kbit/s)...
File  md5: 8ef5f77da076b35118b46f23ea2e64e5
Flash md5: c48baf0f6c7eacd27ad123149618d6d5
MD5 of 0xFF is c48baf0f6c7eacd27ad123149618d6d5

A fatal error occurred: MD5 of file does not match data in flash!
make: *** [flash] Error 2
I tried all modes: QIO/DOUT/DIO and the result is same.

The chip is working fine with different memory.

Any hints?

Cheers,
Michal

Re: SPI Memory selection

Posted: Sun Dec 11, 2016 10:42 pm
by ESP_Angus
LordCommander wrote: I'm trying to use microchip QIO memory 26VF032B-104I/SM from microchip.
Hi Michal,

Someone reported problems with this chip and ESP8266 recently. It seems to use the "standard" SPI flash commands in a different way to most chips, so it's not compatible with either the ESP8266 or ESP32 flash controllers.

More details here: https://github.com/espressif/esptool/issues/149

Angus

Re: SPI Memory selection

Posted: Thu Nov 09, 2017 2:27 pm
by novalight
Since we are right now evaluating different options for our production. Basically we are looking for 8MB, 80MHz, 3.3V and QIO support. But we found that the market and the flash-support by ESP32 is a little bit non-obvious. Many chips are shown as EOL on Mouser or Digikey.
It would really help if there would be some official overview which flash chips are supported, which manufactuerer, voltage, spi mode, frequency etc. Does anybody know a chip that is obtainable through Mouser or Digikey that fulfills the requirements above?

Re: SPI Memory selection

Posted: Wed Feb 06, 2019 2:46 pm
by themadsens
Knock, knock ..
An offical stance on this would be really nice .. :D

Re: SPI Memory selection

Posted: Tue Aug 11, 2020 11:43 am
by abhishekbn
Hey Guys,

Is there any recommendation on the supported flash chipsets yet? We are looking to add 16MB main flash in our custom-designed board and the GigaDevice flash is not easily available to procure at all the places.

A recommended list of supported flash chips (sizewise) would be of great help.

Thanks,