esp32c3 FN4 constantly rebooting

e.voellm@mail.de
Posts: 6
Joined: Fri Jul 10, 2020 6:50 am

esp32c3 FN4 constantly rebooting

Postby e.voellm@mail.de » Wed Nov 16, 2022 9:32 pm

Dear ESP32 forum,
i have made a new design using the ESP32C3 FN4 with 4 MB Flash on chip hence i am not able to load code or bootloader into the chip as i see a constant rebooting after a very short random time like shown here (1), restart reason is sometimes printed as "rst:0x13 (GLITCH_RTC_RST)".
My hardware design is like this:
Selection_140.png
Selection_140.png (13.23 KiB) Viewed 1715 times
I have checked power pins 2,3,11,17,31 and 32 , and measure 3.34V with a minimum 3.2V with my digital oszilloscope. GPIO9 is hold down by the programmer, while EN pin is going low to force a hardware reset.
The design is connecting an I2C chip on the left side with SDA and SCL, and a CAN bus interface on the right side.
The same design works great with the ESP32C3 without flash connected with an external flash chip.
Even just connecting the serial monitor, the chip does not stop to reboot, so i don't get any foot into the door to download anything.
And idea what could be wrong?

Many thanks !

1)
esp32�ESP-ROM:esp32c3-api1-20210207
BESP-ROM:esp32c3-api1-20ESP-ROM:esp32c3-api1-20210207
Build:Feb ESP�ESP-ROM:esp32c3-api1-2021020ESP-ROMESPESP-ROM:esp32c3-api1-2021ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 20�ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
�ESP-ROM:esp32c3-api1-20210207M:esp32c3-api1-20210207
Build:�ESP�ESP-ROM:esp32c3-api1-20210207
�ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
�ESP-ROM:esp32c3-api1-�ESP-ROM:esp32c3-api1-�ESP-ESP-ROM:esp32c3-api1-20210207
Build:�ESP-ROM:espESP-�ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1�ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x13 (GLITCH_RTC_RST),boot:0x�ESP-�ESP-ROM:esp32c3-api1-20�ESP-ROM:esp32c3�ESP-ROESP-ROM:esp32c3-api1-202102ESP-ROM:esp32�E�ESP-ROM:esp32c3-��ESP-ROM:esp32c3-api1-2ESP-ROM:esp32c3-api1-20210207
Bu�ESP-ROM:esp32c3-apiESP-ROM:ESP-ROM:esp3�ESP-ROM:esESP-ROM:eESP-ROM:esp32c3-api1-20�ESP-ROM:esp32c3-api1-20210207
Build:�ESP-ROM:esp32c3-api1-20210207
Build:�ESE�ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x13 �ESP-ROM:�ESP-ROM:eESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:�E�ESP-ROM:esESP-ROM:e�ESP-ROM:esp32�ESP-�ESP-ROM:esp32c3-api1-20210207
B�ESP-ROM:esp32c3-api1-20210207

e.voellm@mail.de
Posts: 6
Joined: Fri Jul 10, 2020 6:50 am

Re: esp32c3 FN4 constantly rebooting

Postby e.voellm@mail.de » Thu Nov 17, 2022 8:15 pm

Found it!
The 15pF capacitor C6 connected from XTAL_P to GND did somehow not harmonize with the ESP32C3 and the crystal selected. Removed C6 and it booted stable. Coulds see this "invalid header" (1) at boot what means there is nothing flashed so far.
Then flashed it (2), and everything came up correctly.

Unclear why 15pF left and right didn't work with this crystal, according to the datasheet this should be possible.
https://datasheet.lcsc.com/lcsc/2103291 ... _C9010.pdf
Possibly a bit a long wire to this pad of the crystal had some capacitance too so it got to much. Optimized the layout for shorter wires now.


1)
Build:Feb 7 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0xf (SPI_FAST_FLASH_BOOT)
Saved PC:0x4004d1f8
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff

2)
Executing action: flash
Running ninja in directory /home/esp32c3/CanMagSens/build
Executing "ninja flash"...
[1/4] Performing build step for 'bootloader'
ninja: no work to do.
[1/2] cd /home/esp32c3/esp/esp-idf/components/esptool_py && /usr/b...me/esp32c3/esp/esp-idf/components/esptool_py/run_serial_tool.cmake
esptool.py esp32c3 -p /dev/ttyUSB0 -b 115200 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x8000 partition_table/partition-table.bin 0x0 bootloader/bootloader.bin 0x10000 CanMagSens.bin
esptool.py v3.3.2-dev
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: a0:76:4e:21:ae:b4
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00000000 to 0x00004fff...
Flash will be erased from 0x00010000 to 0x000bbfff...
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 355.9 kbit/s)...
Hash of data verified.
Compressed 20448 bytes to 12288...
Writing at 0x00000000... (100 %)
Wrote 20448 bytes (12288 compressed) at 0x00000000 in 1.4 seconds (effective 113.2 kbit/s)...
Hash of data verified.
Compressed 703712 bytes to 333696...
Writing at 0x00010000... (4 %)
Writing at 0x0001b79b... (9 %)
Writing at 0x0002afa6... (14 %)
Writing at 0x0003bd66... (19 %)
Writing at 0x00048290... (23 %)
Writing at 0x0004e1ff... (28 %)
Writing at 0x00055cbe... (33 %)
Writing at 0x0005dc78... (38 %)
Writing at 0x00064bf8... (42 %)
Writing at 0x0006a8d3... (47 %)
Writing at 0x00070e0e... (52 %)
Writing at 0x00076e38... (57 %)
Writing at 0x0007e08c... (61 %)
Writing at 0x00085d25... (66 %)
Writing at 0x0008d1c1... (71 %)
Writing at 0x00094ebe... (76 %)
Writing at 0x0009d87f... (80 %)
Writing at 0x000a3cdd... (85 %)
Writing at 0x000ab7db... (90 %)
Writing at 0x000b2624... (95 %)
Writing at 0x000b913d... (100 %)
Wrote 703712 bytes (333696 compressed) at 0x00010000 in 29.7 seconds (effective 189.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
Done
esp32c3@hp2:~/CanMagSens$ monitor
Executing action: monitor
Running idf_monitor in directory /home/esp32c3/CanMagSens
Executing "/home/esp32c3/.espressif/python_env/idf4.3_py3.10_env/bin/python /home/esp32c3/esp/esp-idf/tools/idf_monitor.py -p /dev/ttyUSB0 -b 115200 --toolchain-prefix riscv32-esp-elf- --decode-panic backtrace --target esp32c3 /home/esp32c3/CanMagSens/build/CanMagSens.elf -m '/home/esp32c3/.espressif/python_env/idf4.3_py3.10_env/bin/python' '/home/esp32c3/esp/esp-idf/tools/idf.py' '-p' '/dev/ttyUSB0'"...
/home/esp32c3/esp/esp-idf/tools/idf_monitor.py:518: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if StrictVersion(serial.VERSION) < StrictVersion('3.3.0'):
--- idf_monitor on /dev/ttyUSB0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xa (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x3fcd6100,len:0x1890
load:0x403ce000,len:0x8d4
load:0x403d0000,len:0x2e1c
entry 0x403ce000
I (31) boot: ESP-IDF v4.3.4-169-g635a9c5efb 2nd stage bootloader
I (32) boot: compile time 20:15:51
I (32) boot: chip revision: 3
I (35) boot.esp32c3: SPI Speed : 40MHz
I (39) boot.esp32c3: SPI Mode : DIO
I (44) boot.esp32c3: SPI Flash Size : 4MB
I (49) boot: Enabling RNG early entropy source...
I (54) boot: Partition Table:
I (58) boot: ## Label Usage Type ST Offset Length
I (65) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (73) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (80) boot: 2 factory factory app 00 00 00010000 00100000
I (88) boot: End of partition table
I (92) esp_image: segment 0: paddr=00010020 vaddr=3c070020 size=34d28h (216360) map
I (147) esp_image: segment 1: paddr=00044d50 vaddr=3fc8ec00 size=0261ch ( 9756) load
I (149) esp_image: segment 2: paddr=00047374 vaddr=40380000 size=08ca4h ( 36004) load
I (161) esp_image: segment 3: paddr=00050020 vaddr=42000020 size=65e48h (417352) map
I (252) esp_image: segment 4: paddr=000b5e70 vaddr=40388ca4 size=05e40h ( 24128) load
I (262) boot: Loaded app from partition at offset 0x10000
I (262) boot: Disabling RNG early entropy source...
I (274) cpu_start: Pro cpu up.
I (283) cpu_start: Pro cpu start user code
I (283) cpu_start: cpu freq: 80000000
I (283) cpu_start: Application information:
I (286) cpu_start: Project name: CanMagSens
I (291) cpu_start: App version: 5e84f94
I (296) cpu_start: Compile time: Nov 17 2022 19:23:10
I (302) cpu_start: ELF file SHA256: 1de91fdd299c1478...
I (308) cpu_start: ESP-IDF: v4.3.4-169-g635a9c5efb
I (314) heap_init: Initializing. RAM available for dynamic allocation:
I (322) heap_init: At 3FC967E0 len 00029820 (166 KiB): DRAM
I (328) heap_init: At 3FCC0000 len 0001F060 (124 KiB): STACK/DRAM
I (335) heap_init: At 50000020 len 00001FE0 (7 KiB): RTCRAM
I (342) spi_flash: detected chip: generic
I (346) spi_flash: flash io: dio
I (355) QMC6310U.cpp: QMC6310U( 1C )
I (357) sleep: Configure to isolate all GPIO pins in sleep state
I (361) sleep: Enable automatic switching of GPIO sleep configuration
I (368) cpu_start: Starting scheduler.
I (372) sensor.cpp: app_main
I (372) sensor.cpp: Now init all Setup elements
I (372) SetupNG.cpp: SetupCommon::initSetup()
E (392) SetupNG.h: NVS nvs_get_blob error: returned error ret=4354
I (392) SetupNG.h: set val: 0.000000
W (392) SetupNG.h: Value already in NVS: 0.000000
E (402) SetupNG.h: NVS nvs_get_blob error: returned error ret=4354
I (402) SetupNG.h: set val: 0.000000
W (412) SetupNG.h: Value already in NVS: 0.000000
E (412) SetupNG.h: NVS nvs_get_blob error: returned error ret=4354
I (422) SetupNG.h: set val: 0.000000
W (422) SetupNG.h: Value already in NVS: 0.000000
E (432) SetupNG.h: NVS nvs_get_blob error: returned error ret=4354
I (442) SetupNG.h: set val: 0.000000
W (442) SetupNG.h: Value already in NVS: 0.000000
E (442) SetupNG.h: NVS nvs_get_blob error: returned error ret=4354
I (452) SetupNG.h: set val: 0.000000
W (462) SetupNG.h: Value already in NVS: 0.000000
E (462) SetupNG.h: NVS nvs_get_blob error: returned error ret=4354
I (472) SetupNG.h: set val: 0.000000
W (472) SetupNG.h: Value already in NVS: 0.000000
I (482) SetupNG.h: NVS key CANSPEED exists len: 4 value: 2
I (482) sensor.cpp: Log level set globally to INFO 3
I (492) sensor.cpp: This is ESP32 chip with 1 CPU core(s), WiFi/BLE,
I (502) sensor.cpp: Silicon revision 3,
I (502) sensor.cpp: 4MB external flash

I (612) sensor.cpp: Program Version 22.1115-20
I (612) sensor.cpp: Wireless ID MagSens-737
I (612) sensor.cpp: Now start CAN bus selftest
I (612) canbus.cpp: CAN bus selftest
I (612) canbus.cpp: CAN rate 1MBit
I (622) canbus.cpp: Driver installed OK, mode 1
I (672) canbus.cpp: Driver started
I (772) canbus.cpp: strlen 8
I (772) canbus.cpp: CAN connected, can speed 2 saved
I (772) SetupNG.h: set val: 2
W (772) SetupNG.h: Value already in NVS: 2
I (782) canbus.cpp: RX CAN bus message bytes:8, id:0100, data:18273645
W (842) canbus.cpp: CAN bus selftest TX/RX OKAY
I (842) sensor.cpp: CAN bus selftest end
I (842) canbus.cpp: CANbus::begin
I (842) canbus.cpp: CAN rate 1MBit
I (842) canbus.cpp: Driver installed OK, mode 0
I (902) canbus.cpp: Driver started
I (1002) I2Cbus: stop timing setup 199, hold 199
E (1002) i2c: i2c_set_stop_timing(763): i2c timing value error
I (1002) I2Cbus: new stop timing: setup 199, hold 199
I (1002) I2Cbus: data timing sample 197, hold 49
I (1012) QMC6310U.cpp: initialize() I2C addr 1c
I (1012) QMC6310U.cpp: initialize() QMC6310U detected addr: 1c
I (1022) QMC6310U.cpp: QMC6310U selftest
I (1022) QMC6310U.cpp: QMC6310 selftest chip ID
I (1032) QMC6310U.cpp: QMC6310 selftest chip ID PASSED
I (1042) QMC6310U.cpp: initialize() QMC6310U OK
I (1042) QMC6310U.cpp: QMC6310U selftest
I (1052) QMC6310U.cpp: QMC6310 selftest chip ID
I (1052) QMC6310U.cpp: QMC6310 selftest chip ID PASSED
I (1112) QMC6310U.cpp: X:-6135 Y:4005 Z:-7147 RDY:1 OVL:0
I (1162) QMC6310U.cpp: X:-6127 Y:3855 Z:-6862 RDY:1 OVL:0
I (1212) QMC6310U.cpp: X:-6040 Y:3825 Z:-6859 RDY:1 OVL:0
I (1262) QMC6310U.cpp: X:-6037 Y:3843 Z:-6826 RDY:1 OVL:0
I (1312) QMC6310U.cpp: X:-6102 Y:3837 Z:-6751 RDY:1 OVL:0
I (1362) QMC6310U.cpp: X:-6100 Y:3835 Z:-6757 RDY:1 OVL:0

Who is online

Users browsing this forum: No registered users and 75 guests