Page 1 of 1

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

Posted: Thu Jan 09, 2020 9:26 am
by lolomarx
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

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

Posted: Thu Jan 09, 2020 12:49 pm
by jimmo
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.

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

Posted: Fri Jan 10, 2020 1:06 am
by lolomarx
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

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

Posted: Fri Jan 10, 2020 1:09 am
by lolomarx
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...

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

Posted: Fri Jan 10, 2020 2:29 am
by jimmo
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.

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

Posted: Fri Jan 10, 2020 5:42 am
by lolomarx
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.

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

Posted: Fri Jan 24, 2020 2:23 pm
by BjHave
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.