VS Arduino
>> >> ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
https://www.visualmicro.com/forums/YaBB.pl?num=1650736681

Message started by Chris2N on Apr 23rd, 2022 at 5:58pm

Title: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 23rd, 2022 at 5:58pm
Hi,

Freed GPIO 14 by unsoldering D6, which was done successfully by other users also to make this board compatible with JTAG debugging:
https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/6#issuecomment-899104385

While uploading and debugging via serial works fine, trying to debug via hardware results in error message popping up: Unable to start debugging. GDB exited unexpectedly with exit code 1 (Ox1).

When trying to upload via hardware debugger (ESP Prog) I got initially the error message:
****[vMicro]**** Uploading App :Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates target still busy!
After trying a few solutions it is now the following error code (see attached output files):
****[vMicro]**** Uploading App :Error: JTAG scan chain interrogation failed: all ones

Cabling and drivers should be okay as the same setup works fine with my Wemos Lolin (4MB) board.
I also checked the boards connection to GPIO 14 by connecting an LED and using it as an output.
(Of course the sketch I used to try hardware debugging/uploading does not use any of the GPIO’s 12 to 15 and only the ESP PROG is connected to these. In fact I use a simple blink sketch controlling GPIO 4 which is the LCD Backlight.)

I tried the following solutions without success:
  • trying different USB ports and cables
  • trying a different ESP Prog Board
  • updating Visual Micro and using different versions of board.txt file to enforce use of new open OCD version (see enclosed output files).

The DebugOpenOCD.log from the Build folder has only 1 line:
Unexpected command line argument: reset

Hope this info is describing my problem well enough,
Thanks in advance for your help
Chris

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 23rd, 2022 at 6:01pm
PS: Here the Output Files, that seem to have not been uploaded with my first post.
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Error_OCD.txt ( 79 KB | 3 Downloads )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Error_OCD_-_OpenOCD_from_2021_11_11.txt ( 80 KB | 6 Downloads )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Simon@Visual Micro on Apr 25th, 2022 at 10:05am
Thanks for the report, and detail and output files.

The error on debug is unexpected, can you attach the .vmgdbinit file from the build folder after trying to run Debug > Attach to Process?

Can you confirm you are not using a battery in the Upload/Debug scenario as this seems to have some impact from the linked GitHub post?

If possible can you also attach an image of the modified board and connections to the ESP-PROG device, just in case there is anything visible there?

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 25th, 2022 at 3:54pm
Hello Simon,
Thanks for your reply. Trying to attach to a running process is even not working on my Wemos Lolin. I get the following pop-up with an error message:
Unable to start debugging. Launch options string provided by the project system is invalid. The string is null or empty.

Do I need to change anything in my configuration?

In the folder I think which should be the build folder I do not find any new files after such operation.
I have checked the following 2 file locations:
Compiling 'TTGOTest' for 'ESP32 Dev Module'
Build Folder: "file:///C:/Users/admin/AppData/Local/Temp/VMBuilds/TTGOTest/esp32_esp32/Debug"
# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: file:///E:/Eigene%20Dateien/Quelltexte/Arduino/Arduino/ESP32/TTGO%20T5/Debug/

But I do not find a .vmgdbinit file anywhere else on my hard drive also.

As you can see from the enclosed pictures, I do not operate the board from battery (and I disconnect the red power supply from the 3 Volts input of the board, if I use the USB connection in parallel).

I soldered the anode pad from D6 directly to pin 3 of header 12 and isolated the pin with a short piece of Teflon tube to the (enlarged) hole of the ground connection that is normally on that place of the board. (Red wire on the attached photos.) The anode pad is directly connected with GPIO 14 on the ESP 32.

Best regards
Chris

DSCN0011.JPG ( 892 KB | 1 Download )
DSCN0013.JPG ( 922 KB | 0 Downloads )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 25th, 2022 at 3:56pm
PS: additional pictures.
DSCN0016.JPG ( 913 KB | 1 Download )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 25th, 2022 at 4:02pm
PPS: I have also a board where all the outputs (including a similar red cable) are conected to a PCB and which has a proper DC 10P connecteor as a JTAG port. It is not working there also.

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Simon@Visual Micro on Apr 26th, 2022 at 2:15pm
Thanks for all the detail.

Just sticking with the initial (pictured) board to start with:

You mentioned you had uploaded a sketch which used pin 14 as an output.  Have you since uploaded the sketch not using pin 14 as an output via USB-Serial?
(If not the sketch on-board will cause JTAG communication to fail as pin 14 is still in use on-chip)

Also try commenting out all of the local board.txt entries (put '#' at the start of each line), when trying the debugging again, as the latest configuration should not be needed for this Chip+Core configuration to my knowledge.


Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 26th, 2022 at 4:31pm
Dear Simon,

yess! I made sure that the sketch I try to upload (and of course also the one on the board) is not using any of the GPIO's 12-15.

BTW: In the cabeling setup shown on the photos, sometimes the board does not start (when plugging on the ESP-PROG or when pressing Reset or after a failed upload via Programmer). When I unplug GPIO 12 it starts.
Is it normal, that ESP-Prog pulls GPIO12 on high (which I measured and blocks the ESP32 from booting)? Both my ESP-Prog-Boards are doing this today.
I double checked my driver configuration again, but Zadig still shows that I have WINUSB installed on Device 0.

I tried with commenting all lines in board.txt and also completely without board.txt and get the target is still busy message when uploading, even if the board is not blocked by the ESP-Prog but actively executing a program (blinking on IO4).

Changing back to the Lolin board and everything is fine (appart from attaching gives an Unexpected GDB output from  "-exec -run". Try "help target".-message). :-/

BR
Christian

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 26th, 2022 at 5:48pm
PS:
I received today a new Batch of these TTGO-Boards and tried one.
Did the soldering this time exactly as the guy who claimed to be successful:
- leaving D6 in place
- not connecting to the (insulated) Pin of the Header 12 but directly to the ESP-Prog.
Result:
> No board blocking at the moment
>when uploading via Programmer: ****[vMicro]**** Uploading App :Error: JTAG scan chain interrogation failed: all ones

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Simon@Visual Micro on Apr 27th, 2022 at 11:43am
Thanks for confirming about the sketch, I've tripped over that with the sketch on chip was my reason for asking.

The ESP-PROG does seem to hold GPIO12 (TDI) High, until the RST button on the ESP-PROG is pressed, which puts it to LOW allowing the board to boot as expected.

If you also connect the EN pin from the ESP-PROG to the boards' EN pin, then pressing either reset on the board or the ESP-PROG will perform the reset correctly and allow the board to startup correctly. (we will amend our wiring diagrams to show this correctly).
https://docs.espressif.com/projects/espressif-esp-iot-solution/en/latest/hw-reference/ESP-Prog_guide.html#communication-interface

If your board does not have the EN pin exposed (I cannot see it on the pinout for this board), tapping the reset button on the board may resolve the "target is still busy" when trying the upload.

For now it may be best to just upload to the board through the USB-Serial (or route the Serial via ESP-PROG), to remove the programming element, and focus on the debugging side of things.



Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 27th, 2022 at 1:31pm
Hello Simon,
Thanks for your comments.

The behaviour is strange:

when I started today the board kept on blocking. As you recognised correctly, there is no EN-connector on my board.
So I tried to use the reset button during upload without success (when exactly to push it?).
Furthermore I found out, that pushing the reset button (on the board or on the ESP Prog) sometimes results in a proper reset and sometimes the board keeps on hanging in the blocked state.

I went back to the old board.txt file enclosed with the following results:
The blocking problem completely vanished. Hardware upload works now (but takes extremely long)
I get one of the following pop-up-error messages:
  • Unable to start debugging. Launch options string provided by the project system is invalid. The string is null or empty.
  • Unable to start debugging. Unexpected GDB output from command "-exec-run". Don't know how to run. Try "help target".

I would have enclosed also the output, but this has vanished when the pop-up came.

Maybe this problem is similar to the failure to attach properly. (At least it gives the same Error message.)

BR
Chris
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=board_006.txt ( 2 KB | 6 Downloads )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 27th, 2022 at 1:40pm
PS:
Disabling the first line in the board.txt (and correction of the typographic quotes that were there by mistake) gives the same result: 

Unable to start debugging. Launch options string provided by the project system is invalid. The string is null or empty.

https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=board_007.txt ( 2 KB | 5 Downloads )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 27th, 2022 at 1:55pm
PPS:
Of course the output didn't vanish and could be revealed selecting "Micro Build" in the dropdown.
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Output_067.txt ( 127 KB | 2 Downloads )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Simon@Visual Micro on Apr 27th, 2022 at 2:02pm
Thanks for the update.

To our knowledge the newer OpenOCD versions were only needed for the newer ESP WROVER-E (and others such as S2/C3) modules, however your experience seems to indicate there is something we are missing here.

Upload:
From your board.txt you are using the latest OpenOCD for the programming, and this works correctly from your report.

Does this only work on "openocd-esp32-0.10.1-2021.11.11" (latest), or does it also work on the "openocd-esp32-0.10.1-2021.07.21" or "openocd-espressif-esp32-10.0.1" (default if not overriden)?

Debug
This is using the default "openocd-espressif-esp32-10.0.1" version, does this improve if you uncomment the below line?
[code]tools.openocd.debug.path={runtime.tools.openocd-esp32-0.10.1-2021.11.11.path}[/code]

If you can ensure the vMicro > Uploader > Verbose is enabled, and try the Debug > Attach to Process again, and attach the log from Output > Micro Build, we should be able to see why the Launch Options String is invalid.


Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 27th, 2022 at 2:12pm
One more postscriptum:
I overlooked somehow your last advice. Using the serial upload is much faster but gives the same pop-up-error-message:

Unable to start debugging. Launch options string provided by the project system is invalid. The string is null or empty.

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Simon@Visual Micro on Apr 27th, 2022 at 2:49pm
Thanks for the information about the serial upload.

So we can understand the Debugging issue further, can you ensure the vMicro > Uploader > Verbose is enabled, and try the Debug > Attach to Process again, and attach the log from Output > Micro Build, we should be able to see why the Launch Options String is invalid.

Also please confirm you are not using a custom debugger launch options.json file (it will be visible in solution explorer, and is added when using the vMicro > Add Code > Add Custom GDB Debugger (Advanced) menu option).

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 27th, 2022 at 3:01pm
Thanks for your new comment. Enabled Uploader > Verbose.
2021.07.21 can do uploading as well as 2021.11.11 with commenting out the debug path.
But both result in:
Unable to start debugging. Launch options string provided by the project system is invalid. The string is null or empty.

openocd-espressif-esp32-10.0.1 version fails to upload via ESP PROG.

See enclosed files.

https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Board___Output_2021_11_11____comment_-_WORKS.txt ( 145 KB | 3 Downloads )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Board___Output_openocd-espressif-esp32-10_0_1_-_FAILS.txt ( 141 KB | 1 Download )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 27th, 2022 at 3:02pm
and the last file.
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Board___Output_2021_07_21_-_WORKS.txt ( 135 KB | 3 Downloads )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 27th, 2022 at 3:17pm
Thanks for your latest comment.

I can confirm I'm not using a custom debugger launch options.json file (have not used  Add Code > Add Custom GDB Debugger (Advanced), and can not see it in Solution explorer.)

Trying to attach to process adds only the last line (regarding the project build property overrides) to the Output:

     
..
The upload process has finished.
# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: "file:///E:/Eigene%20Dateien/Quelltexte/Arduino/Arduino/ESP32/OfenSteuerung/Debug/"


shutdown command invoked
Using project build property overrides from E:\Eigene Dateien\Quelltexte\Arduino\Arduino\ESP32\OfenSteuerung\board.txt



Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 27th, 2022 at 3:29pm
here complete output after successful uploading (via ESP Prog & Serial) and unsuccessfull start of debug session & attaching
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Output_After_Attaching_-_Serial.txt ( 133 KB | 4 Downloads )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Output_After_Attaching_001.txt ( 145 KB | 2 Downloads )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Simon@Visual Micro on Apr 28th, 2022 at 3:27pm
Thanks for the update and I believe I have found an issue in how the commands are manipulated in the new gdb tooling system.

If you change your board.txt, and replace the two debug entries with the below, does this allow the debugging to begin?
[code]# Debugger Patterns
debug.gdbscript.adapter_khz=2000
tools.openocd.debug.path={runtime.tools.openocd-esp32-0.10.1-2021.11.11.path}
tools.openocd.debug.args={params.verbose} -l "{{build.path}/{build.project_name}_DebugOpenOCD.log}" -s "{path}/share/openocd/scripts/" -f "{path}/share/openocd/scripts/interface/{build.openocddebugger}" -c "set ESP32_RTOS none" -f "{path}/share/openocd/scripts/board/{openocdscript}" {initCmd}[/code]

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 28th, 2022 at 4:01pm
unfortunately it is not working. The behaviour seems to be unchanged: Upload via Serial & ESP-Prog works, but Hardware Debugging fails (Launch options string-Error again)

Attaching adds only this line to the output (as before)
Using project build property overrides from E:\Eigene Dateien\Quelltexte\Arduino\Arduino\ESP32\OfenSteuerung\board.txt

https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Board___Output_Serial.txt ( 141 KB | 8 Downloads )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Board___Output_ESPProg.txt ( 146 KB | 4 Downloads )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Chris2N on Apr 29th, 2022 at 5:41pm
Problem was solved  :) with help of Simon and the debugger patterns he gave. (Many thanks!)
I attach the boards.txt that finally worked for me in Visual Micro 2022.218.2205 and 2022.429.2200

One contribution to the problem was also, that I didn't had  the option
Visual Micro > Debugger set to Debug: Hardware in all relevant projects.

PS: Also worked with my other batch of TTGOs (DOWDQ5 CPU, the Batch I tried first was DOWDQ6) and leaving D6 in place.
(Simplified Cabeling mentioned by kiromaisus: https://github.com/Xinyuan-LilyGO/TTGO-T-Display/issues/6#issuecomment-899104385)

See also attached photo. (If you do the same, don't forget to insulate the header pin used for GPIO 14 against the ground conector on that place on the board e.g. with a piece of shrink tube.)
DSCN0018.JPG ( 924 KB | 1 Download )

Title: Re: ESP Prog / LilyGO-TTGO-T-Display (16MB ESP32) : JTAG scan chain interrogation failed: all one
Post by Simon@Visual Micro on May 6th, 2022 at 3:50pm
We have released an updated version (22.04.29-1) which should work correctly with a pattern containing -c "adapter_khz 2000" , which is available from the top of the board below:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.