ESP32-C3

From Wildsong
Jump to navigationJump to search

I am interested in RISC V and this seemed like a good way to get my hands on one. (Or 5)

I have 5 AI-Thinker ESP-C3-12F chips and a DOITING programmer thingie that I can pop them into. It's like this one, I don't remember where I bought it. It breaks out the pins and has a ESP-01S 2x4 pin socket and gives me a USB connection.

Single core processor, 4MB flash, 400K ram


Development options

Suggestions https://github.com/laris/rust-embedded-study-esp32-c3

Rust and Tock https://github.com/tock/tock Looks interesting but clearly it's early days for this one. I will get my feet under me first.

Micropython https://micropython.org/download/esp32c3-usb/ This is the obvious starting point for me because it's Python.

ESP-IDF This is probably the best option for serious work for example sticking a C3 in a light switch.

Arduino https://github.com/espressif/arduino-esp32 The Arduino option is the most practical but dull. :-)

Micropython

Download esptool.py from [email protected]:espressif/esptool.git

Plug in the board and figure out what port it shows up on.

Mac OS

On the Mac, where it does not work.

ls /dev/tty.*
/dev/tty.Bluetooth-Incoming-Port	/dev/tty.usbserial-0001
python esptool.py --chip esp32c3 --port /dev/tty.usbserial-0001 erase_flash

I tried on the Mac using a direct cable, and also through a USB3 hub with external power supply to give it more power.

Windows

On Windows, after installing the CP2102 driver from Silicon Labs, and the pyserial module,

conda activate esphome
conda install pyserial
python esptool.py --chip esp32c3 --port com4 erase_flash

Same error, strike 2!

A fatal error occurred: Failed to connect to ESP32-C3: Serial data stream stopped: Possible serial noise or corruption.

Linux

Just plug it in and check the last few lines of 'dmesg'. It showed up on /dev/ttyUSB2. If you get "permission denied" make sure you are a member of the "dialout" group. (How quaint!)

[983962.208723] usb 1-3: Product: CP2102 USB to UART Bridge Controller
[983962.208727] usb 1-3: Manufacturer: Silicon Labs
[983962.208730] usb 1-3: SerialNumber: 0001
[983962.213333] cp210x 1-3:1.0: cp210x converter detected
[983962.215605] usb 1-3: cp210x converter now attached to ttyUSB2
conda activate esphome
conda install pyserial
python esptool.py --chip esp32c3 --port /dev/ttyUSB2 --baud 115200 erase_flash

...and STRIKE 3! It works equally badly on all three operating systems.

This widget is looking pretty hopeless to me so far.

Arduino

Set up the environment, follow these instructions. https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/

Set the board to "ESP32C3 Dev Module".

Set comm port to com4 (or whatever your board installed at from the Micropython failure above.)

I created a "BasicOTA" sample, and compiled it.

I try the upload option and see it's using esptool, that can't be good. I set speed to 115200. I get the same error as in running esptool myself. At least it's all consistent.

Maybe this programmer is just a write-off for programming ESP32C3 chips, and it's a whiz at ESP12F?? Do I have one of them???

Coolest feature of this chip?

I2S

Compatible with old Esp12F?

6 channels of PWM

BLE 5.0?

RTC + 4 different power modes

Temperature sensor