ESP32-C3

From Wildsong
(Redirected from ESP-C3)
Jump to navigationJump to search

ESP-C3-12F

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

I have 5 AI-Thinker ESP-C3-12F (model C3FN4 = 4MB flash) and a DOITING programmer thingie that I can pop them into. It's like this one, I don't remember where I bought it. Probably Amazon. It came with 5 ESP12F's. It breaks out the pins and has a ESP-01S 2x4 pin socket and gives me a USB connection.

I think it fails with the C3. See "Using programmer" below.

Single core processor, 4MB flash, 400K ram


M5Stack C3U Stamp

After getting the 12F chips, I got a few of these. I think I have 2?

They are programmable over a USB cable. Since getting them I have not touched the 12F's.

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. :-)

Using programmer

I think this page is probably more accurate than the rest of this section and I will have to cobble something together. https://www.esp32.com/viewtopic.php?t=24511

"I couldn't find any docs either but it's pretty basic. Plug the esp into the programmer, plug the programmer into your computer, then hold down the flash button and press/release the reset button then you can remove your finger from the flash button, this combo of buttons will put the esp into flash mode. You then use your IDE of choice to upload code to the esp By Amazon Customer on December 9, 2021"

That's wrong, it only works that way with an ESP8266 based ESP-12F.

The ESP32-C3-12F needs three pins conditioned, I think 2 pulled high and one low? Observe here https://www.esp32.com/viewtopic.php?f=12&p=87403

Or if you prefer video, https://www.youtube.com/watch?v=YjKEpQDj8S0

Micropython

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

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

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