[ESP32C3] Application Not Running and Debugging Issues

life711event
Posts: 3
Joined: Sat Oct 07, 2023 9:34 am

[ESP32C3] Application Not Running and Debugging Issues

Postby life711event » Sat Oct 07, 2023 12:01 pm

Hi,

I am working on a custom ESP-C3 board powered up by USB, and i want to be able to program and debug it using builtin USB-JTAG.
I have two applications, ESP_GEN (to test integrity), generated by Espressif-IDE with a simple main;
And an other one, ESP_APP for my application. Both share the same sdkconfig (originaly from ESP_GEN).
From Espressif-IDE (2.9.1, with IDF-5.0.2) I have created ESP-IDF GDB OpenOCD Debugging configuration for both projects.
First work without any problems, but second one just do not.

My problem can easily be described with a FSM as following:
debug_issue.png
debug_issue.png (45.54 KiB) Viewed 1349 times
0- Plug USB from ESP-C3 Custom PCB -> Chip detected.

1A- Debug ESP_GEN -> Work as expected; I have two threads (#1 IDLE and #2 main on app_main breakpoint) (look at log from log_1a.txt).
1B- Debug ESP_APP -> Open a debug session, without any running thread (look at log from log_1b.txt).

2-The ESPC3 is not reachable anymore[/b], debug attempts resulting on log_2.txt.
2-At restarting (plug/unplug) the custom PCB, USB is not recognized. Bypass GPIO9 to GND, i can force ESP to enter bootloader at restarting.

3- At this point, debuging both projects results on log_3.txt, and even if the debug session start, there is only Thread #1 (Running : User Request) with no running instructions.
3-If debug ESP_APP, at restarting the board returns to 2- Fail state.
3-If debug ESP_GEN, at restarting the board returns to 0- Idle state.

I attached logs of Espressif IDE Console at debugging for each relevants states (1, 2 and 3).
If anyone have an idea.
Attachments
log.txt
(16.58 KiB) Downloaded 109 times

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: [ESP32C3] Application Not Running and Debugging Issues

Postby ESP_Sprite » Sun Oct 08, 2023 12:38 pm

Are you sure you're not reconfiguring the USB GPIO pins?

life711event
Posts: 3
Joined: Sat Oct 07, 2023 9:34 am

Re: [ESP32C3] Application Not Running and Debugging Issues

Postby life711event » Sun Oct 08, 2023 3:02 pm

I am configuring GPIOs 0 and 1 for I2C onto ESP_GEN application, using peripheral registers.
But it seems that it do not even boot after flash process (log_1b.txt).

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: [ESP32C3] Application Not Running and Debugging Issues

Postby ESP_Sprite » Mon Oct 09, 2023 2:16 am

There's only one log file attached to your post, so I can't see that log.

life711event
Posts: 3
Joined: Sat Oct 07, 2023 9:34 am

Re: [ESP32C3] Application Not Running and Debugging Issues

Postby life711event » Mon Oct 09, 2023 4:11 am

All the logs are into the unique text file.
Finally I found the problem, null pointer access onto my code..

Does the application run before openOCD Debugging sesion start?

Who is online

Users browsing this forum: Bing [Bot], ESP_adokitkat, Gaston1980 and 138 guests