AI-deck jtag wrong states

Discussions about the AI-deck
Post Reply
HaolinChen
Beginner
Posts: 3
Joined: Mon Jun 14, 2021 12:54 pm

AI-deck jtag wrong states

Post by HaolinChen »

Recently, I am working on the AI-deck wifi-streamer example. There is two port to upload the code on the AI-deck, the NINA JTAG and the GAP8 JTAG. I upload the GAP8 code with the NINA JTAG by mistake. Then when I change to GAP8 JTAG I can't upload code to AI-DECK any more and the LED on the AI-deck don't flash any more(but the power LED is still on). The terminal will display like this.

gapy --target=ai_deck --platform=board --work-dir=/home/bitcraze/projects/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV run --exec-prepare --exec --binary=/home/bitcraze/projects/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV/test
Launching execution with command:
gap8-openocd -c 'gdb_port disabled; telnet_port disabled; tcl_port disabled' -f interface/jlink.cfg -f target/gap8revb.tcl -f tcl/jtag_boot_entry.tcl -c 'gap8_jtag_load_binary_and_start "/home/bitcraze/projects/gap_sdk/examples/pmsis/helloworld/BUILD/GAP8_V2/GCC_RISCV/test" elf 0x1c000080'
Open On-Chip Debugger 0.10.0+dev-dirty (2021-06-12-10:31)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter speed' not 'adapter_khz'
DEPRECATED! use 'adapter driver' not 'interface'
Warn : Interface already configured, ignoring
TARGET create
Info : core 0 selected
0
Info : gap8_adv_debug_itf tap selected
Info : adv_dbg_unit debug unit selected
Info : Option 7 is passed to adv_dbg_unit debug unit
GAP8 INIT TARGET
Info : J-Link V11 compiled Apr 23 2020 16:49:23
Info : Hardware version: 11.00
Info : VTarget = 3.287 V
Info : clock speed 1500 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: gap8.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
GAP8 examine target
Init jtag
Initialising GAP8 JTAG TAP
Info : adv debug unit is configured with option BOOT MODE JTAG
Info : adv debug unit is configured with option ADBG_USE_HISPEED
Warn : Burst read timed out
Warn : Burst read timed out
Warn : Burst read timed out
Warn : Burst read timed out
Warn : Burst read timed out
Warn : Burst read timed out

I'm using jlink v11 to debug the AI-deck. And I've tried to hold the button on the AI-deck and flash the ESP32 (NINA) with a working firmware.

bitcraze@ubuntu:~/projects/gap_sdk/AIdeck_examples/NINA/firmware$ /home/bitcraze/esp/openocd-esp32/src/openocd -f /home/bitcraze/esp/openocd-esp32/tcl/interface/jlink.cfg -f /home/bitcraze/esp/openocd-esp32/tcl/board/esp-wroom-32.cfg -c "program_esp32 build/partitions_singleapp.bin 0x8000 verify" -c "program_esp32 build/bootloader/bootloader.bin 0x1000 verify" -c "program_esp32 build/ai-deck-jpeg-streamer-demo.bin 0x10000 verify reset exit"
Open On-Chip Debugger v0.10.0-esp32-20210401-39-gfd267384 (2021-06-14-23:46)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1500 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
WARNING: Function (program_esp32) is deprecated, and may be removed in a future release.
Use (program_esp) instead.
Info : J-Link V11 compiled Apr 23 2020 16:49:23
Info : Hardware version: 11.00
Info : VTarget = 3.305 V
Info : clock speed 1500 kHz
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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : Listening on port 3333 for gdb connections
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.cpu0: Target halted, PC=0x400800C0, debug_reason=00000000
Info : Set GDB target to 'esp32.cpu0'
Info : esp32.cpu1: Target halted, PC=0x40082A9F, debug_reason=00000000
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 95 KB
Info : Flash mapping 1: 0x30020 -> 0x400d0020, 472 KB
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu0.flash' size 2048 KB
Info : Using flash bank 'esp32.cpu0.flash' size 2048 KB
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 95 KB
Info : Flash mapping 1: 0x30020 -> 0x400d0020, 472 KB
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu1.flash' size 2048 KB
Info : Using flash bank 'esp32.cpu1.flash' size 2048 KB
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : PROF: Data transferred in 184.581 ms @ 21.6707 KB/s
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
** Programming Finished **
** Verify Started **
Info : PROF: Data transferred in 107.901 ms @ 27.8033 KB/s
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
** Verified OK **
WARNING: Function (program_esp32) is deprecated, and may be removed in a future release.
Use (program_esp) instead.
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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : PROF: Data transferred in 892.824 ms @ 31.3612 KB/s
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
** Programming Finished **
** Verify Started **
Info : PROF: Data transferred in 683.843 ms @ 35.37 KB/s
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
** Verified OK **
WARNING: Function (program_esp32) is deprecated, and may be removed in a future release.
Use (program_esp) instead.
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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
** Programming Started **
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
Info : PROF: Data transferred in 21276.9 ms @ 31.3956 KB/s
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
** Programming Finished **
** Verify Started **
Info : PROF: Data transferred in 18471.1 ms @ 36.0935 KB/s
Info : esp32.cpu0: Target halted, PC=0x400928DA, debug_reason=00000001
** Verified OK **
** Resetting Target **
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.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
shutdown command invoked

But the gap8 still don't work and have the same problem.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: AI-deck jtag wrong states

Post by tobias »

It is good you got the ESP32 programmed back. I'm not sure why the GAP8 is not responding anymore though. After you were able to flash the ESP32 with the wifi streamer example is the LED1 blinking then?

For the GAP8 I tired it with our jlink and got this output with the wifi streamer example:

Code: Select all

gap8-openocd -c 'gdb_port disabled; telnet_port disabled; tcl_port disabled' -f interface/jlink.cfg -f target/gap8revb.tcl -f tcl/jtag_boot_entry.tcl -c 'gap8_jtag_load_binary_and_start "/home/tobias/projects/workspace/AIdeck_examples/GAP8/test_functionalities/wifi_jpeg_streamer/BUILD/GAP8_V2/GCC_RISCV/test" elf 0x1c000080'
Open On-Chip Debugger 0.10.0+dev (2021-02-16-17:27)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter speed' not 'adapter_khz'
DEPRECATED! use 'adapter driver' not 'interface'
Warn : Interface already configured, ignoring
TARGET create
Info : core 0 selected
0
Info : gap8_adv_debug_itf tap selected
Info : adv_dbg_unit debug unit selected
Info : Option 7 is passed to adv_dbg_unit debug unit
GAP8 INIT TARGET
Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
Info : Hardware version: 8.00
Info : VTarget = 2.769 V
Info : clock speed 1500 kHz
Info : JTAG tap: gap8.cpu tap/device found: 0x149511c3 (mfg: 0x0e1 (Wintec Industries), part: 0x4951, ver: 0x1)
GAP8 examine target
Init jtag
Initialising GAP8 JTAG TAP
Info : adv debug unit is configured with option BOOT MODE JTAG
Info : adv debug unit is configured with option ADBG_USE_HISPEED
Info : gdb port disabled
Loading binary through JTAG
Info : tcl server disabled
Info : telnet server disabled
Warn : Burst read timed out


	 *** Wifi Streamer ***

Entering main controller...
0
1
2
S
What is a bit strange is that you get VTarget 3.287V but it should be around 2.8V. I'm suspecting some contact problem. Is the cable glitching or the connector?
HaolinChen
Beginner
Posts: 3
Joined: Mon Jun 14, 2021 12:54 pm

Re: AI-deck jtag wrong states

Post by HaolinChen »

Hi,
Do you mean that I've flash the ESP32 successfully? I'm wondering maybe problem occurs because I'm using jlink v11 instead of jlink v8. My another AI-deck which is not broken feeds back the same high voltage, Which is around 3.3v, but I can flash code to it easily.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: AI-deck jtag wrong states

Post by tobias »

Yes, according to the log the ESP32 was flashed successfully.

I don't know if the 3.3v means anything but possibly the jlink can supply 3.3V? If you have a multimeter can you measure the GAP8 JTAG connector when the AI-deck is powered? You should measure pin 1 and 9 as per the image. If you can measure it with and without the JTAG cable connected that might tell us something.
AI-deck_jtag_gap8.png
AI-deck_jtag_gap8.png (21.98 KiB) Viewed 1842 times
Have you ever manged to flash the GAP8 successfully? It worked before you managed to flash the ESP32 with the GAP8 FW right?

After flashing the ESP32 is the LED1 blinking. I mean does it seam to be running?
HaolinChen
Beginner
Posts: 3
Joined: Mon Jun 14, 2021 12:54 pm

Re: AI-deck jtag wrong states

Post by HaolinChen »

Hi,
Indeed I have used the jtag v11 to supply 3.3V power. Now I have changed Supply voltage to 2.8V. Again I successfully flash the NINA and indeed I see the LED1 is flashing. Then I tried to flsh code to the GAP8. The terminal is shown below. Still I can't download code to GAP8, even a single HelloWorld. Is that possible that the GAP8 chip is broken.

Code: Select all

Info : J-Link V11 compiled Apr 23 2020 16:49:23
Info : Hardware version: 11.00
Info : VTarget = 2.832 V
Info : clock speed 1500 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: gap8.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
GAP8 examine target
Init jtag
Initialising GAP8 JTAG TAP
Info : adv debug unit is configured with option BOOT MODE JTAG
Info : adv debug unit is configured with option ADBG_USE_HISPEED
Warn : Burst read timed out
Warn : Burst read timed out
Warn : Burst read timed out

^CWarn : Burst read timed out
Warn : Burst read timed out
^Z
[3]+  Stopped                 make run
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: AI-deck jtag wrong states

Post by tobias »

Yes it is possible that the GAP8 is broken. Could you send us a email at support@bitcraze.io and let's work something out.
Post Reply