ESP32-C3 resets and shows 'gdb_exception_error'

User avatar
EUtrilla2002
Posts: 18
Joined: Mon Mar 31, 2025 10:23 am

ESP32-C3 resets and shows 'gdb_exception_error'

Postby EUtrilla2002 » Mon Mar 31, 2025 10:32 am

Hi! I'm developing a gateway that uses idf.py commands and i want to use idf.py gdbgui monitor in my app
However ,when i execute first idf.py openocd and then idf.py gdbgui monitor, the webpage shows this message:

Code: Select all

terminate called after throwing an instance of 'gdb_exception_error'
When i lookup into the openocd logs, it shows this:

Code: Select all

Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
Info : Detected FreeRTOS version: (10.5.1)
Info : JTAG tap: esp32c3.tap0 tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
[b]Info : [esp32c3] Reset cause (3) - (Software core reset)[/b]
Info : dropped 'gdb' connection
Info : [esp32c3] Target halted, PC=0x4200A32E, debug_reason=00000001
It only works when i manually create a new session in gdbgui dashboard. I tried making a loop destroying and setting un idf.py gdbgui, however if i want to introduce thiongs through terminal, i need to introduce also monitor. If i do that, it always resets :(

Please help

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: ESP32-C3 resets and shows 'gdb_exception_error'

Postby ahsrabrifat » Thu Apr 03, 2025 7:39 am

Your OpenOCD log suggests:

Code: Select all

Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"

To fix this:

Open gdbgui.In the GDB console, manually enter:

Code: Select all

target extended-remote :3333


User avatar
EUtrilla2002
Posts: 18
Joined: Mon Mar 31, 2025 10:23 am

Re: ESP32-C3 resets and shows 'gdb_exception_error'

Postby EUtrilla2002 » Mon Apr 07, 2025 7:15 am

Hi. Thank you for replying
I tried to do that, changing gdbinit commands line this

Code: Select all

set remotetimeout 25
target extended-remote :3333
monitor reset halt
maintenance flush register-cache
thbreak app_main
continue
However, it still fails :( openocd shows this logs

Code: Select all

Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : [esp32c3] Target halted, PC=0x40383D98, debug_reason=00000000
Memory protection is enabled. Reset target to disable it...
Info : JTAG tap: esp32c3.tap0 tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
Info : [esp32c3] Reset cause (3) - (Software core reset)
Warn : No symbols for FreeRTOS!
Info : [esp32c3] Found 8 triggers
Info : Flash mapping 0: 0x10020 -> 0x3c030020, 59 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 181 KB
Info : Auto-detected flash bank 'esp32c3.flash' size 4096 KB
Info : Using flash bank 'esp32c3.flash' size 4096 KB
Info : Flash mapping 0: 0x10020 -> 0x3c030020, 59 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 181 KB
Info : Using flash bank 'esp32c3.irom' size 184 KB
Info : Flash mapping 0: 0x10020 -> 0x3c030020, 59 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 181 KB
Info : Using flash bank 'esp32c3.drom' size 60 KB
Info : Detected FreeRTOS version: (10.5.1)
Info : JTAG tap: esp32c3.tap0 tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
Info : [esp32c3] Reset cause (3) - (Software core reset)
Info : dropped 'gdb' connection
Info : [esp32c3] Target halted, PC=0x4200B222, debug_reason=00000001
This only happens when i'm using gdbgui, but with gdb works fine :/

User avatar
EUtrilla2002
Posts: 18
Joined: Mon Mar 31, 2025 10:23 am

Re: ESP32-C3 resets and shows 'gdb_exception_error'

Postby EUtrilla2002 » Fri Apr 25, 2025 11:34 am

Hi there. I found somehow, an answer

I first send a

Code: Select all

 idf.py gdb
session, then delete it. Last, i send an

Code: Select all

 idf.py gdbgui 
monitor command. Somehow, this works for me.

User avatar
EUtrilla2002
Posts: 18
Joined: Mon Mar 31, 2025 10:23 am

Re: ESP32-C3 resets and shows 'gdb_exception_error'

Postby EUtrilla2002 » Mon Sep 15, 2025 6:57 am

Hi
I found a more elegant way to solve this modifying openocd
I just really copy the board/esp32c3-builtin.cfg in my proyect (called openocdscript.cfg) and added a reset

Code: Select all

## Source the JTAG interface configuration file
source [find interface/esp_usb_jtag.cfg]
# Source the ESP32-C3 configuration file
source [find target/esp32c3.cfg]
# First reset to setup everything (NEW)
init 
reset halt
And then in my python script y executed this code

Code: Select all

openocd  -f ./openscript.cfg
Works really fine even with monitor

Who is online

Users browsing this forum: Bing [Bot], ChatGPT-User and 6 guests