JTag debugging using the USB-C connector on Dahlia

Verdin iMX8MP q 4GB IT
Dahlia carrier board rev 1.1

Hello, I was following this tutorial. Now it tells that you have to use a seperate Segger Jlink debugger. But on the Dahlia there’s also FTDI to jtag chip which should be able to handle debugging, if I’m not mistaken.

Are there any solutions available to use that instead of the seperate connector?

Hi @Calvin,

You are correct, the JTAG is connected to the FTDI chip, however, you will need an OpenOCD script as we currently don’t have it. You can try to write the script yourself, but unfortunately for now we recommend using the JLink device.

Best Regards,
Hiago.

Hi @Calvin !

Do you have any updates regarding this topic?

Best regards,

Hello!

I haven’t taken a look yet in how to do it.
We have ordered the right parts to do JTAG debugging.
With the updated information on the developer.toradex site, we’ve managed to do debugging with a segger, on Linux.
Not yet on Windows.

1 Like

Hi, I am also interested how to use the FTDI JTAG debugger on Dahlia carrier board.

Based on the Dahlia schematic and OpenOCD documentation, I created the attached dahlia.cfg file. The imx8mp.cfg file can be found in the release of OpenOCD: Link

OpenOCD does detect the M7 core, but “halt” does not work. Thus I also cannot load a program or do debugging.

Note: This works only under Linux, as in Windows a custom (unsigned) .inf driver file would be needed for the USB composite device which uses WinUSB for the B port of the FTDI chip, where JTAG is attached. In most company environments loading a unsigned driver is not possible.

OpenOCD stdout:
openocd -f dahlia.cfg -f imx8mp.cfg 
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 4000 kHz
Info : JTAG tap: imx8m.cpu tap/device found: 0x5ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x5)
Info : DAP transaction stalled (WAIT) - slowing down and resending
Error: JTAG-DP STICKY ERROR
Error: imx8m.a53.0: examination failed

Warn : target imx8m.a53.0 examination failed
Info : [imx8m.m7] Cortex-M7 r1p2 processor detected
Info : [imx8m.m7] target has 8 breakpoints, 4 watchpoints
Info : starting gdb server for imx8m.a53.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : starting gdb server for imx8m.m7 on 3334
Info : Listening on port 3334 for gdb connections
Info : gdb port disabled
Info : accepting 'telnet' connection on tcp/4444
Warn : [imx8m.m7] target was in unknown state when halt was requested
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted

OpenOCD Telnet:
telnet 127.0.0.1 4444
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Open On-Chip Debugger
> targets      
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* imx8m.a53.0        aarch64    little imx8m.cpu          unknown
 1  imx8m.m7           cortex_m   little imx8m.cpu          unknown
 2  imx8m.ahb          mem_ap     little imx8m.cpu          running

> targets imx8m.m7
> halt
[imx8m.m7] target was in unknown state when halt was requested
Halt timed out, wake up GDB.
timed out while waiting for target halted

dahlia.cfg

#
# Dahlia Carrier Board FTDI JTAG
#
# 
#
adapter driver ftdi
adapter speed 4000
transport select jtag
reset_config none

ftdi vid_pid 0x0403 0x6011

# Dahlia uses "B" channel GPIOs for JTAG
ftdi channel 1

ftdi layout_init 0x0018 0x009b
#
#    80 0 > LED
#    40 z < (unused)
#    20 z < (unused)
#    10 1 > nTRST
#
#     8 1 > TMS
#     4 z < TDO
#     2 0 > TDI
#     1 0 > TCK
#

ftdi layout_signal nTRST -data 0x0010
ftdi layout_signal LED -data 0x0080

Hello @j.kugele !

Please create a new post containing this info together with your issue so we can better assist you!