Skip to content

ESP32-C3 boot loop #7578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wstlxx opened this issue Feb 14, 2023 · 14 comments
Open

ESP32-C3 boot loop #7578

wstlxx opened this issue Feb 14, 2023 · 14 comments

Comments

@wstlxx
Copy link

wstlxx commented Feb 14, 2023

CircuitPython version

Adafruit CircuitPython 8.0.0 on 2023-02-06; ESP-C3-32S (2M)
Chrome + Adafruit ESPTool
Thonny 4.0.2

Code/REPL

# no code yet

Behavior

I tried several different languages versiona of the ROMs and it appears to be the same for 8.0.0
But when I turned to 7.3.2, it worked as expected.
I use Chrome and Adafruit ESPTool for burning and Thonny as serial monitor. when the device boot up, LED blinked as expected, but then the serial keep getting messages like below:

load:0x403ce710,len:0x2218
entry 0x403cc710
Serial console setup
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
Saved PC:0x403820a6
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcd5810,len:0x24
load:0x403cc710,len:0x668
load:0x403ce710,len:0x2218

Description

I tried to open directory within the board, and it says device is busy while receiving logs.

one thing worth noticing, I occasionally ran into a successful booting with UK version with normal python interface. But all modifications to internal storage seems not working, files uploaded with Thonny or REPL cannot be actually saved.

But i tried the same bin file later, this phenomenon didn't show up again. Still endless logs like the above.
So i think it has nothing to do with languages. maybe i triggered something i did not realize.

Additional information

No response

@wstlxx wstlxx added the bug label Feb 14, 2023
@tannewt tannewt added this to the 8.x.x milestone Feb 14, 2023
@dhalbert dhalbert modified the milestones: 8.x.x, Long term Apr 14, 2023
@dhalbert
Copy link
Collaborator

Related to #7056 ?

@dhalbert dhalbert reopened this Oct 28, 2023
@rgrizzell
Copy link

I'm working on porting CircuitPython 9.2.1 to the LILYGO T-Keyboard and have been running into this boot-loop consistently.

The T-Keyboard also uses the ESP32-C3. A minimally viable board configuration results in a batch of messages printed many times a second. I have yet to find a way to get this to fully start-up.

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x120
load:0x403cc710,len:0x948
load:0x403ce710,len:0x229c
entry 0x403cc710
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x120
load:0x403cc710,len:0x948
load:0x403ce710,len:0x229c
entry 0x403cc710
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x120
load:0x403cc710,len:0x948
load:0x403ce710,len:0x229c
entry 0x403cc710

Board Configuration: https://github.com/rgrizzell/circuitpython/tree/port/lilygo-t-keyboard_minimal/ports/espressif/boards/lilygo_tkeyboard

I've attempted to do the following things, but behavior remains unchanged:

  • Toggled CIRCUITPY_LEGACY_4MB_FLASH_LAYOUT and CIRCUITPY_ESP_USB_SERIAL_JTAG.
  • Swapped flash modes between qio and dio.
  • Reduced the flash size from 4MB to 2MB.
  • Removed all unused pins.
  • Removed all board.c statements.
  • Flashed the binaries with esptool.py and Web Serial Flasher.

A couple of other notes:

  • CircuitPython builds without warnings or errors.
  • Flash is erased before a new build is flash to the device.
  • Flashing a build from another ESP32-C3 LILYGO device also bootloops.
  • Factory Firmware and MicroPython flash and run just fine.
  • CircuitPython 8.x bootloops on ESP-C3-32S (2M) #7932 may or may not be related.

@dhalbert
Copy link
Collaborator

I can't find a schematic but this image:
image
from https://github.com/Xinyuan-LilyGO/T-keyboard/tree/main/frimware says to use dio (you have qio) and that's it's an 8MB flash chip.

@dhalbert dhalbert modified the milestones: Long term, Support Dec 31, 2024
@rgrizzell
Copy link

rgrizzell commented Jan 1, 2025

from https://github.com/Xinyuan-LilyGO/T-keyboard/tree/main/frimware says to use dio (you have qio) and that's it's an 8MB flash chip.

I think the screenshot in that repository is misleading. When attempting to flash 8MB, esptool.py reports it's actually 4MB.

WARNING: Set --flash_size 8MB is larger than the available flash size of 4MB.

Additionally, when I set the CIRCUITPY_ESP_FLASH_MODE to dio it flashes successfully. The device connects via USB, but it does not emit anything to Serial nor does it respond to Serial input. It won't show up as a Filesystem either.

The closest I've gotten to getting anything to run is qio. What's even more confusing when I run make BOARD=lilygo_tkeyboard PORT=/dev/ttyACM0 flash, it uses dio anyways... not sure what to make of that.

esptool.py --chip esp32c3 -p /dev/ttyACM0 --before=default_reset --after=no_reset --baud 921600 write_flash --flash_mode "dio" --flash_freq 80m --flash_size 4MB 0x0000 build-lilygo_tkeyboard/firmware.bin

Either way, CIRCUITPY_ESP_FLASH_SIZE and CIRCUITPY_LEGACY_4MB_FLASH_LAYOUT has no effect on the device behavior when set to either dio or qio flash modes.

On the off-chance I've missed something, here's the output from the flash settings is currently have.

Build Log
$ make BOARD=lilygo_tkeyboard clean
- Verbosity options: any combination of "steps commands rules", as `make V=...` or env var BUILD_VERBOSE
rm -rf build-lilygo_tkeyboard
$ make BOARD=lilygo_tkeyboard -j15 all
- Verbosity options: any combination of "steps commands rules", as `make V=...` or env var BUILD_VERBOSE
-- Found Git: /usr/bin/git (found version "2.47.1")
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/rgrizzell/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
-- Detecting C compiler ABI info
GEN build-lilygo_tkeyboard/genhdr/mpversion.h
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/rgrizzell/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/rgrizzell/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32c3
-- Checking Python dependencies...
Python requirements are satisfied.
Constraint file: /home/rgrizzell/.espressif/espidf.constraints.v5.3.txt
Requirement files:
 - /home/rgrizzell/circuitpython/ports/espressif/esp-idf/tools/requirements/requirements.core.txt
Python being checked: /home/rgrizzell/.espressif/python_env/idf5.3_py3.10_env/bin/python
NOTICE: Processing 1 dependencies:
NOTICE: [1/1] idf (5.3.1)
-- Project sdkconfig file /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf/sdkconfig
Loading defaults file /home/rgrizzell/circuitpython/ports/espressif/esp-idf-config/sdkconfig.defaults...
Loading defaults file /home/rgrizzell/circuitpython/ports/espressif/esp-idf-config/sdkconfig-opt.defaults...
Loading defaults file /home/rgrizzell/circuitpython/ports/espressif/esp-idf-config/sdkconfig-flash-4MB-no-uf2.defaults...
Loading defaults file /home/rgrizzell/circuitpython/ports/espressif/esp-idf-config/sdkconfig-flash-qio.defaults...
Loading defaults file /home/rgrizzell/circuitpython/ports/espressif/esp-idf-config/sdkconfig-flash-80m.defaults...
Loading defaults file /home/rgrizzell/circuitpython/ports/espressif/esp-idf-config/sdkconfig-esp32c3.defaults...
Loading defaults file /home/rgrizzell/circuitpython/ports/espressif/boards/lilygo_tkeyboard/sdkconfig...
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/riscv/ld/rom.api.ld
-- Found Python3: /home/rgrizzell/.espressif/python_env/idf5.3_py3.10_env/bin/python3.10 (found version "3.10.16") found components: Interpreter
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
-- App "circuitpython" version: 9.2.1-1-g7d59bcc7a3-dirty
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf/esp-idf/esp_system/ld/sections.ld.in
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.api.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.libgcc.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.version.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.eco3.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.newlib.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/soc/esp32c3/ld/esp32c3.peripherals.ld
-- Components: app_update bootloader bootloader_support bt console cxx driver efuse esp-camera esp-tls esp_adc esp_app_format esp_bootloader_format esp_coex esp_common esp_driver_ana_cmpr esp_driver_dac esp_driver_gpio esp_driver_gptimer esp_driver_i2c esp_driver_i2s esp_driver_ledc esp_driver_mcpwm esp_driver_parlio esp_driver_pcnt esp_driver_rmt esp_driver_sdio esp_driver_sdm esp_driver_sdmmc esp_driver_sdspi esp_driver_spi esp_driver_tsens esp_driver_uart esp_driver_usb_serial_jtag esp_event esp_hw_support esp_lcd esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_vfs_console esp_wifi esptool_py freertos hal heap http_parser log lwip mbedtls mdns newlib nvs_flash partition_table pthread riscv sdmmc soc spi_flash ulp usb vfs wpa_supplicant
-- Component paths: /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/app_update /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/bootloader /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/bootloader_support /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/bt /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/console /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/cxx /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/driver /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/efuse /home/rgrizzell/circuitpython/ports/espressif/esp-camera /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp-tls /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_adc /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_app_format /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_bootloader_format /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_coex /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_common /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_ana_cmpr /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_dac /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_gpio /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_gptimer /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_i2c /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_i2s /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_ledc /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_mcpwm /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_parlio /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_pcnt /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_rmt /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_sdio /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_sdm /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_sdmmc /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_sdspi /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_spi /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_tsens /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_uart /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_driver_usb_serial_jtag /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_event /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_hw_support /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_lcd /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_mm /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_netif /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_netif_stack /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_partition /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_phy /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_pm /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_psram /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_ringbuf /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_system /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_timer /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_vfs_console /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_wifi /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esptool_py /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/freertos /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/hal /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/heap /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/http_parser /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/log /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/lwip /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/mbedtls /home/rgrizzell/circuitpython/ports/espressif/esp-protocols/components/mdns /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/newlib /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/nvs_flash /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/partition_table /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/pthread /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/riscv /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/sdmmc /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/soc /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/spi_flash /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/ulp /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/usb /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/vfs /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/wpa_supplicant
-- Configuring done (2.6s)
-- Generating done (0.2s)
-- Build files have been written to: /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf
ninja: Entering directory `build-lilygo_tkeyboard/esp-idf'
[5/902] Generating ../../partition_table/partition-table.bin
Partition table binary generated. Contents:
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,20K,
otadata,data,ota,0xe000,8K,
ota_0,app,ota_0,0x10000,1408K,
ota_1,app,ota_1,0x170000,1408K,
user_fs,data,fat,0x2d0000,1216K,
*******************************************************************************
[893/902] Linking C static library esp-idf/bt/libbt.aRoot pointer registrations updated
Module registrations updated
GEN build-lilygo_tkeyboard/genhdr/root_pointers.h
GEN build-lilygo_tkeyboard/genhdr/moduledefs.h
[897/902] Linking C static library esp-idf/esp-camera/libesp-camera.aQSTR updated
GEN build-lilygo_tkeyboard/genhdr/qstrdefs.generated.h
[898/902] Performing configure step for 'bootloader'
-- Found Git: /usr/bin/git (found version "2.47.1")
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/rgrizzell/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/rgrizzell/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/rgrizzell/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32c3
-- Project sdkconfig file /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf/sdkconfig
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/riscv/ld/rom.api.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/soc/esp32c3/ld/esp32c3.peripherals.ld
-- Bootloader project name: "bootloader" version: 1
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.api.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.libgcc.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.version.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom/esp32c3/ld/esp32c3.rom.newlib.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld
-- Adding linker script /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/bootloader/subproject/main/ld/esp32c3/bootloader.rom.ld
-- Components: bootloader bootloader_support efuse esp_app_format esp_bootloader_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table riscv soc spi_flash
-- Component paths: /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/bootloader /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/bootloader_support /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/efuse /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_app_format /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_bootloader_format /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_common /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_hw_support /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_rom /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esp_system /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/esptool_py /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/freertos /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/hal /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/log /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/bootloader/subproject/main /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/bootloader/subproject/components/micro-ecc /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/newlib /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/partition_table /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/riscv /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/soc /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/spi_flash
-- Configuring done (3.9s)
-- Generating done (0.0s)
-- Build files have been written to: /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf/bootloader
[901/902] Performing build step for 'bootloader'
[1/98] Building C object esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_crc.c.obj
[2/98] Building C object esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_sys.c.obj
[3/98] Building C object esp-idf/log/CMakeFiles/__idf_log.dir/log_noos.c.obj
[4/98] Building C object esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_efuse.c.obj
[5/98] Building C object esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_systimer.c.obj
[6/98] Building C object esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32c3/esp_cpu_intr.c.obj
[7/98] Building C object esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_spiflash.c.obj
[8/98] Building C object esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/esp_memory_utils.c.obj
[9/98] Building C object esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/cpu.c.obj
[10/98] Building C object esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32c3/cpu_region_protect.c.obj
[11/98] Building C object esp-idf/esp_common/CMakeFiles/__idf_esp_common.dir/src/esp_err_to_name.c.obj
[12/98] Building C object esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32c3/rtc_clk_init.c.obj
[13/98] Building C object esp-idf/log/CMakeFiles/__idf_log.dir/log.c.obj
[14/98] Building C object esp-idf/esp_rom/CMakeFiles/__idf_esp_rom.dir/patches/esp_rom_uart.c.obj
[15/98] Building C object esp-idf/log/CMakeFiles/__idf_log.dir/log_buffers.c.obj
[16/98] Building C object esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32c3/chip_info.c.obj
[17/98] Building C object esp-idf/esp_system/CMakeFiles/__idf_esp_system.dir/esp_err.c.obj
[18/98] Building C object esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32c3/rtc_init.c.obj
[19/98] Linking C static library esp-idf/log/liblog.a
[20/98] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32c3/esp_efuse_fields.c.obj
[21/98] Building C object esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32c3/rtc_time.c.obj
[22/98] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32c3/esp_efuse_table.c.obj
[23/98] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32c3/esp_efuse_rtc_calib.c.obj
[24/98] Linking C static library esp-idf/esp_rom/libesp_rom.a
[25/98] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_api.c.obj
[26/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_mem.c.obj
[27/98] Linking C static library esp-idf/esp_common/libesp_common.a
[28/98] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_fields.c.obj
[29/98] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/esp32c3/esp_efuse_utility.c.obj
[30/98] Building C object esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32c3/rtc_sleep.c.obj
[31/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_efuse.c.obj
[32/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_random.c.obj
[33/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_common_loader.c.obj
[34/98] Building C object esp-idf/esp_hw_support/CMakeFiles/__idf_esp_hw_support.dir/port/esp32c3/rtc_clk.c.obj
[35/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_common.c.obj
[36/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/secure_boot.c.obj
[37/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_clock_init.c.obj
[38/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_encrypt.c.obj
[39/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/flash_partitions.c.obj
[40/98] Linking C static library esp-idf/esp_hw_support/libesp_hw_support.a
[41/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_random_esp32c3.c.obj
[42/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_clock_loader.c.obj
[43/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32c3/bootloader_sha.c.obj
[44/98] Linking C static library esp-idf/esp_system/libesp_system.a
[45/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_console_loader.c.obj
[46/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_panic.c.obj
[47/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_console.c.obj
[48/98] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/esp_efuse_utility.c.obj
[49/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32c3/bootloader_soc.c.obj
[50/98] Building C object esp-idf/esp_bootloader_format/CMakeFiles/__idf_esp_bootloader_format.dir/esp_bootloader_desc.c.obj
[51/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/flash_qio_mode.c.obj
[52/98] Building C object esp-idf/efuse/CMakeFiles/__idf_efuse.dir/src/efuse_controller/keys/with_key_purposes/esp_efuse_api_key.c.obj
[53/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/bootloader_flash_config_esp32c3.c.obj
[54/98] Building C object esp-idf/spi_flash/CMakeFiles/__idf_spi_flash.dir/spi_flash_wrap.c.obj
[55/98] Building C object esp-idf/hal/CMakeFiles/__idf_hal.dir/hal_utils.c.obj
[56/98] Linking C static library esp-idf/efuse/libefuse.a
[57/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_init.c.obj
[58/98] Building C object esp-idf/hal/CMakeFiles/__idf_hal.dir/efuse_hal.c.obj
[59/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/interrupts.c.obj
[60/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/dport_access_common.c.obj
[61/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp32c3/bootloader_esp32c3.c.obj
[62/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/gpio_periph.c.obj
[63/98] Building C object esp-idf/hal/CMakeFiles/__idf_hal.dir/esp32c3/efuse_hal.c.obj
[64/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/lldesc.c.obj
[65/98] Building C object esp-idf/hal/CMakeFiles/__idf_hal.dir/cache_hal.c.obj
[66/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/bootloader_flash/src/bootloader_flash.c.obj
[67/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/adc_periph.c.obj
[68/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/uart_periph.c.obj
[69/98] Building C object esp-idf/hal/CMakeFiles/__idf_hal.dir/mmu_hal.c.obj
[70/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/dedic_gpio_periph.c.obj
[71/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/bootloader_utility.c.obj
[72/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/sdm_periph.c.obj
[73/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/gdma_periph.c.obj
[74/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/temperature_sensor_periph.c.obj
[75/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/rmt_periph.c.obj
[76/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/twai_periph.c.obj
[77/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/ledc_periph.c.obj
[78/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/i2s_periph.c.obj
[79/98] Generating project_elf_src_esp32c3.c
[80/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/mpi_periph.c.obj
[81/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/timer_periph.c.obj
[82/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/i2c_periph.c.obj
[83/98] Building C object esp-idf/soc/CMakeFiles/__idf_soc.dir/esp32c3/spi_periph.c.obj
[84/98] Building C object CMakeFiles/bootloader.elf.dir/project_elf_src_esp32c3.c.obj
[85/98] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/bootloader_start.c.obj
[86/98] Building C object esp-idf/hal/CMakeFiles/__idf_hal.dir/wdt_hal_iram.c.obj
[87/98] Building C object esp-idf/bootloader_support/CMakeFiles/__idf_bootloader_support.dir/src/esp_image_format.c.obj
[88/98] Linking C static library esp-idf/bootloader_support/libbootloader_support.a
[89/98] Linking C static library esp-idf/esp_bootloader_format/libesp_bootloader_format.a
[90/98] Linking C static library esp-idf/spi_flash/libspi_flash.a
[91/98] Linking C static library esp-idf/hal/libhal.a
[92/98] Building C object esp-idf/micro-ecc/CMakeFiles/__idf_micro-ecc.dir/uECC_verify_antifault.c.obj
[93/98] Linking C static library esp-idf/micro-ecc/libmicro-ecc.a
[94/98] Linking C static library esp-idf/soc/libsoc.a
[95/98] Linking C static library esp-idf/main/libmain.a
[96/98] Linking C executable bootloader.elf
[97/98] Generating binary image from built executable
esptool.py v4.8.1
Creating esp32c3 image...
Merged 2 ELF sections
Successfully created esp32c3 image.
Generated /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf/bootloader/bootloader.bin
[98/98] cd /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf/bootloader/esp-idf/esptool_py && python /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf/bootloader/bootloader.bin
Bootloader binary size 0x2d60 bytes. 0x52a0 bytes (65%) free.
[902/902] Generating ld/sections.ld
/home/rgrizzell/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: warning: build-lilygo_tkeyboard/firmware.elf has a LOAD segment with RWX permissions
Memory region         Used Size  Region Size  %age Used
     iram0_0_seg:         70 KB     321296 B     22.31%
     iram0_2_seg:     1169914 B    8388576 B     13.95%
     dram0_0_seg:      120688 B     321296 B     37.56%
     drom0_0_seg:     1384259 B    8388576 B     16.50%
    rtc_iram_seg:         516 B       8168 B      6.32%
rtc_reserved_seg:          24 B         24 B    100.00%
esptool.py v4.8.1
Creating esp32c3 image...
Merged 1 ELF section
Successfully created esp32c3 image.
1431040 bytes used,   10752 bytes free in flash firmware space out of 1441792 bytes (1408.0kB).
    540 bytes used,    7652 bytes free in 'RTC Fast Memory' out of 8192 bytes (8.0kB).
      0 bytes used,   16384 bytes free in 'Internal SRAM 0' out of 16384 bytes (16.0kB).
 120684 bytes used,  272532 bytes free in 'Internal SRAM 1' out of 393216 bytes (384.0kB).
$ esptool.py --chip esp32c3 -p /dev/ttyACM0 erase_flash
esptool.py v4.8.1
Serial port /dev/ttyACM0
Connecting.....
Chip is ESP32-C3 (QFN32) (revision v0.4)
Features: WiFi, BLE
Crystal is 40MHz
MAC: dc:da:0c:91:d4:6c
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 9.3s
Hard resetting via RTS pin...
$ make BOARD=lilygo_tkeyboard PORT=/dev/ttyACM0 flash
- Verbosity options: any combination of "steps commands rules", as `make V=...` or env var BUILD_VERBOSE
ninja: Entering directory `build-lilygo_tkeyboard/esp-idf'
[1/1] Performing build step for 'bootloader'
[1/1] cd /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf/bootloader/esp-idf/esptool_py && python /home/rgrizzell/circuitpython/ports/espressif/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 /home/rgrizzell/circuitpython/ports/espressif/build-lilygo_tkeyboard/esp-idf/bootloader/bootloader.bin
Bootloader binary size 0x2d60 bytes. 0x52a0 bytes (65%) free.
esptool.py --chip esp32c3 -p /dev/ttyACM0 --before=default_reset --after=no_reset --baud 921600 write_flash --flash_mode "dio" --flash_freq 80m --flash_size 4MB 0x0000 build-lilygo_tkeyboard/firmware.bin
esptool.py v4.8.1
Serial port /dev/ttyACM0
Connecting.....
Chip is ESP32-C3 (QFN32) (revision v0.4)
Features: WiFi, BLE
Crystal is 40MHz
MAC: dc:da:0c:91:d4:6c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x0016dfff...
SHA digest in image updated
Compressed 1496576 bytes to 927967...
Wrote 1496576 bytes (927967 compressed) at 0x00000000 in 22.4 seconds (effective 535.5 kbit/s)...
Hash of data verified.
Leaving...
Staying in bootloader.
$ tio /dev/ttyACM0
[09:51:16.777] tio 3.8
[09:51:16.777] Press ctrl-t q to quit
[09:51:16.777] Warning: Could not open /dev/ttyACM0 (No such file or directory)
[09:51:16.777] Waiting for tty device..
[09:51:18.781] Connected to /dev/ttyACM0
����	cB���H4U
                ���d�@`1)U'����N���)��x)�����ΗJ��m)N�p15H`��*��
                                                               ��m)��)!�W���Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x120
load:0x403cc710,len:0x948
load:0x403ce710,len:0x229c
entry 0x403cc710
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x120
load:0x403cc710,len:0x948
load:0x403ce710,len:0x229c
entry 0x403cc710
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x120
load:0x403cc710,len:0x948
load:0x403ce710,len:0x229c
entry 0x403cc710
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x120
load:0x403cc710,len:0x948
load:0x403ce710,len:0x229c
entry 0x403cc710
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x120
load:0x403cc710,len:0x948
load:0x403ce710,len:0x229c
entry 0x403cc710
...

@bablokb
Copy link

bablokb commented Jan 2, 2025

Have you ever tried changing the flash-frequency? As a default, I use dio and 40m for my various ESP32C3 chips. And I don't pass in the flash-size, the auto-detection seems to work fine.

I also remember that I had to change the flash mode to "dout" (even slower than dio) on an ESP-01S to make that device work (of course not with CircuitPython). With that device, flashing with dio did work, but only the flashing and not the subsequent operation. But I never encountered this problem with an ESP32C3.

@dhalbert
Copy link
Collaborator

dhalbert commented Jan 2, 2025

Did you find a link to a schematic? I was unable to find one.

@tannewt
Copy link
Member

tannewt commented Jan 2, 2025

Build CircuitPython with the DEBUG=1 option in the make line. That enables ESP-IDF output that may show you what is happening.

RTC_SW_SYS_RST may be that CircuitPython is starting up but trigger a safe mode and reset. If this happens even when in safe mode, then it'll boot loop.

@rgrizzell
Copy link

Did you find a link to a schematic? I was unable to find one.

I haven't been able to find one either. The Pinout on the Product Page is as close as it gets. I also searched around on their forums, but haven't found anything.

Build CircuitPython with the DEBUG=1 option in the make line. That enables ESP-IDF output that may show you what is happening.

RTC_SW_SYS_RST may be that CircuitPython is starting up but trigger a safe mode and reset. If this happens even when in safe mode, then it'll boot loop.

Much appreciated. I had to set CIRCUITPY_LEGACY_4MB_FLASH_LAYOUT = 0, otherwise build would fail because there wasn't enough flash space when DEBUG=1.

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x18a8
load:0x403cc710,len:0xd68
load:0x403ce710,len:0x2f30
entry 0x403cc71a
I (35) boot: ESP-IDF v5.3-dev-4529-g3ecf6bafcf0-dirt 2nd stage bootloader
I (35) boot: compile time Jan  3 2025 00:18:37
I (36) boot: chip revision: v0.4
I (40) qio_mode: Enabling QIO for flash chip WinBond
I (46) boot.esp32c3: SPI Speed      : 80MHz
I (51) boot.esp32c3: SPI Mode       : QIO
I (55) boot.esp32c3: SPI Flash Size : 4MB
I (60) boot: Enabling RNG early entropy source...
E (65) flash_parts: partition 0 invalid magic number 0xefcf
E (72) boot: Failed to verify partition table
E (77) boot: load partition table error!

@dhalbert
Copy link
Collaborator

dhalbert commented Jan 3, 2025

Erase the flash completely with esptool.py before trying to load firmware.bin. Note that you should not load circuitpython-firmware.bin: that is a partial bin that does not include the partition table and some other stuff.

@rgrizzell
Copy link

Erase the flash completely with esptool.py before trying to load firmware.bin. Note that you should not load circuitpython-firmware.bin: that is a partial bin that does not include the partition table and some other stuff.

I was worried that might've been the issue, so I've been making sure to start with both a clean build and a clean flash. These are the commands I've been running after each change.

make BOARD=lilygo_tkeyboard clean 
make BOARD=lilygo_tkeyboard DEBUG=1 -j15 all
esptool.py --chip esp32c3 -p /dev/ttyACM0 erase_flash
make BOARD=lilygo_tkeyboard PORT=/dev/ttyACM0 flash

When I flash it using either esptool.py or esptool.js (web flasher), both the Factory Firmware AND MicroPython start up correctly when using offset 0x0.

Without the schematic I can't confirm for certain, but I think this chip is an ESP32-C3 with external flash chip rather than the later ESP32-C3FH4(X) with in-package flash. https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf#section.1

And since the ESP Bootloader is printing to the serial interface, I'm assuming the error is valid.

E (65) flash_parts: partition 0 invalid magic number 0xefcf
E (72) boot: Failed to verify partition table
E (77) boot: load partition table error!

I don't know if there's a difference in the way the partitions are setup between in-package and external flash, but I'll see about trying a few different other partition layouts to see if that helps.

@rgrizzell
Copy link

Since UF2 doesn't support the ESP32-C3, I tried the no-ota-no-uf2 layout in mpconfigboard.mk.

FLASH_SIZE_SDKCONFIG = esp-idf-config/sdkconfig-flash-$(CIRCUITPY_ESP_FLASH_SIZE)-no-ota-no-uf2.defaults

But that resulted in the same partition error.

E (65) flash_parts: partition 0 invalid magic number 0xefcf
E (72) boot: Failed to verify partition table
E (77) boot: load partition table error!

For good measure, I tried flashing using just esptool.py. Same result as using make, so probably not related to the Flash Config...

esptool.py --chip esp32c3 --port /dev/ttyACM0 write_flash --erase-all
 --compress 0x0 build-lilygo_tkeyboard/firmware.bin

@dhalbert
Copy link
Collaborator

dhalbert commented Jan 5, 2025

Have you tried some more generic ESP32-C3 build from https://circuitpython.org/downloads?q=c3, like the Espressif DevKit one?

@rgrizzell
Copy link

Downloaded the build for the ESP32-C3-DevKitM-1-N4. It flashed but still exhibits the same issue.

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048b82
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x120
load:0x403cc710,len:0x948
load:0x403ce710,len:0x229c
entry 0x403cc710

@dhalbert dhalbert changed the title serial keep printing messages upon launching. ESP32-C3 boot loop Feb 1, 2025
@dhalbert
Copy link
Collaborator

dhalbert commented Feb 1, 2025

This may be related to #10002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants