From 563f8b604a6b845448d9d7cbfc960c100f73dadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Tue, 16 Mar 2021 23:27:29 +0100 Subject: [PATCH] application: add SWD to JTAG sequence --- application.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application.c b/application.c index 6b6b761..cd22f7c 100644 --- a/application.c +++ b/application.c @@ -389,6 +389,9 @@ static void command_jtag_scan(void* argument) gpio_set(channel_ports[tms], channel_pins[tms]); // start high (to go to reset state) gpio_mode_setup(channel_ports[tms], GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, channel_pins[tms]); // set channel for TMS back to input jtag_tms_ch = tms; // remember which channel we use for TMS for the transaction + jtag_transaction(0xffffffff, 0, 26); // ensure we are is reset state, even on SWD devices (needs 50 TMS hig); + jtag_transaction(0xffffffff, 0, 26); // continuation + jtag_transaction(0xE73C, 0, 16); // send sequence to switch any SWD device back to JTAG (this constant magic value) // all other channel should already be inputs jtag_transaction(0x3f | (0 << 6) | (1 << 7) | (0 << 8) | (0 << 9), 0, 6 + 1 + 1 + 1 + 1); // go back to JTAG TEST-LOGIC_RESET (5 bits should be enough to go from any state to RESET, but we a one just to be sure) -> RUN-TEST/IDLE -> SELECT-DR-SCAN -> CAPTURE-DR -> SHIFT-DR states // initialize array