[SOLVED] Memory upgrade: Expand flash to 32 MB
[SOLVED] Memory upgrade: Expand flash to 32 MB
Hey!
First of all: What do I want to do? I want to increase the memory of my ESP8266 (or ESP32) to at least 28MB using as few space as possible.
I saw a video where somebody replaced the memory chip (hardware) on the ESP8266 to get 4MB instead of 1MB. Now, I have a ESP-12F with 4MB and thought of expanding the memory to 32MB, because I don't want to use a microSD card. Therefore, I bought a WINBOND 25Q256FV (32MB; unfortunately with SOIC 300-MIL pin configuration, which should work as well, but I will buy the 8-pin version later). The problem is that esptool only supports flash memory up to 16MB. So: Is there a solution to increase the memory of an ESP to 32MB? I don't want to use a SD card because the module would require to much extra space.
E. g.: Is it possible to use the six extra pins on the ESP-12F (and 12E) model? They have something to do with memory but I couldn't figure out how to use them in order to replace/expand the memory...
Thanks!
Edit: For solution see post 11.
First of all: What do I want to do? I want to increase the memory of my ESP8266 (or ESP32) to at least 28MB using as few space as possible.
I saw a video where somebody replaced the memory chip (hardware) on the ESP8266 to get 4MB instead of 1MB. Now, I have a ESP-12F with 4MB and thought of expanding the memory to 32MB, because I don't want to use a microSD card. Therefore, I bought a WINBOND 25Q256FV (32MB; unfortunately with SOIC 300-MIL pin configuration, which should work as well, but I will buy the 8-pin version later). The problem is that esptool only supports flash memory up to 16MB. So: Is there a solution to increase the memory of an ESP to 32MB? I don't want to use a SD card because the module would require to much extra space.
E. g.: Is it possible to use the six extra pins on the ESP-12F (and 12E) model? They have something to do with memory but I couldn't figure out how to use them in order to replace/expand the memory...
Thanks!
Edit: For solution see post 11.
Last edited by crizeo on Sat Oct 14, 2017 4:05 pm, edited 1 time in total.
Re: Memory upgrade: Expand flash to 32 MB
It gets worse. The esptool.py only supports up to 16MB, but MicroPython itself only supports up to 4MB. We are still waiting for support for the 16MB D1 Mini Pro boards. So even if you got that memory chip to work with ESP8266, MicroPython wouldn't use more than 4MB of it.
There is another idea: you can connect the memory chip over the user SPI, and use it as if it was an SD card — you would of course need to write a driver similar to that for the SD card, but that should be relatively easy, and it's done in Python.
There is another idea: you can connect the memory chip over the user SPI, and use it as if it was an SD card — you would of course need to write a driver similar to that for the SD card, but that should be relatively easy, and it's done in Python.
Re: Memory upgrade: Expand flash to 32 MB
Hm, thanks for your answer anyway! To explain my intention a bit more in detail: I have a btree database (~23 MB), which I want to access (only read, not write!). All the rest fits on the 4 MB flash memory.
Regarding the second part of your answer: You are talking about the additional six pins on ESP-12 (GPIO 6-11)? I can't imagine that it is easy to write a driver for this purpose
Could this driver help?
Regarding the second part of your answer: You are talking about the additional six pins on ESP-12 (GPIO 6-11)? I can't imagine that it is easy to write a driver for this purpose

Re: Memory upgrade: Expand flash to 32 MB
SPI would require 3 GPIO ports (MISO, MOSI and CS). And a blueprint of the driver is flashbdev.py in the esp8266/modules directory of the repository. https://github.com/micropython/micropyt ... ashbdev.py.
Re: Memory upgrade: Expand flash to 32 MB
No, I mean the gpio12-15 pins of the "user" SPI, also known as HSPI, the gpio6-11 pins are the flash SPI, which is already being used by the flash built in on the module, and are not available from within MicroPython.crizeo wrote:Regarding the second part of your answer: You are talking about the additional six pins on ESP-12 (GPIO 6-11)?
Re: Memory upgrade: Expand flash to 32 MB
Hm, okay, thanks.. So I will probably have to stay with my SD card :/ Will try to solder it.
Re: Memory upgrade: Expand flash to 32 MB
If you are using a D1 Mini, there's a SD card shield wired up to the SPI pins:
https://www.aliexpress.com/store/produc ... 62865.html
https://wiki.wemos.cc/products:d1_mini_ ... ard_shield
D5 - GPIO14 - SCK
D6 - GPIO12 - MISO
D7 - GPIO13 - MOSI
D8 - GPIO15 - SS
https://www.aliexpress.com/store/produc ... 62865.html
https://wiki.wemos.cc/products:d1_mini_ ... ard_shield
D5 - GPIO14 - SCK
D6 - GPIO12 - MISO
D7 - GPIO13 - MOSI
D8 - GPIO15 - SS
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Memory upgrade: Expand flash to 32 MB
@crizeo There is a MicroPython driver for a Winbond W25Q32 chip here https://github.com/peterhinch/micropyth ... r/flash.py which might be adapted for your Winbond W25Q256FV chip. It uses buffering to minimise wear on frequently updated sectors - a read-only version for the ESP8266 could be radically simplified.
Last edited by pythoncoder on Tue Oct 10, 2017 8:28 am, edited 1 time in total.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Memory upgrade: Expand flash to 32 MB
Hi Peter, the link you gave does not work. For some reason it includes the closing bracket. This one works:
https://github.com/peterhinch/micropyth ... r/flash.py
https://github.com/peterhinch/micropyth ... r/flash.py
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Memory upgrade: Expand flash to 32 MB
Thanks, Robert. Now fixed.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.