After trying to use JLink to flash the NuttX firmware on NXP iMXRT1060_EVK board and receiving the message that it doesn’t support Cortex-M7 (I’m using the most up to date JLink’s firmware), I decide to use the OpenOCD.
Initially I was getting this error:
$ sudo openocd -f interface/cmsis-dap.cfg [sudo] password for alan: Open On-Chip Debugger v0.10.0-esp32-20200526-6-g4c41a632 (2020-06-23-10:12) 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 : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: FW Version = 1.10 Error: CMSIS-DAP: JTAG not supported
Then I edited the cmsis-dap.cfg and added the SWD transport:
# # ARM CMSIS-DAP compliant adapter # # http://www.keil.com/support/man/docs/dapdebug/ # interface cmsis-dap transport select swd
But then I got this error:
$ sudo openocd -f interface/cmsis-dap.cfg Open On-Chip Debugger v0.10.0-esp32-20200526-6-g4c41a632 (2020-06-23-10:12) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html swd Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: FW Version = 1.10 Info : CMSIS-DAP: Interface Initialised (SWD) Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1 Error: CMSIS-DAP command CMD_DAP_SWJ_CLOCK failed.
After search in the Internet I found how to fix it: I edited the cmsis-dap.cfg again and added the adapter speed:
# # ARM CMSIS-DAP compliant adapter # # http://www.keil.com/support/man/docs/dapdebug/ # interface cmsis-dap transport select swd adapter_khz 500
Finally everything worked fine:
$ sudo openocd -f interface/cmsis-dap.cfg Open On-Chip Debugger v0.10.0-esp32-20200526-6-g4c41a632 (2020-06-23-10:12) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html adapter speed: 500 kHz Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Info : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: FW Version = 1.10 Info : CMSIS-DAP: Interface Initialised (SWD) Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 500 kHz Warn : gdb services need one or more targets defined