Using Serial Wire And Releasing The Unused Debug Pins As Gpios; Stm32F10Xxx Jtag Tap Connection - ST STM32F102 Series Reference Manual

Hide thumbs Also See for STM32F102 Series:
Table of Contents

Advertisement

Debug support (DBG)
Once a JTAG I/O is released by the user software, the GPIO controller takes control again.
The reset states of the GPIO control registers put the I/Os in the equivalent state:
JNTRST: Input pull-up
JTDI: Input pull-up
JTMS/SWDIO: Input pull-up
JTCK/SWCLK: Input pull-down
JTDO: Input floating
The software can then use these I/Os as standard GPIOs.
Note:
The JTAG IEEE standard recommends to add pull-ups on TDI, TMS and nTRST but there is
no special recommendation for TCK. However, for STM32F10xxx, an integrated pull-down is
used for JTCK.
Having embedded pull-ups and pull-downs removes the need to add external resistors.
26.4.4

Using serial wire and releasing the unused debug pins as GPIOs

To use the serial wire DP to release some GPIOs, the user software must set
SWJ_CFG=010 just after reset. This release PA15, PB3 and PB4 which now become
available as GPIOs.
When debugging, the host performs the following actions:
Under system RESET, all SWJ pins are assigned (JTAG-DP + SW-DP)
Under system RESET, the debugger host sends the JTAG sequence to switch from the
JTAG-DP to the SW-DP.
Still under system RESET, the debugger sets a breakpoint on vector reset
The System Reset is released and the Core halts.
All the debug communications from this point are done using the SW-DP. The other
JTAG pins can then be reassigned as GPIOs by the user software.
Note:
For user software designs, note that:
To release the debug pins, remember that they will be first configured either in input-pull-up
(nTRST, TMS, TDI) or pull-down (TCK) or output tristate (TDO) for a certain duration after
reset until the instant when the user software releases the pins.
When debug pins (JTAG or SW or TRACE) are mapped, changing the corresponding I/O pin
configuration in the IOPORT controller has no effect.
26.5

STM32F10xxx JTAG TAP connection

The STM32F10xxx MCU integrates two serially connected JTAG TAPs, the boundary scan
TAP (IR is 5-bit wide) and the Cortex-M3 TAP (IR is 4-bit wide).
To access the TAP of the Cortex-M3 for debug purposes:
1.
First, it is necessary to shift the BYPASS instruction of the boundary scan TAP.
2.
Then, for each IR shift, the scan chain contains 9 bits (=5+4) and the unused TAP
instruction must be shifted in using the BYPASS instruction.
3.
For each data shift, the unused TAP, which is in BYPASS mode, adds 1 extra data bit in
the data scan chain.
658/690
RM0008

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F102 Series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Stm32f101 seriesStm32f103 series

Table of Contents