SPI Memory selection
SPI Memory selection
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!
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
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.
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
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.
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
ESP_Angus,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.
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
Hi Uhrheber,uhrheber wrote: How much of a difference does it make?
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
-
- Posts: 1
- Joined: Wed Jun 08, 2016 12:32 pm
Re: SPI Memory selection
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:
I tried all modes: QIO/DOUT/DIO and the result is same.
The chip is working fine with different memory.
Any hints?
Cheers,
Michal
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
The chip is working fine with different memory.
Any hints?
Cheers,
Michal
Re: SPI Memory selection
Hi Michal,LordCommander wrote: I'm trying to use microchip QIO memory 26VF032B-104I/SM from microchip.
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
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?
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?
-
- Posts: 17
- Joined: Wed Sep 05, 2018 6:49 pm
Re: SPI Memory selection
Knock, knock ..
An offical stance on this would be really nice ..
An offical stance on this would be really nice ..
-
- Posts: 4
- Joined: Tue Jul 28, 2020 12:44 pm
Re: SPI Memory selection
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,
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: Google [Bot] and 36 guests