ESP32¶
- Comparison
- Selector: https://products.espressif.com/#/product-selector?filter={%22Series%22:[%22ESP32-C3(including%20ESP8685)%22,%22ESP8266%22,%22ESP32%22],%22Antenna%22:[%22Antenna%20Connector%22]}
-
Series: https://products.espressif.com/api/user/file/Espressif_SoC_Product_Portfolio.pdf
| Feature | ESP32 (original, e.g. ESP32-D0WD) | ESP32-C3 |
|---|---|---|
| Release year | 2016 | 2020 |
| CPU architecture | Xtensa LX6 | RISC-V RV32IMC (open-source ISA) |
| Cores | Dual-core (single-core variants exist) | Single-core |
| Max clock | 240 MHz | 160 MHz |
| Floating-Point Unit | Yes (in Xtensa LX6) | No hardware FPU |
| Bluetooth | Classic BT 4.2 BR/EDR + BLE | BLE 5.0 only (no Classic, no audio) |
| SRAM | 520 KB | 400 KB (16 KB used for cache) |
| ROM | 448 KB | 384 KB |
| RTC SRAM | 16 KB | 8 KB |
| External PSRAM support | Yes (up to 8 MB) | No |
| Integrated flash | 0 / 2 / 4 MB (variant dependent) | 0 / 4 MB (some modules 8 MB) |
| Package | QFN48 (5×5 / 6×6 mm) | QFN32 (5×5 mm) |
| GPIO (max) | 34 | 22 (some modules expose 15–16) |
| ADC | 2× 12-bit, up to 18 channels | 2× 12-bit SAR, up to 6 channels |
| DAC | 2× 8-bit | None |
| Touch sensor | 10 channels | None |
| Hall sensor | Yes | None |
| UART | 3 | 2 |
| SPI | 4 | 3 |
| I2C | 2 | 1 |
| I2S | 2 | 1 |
| LED PWM | 16 channels | 6 channels |
| MCPWM | 2 (6 outputs) | None |
| RMT | 8 channels | 2 TX + 2 RX channels |
| USB | None (needs external USB-UART) | Full-speed USB Serial/JTAG controller |
| JTAG debug | External JTAG only | USB Serial/JTAG built-in |
| TWAI / CAN | 1 | 1 |
| Ethernet MAC | Yes | No |
| SDIO host / slave | Yes / Yes / ~20 MB/s (4-bit SDIO) | No / No / SD card via SPI ~1 MB/s |
platformio¶
https://docs.platformio.org/en/latest/tutorials/index.html
pio: https://docs.platformio.org/en/latest/core/userguide/index.html - run: https://docs.platformio.org/en/latest/core/userguide/cmd_run.html#examples
ESPHome¶
- pair to remote build
- build on HAOS : /config/apps/
- build on local Desktop WebUI : https://esphome.io/install/
- C:\esphb
https://esphome.io/components/esp32/#configuration-variables - flash_mode : wrong value will cause fail to boot - qio, qout, dio, dout or opi (octal flash chips only)
esptool¶
uv pip install esptool # D:\github\scripts\elec\
esptool --chip esp32c3 --port COM4 chip-id
esptool.py v4.8.1
Serial port COM4
Connecting....
Chip is ESP32-C3 (QFN32) (revision v0.4)
Features: WiFi, BLE, Embedded Flash 4MB (XMC)
Crystal is 40MHz
MAC: dc:06:75:aa:6e:e8
Uploading stub...
Running stub...
Stub running...
Warning: ESP32-C3 has no Chip ID. Reading MAC instead.
MAC: dc:06:75:aa:6e:e8
Hard resetting via RTS pin...
esptool --chip esp32c3 --port COM4 flash_id
Manufacturer: 20
Device: 4016
Detected flash size: 4MB
esptool --chip esp32c3 --port COM4 erase_flash
Erasing flash (this may take a while)...
Chip erase completed successfully in 17.0s
esptool.py --port COM3 --baud 460800 read_flash 0x00000 0x400000 firmware_backup.bin # 0x400000 4MB / 0x1000000 16MB
D:\天问Block>pyboard\esptool.exe --chip esp32c3 --baud 1500000 --port COM4 write_flash -z --erase-all 0x00 esp32c3.bin
Compressed 4194304 bytes to 1491998...
Wrote 4194304 bytes (1491998 compressed) at 0x00000000 in 52.4 seconds (effective 640.7 kbit/s)...
Hash of data verified.