Unable to program/Boot loop custom ESP32-C3-MINI board

bobolink
Posts: 98
Joined: Mon Feb 26, 2018 4:17 pm

Re: Unable to program/Boot loop custom ESP32-C3-MINI board

Postby bobolink » Wed Apr 13, 2022 12:20 pm

So, em, the C3 has a built-in USB-to-serial-JTAG converter...
Here is the first commercial board I’ve seen without the download chip.
https://www.espressif.com/en/news/M5Stamp_C3U

I don’t have openocd/gdb working on it yet but I’m on it. :D

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: Unable to program/Boot loop custom ESP32-C3-MINI board

Postby lbernstone » Wed Apr 13, 2022 11:43 pm

I have boards that I am working on using only the USB pins. As esp_minatel mentioned, the first time you program you will need to hold the boot pin low, but after that esptool can program it without any strapping. To use it for serial debugging, you need to set "USB CDC on Boot" in Arduino IDE or flag -DARDUINO_USB_CDC_ON_BOOT=0 in platform.ini, et al. I haven't tried jtag/openocd with it yet.

marcopiai
Posts: 4
Joined: Sun Oct 22, 2023 12:36 pm

Re: Unable to program/Boot loop custom ESP32-C3-MINI board

Postby marcopiai » Mon Oct 23, 2023 9:45 am

Dear
I have a similar problem.
i have a custom board like that in RUST schema abobe
pin 8 pulled up 10K resistor
Pin 9 pulled up 10K resistor and BOOT button to GND
pin 2 also pulled up 10 resistor.

if I connect the UART bridge i can see a long log output:
SPIWP:0xee
mode:DIO, clock div:1
Valid secure boot key blocks: 0
secure boot verification succeeded
load:0x3fcd6268,len:0x38b4
load:0x403ce000,len:0x930
load:0x403d0000,len:0x58b0
entry 0x403ce000
I (77) boot: ESP-IDF v4.4.1-238-gae0e3e2e2a-dirty 2nd stage bootloader
I (77) boot: compile time 08:41:51
I (77) boot: chip revision: 3
I (81) boot.esp32c3: SPI Speed : 80MHz
I (85) boot.esp32c3: SPI Mode : DIO
I (90) boot.esp32c3: SPI Flash Size : 4MB
I (95) boot: Enabling RNG early entropy source...
I (100) boot: Partition Table:
I (104) boot: ## Label Usage Type ST Offset Length
I (111) boot: 0 pre_prov unknown 3f 06 0000d000 00006000
I (119) boot: 1 nvs WiFi data 01 02 00013000 00009000
I (126) boot: 2 nvs_key NVS keys 01 04 0001c000 00001000
I (134) boot: 3 otadata OTA data 01 00 0001d000 00002000
I (141) boot: 4 phy_init RF data 01 01 0001f000 00001000
I (149) boot: 5 ota_0 OTA app 00 10 00020000 001d0000
I (157) boot: 6 ota_1 OTA app 00 11 001f0000 001d0000
I (164) boot: 7 coredump Unknown data 01 03 003c0000 00020000
I (172) boot: 8 storage WiFi data 01 02 003e0000 00010000
I (179) boot: End of partition table
I (184) esp_image: segment 0: paddr=00020020 vaddr=3c0f0020 size=31ed0h (204496) map
I (227) esp_image: segment 1: paddr=00051ef8 vaddr=3fc92c00 size=03910h ( 14608) load
I (231) esp_image: segment 2: paddr=00055810 vaddr=40380000 size=0a808h ( 43016) load
I (242) esp_image: segment 3: paddr=00060020 vaddr=42000020 size=eb118h (962840) map
I (415) esp_image: segment 4: paddr=0014b140 vaddr=4038a808 size=08314h ( 33556) load
I (422) esp_image: segment 5: paddr=0015345c vaddr=50000010 size=00010h ( 16) load
I (422) esp_image: segment 6: paddr=00153474 vaddr=00000000 size=0cb5ch ( 52060)
I (438) esp_image: Verifying image signature...
I (438) secure_boot_v2: Verifying with RSA-PSS...
I (443) secure_boot_v2: Signature verified successfully!
I (451) boot: Loaded app from partition at offset 0x20000
I (452) secure_boot_v2: enabling secure boot v2...
I (457) secure_boot_v2: secure boot v2 is already enabled, continuing..
I (464) boot: Checking flash encryption...
I (469) flash_encrypt: flash encryption is enabled (0 plaintext flashes left)
I (477) boot: Disabling RNG early entropy source...
I (494) cpu_start: Pro cpu up.
I (502) cpu_start: Pro cpu start user code
I (503) cpu_start: cpu freq: 160000000
I (503) cpu_start: Application information:
I (505) cpu_start: Project name: expresslink_esp32_c3
I (511) cpu_start: App version: ab0b8c1-dirty
I (517) cpu_start: Compile time: Jun 21 2022 09:17:55
I (523) cpu_start: ELF file SHA256: 999a3eb5048b58dd...
I (529) cpu_start: ESP-IDF: v4.4.1-263-gf85ba92b1d-dirty
I (536) heap_init: Initializing. RAM available for dynamic allocation:
I (543) heap_init: At 3FCAF310 len 00010CF0 (67 KiB): DRAM
I (549) heap_init: At 3FCC0000 len 0001F060 (124 KiB): STACK/DRAM
I (556) heap_init: At 50000020 len 00001FE0 (7 KiB): RTCRAM
I (563) spi_flash: detected chip: generic
I (567) spi_flash: flash io: dio
I (572) sleep: Configure to isolate all GPIO pins in sleep state
I (578) sleep: Enable automatic switching of GPIO sleep configuration
I (585) coexist: coexist rom version 9387209
I (590) cpu_start: Starting scheduler.
[INFO] [APPMAIN] [app_main:69] Starting Command Interface Task
[INFO] [APPMAIN] [app_main:72] [INIT] Starting WiFi...
I (638) nvs: NVS partition "nvs" is encrypted.
I (638) pp: pp rom version: 9387209
I (638) net80211: net80211 rom version: 9387209
I (648) wifi:wifi driver task: 3fcbb824, prio:23, stack:6656, core=0
I (648) system_api: Base MAC address is not set
I (648) system_api: read default base MAC address from EFUSE
I (658) wifi:wifi firmware version: d5c1f71
I (658) wifi:wifi certification version: v7.0
I (668) wifi:config NVS flash: enabled
I (668) wifi:config nano formating: disabled
I (678) wifi:Init data frame dynamic rx buffer num: 32
I (678) wifi:Init management frame dynamic rx buffer num: 32
I (688) wifi:Init management short buffer num: 32
I (688) wifi:Init dynamic tx buffer num: 32
I (688) wifi:Init static tx FG buffer num: 2
I (698) wifi:Init static rx buffer size: 1600
I (698) wifi:Init static rx buffer num: 10
I (708) wifi:Init dynamic rx buffer num: 32
I (708) wifi_init: rx ba win: 6
I (708) wifi_init: tcpip mbox: 32
I (718) wifi_init: udp mbox: 6
I (718) wifi_init: tcp mbox: 6
I (728) wifi_init: tcp tx win: 5744
I (728) wifi_init: tcp rx win: 5744
I (728) wifi_init: tcp mss: 1440
I (738) wifi_init: WiFi IRAM OP enabled
I (738) wifi_init: WiFi RX IRAM OP enabled
I (748) phy_init: phy_version 909,aa05aec,Apr 16 2022,13:42:08
I (838) wifi:mode : sta (f4:12:fa:0c:ac:10)
I (838) wifi:enable tsf
[INFO] [WIFI] [WIFI_EventHandler:184] WiFi Event Handler
[INFO] [WIFI] [WIFI_EventHandler:192] Station started
[INFO] [WIFI] [WIFI_Init:278] Wifi started...
I (848) nvs: NVS partition "nvs" is encrypted.
I (858) ExpressLink: Device Certificate:
Length: 1314
-----BEGIN CERTIFICATE-----
MIIDnjCCAoagAwIBAgIQZ/RLuCCCQES3ezWxu5dYzzANBgkqhkiG9w0BAQsFADB2
MQswCQYDVQQGEwJDTjELMAkGA1UECAwCU0gxCzAJBgNVBAcMAlNIMSwwKgYDVQQK
DCNFc3ByZXNzaWYgU3lzdGVtcyAoU2hhbmdoYWkpIENPIExURDEMMAoGA1UECwwD
RVNQMREwDwYDVQQDDAhFU1AzMi1DMzAeFw0yMjEwMDQwNTQwNTRaFw0zMjEwMDEw
NTQwNTRaMF0xLTArBgNVBAMMJDBmYzdmN2FiLTczY2UtNGMxZC04N2U4LWVkMGVm
OTQ0ZWVjOTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAlNIMRIwEAYDVQQKDAlFc3By
ZXNzaWYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDH+AtqRsB07Hop
RlH9zNEEMUsLW1wuAlbbb4IEud4zdY9/bl6sef3W6P86hiZyTmnTSVTD2ySaRtYA
NR10Go6BfLhCmZiy/gPAM7yvfGxrn3JFq7x7xn30WgbW6UCTu8WDObLakyXRyGa7
lMfxKcRk5QY8P/nqu9jgjP/PkT3PECq1CV03RW3SQpvYaipuxi4zgmesCGFLwLTl
fGCVuoFDRbdytiBFX0eQLC6ccWKt6P/xn4Jcfktbo1kl15U03iK4QtU8GB5t2Qqa
svzGFgkbDwH+HffU4+LDjU2vLTOQh3HrS3XegjtPN34eMRl9xynt+SrJP9ZRyD5e
yIt3KZYLAgMBAAGjQTA/MA4GA1UdDwEB/wQEAwIF4DAMBgNVHRMBAf8EAjAAMB8G
A1UdIwQYMBaAFGlVBC1yu1m8TtYJXuiPLS1pz4xmMA0GCSqGSIb3DQEBCwUAA4IB
AQAkHkF57StezrFc8iDsvfq8OE9sE3y+f9S+HSmIoASOBG5/K+R7Ai5Gl8PLA1Wu
DBiSJjBNcXATbjIbJk9raNKF7L7qScsBLst1xJ63QWumvBUjDSZUgc864iJyFv+n
nlPL3vZQWydVNbfz9PHYWLUo2O87AtysO7MH8O1G6bgAPoS7jluyAtRHNr8dR0UJ
VfHZfcyBKk69wlStv9C88cimc/oJ8FBCsOrzVwHI0ZLpccRvM5pE0hEnMHQoydeY
UsAa0jb92N7YDJl76FgXlQnAjglLyaYpb7GfGibAF9mxRYgmQFyRg4FWyxJDCwjr
fHXbFGlLmVNZkLwnil95YLpj
-----END CERTIFICATE-----

I (978) ExpressLink: Thingname is: 0fc7f7ab-73ce-4c1d-87e8-ed0ef944eec9
[INFO] [EL] [expresslink_init:42] Starting ExpressLink
I (988) gpio: GPIO[10]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (998) gpio: GPIO[4]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (998) gpio: GPIO[5]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
[INFO] [EL] [expresslink_init:66] Starting MQTT Agent
[INFO] [MQTT] [prvConfigManagerTask:211] Waiting for MQTT manager to be connected.
I (1028) OTA: Current Firmware version 1.0.20
I (1028) OTA: Initializing OTA Agent with thingname: 0fc7f7ab-73ce-4c1d-87e8-ed0ef944eec9
I (1038) OTA: Waiting for MQTT agent to be connected.
[INFO] [MQMGR] [bStartMQTTAgent:227] MQTT Agent initialised successfully
I (1048) TIME: Initializing the NTP
[INFO] [APPMAIN] [app_main:139] [INIT] Complete.
[INFO] [APPMAIN] [app_main:141] APP_MAIN complete


if i press BOOT button (pin 9 GND) and reset the C3 I can see:
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0x4 (DOWNLOAD(USB/UART0/1))
Download boot modes disabled
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0x4 (DOWNLOAD(USB/UART0/1))
Saved PC:0x40048b82
Download boot modes disabled

and loop this reset quickly.
anyone can help me?

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: Unable to program/Boot loop custom ESP32-C3-MINI board

Postby lbernstone » Tue Oct 24, 2023 4:12 pm

Secure boot is enabled, so you cannot flash a firmware over uart.

Who is online

Users browsing this forum: No registered users and 100 guests