ESP-03 is the smallest ESP8266 board that have on board antenna, it can fit for many projects that have limited space, such as wearable or portable device. The only limitation is it storage, it only have 4 M bit (512 KB) flash memory. ESP8266 should support 128 M bit of flash chip but it only can found the ESP board with 32 M bit in the market.
This instructables show how to upgrade ESP-03 flash memory to 128 M bit (16 MB).
Step 1: Why Upgrade Flash Size? Why ESP-03?
ESP-03 only have 4 M bit (512 KB) flash, there are many limitation:
- the latest firmware cannot fit in 512 KB flash
- limited size for data logging
- ESP8266 not yet have an image (jpeg/png) decode library, uncompressed bitmap is space hungry for developing GUI related project
- unicode font support, one unicode font type is around 4 MB in size, if you want your project fully builtin support unicode font display require > 4 MB ROM space
- according to ESP8266Ex data sheet, it is able to support 128 M bit flash. But there are no 128 M bit ESP board in the market, its time to proof it
ESP-03 is the smallest board that have on board antenna and also it have no metal case cover the flash chip, so it is easier for the flash chip upgrade.
Step 2: Preparation
- an ESP-03 board
- a Winbond 25Q128FV flash chip
Step 3: De-solder Old Flash Chip
- apply some soldering flux to the old flash chip pin
- use solder iron melt one side pins' solder at the same time
- use clip apply mild force to pull up the melt pin a little
- melt other side pins' solder for remove the flash chip
Step 4: Apply New Solder to the ESP Board
After remove the old flash chip, there are some solder remain on the board. But it is not good enough for solder the new flash chip. Apply some solder on each pin carefully.
Step 5: Prepare New Flash Chip Pin
Winbond 25Q128FV flash chip is a little bit wider than the old flash chip. It is require bend the pin a little bit to fit in the board.
Step 6: Solder New Flash Chip
- solder one side pins at the same time
- check no pin melt together
- solder another side
- double check no pin melt together
Step 7: Prepare Firmware
There are many firmware for ESP8266, but I cannot found one support 128 M bit flash chip correctly:
- esp8266/Arduino: you can treat it as normal 32 M bit flash chip and access the data correctly, but it fail to use more space
- nodemcu have some code support 128 M bit and autosize facility, but it still have some code not yet handle the flash size over 32 M bit, so it become infinite loop for resize and reboot
I am using nodemcu in previous projects, so I try to fix it first. Here is the branch for my patch:
If you not familiar with docker, I have prebuilt 2 firmwares (attached files) for basic testing:
nodemcu_integer_master_128m.bin: default build
- nodemcu_integer_master_128m_modules.bin: CJSON, ENDUSER_SETUP, HTTP, RTCTIME, SNTP, WS2812
If you familiar with docker, here are the summary for building your firmware:
(It require around 5 minutes to build depends on the processing power)
git clone https://github.com/moononournation/nodemcu-firmware.git
docker run --rm -ti -v `pwd`:/opt/nodemcu-firmware marcelstoer/nodemcu-build
Step 8: Upload Firmware to the New Flash Chip
- Connect the ESP-03 board to the ESP-03 testing board
- hold program button
- press reset button
- release program button
- Run the follow command to upload the firmware:
("-ff 20m -fm dout" should be the slowest flash speed for safety test, you may try to fine tune it after preliminary test success)
cd [your path to nodemcu-firmware] tools/esptool.py --port /dev/cu.wchusbserial620 write_flash -ff 20m -fm dout -fs 128m 0x0 bin/[your firmware name]
Step 9: Test the Flash
After upload the firmware, open ESPlorer to connect to the ESP-03 board and press the reset button. you can see the nodemcu init message. The SPIFFS allocated around 15 MB and should be ready for write files to it.
For safety check, press the format button on the right hand side. It takes around 10 minutes to finish.
After format complete, press FS Info button, it show around 15 MB available. Great!
Step 10: Happy Coding!
Now I have put the code in my previous project on it and runs well.
It's time to unleash the power of the ESP8266!!