You matched the platformio.ini
perfectly with the Arduino IDE settings, so there shouldn’t be a fault in there. A remaning thing would be the Arduino-ESP32 core version (as seen in Tools → Boards → Board Manager → esp32). If you use 2.0.4 core in the Arduino IDE, use
platform = https://github.com/platformio/platform-espressif32.git
in the platformio.ini
to also use that in PlatformIO.
It says the flash is only 2MByte instead of 4Mbyte? Please use
board_build.partitions = bare_minimum_2MB.csv
in the platformio.ini
instead.
The same result.
Processing esp32-c3-devkitm-1 (platform: GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO; board: esp32-c3-devkitm-1; framework: arduino)
Verbose mode can be enabled via -v, --verbose
option
CONFIGURATION: Redirecting...
PLATFORM: Espressif 32 (5.0.0+sha.e66e12c) > Espressif ESP32-C3-DevKitM-1
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20004.0 (2.0.4)
- tool-esptoolpy @ 1.30300.0 (3.3.0)
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 32 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Compiling .pio\build\esp32-c3-devkitm-1\src\main.cpp.o
Generating partitions .pio\build\esp32-c3-devkitm-1\partitions.bin
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\FirmwareMSC.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\HWCDC.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\IPv6Address.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\MD5Builder.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\Print.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\StreamString.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\Tone.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\USB.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\USBCDC.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\USBMSC.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\WString.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\base64.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-cpu.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-dac.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-gpio.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-i2c-slave.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-i2c.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-ledc.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-matrix.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-misc.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-psram.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-rgb-led.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-rmt.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-sigmadelta.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-spi.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-time.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-timer.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-tinyusb.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-touch.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\esp32-hal-uart.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\firmware_msc_fat.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\libb64\cdecode.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\libb64\cencode.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\main.cpp.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\stdlib_noniso.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\wiring_pulse.c.o
Compiling .pio\build\esp32-c3-devkitm-1\FrameworkArduino\wiring_shift.c.o
Archiving .pio\build\esp32-c3-devkitm-1\libFrameworkArduino.a
Linking .pio\build\esp32-c3-devkitm-1\firmware.elf
Retrieving maximum program size .pio\build\esp32-c3-devkitm-1\firmware.elf
Checking size .pio\build\esp32-c3-devkitm-1\firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [ ] 3.0% (used 9988 bytes from 327680 bytes)
Flash: [= ] 11.6% (used 225056 bytes from 1945600 bytes)
Building .pio\build\esp32-c3-devkitm-1\firmware.bin
esptool.py v3.3
Creating esp32c3 image…
Merged 2 ELF sections
Successfully created esp32c3 image.
It really shouldn’t have 4MB as a flash size anymore if platform-espressif32/main.py at develop · platformio/platform-espressif32 · GitHub respects the platformio.ini
.
Can you please do the following: In your project, create a folder called boards
. In it, create the file esp-c3-32s-kit-2m.json
with the content
{
"build": {
"arduino":{
"ldscript": "esp32c3_out.ld",
"partitions": "bare_minimum_2MB.csv"
},
"core": "esp32",
"f_cpu": "160000000L",
"f_flash": "80000000L",
"flash_mode": "dio",
"extra_flags": "-DARDUINO_ESP32C3_DEV",
"mcu": "esp32c3",
"variant": "esp32c3"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32c3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "ESP-C3-32S-KIT-2M",
"upload": {
"flash_size": "2MB",
"maximum_ram_size": 327680,
"maximum_size": 2097152,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html",
"vendor": "Espressif"
}
then, use just the platformio.ini
:
[env:esp-c3-32s-kit-2m]
platform = https://github.com/platformio/platform-espressif32.git
board = esp-c3-32s-kit-2m
framework = arduino
upload_port = COM5
don’t forget to select this new environment in the project environment switcher after the platformio.ini
was saved.
Then somehow it didn’t accept the platformio.ini
modifications for the flash_size. Good that it’s working now. I’ll see if I can reproduce this an file an issue at Issues · platformio/platform-espressif32 · GitHub, this should be solved.