Connection to STM32 Debug Ports The STM32 is has a Serial-Wire JTAG Debug Port (SWJ-DP). This debug port can be used either in JTAG or Serial-Wire mode. Keil ULINK2 USB-JTAG Adapter supports both, the JTAG and also the Serial-Wire mode. The Serial-Wire mode uses less pins than the JTAG mode. With a specific sequence it is possible to switch between the different modes. This is done by the ULINK2 depending on the Target Debug Driver settings (see Cortex-M Target Driver Configuration). On the ARM JTAG connecter the pins are always the same and on the STM32 the pins change their meaning depending on the selected mode. The following pictures show the used pins in the differnt modes and the necessary Target Driver cofiguration.
Following connections can be used:
Classic JTAG connection Classic JTAG uses a 5-pin interface. On STM32 the JTAG-DP is selected for debugging.
Choose following Cortex-M Target Driver configuration to connect to the JTAG-DP.
In Cortex-M Target Driver Setup check SWJ and choose for Port JTAG with the correct rate for Max Clock.
Serial-Wire connection Serial-Wire only uses a 2-pin interface. One pin for clock and one pin for bidirectional data exchange. On STM32 the SW-DP is selected for debugging.
To connect to the SW-DP use following Cortex-M Target Driver configuration.
In Cortex-M Target Driver Setup check SWJ and choose for Port SW with the correct rate for Max Clock.
Serial-Wire connection with Serial-Wire Trace If Serial-Wire Viewer is used than an additional pin is necessary for the Serial-Wire Viewer Output. On STM32 the SW-DP is selected for debugging.
To connect to the SW-DP with SW Trace use following Cortex-M Target Driver configuration.
In Cortex-M Target Driver Setup check SWJ and choose for Port SW with the correct rate for Max Clock. Also check Trace with the correct Core Clock rate.