Skip to content

OyczE/WiFiP0rN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Arduino on ESP32-C5 (ECO2) Boot Issue

This document describes attempts to run Arduino Core on an ESP32-C5 ECO2 module, purchased from the manufacturer at AliExpress. The document covers encountered issues, current workarounds, and insights into problems with the default Arduino Core bootloader.


Issue Overview

Compilation and flashing using Arduino Core ESP32 (version 3.3.0-alpha1) for the ESP32-C5 succeed but result in a boot loop. Analysis suggests a compatibility issue between the Arduino Core precompiled bootloader and the ESP32-C5 ECO2 chip.

Symptoms

After successful compilation and flashing, the module repeatedly resets with the following error:

ESP-ROM:esp32c5-eco2-20250121
Build:Jan 21 2025
rst:0x8 (TG1_WDT_HPSYS),boot:0x18 (SPI_FAST_FLASH_BOOT)
Core0 Saved PC:0x408064e0
SPI mode:DIO, clock div:1
load:0x40855ab0,len:0x1274
load:0x4084bfa0,len:0xa88
load:0x4084e9a0,len:0x3004
entry 0x4084bfa0

This indicates a hardware watchdog reset (TG1_WDT).


Flashing Modifications

To flash Arduino sketches on the ESP32-C5, modifications to Arduino Core's flashing configuration are required.

Platform.local.txt Modification

Create or edit a file named platform.local.txt in:

C:\Users\Pred\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0-alpha1
# Match ESP-IDF flashing command
tools.esptool_py.upload.pattern="{path}/{cmd}" --chip {build.mcu} --port "{serial.port}" --baud 460800 --before default_reset --after hard_reset --no-stub write_flash -z --flash_mode dio --flash_freq 80m --flash_size 8MB 0x2000 "{build.path}/{build.project_name}.bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" 0x10000 "{build.path}/{build.project_name}.bin"

# Disable boot_app0.bin generation
recipe.hooks.objcopy.postobjcopy.1.pattern=

Main changes:

  • Added --no-stub parameter.
  • Removed unnecessary boot_app0.bin.

Custom Partition Table (partitions.csv)

Use this minimal partition table for the ESP32-C5 (8 MB flash):

# ESP32-C5 8MB Partition Table (minimal)
nvs,data,nvs,0x9000,24K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,2M,
core_dump,data,coredump,0x210000,64K,

Bootloader Investigation

Comparing default Arduino Core bootloader with a manually generated ESP-IDF bootloader reveals significant differences:

Default Arduino Core Bootloader (bootloop)

ESP-ROM:esp32c5-eco2-20250121
Build:Jan 21 2025
rst:0x8 (TG1_WDT_HPSYS),boot:0x18 (SPI_FAST_FLASH_BOOT)
Core0 Saved PC:0x408064e0
SPI mode:DIO, clock div:1
load:0x40855ab0,len:0x1274
load:0x4084bfa0,len:0xa88
load:0x4084e9a0,len:0x3004
entry 0x4084bfa0

ESP-IDF Bootloader (working, but manual replacement needed)

Manually replacing Arduino Core bootloader with one generated via ESP-IDF (idf.py bootloader) results in successful boot:

I (66) boot: ## Label            Usage          Type ST Offset   Length
I (74) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (81) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (89) boot:  2 factory          factory app      00 00 00010000 00200000
I (96) boot:  3 core_dump        Unknown data     01 03 00210000 00010000
I (104) boot: End of partition table
I (108) esp_image: segment 0: paddr=00010020 vaddr=42020020 size=0ecfch (60668) map
I (126) esp_image: segment 1: paddr=0001ed24 vaddr=40800000 size=012f4h (4852) load
I (128) esp_image: segment 2: paddr=00020020 vaddr=42000020 size=1f3c8h (127944) map
I (153) esp_image: segment 3: paddr=0003f3f0 vaddr=408012f4 size=0a09ch (41116) load
I (161) esp_image: segment 4: paddr=00049494 vaddr=4080b400 size=01a44h (6724) load
I (166) boot: Loaded app from partition at offset 0x10000
I (166) boot: Disabling RNG early entropy source...

This indicates the issue is the default Arduino Core precompiled bootloader, which is currently not compatible with ESP32-C5 ECO2.


Proposed Solutions

Short-term

  • Generate the bootloader manually via ESP-IDF and replace the bootloader binary in Arduino IDE temporary build folder or Arduino Core SDK directory.

Long-term

  • Officially update the Arduino Core ESP32-C5 bootloader binary to ensure compatibility with ESP32-C5 ECO2.

Environment


Next Steps

A GitHub issue has been opened to address this incompatibility officially. Further updates will be provided upon resolution.


Manual Override Paths (for advanced users)

If you want to manually override the default bootloader or sdkconfig used by Arduino Core for ESP32-C5, you can do so by replacing the following files:

🔧 Bootloader:

Replace the bootloader binary here:

C:\Users\%username%\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-master-d930a386-v1\esp32c5\bin

Example file to replace: bootloader_dio_80m.bin (if present)

🧩 sdkconfig:

Override or edit the default sdkconfig here:

C:\Users\%username%\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-master-d930a386-v1\esp32c5

Proper DevBoard 1.2 PinOut Mapping

|  ESP32 ChipL | DEV Board    |  ESP32 ChipR |DEV Board         |
|--------------|--------------|--------------|------------------|
| 1  GND       |  GND PinL 15 | 28  GND      | GND PinR 1 12 15 |
| 2  3V3       |  3v3 PinL 1  | 27  IO26     | IO26 PinL 12     |
| 3  EN        |  RST PinL 2  | 26  IO25     | IO25 PinL 13     |
| 4  IO2       |  IO2 PinL 3  | 25  TX0      | TX PinR 2        |
| 5  IO3       |  IO3 PinL 4  | 24  RX0      | RX PinR 3        |
| 6  IO0       |  IO4 PinL 5  | 23  IO24     | IO24 PinR 4      |
| 7  IO1       |  IO5 PinL 6  | 22  NC       | NC               |
| 8  IO6       |  IO0 PinL 7  | 21  IO23     | IO23 PinR 5      |
| 9  IO7       |  IO1 PinL 8  | 20  NC       | NC               | 
| 10 IO8       |  IO27 PinL 9 | 19  NC/IO15  | NC/IO15 PinR 6   |
| 11 IO9       |  IO6 PinL 10 | 18  IO27     | IO10 PinR 7      |
| 12 IO10      |  IO7 PinL 11 | 17  IO4      | IO9 PinR 8       |
| 13 IO13      |  IO13 PinR 14| 16  IO5      | IO8 PinR 9       |
| 14 IO14      |  IO14 PinR 13| 15  IO28     | IO28 PinR 11     |

⚠️ Note: These files may be reset during board package updates. Back up your modifications if needed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages