esp32 板已经是16M的flash , 分区表用到8.1 M 理论是没问题的。
Partitions defined in 'mypartition.csv' occupy 8.1MB of flash (8454144 bytes) which does not fit in configured flash size 4MB. Change the flash size in menuconfig under the 'Serial Flasher Config' menu.
然而,使用 pio run -t menconfig ,配置 flash 也为16Mb 无效!
理解:编绎时没接入板,与板的flash大小没关。修改配置无效,是因为编绎程序首先认为板是默认4M大小的。而pio run -t menconfig 只是修改配置项,只能在编绎成功时才能将配置一起并入目标码,可能这个编译顺序错误或提示错误。所以就要了解从哪里读到的是4M大小。plaftfromio 新建项目时,要选择板,其实每种板子都有它的配置文件。plaftfromio 先读取的是配置文件。由与是选的板子是esp32 dev module ,所以 配置文件是 esp32_dev.json。
解决: 修改 板的配置文件,这里是 esp32_dev.json.windows 一般位于{userProfile}\.platformio\platforms\espressif32\boards 目录下。环境重装时记得这里要改过来,否则项目又会报错~。
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"require_upload_port": true,
"speed": 460800
},