Unable to Flash MicroPython on ESP32-C3
Hello,
I have built firmware.bin using the following commands with a small modification, at the last step while executing "make" command, it fails while compiling "usb_serial_jtag.c" because at the line it is expecting the value "USB_SERIAL_JTAG_INTR_SOF" instead of "ETS_USB_SERIAL_JTAG_INTR_SOURCE":
#!/bin/bash
export BUILD_DIR=$(pwd)
echo "--- CLONING MICROPYTHON ---"
git clone --depth 1 https://github.com/micropython/micropython.git
echo "--- CLONING ESP-IDF ---"
cd $BUILD_DIR/micropython/
git clone -b v4.3.2 --recursive https://github.com/espressif/esp-idf.git
echo "--- INSTALL ESP-IDF ---"
cd $BUILD_DIR/micropython/esp-idf
./install.sh
. ./export.sh
echo "--- MPY-CROSS ---"
cd $BUILD_DIR/micropython/mpy-cross
make
echo "--- ESP32 SUBMODULES ---"
cd $BUILD_DIR/micropython/ports/esp32
make submodules
echo "--- PATCH MAKEFILE ---"
cp $BUILD_DIR/micropython/ports/esp32/Makefile $BUILD_DIR/micropython/ports/esp32/MakefileOld
echo "BOARD = GENERIC_C3_USB" > $BUILD_DIR/micropython/ports/esp32/Makefile
cat $BUILD_DIR/micropython/ports/esp32/MakefileOld >> $BUILD_DIR/micropython/ports/esp32/Makefile
echo "--- MAKE ---"
make
The binary file "firmware.bin" is generated and it is written to ESP32-C3 successfully. However, while flashing it gives following error:
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xe (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0xf18
load:0x403ce000,len:0x6cc
load:0x403d0000,len:0x292c
entry 0x403ce000
And, if I try to write & flash binary from micropython site(https://micropython.org/download/esp32c3-usb/) it works without any issue. Please advise, what is wrong above?
Micropython won't boot on esp32 c3?
I'm trying to use https://micropython.org/download/esp32c3-usb/ on a recently purchased ESP32 C3 module. flash_id reports:
Serial port /dev/ttyUSB0
Connecting....
Chip is unknown ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: 34:b4:72:4e:34:c4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Manufacturer: 20
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...
I'm writing the binary using the following command:
esptool.py --chip esp32c3 --port /dev/ttyUSB0 --baud 460800 \
write_flash -z 0x0 esp32c3-usb-20220117-v1.18.bin
The write completes successfully, but the board doesn't boot into
micropython. Pressing the reset switch while connected to the serial
port results in:
Terminal ready
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0xe3c
load:0x403ce000,len:0x6dc
load:0x403d0000,len:0x28c4
entry 0x403ce000
...and nothing else.
Both CircuitPython (https://downloads.circuitpython.org/bin/ai_thinker_esp32-c3s/en_US/adafruit-circuitpython-ai_thinker_esp32-c3s-en_US-7.2.0.bin) and the AT firmware install and boot successfully on this board.