Board configuration for ESP32-C3 2MB Version

I’m just about to test the the ESP32-C3 (2MB) devkit from Ai-Thinker,

[env:esp32c3]
platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
platform_packages = 
  toolchain-riscv-esp
  platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.0-rc1
  platformio/tool-esptoolpy @ ~1.30100
framework = arduino
board = esp32-c3-devkitm-1

but got this error related to flash size

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x142c
load:0x403ce000,len:0xbe8
load:0x403d0000,len:0x292c
entry 0x403ce000
I (30) boot: ESP-IDF v4.4-dev-2030-gd93887f9f-dirty 2nd stage bootloader
I (30) boot: compile time 01:17:11
I (30) boot: chip revision: 3
I (31) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (37) qio_mode: Enabling default flash chip QIO
I (41) boot.esp32c3: SPI Speed      : 80MHz
I (45) boot.esp32c3: SPI Mode       : QIO
I (49) boot.esp32c3: SPI Flash Size : 2MB
I (53) boot: Enabling RNG early entropy source...
E (57) flash_parts: partition 3 invalid - offset 0x150000 size 0x140000 exceeds flash chip size 0x200000
E (66) boot: Failed to verify partition table
E (70) boot: load partition table error!

I’ve notice that esp32-c3-devkitm-1 board is using 4MB flash size partition, and I need to change that to 2MB. How to do that? I’ve tried to simply change the upload.maximum_size value to 2097152 but not working. Do I need to change the partition offset too?

https://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables

1 Like

Ok, thank you. Now the board able to run the program. I’ll put the partition file here in case somebody needed it.

# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x6000,
phy_init, data, phy,     0xf000,  0x1000,
factory,  app,  factory, 0x10000, 0x1F0000,