SPI Memory selection

Singe12
Posts: 14
Joined: Mon Mar 07, 2016 10:26 am

SPI Memory selection

Postby Singe12 » Sun Oct 30, 2016 6:03 pm

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!

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: SPI Memory selection

Postby ESP_Angus » Tue Nov 01, 2016 1:01 am

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.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: SPI Memory selection

Postby ESP_Angus » Mon Nov 14, 2016 12:45 am

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.

uhrheber
Posts: 16
Joined: Sat Nov 12, 2016 12:07 pm

Re: SPI Memory selection

Postby uhrheber » Wed Nov 16, 2016 7:30 am

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

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: SPI Memory selection

Postby ESP_Angus » Wed Nov 16, 2016 9:42 pm

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

LordCommander
Posts: 1
Joined: Wed Jun 08, 2016 12:32 pm

Re: SPI Memory selection

Postby LordCommander » Sun Dec 11, 2016 8:16 pm

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

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: SPI Memory selection

Postby ESP_Angus » Sun Dec 11, 2016 10:42 pm

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

novalight
Posts: 40
Joined: Tue Apr 19, 2016 1:13 pm

Re: SPI Memory selection

Postby novalight » Thu Nov 09, 2017 2:27 pm

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?

themadsens
Posts: 17
Joined: Wed Sep 05, 2018 6:49 pm

Re: SPI Memory selection

Postby themadsens » Wed Feb 06, 2019 2:46 pm

Knock, knock ..
An offical stance on this would be really nice .. :D

abhishekbn
Posts: 4
Joined: Tue Jul 28, 2020 12:44 pm

Re: SPI Memory selection

Postby abhishekbn » Tue Aug 11, 2020 11:43 am

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,

Who is online

Users browsing this forum: Bing [Bot] and 189 guests