Page 1 of 1

JTAG Debugging Using Eclipse on Mac

Posted: Sun Dec 30, 2018 9:59 am
by NevynSelby
I have followed the instructions in the documentation web site for setting up JTAG debugging with Eclipse. After completing this I run a simple Blinky example on the WROVER board and that seems to work OK.

I then move over to a custom board we are building using the ESP32-D2WD chip programming using the ESP-PROG board and I am having problems getting debugging working. I think the chip is being recognised correctly as OpenOCD is showing the following:

Code: Select all

Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
It also looks like something is being programmed into the chips memory:

Code: Select all

** Programming Started **
auto erase enabled
Info : Target halted. PRO_CPU: PC=0x4009171A (active)    APP_CPU: PC=0x40000400 
Info : Target halted. PRO_CPU: PC=0x4009171A (active)    APP_CPU: PC=0x40000400 
wrote 606208 bytes from file /Users/username/SoftwareDevelopment/ESP32/Blinky/build/Blinky.bin in 3.630915s (163.044 KiB/s)
** Programming Finished **
** Verify Started **
Info : Target halted. PRO_CPU: PC=0x4009171A (active)    APP_CPU: PC=0x40000400 
read 603680 bytes from file /Users/username/SoftwareDevelopment/ESP32/Blinky/build/Blinky.bin and flash bank 0 at offset 0x00010000 in 2.338097s (252.141 KiB/s)
contents match
** Verified OK **
When the board is first connected to the ESP-PROG board I get the following repeated a lot:

Code: Select all

Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
In fact this continues until a command is received from Eclipse.

The system does not hit any breakpoints in Eclipse and after a while I hit the Pause button and open the Debugger Console. Here I issue the bt command and get the following output:

Code: Select all

bt
#0  0x40007ba1 in ?? ()
#1  0x40000740 in ?? ()
The GDB info symbol command tells me it cannot locate a symbol for either of the addresses listed above.

I am using the same OpenOCD config file / command for this board as the WROVER board, namely:

Code: Select all

bin/openocd -s share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp-wroom-32.cfg
Is this valid or does the config etc need to be changed?

Any other tips for resolving this would be appreciated. Note that I do not have access to the CHIP_PU pin or UART0 on this rev of the board. I've asked for this to be resolved on the next revision.

OpenOCD version 0.10.0-dev (2018-11-05-04:08)

Regards,
Mark

Re: JTAG Debugging Using Eclipse on Mac

Posted: Mon Jan 07, 2019 10:20 am
by ESP_igrr
Could you please open idf_monitor ("make monitor") before you start programming the board over JTAG, and observe the console output which is generated at the time when OpenOCD prints "Core 0 was reset". If you see something like "flash read err, 1000", then it is likely that the chip is not bootstrapped correctly, and fails to read the program from flash.

Re: JTAG Debugging Using Eclipse on Mac

Posted: Tue Jan 08, 2019 1:44 pm
by NevynSelby
Thank you ESP_igrr. It looks like you are right. I finally managed to get to UART0 through a tricky modification to the board.

At boot we are getting something like the following on the UART:

Code: Select all

rst:0x10 (RTCWDT_RTC_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371 
ets Jun  8 2016 00:22:57
Looks like you are right about the flash not being programmed correctly. We are looking into our hardware design.

Many thanks for your time,
Mark

Re: JTAG Debugging Using Eclipse on Mac

Posted: Tue Jan 08, 2019 2:02 pm
by ESP_igrr
How are you starting OpenOCD when debugging on the custom board (what are the arguments) and what is the voltage of the flash chip used on the custom board?

If it is 3.3v the you need to use esp-wroom32.cfg instead of esp32-wrover.cfg.

Re: JTAG Debugging Using Eclipse on Mac

Posted: Wed Jan 09, 2019 7:49 am
by NevynSelby
We were using the D2WD chip with built in flash so that would have been 1.8V (assuming I've read the datasheet correctly).

Things has slight overtaken us since the original post. We have made some changes to the hardware and currently have a new prototype in manufacture. We decided to switch from the D2WD the the PICO chip.

I'll be revisiting this when I get the new boards.

Thanks for your help,
Mark