DocID018909 Rev 11
RM0090
Debug support (DBG)
1701
38.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 change the GPIO
(PA15, PB3 and PB4) configuration mode in the GPIO_MODER register. This releases
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 IO pin
configuration in the IOPORT controller has no effect.
38.5
STM32F4xx JTAG TAP connection
The STM32F4xx MCUs integrate two serially connected JTAG TAPs, the boundary scan
TAP (IR is 5-bit wide) and the Cortex
®
-M4 with FPU TAP (IR is 4-bit wide).
To access the TAP of the Cortex
®
-M4 with FPU 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.
Note:
Important
: Once Serial-Wire is selected using the dedicated ARM
®
JTAG sequence, the
boundary scan TAP is automatically disabled (JTMS forced high).