Page 1 of 1

JTAG Debugging custom board

Posted: Wed Aug 02, 2017 10:00 pm
by Rocker
I'm trying to debug a custom board through JTAG (using Tiao Tumpa debugger). I'm able to do 4-line JTAG flash and debugging on the dev kit board which uses the ESP-WROOM-32 module. The custom board uses the same module and appears also to flash successfully. Both boards have the same openocd logs when flashing. Debugging on the dev kit goes fine. I'm using initial gdb commands as recommended of:

target remote :3333
mon reset halt
thb app_main
x $a1=0
c

Everything is the same until the continue command. For the dev kit, I get:
Continuing.
Target halted. PRO_CPU: PC=0x40080E10 (active) APP_CPU: PC=0xF8001080
[New Thread 1073413748]
[New Thread 1073441260]
[New Thread 1073413364]

Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 1073408876]
ipc_task (arg=0x0) at /home/rob/esp32-idf/esp-idf-v2.0-rc1/components/esp32/./ipc.c:45
45 {

If I look at the threads, I get:
(gdb) info threads
Id Target Id Frame
4 Thread 1073413364 (main) main_task (args=0x0)
at /home/rob/esp32-idf/esp-idf-v2.0-rc1/components/esp32/./cpu_start.c:300
3 Thread 1073441260 (Tmr Svc) prvTimerTask (pvParameters=0x0)
at /home/rob/esp32-idf/esp-idf-v2.0-rc1/components/freertos/./timers.c:427
2 Thread 1073413748 (IDLE) prvIdleTask (pvParameters=0x0)
at /home/rob/esp32-idf/esp-idf-v2.0-rc1/components/freertos/./tasks.c:3263
* 1 Thread 1073408876 (ipc0 : Running) ipc_task (arg=0x0)
at /home/rob/esp32-idf/esp-idf-v2.0-rc1/components/esp32/./ipc.c:45

I switch to thread 4, continue, and hit my breakpoint at app_main. Everything works great.

For the custom board, I get the Continuing, but the target never halts. I have to Ctrl-C to get a prompt.

Any clues why the custom board won't ever hit the breakpoint?

Re: JTAG Debugging custom board

Posted: Wed Aug 02, 2017 10:49 pm
by Rocker
I realized I had never flashed the bootloader.bin or partitions_singleapp.bin to the custom board and thought that might be the problem. The dev kit had those components downloaded via the USB port prior to my JTAG debugging.
I flashed:
bootloader.bin to 0x1000
partitions_singleapp.bin to 0x8000

No change in behavior

Re: JTAG Debugging custom board

Posted: Wed Aug 09, 2017 2:16 am
by Rocker
For those reading this thread, JTAG Debugging on a custom board isn't appreciably different than on the WROOM dev kit board. My issue was that GPIO0 was shorted to ground because a part was installed incorrectly. GPIO 0 is a strapping pin, that if held low, causes the ESP32 to try to download the program rather than run directly from flash. Once that was fixed, the custom board operated like the dev board.