I wanted to switch my Tiva C series MCU (a Stellaris target) from JTAG
to SWD, but OpenOCD doesn't seem to support doing this directly. It
does support resetting the flash of the MCU which involves switching
from JTAG to SWD and back, so it wasn't too hard to make something
work.

I have a few questions about the best way to implement it.
1) I added commands to switch to JTAG and to switch to SWD to the
`dap_instance_commands` `command_registration` in `arm_adi_v5.c`. It
seems that all ARM ADI V5 MCUs support switching transports with these
commands, so it seemed like the right place to put them. Is this the
correct place or should they go somewhere else?
2) After switching, OpenOCD can no longer communicate with the MCU and
starts spitting out errors because it is trying to use the wrong
transport. Should these commands shut down OpenOCD or do nothing and
let the user stop OpenOCD? The user would then have to restart OpenOCD
with the correct transport. Even better, is there some way to change
the transport without restarting OpenOCD?

Thanks,
Bryn Hakl

Reply via email to