2013-11-27 01:14 PM
Hello, i'm working with a custom board with a STM32L151RD and a st-linkv2. For debugging purpose i only have access to SWD pins:
SWCLK (PA14) SWDIO (PA13)TRACESWO (PB3)NRSTBut the microcontroller is JTAG wired by default, so my question is:When i select the SWD protocol on the ST-linkv2 it automatically send the special sequence on the SWDIOTMS pin is used to switch between JTAG-DP and SW-DP?Explanation from the reference manual:29.3.1 Mechanism to select the JTAG-DP or the SW-DPBy default, the JTAG-Debug Port is active.If the debugger host wants to switch to the SW-DP, it must provide a dedicated JTAGsequence on TMS/TCK (respectively mapped to SWDIO and SWCLK) which disables theJTAG-DP and enables the SW-DP. This way it is possible to activate the SWDP using onlythe SWCLK and SWDIO pins.This sequence is:1. Send more than 50 TCK cycles with TMS (SWDIO) =12. Send the 16-bit sequence on TMS (SWDIO) = 0111100111100111 (MSB transmittedfirst)3. Send more than 50 TCK cycles with TMS (SWDIO) =1 #cross-post2013-11-27 05:25 PM
Yes, only needs these pins (and ground) for SWD/SWV connectivity, this is how the Discovery boards work. JTAG mode will not be viable unless you have it's full complement of pins.
2013-11-28 07:00 AM
Thanks for the reply
Regards2013-11-29 10:43 AM
Now update your cross-post on the Keil forum to note that the question is answered: