From b4a27be5f5767f4812fe5e0a745c5ffd8793ecd7 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 2 Jan 2025 22:40:07 -0800 Subject: [PATCH] improved debugging instructions for ESP32 --- examples/esp32/README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/examples/esp32/README.md b/examples/esp32/README.md index f3c483dc..f9b5d9d2 100644 --- a/examples/esp32/README.md +++ b/examples/esp32/README.md @@ -46,7 +46,7 @@ Supports the different ESP32 chips: ## Debugging -In case you need to debug an ESP32-S3 (or ESP32-C3) using JTAG, follow these steps: (or +In case you need to debug an ESP32-S3 (or ESP32-C3 / C6) using JTAG, follow these steps: (or read [ESP32 JTAG Debugging][esp32-gdb]). *Note: If you have a standard ESP32, you can do it with an [ESP-PROG][esp-prog] module.* @@ -55,6 +55,12 @@ TL;DR: Open 3 terminals, and do: ### Terminal 1 +```shell +idf.py openocd +``` + +Or if you prefer the verbose way (but not both): + ```shell # Open OpenOCD # Valid for ESP32-S3. Change it to "esp32c3-builtin.cfg" for ESP32-C3 @@ -63,11 +69,20 @@ sudo openocd -f board/esp32s3-builtin.cfg -c "adapter speed 5000" ### Terminal 2 +```shell +idf.py gdb +``` + +Or if you prefer the verbose way (but not both): + ```shell xtensa-esp32s3-elf-gdb bluepad32_esp32_example_app.elf > target remote :3333 -> monitor reset init -> continue +> set remote hardware-watchpoint-limit 2 +> mon reset halt +> maintenance flush register-cache +> thb app_main +> c ``` ### Terminal 3