Install esptool on Raspberry Pi OS and flash MicroPython/CircuitPython firmware on NodeMCU ESP-C3-32S-Kit

Updated@2024-01-28:

In pre-bookworm Raspberry Pi OS, esptool can be install esptool directly, system-wide, using pip. This is no longer the case in the new Raspberry Pi OS (bookworm).
From bookworm onwards, when using pip, packages must be installed into a Python virtual environment.

Read: Install esptool inside Virtual Environment, on Raspberry Pi 5 running 64-bit Raspberry Pi OS (bookworm).


This video show how to install esptool on Raspberry Pi OS 32 bit buster and flash MicroPython v1.19.1 firmware on NodeMCU ESP-C3-32S-Kit. (and also Espressif ESP32-S3-DevKitC-1)



Install esptool.py using pip3

$ sudo pip3 install esptool


To identify the USB connected to ESP-C3-32S-Kit

before connected, clear dmesg with command
$ sudo dmesg -c

after connected, run dmesg again
$ dmesg

With esptool.py installed, you can check ESP chip with:
$ esptool.py --chip auto --port /dev/ttyUSB0 chip_id
$ esptool.py --chip auto --port /dev/ttyUSB0 flash_id

To updeate esptool
$ pip3 install esptool --upgrade

Download MicroPython firmware

visit https://micropython.org/download/

scroll down to click link of "esp32c3"

Click on "ESP32-C3 Espressif"

Download the firmware in bin format.

Flash firmware

You can erase the entire flash using:

$ esptool.py --chip esp32c3 --port /dev/ttyUSB0 erase_flash

Program the firmware starting at address 0x0:

$ esptool.py --chip esp32c3 --port /dev/ttyUSB0 --baud 460800 write_flash -z 0x0 <firmware.bin>


CircuitPython

To download CircuitPython Firmware, visit https://circuitpython.org/downloads, search and select "ESP-C3-32S by Ai-Thinker", download .BIN.


The esptool commands listed above can be used to flash CircuitPython Firmware also.


CircuitPython run on NodeMCU ESP-C3-32S-Kit



More exercises

for ESP32 Series/MicroPython:
Implement class to do repeat task in fix-time delay, without blocking.
MicroPython/NodeMCU ESP-C3-32S-Kit control onboard LEDs.
Run tasks concurrently, base on time ticks, uasyncio and _thread.
MicroPython/ESP32-C3 + 1.8" 128x160 TFT ST7735 SPI, using boochow/MicroPython-ST7735 library.

for ESP32 Series/CircuitPython:
CircuitPython/ESP32-C3 + 1.8" 128x160 TFT ST7735 SPI.




Comments

Popular posts from this blog

480x320 TFT/ILI9488 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library

my dev.tools - FNIRSI 2C23T 3-in-1 Dual Channel Oscilloscope/Multimeter/Signal Generator