How to get the full capacity of an 8MB or 16MB flash chip?
Posted: Tue Feb 09, 2021 4:11 pm
I could use some help with accessing the flash memory on my esp32 boards.
I have a bunch of factory expressif ESP32-DEVKITC-VE/VIE WROVER boardlets with 4 MB RAM and 8MB. I even could lay my hands on promising Chinese esp32 boards with 4 MB of RAM, 16 MB of flash and a CD slot thrown in. All in the hope of having more flash than the 1.89 MB that came with the DOIT boards I started with. I use them all with Micropython, because that’s what I know. However, I can’t get to the extra flash memory.
When I flash the boards with the latest GENERIC-SPIRAM firmware provided by https://micropython.org/download/esp32/, I get (nearly) the full 4 MB of RAM, but flash memory is reported as 1.89 MB, and not as close to 8 MB on the WROVER boards, or 16 MB on the latest Chinese imports. So, off to recompiling the firmware.
According to the recipes on the web, once the toolchain is set up, the job is as easy as adjusting the last line of partitions.csv and a make.
So, I make partitions.csv read like this for the 8MB flash chip:
I compile, flash, boot, and I get:
So apparently, someone is thinking I only have a 4MB flash chip. Alright, lets humor whoever does the thinking and adjust the last line to:
Recompile, flash, and I get:
Really?
To make a long story (and many recompiles) short, the only successful last line in partitions.csv is
It yields a puny 2.43 MB of flash memory. If I go to
the board crashes again on reboot, saying that the requested 0x280000 exceed the (bogus) 0x400000 delivered by a flash chip rated at 8M. Of course, the results with the 16MB board are the same, only more disappointing.
Apparently, things are not as simple as changing the last line of partitions.csv.
Does anyone have an idea how to
- Recognize the full size of the flash chip?
- Hand the full amount of memory to the file system?
Thank you!
I have a bunch of factory expressif ESP32-DEVKITC-VE/VIE WROVER boardlets with 4 MB RAM and 8MB. I even could lay my hands on promising Chinese esp32 boards with 4 MB of RAM, 16 MB of flash and a CD slot thrown in. All in the hope of having more flash than the 1.89 MB that came with the DOIT boards I started with. I use them all with Micropython, because that’s what I know. However, I can’t get to the extra flash memory.
When I flash the boards with the latest GENERIC-SPIRAM firmware provided by https://micropython.org/download/esp32/, I get (nearly) the full 4 MB of RAM, but flash memory is reported as 1.89 MB, and not as close to 8 MB on the WROVER boards, or 16 MB on the latest Chinese imports. So, off to recompiling the firmware.
According to the recipes on the web, once the toolchain is set up, the job is as easy as adjusting the last line of partitions.csv and a make.
So, I make partitions.csv read like this for the 8MB flash chip:
Code: Select all
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x180000,
vfs, data, fat, 0x200000, 0x600000,
Code: Select all
rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:5048
load:0x40078000,len:11608
load:0x40080400,len:6120
entry 0x400806bc
;31mE (65) flash_parts: partition 3 invalid - offset 0x200000 size 0x600000 exceeds flash chip size 0x400000m
;31mE (66) boot: Failed to verify partition table
;31mE (69) boot: load partition table error!
Code: Select all
vfs, data, fat, 0x200000, 0x400000,
Code: Select all
partition 3 invalid - offset 0x200000 size 0x400000 exceeds flash chip size 0x400000
To make a long story (and many recompiles) short, the only successful last line in partitions.csv is
Code: Select all
vfs, data, fat, 0x190000, 0x270000
Code: Select all
vfs, data, fat, 0x190000, 0x280000
Apparently, things are not as simple as changing the last line of partitions.csv.
Does anyone have an idea how to
- Recognize the full size of the flash chip?
- Hand the full amount of memory to the file system?
Thank you!