修改分区表
官方参考
在工程目录文件夹新建分区表,参考官方的写就行,我这里改成了8M的FLASH,所以新建的分区表为名字是 default_8MB.csv ,内容如下:
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x330000,
app1, app, ota_1, 0x340000,0x330000,
spiffs, data, spiffs, 0x670000,0x180000,
coredump, data, coredump,0x7F0000,0x10000,
配置文件
修改配置文件 一般在 {userProfile}.platformio\platforms\espressif32\boards,修改内容如下,可以直接修改源文件或这新建一个文件。
修改项目配置文件
同时还有修改 platformio.ini
[env:esp32dev]
platform = espressif32
board = esp32dev_8m
framework = arduino
board_build.partitions = default_8MB.csv
报错信息
在修改的过程中出现了报错,是因为检测到的FLASH大小为4MB我修改成8MB了,因为忘记换FLASH了。。。。。。。
rst:0xc (SW_CPU_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:0x3fff0030,len:1184
load:0x40078000,len:13232
load:0x40080400,len:3028
entry 0x400805e4
E (442) spi_flash: Detected size(4096k) smaller than the size in the binary image header(8192k). Probe failed.
assert failed: do_core_init startup.c:328 (flash_ret == ESP_OK)
Backtrace: 0x40083849:0x3ffe3ab0 0x4008c225:0x3ffe3ad0 0x4009172d:0x3ffe3af0 0x400f358e:0x3ffe3c20 0x40082f5d:0x3ffe3c50 0x40079306:0x3ffe3c90 |<-CORRUPTED
ELF file SHA256: 8fcdfcb04d10b949
E (464) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
Rebooting...
ets Jul 29 2019 12:21:46