Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jtag: fix error on TCL command "return" in jtag event handler
The TCL command "return" always returns error code JIM_RETURN, to indicate that the effective error code and message are elsewhere. In the current implementation, the caller of jtag's event only checks for return code JIM_OK and considers any other value, including JIM_RETURN, as an error condition. It can be tested running openocd on a jtag target and adding a jtag event "setup" with a single line "return", e.g. openocd -f board/ti_cc3200_launchxl.cfg \ -c 'jtag configure cc32xx.cpu -event setup return' to get the message: ../src/jtag/core.c:1599: Error: in procedure 'jtag_init' called at file "../src/jtag/core.c", line 1599 Modify jtag_tap_handle_event() to detect the specific return value of the "return" command and to test the real error code that is, eventually, specified to the TCL "return" command. Change-Id: I6d6febc15ef169638afffbffc1810e0b84fcf5c8 Reported-by: Tomas Vanek <[email protected]> Signed-off-by: Antonio Borneo <[email protected]> Reviewed-on: http:https://openocd.zylin.com/5199 Tested-by: jenkins Reviewed-by: Tomas Vanek <[email protected]>
- Loading branch information