How to config 2M flash for a new ESP32 board?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
lolomarx
Posts: 15
Joined: Wed Jan 08, 2020 4:03 am

How to config 2M flash for a new ESP32 board?

Post by lolomarx » Thu Jan 09, 2020 9:26 am

I am follow the step from https://docs.espressif.com/projects/esp ... onfig.html
Perform below command on esp-idf folder :

Code: Select all

idf.py menuconfig
And then meet problem :

Code: Select all

Unknow CMake command ‘idf_build_set_property’ 
And find no answer by google also.

I flash the esp32-idf3-20191220-v1.12.bin to a 4M flash esp32 board ,and it work well .
And can't boot when i flash esp32-idf3-20191220-v1.12.bin to a 2M flash esp32 board.

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:5012
load:0x40078000,len:10404
ho 0 tail 12 room 4
load:0x40080400,len:5680
entry 0x400806bc
E (540) esp_image: Image length 1339808 doesn't fit in partition length 1114112
;31mE (541) boot: Factory app partition is not bootable
E (543) boot: No bootable app partitions in the partition table

User avatar
jimmo
Posts: 1440
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: How to config 2M flash for a new ESP32 board?

Post by jimmo » Thu Jan 09, 2020 12:49 pm

Have a look at the DW2D board configuration -- ports/esp32/board/GENERIC_D2WD and see how it uses partitions-2MiB.csv instead of the regular partition table.

Note that "idf.py menuconfig" isn't part of building MicroPython as it doesn't use the IDF build system.

User avatar
lolomarx
Posts: 15
Joined: Wed Jan 08, 2020 4:03 am

Re: How to config 2M flash for a new ESP32 board?

Post by lolomarx » Fri Jan 10, 2020 1:06 am

I had try to flash /build-GENERIC_D2WD/firmware.bin to my 2M esp32 board.

It can flash and verified ok, but still boot on fail.

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:5012
load:0x40078000,len:10404
ho 0 tail 12 room 4
load:0x40080400,len:5680
entry 0x400806bc
E (69) flash_parts: partition 3 invalid - offset 0x200000 size 0x200000 exceeds flash chip size 0x200000
E (69) boot: Failed to verify partition table
E (73) boot: load partition table error!
ets Jun  8 2016 00:22:57

User avatar
lolomarx
Posts: 15
Joined: Wed Jan 08, 2020 4:03 am

Re: How to config 2M flash for a new ESP32 board?

Post by lolomarx » Fri Jan 10, 2020 1:09 am

Here are the code i perform:

Code: Select all

sudo /home/luke/esp/esp-idf-v3.3.1/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 2000000 write_flash -z 0xf000 build-GENERIC_D2WD/firmware.bin
And the result here:

Code: Select all

esptool.py v2.8-dev
Serial port /dev/ttyUSB0
Connecting.....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 24:0a:c4:af:88:ec
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 2000000
Changed.
Configuring flash size...
Auto-detected Flash size: 2MB
Compressed 1401248 bytes to 890494...
Wrote 1401248 bytes (890494 compressed) at 0x0000f000 in 12.1 seconds (effective 929.0 kbit/s)...
Hash of data verified.


Leaving...
Hard resetting via RTS pin...

User avatar
jimmo
Posts: 1440
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: How to config 2M flash for a new ESP32 board?

Post by jimmo » Fri Jan 10, 2020 2:29 am

Is your chip actually a D2WD though? (i.e. on-chip flash rather than the external spiflash).

I was more just giving example of a config that uses a 2MiB partition table.

You'll likely need to make a board config based on GENERIC with the partition-2MiB.csv file.

User avatar
lolomarx
Posts: 15
Joined: Wed Jan 08, 2020 4:03 am

Re: How to config 2M flash for a new ESP32 board?

Post by lolomarx » Fri Jan 10, 2020 5:42 am

The chip on my board is ESP32 D0WDQ6 and link to a external 2M flash

I had try it with partition-2MiB.csv , but fail.

BjHave
Posts: 5
Joined: Fri Aug 09, 2019 12:32 pm

Re: How to config 2M flash for a new ESP32 board?

Post by BjHave » Fri Jan 24, 2020 2:23 pm

Then you have to create your own board config which uses a partition.csv which matches your needs, because the D2WD board config assumes that the 2MB are embedded.

Post Reply