From: Mihoshi <mih...@ps...> - 2022-12-22 02:47:23
|
Hello, I've been attempting to get an OpenJTAG compatible board working against a Google Coral iMX8M device with OpenOCD. I don't have much experience with OpenOCD and I'm running into a problem. I'm used to Lauterbach debuggers we have at work. The issue I see is that if I attempt to use the openocd\scripts\interface\openjtag.cfg and openocd\scripts\board\imx8mp-evk.cfg scripts, OpenOCD always complains that the device returns all ones and no DTAP is visible, plus the device is always reset. From a -d4 trace, in core.c jtag_init() after it initializes the adapter, it calls jtag_add_reset(0, 0) to deassert the SRST and TRST lines. This falls through to legacy_jtag_add_reset(0, 0) and since the globals jtag_srst and jtag_trst are initialized to -1, interface_jtag_add_reset(0, 0) is called to queue a JTAG_RESET operation. In the OpenJTAG reset handling code, it has the following: static void openjtag_execute_reset(struct jtag_command *cmd) { LOG_DEBUG_IO("reset trst: %i srst %i", cmd->cmd.reset->trst, cmd->cmd.reset->srst); uint8_t buf = 0x00; if (cmd->cmd.reset->trst) { buf = 0x03; } else { buf |= 0x04; buf |= 0x05 << 4; } ... This completely ignores srst, and handles trst == 1 as a software TAP reset, and trst == 0 as a hardware TAP reset instead of 1 as assert TRST and 0 as deassert. According to the OpenJTAG protocol spec https://web.archive.org/web/20180514044108/http://www.openjtag.org/download/protmanual/1.1/OPENJTAG_Communication_Protocol_Manual_1.1.pdf 0x03 is software TAP reset, and 0x04 is hardware TAP reset. Compounding the issue is that on the Google Coral iMX8M device, the 10 mini jtag header TRST- signal is connected to System reset. So a hardware TAP reset forces a full reset of the iMX8. It doesn't look like any reset_config settings will stop this as jtag_add_reset(0, 0) is always executed. Is OpenJTAG still under active development? It appears that boards based on the original OpenJTAG design as well as Cypress CY7C65215 devices can still be purchased. The adapter I'm using is a Cypess PSoC 5LP device running https://github.com/MinatsuT/PSoC5_OpenJTAG_Adapter that emulates the CY7C65215 device. -- M |