33. Debug support (DBG)
33.1 Overview
The STM32F302xx devices are built around a Cortex-M4 ® F core which contains hardware extensions for advanced debugging features. The debug extensions allow the core to be stopped either on a given instruction fetch (breakpoint) or data access (watchpoint). When stopped, the core’s internal state and the system’s external state may be examined. Once examination is complete, the core and the system may be restored and program execution resumed.
The debug features are used by the debugger host when connecting to and debugging the STM32F302xx MCUs.
Two interfaces for debug are available:
- • Serial wire
- • JTAG debug port
Figure 397. Block diagram of STM32 MCU and Cortex-M4 ® F-level debug support
![Block diagram of STM32 MCU and Cortex-M4®F-level debug support. The diagram shows the internal architecture of the MCU, including the Cortex-M4 Core, Bus matrix, AHB-AP, Internal private peripheral bus (PPB), Bridge, NVIC, DWT, FPB, ITM, ETM, TPIU, and DBGMCU. External connections include JTAG/SWD pins (JTMS/SWDIO, JTDI, JTDO/TRACESWO, NJTRST, JTCK/SWCLK) and a Trace port (TRACESWO, TRACECK, TRACED[3:0]).](/RM0365-STM32F302xB-C-D-E-302x6-8/98c2cdeae4cf74e1ad85017fecce67ba_img.jpg)
The diagram illustrates the internal architecture of the STM32 MCU debug support. At the center is the Cortex-M4 Core, which is connected to a Bus matrix. The Bus matrix is connected to the DCode interface and the System interface. The Cortex-M4 Core is also connected to the AHB-AP, which is part of the Internal private peripheral bus (PPB). The PPB includes the Bridge, NVIC, DWT, FPB, and ITM. The Bridge is connected to the ETM, which is connected to the TPIU. The TPIU is connected to the Trace port, which includes TRACESWO, TRACECK, and TRACED[3:0]. The DBGMCU is also connected to the TPIU. External connections include JTAG/SWD pins (JTMS/SWDIO, JTDI, JTDO/TRACESWO, NJTRST, JTCK/SWCLK) and the Trace port. The diagram is labeled with 'STM32 MCU debug support' and 'Cortex-M4 debug support'.
Note: The debug features embedded in the Cortex-M4 core are a subset of the Arm CoreSight Design Kit.
The Cortex-M4 ® F core provides integrated on-chip debug support. It is comprised of:
- • SWJ-DP: Serial wire / JTAG debug port
- • AHP-AP: AHB access port
- • ITM: Instrumentation trace macrocell
- • FPB: Flash patch breakpoint
- • DWT: Data watchpoint trigger
- • TPU1: Trace port unit interface (available on larger packages, where the corresponding pins are mapped)
- • ETM: Embedded Trace Macrocell (available only on STM32F302xB/C devices larger packages, where the corresponding pins are mapped)
It also includes debug features dedicated to the STM32F302xx:
- • Flexible debug pinout assignment
- • MCU debug box (support for low-power modes, control over peripheral clocks, etc.)
Note: For further information on the debug feature supported by the Cortex-M4 ® F core, refer to the Cortex ® -M4 with FPU-r0p1 Technical Reference Manual and to the CoreSight Design Kit-r0p1 TRM (see Section 33.2: Reference Arm documentation ).
33.2 Reference Arm documentation
- • Cortex-M4
®
F r0p1 Technical Reference Manual (TRM)
It is available from: http://infocenter.arm.com - • Arm Debug Interface V5
- • Arm CoreSight Design Kit revision r0p1 Technical Reference Manual
33.3 SWJ debug port (serial wire and JTAG)
The STM32F302xx core integrates the Serial Wire / JTAG Debug Port (SWJ-DP). It is an Arm standard CoreSight debug port that combines a JTAG-DP (5-pin) interface and a SW-DP (2-pin) interface.
- • The JTAG debug port (JTAG-DP) provides a 5-pin standard JTAG interface to the AHP-AP port.
- • The serial wire debug Port (SW-DP) provides a 2-pin (clock + data) interface to the AHP-AP port.
In the SWJ-DP, the two JTAG pins of the SW-DP are multiplexed with some of the five JTAG pins of the JTAG-DP.
Figure 398. SWJ debug port

Figure 398 shows that the asynchronous TRACE output (TRACESWO) is multiplexed with TDO. This means that the asynchronous trace can only be used with SW-DP, not JTAG-DP.
33.3.1 Mechanism to select the JTAG-DP or the SW-DP
By default, the JTAG-Debug Port is active.
If the debugger host wants to switch to the SW-DP, it must provide a dedicated JTAG sequence on TMS/TCK (respectively mapped to SWDIO and SWCLK) which disables the JTAG-DP and enables the SW-DP. This way it is possible to activate the SWDP using only the SWCLK and SWDIO pins.
This sequence is:
- 1. Send more than 50 TCK cycles with TMS (SWDIO) =1
- 2. Send the 16-bit sequence on TMS (SWDIO) = 0111100111100111 (MSB transmitted first)
- 3. Send more than 50 TCK cycles with TMS (SWDIO) =1
33.4 Pinout and debug port pins
The STM32F302xx MCUs are available in various packages with different numbers of available pins. As a result, some functionality (ETM) related to pin availability may differ between packages.
33.4.1 SWJ debug port pins
Five pins are used as outputs from the STM32F302xx for the SWJ-DP as alternate functions of general-purpose I/Os. These pins are available on all packages.
Table 183. SWJ debug port pins
| SWJ-DP pin name | JTAG debug port | SW debug port | Pin assignment | ||
|---|---|---|---|---|---|
| Type | Description | Type | Debug assignment | ||
| JTMS/SWDIO | I | JTAG Test Mode Selection | IO | Serial Wire Data Input/Output | PA13 |
| JTCK/SWCLK | I | JTAG Test Clock | I | Serial Wire Clock | PA14 |
| JTDI | I | JTAG Test Data Input | - | - | PA15 |
| JTDO/TRACEWO | O | JTAG Test Data Output | - | TRACEWO if async trace is enabled | PB3 |
| NJTRST | I | JTAG Test nReset | - | - | PB4 |
33.4.2 Flexible SWJ-DP pin assignment
After RESET (SYSRESETn or PORESETn), all five pins used for the SWJ-DP are assigned as dedicated pins immediately usable by the debugger host (note that the trace outputs are not assigned except if explicitly programmed by the debugger host).
However, it is possible to disable some or all of the SWJ-DP ports and so, to release (in gray in the table below) the associated pins for general-purpose I/O(GPIO) usage. For more details on how to disable SWJ-DP port pins, please refer to Section 10.3.2: I/O pin alternate function multiplexer and mapping .
Table 184. Flexible SWJ-DP pin assignment
| Available debug ports | SWJ IO pin assigned | ||||
|---|---|---|---|---|---|
| PA13 / JTMS/ SWDIO | PA14 / JTCK/ SWCLK | PA15 / JTDI | PB3 / JTDO | PB4/ NJTRST | |
| Full SWJ (JTAG-DP + SW-DP) - Reset State | X | X | X | X | X |
| Full SWJ (JTAG-DP + SW-DP) but without NJTRST | X | X | X | X | |
| JTAG-DP Disabled and SW-DP Enabled | X | X | |||
| JTAG-DP Disabled and SW-DP Disabled | Released | ||||
Note: When the APB bridge write buffer is full, it takes one extra APB cycle when writing the AFIO_MAPR register. This is because the deactivation of the JTAGSW pins is done in two cycles to guarantee a clean level on the nTRST and TCK input signals of the core.
- • Cycle 1: the JTAGSW input signals to the core are tied to 1 or 0 (to 1 for nTRST, TDI and TMS, to 0 for TCK)
- • Cycle 2: the GPIO controller takes the control signals of the SWJTAG IO pins (like controls of direction, pull-up/down, Schmitt trigger activation, etc.).
33.4.3 Internal pull-up and pull-down on JTAG pins
It is necessary to ensure that the JTAG input pins are not floating since they are directly connected to flip-flops to control the debug mode features. Special care must be taken with the SWCLK/TCK pin which is directly connected to the clock of some of these flip-flops.
To avoid any uncontrolled IO levels, the device embeds internal pull-ups and pull-downs on the JTAG input pins:
- • NJTRST: Internal pull-up
- • JTDI: Internal pull-up
- • JTMS/SWDIO: Internal pull-up
- • TCK/SWCLK: Internal pull-down
Once a JTAG IO 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:
- • NJTRST: 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 JTCK, the device needs an integrated pull-down.
Having embedded pull-ups and pull-downs removes the need to add external resistors.
33.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 are 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.
33.5 STM32F302xx JTAG TAP connection
The STM32F302xx MCUs integrate two serially connected JTAG TAPs, the boundary scan TAP (IR is 5-bit wide) and the Cortex-M4 ® F TAP (IR is 4-bit wide).
To access the TAP of the Cortex-M4 ® F 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).
Figure 399. JTAG TAP connections

33.6 ID codes and locking mechanism
There are several ID codes inside the STM32F302xx MCUs. ST strongly recommends tools designers to lock their debuggers using the MCU DEVICE ID code located in the external PPB memory map at address 0xE0042000.
33.6.1 MCU device ID code
The STM32F302xx MCUs integrate an MCU ID code. This ID identifies the ST MCU part-number and the die revision. It is part of the DBG_MCU component and is mapped on the external PPB bus (see Section 33.14 on page 1058 ). This code is accessible using the JTAG debug port (4 to 5 pins) or the SW debug port (two pins) or by the user software. It is even accessible while the MCU is under system reset.
DBGMCU_IDCODE
Address: 0xE004 2000
Only 32-bits access supported. Read-only
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| REV_ID | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res | Res | Res | Res | DEV_ID | |||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | ||||
This code is read as 0x10000439 for Revision 1.0 of STM32F302x6x8 devices and 0x10000422 for Revision 1.0 of STM32F302xBxC devices.
Bits 31:16 REV_ID[15:0] Revision identifier
This field indicates the revision of the device. For example, it is read as 0x1000 for Revision 1.
Bits 15:12 Reserved, must be kept at reset value.
Bits 11:0 DEV_ID[11:0] Device identifier
This field indicates the device and its revision.
The device ID is 0x439 for STM32F302x6x8 devices, 0x422 for STM32F302xBxC devices and 0x446 for STM32F302xD/E.
33.6.2 Boundary scan TAP
JTAG ID code
The TAP of the STM32F302xx BSC (boundary scan) integrates a JTAG ID code equal to 0x06432041.
33.6.3 Cortex-M4 ® F TAP
The TAP of the Cortex-M4 ® F integrates a JTAG ID code. This ID code is the Arm ® default one and has not been modified. This code is only accessible by the JTAG Debug Port.
This code is 0x4BA00477 (corresponds to Cortex-M4 ® F r0p1, see Section 33.2: Reference Arm documentation ).
Only the DEV_ID(11:0) should be used for identification by the debugger/programmer tools.
33.6.4 Cortex-M4 ® F JEDEC-106 ID code
The Cortex-M4 ® F integrates a JEDEC-106 ID code. It is located in the 4KB ROM table mapped on the internal PPB bus at address 0xE00FF000_0xE00FFFFF.
This code is accessible by the JTAG Debug Port (4 to 5 pins) or by the SW Debug Port (two pins) or by the user software.
33.7 JTAG debug port
A standard JTAG state machine is implemented with a 4-bit instruction register (IR) and five data registers (for full details, refer to the Cortex-M4 ® Fr0p1 Technical Reference Manual (TRM), for references, please see Section 33.2: Reference Arm documentation ).
Table 185. JTAG debug port data registers
| IR(3:0) | Data register | Details |
|---|---|---|
| 1111 | BYPASS [1 bit] | |
| 1110 | IDCODE [32 bits] | ID CODE 0x3BA00477 (Cortex-M4 ® F r0p1 ID Code) |
Table 185. JTAG debug port data registers (continued)
| IR(3:0) | Data register | Details |
|---|---|---|
| 1010 | DPACC [35 bits] | Debug port access register This initiates a debug port and allows access to a debug port register.
Refer to Table 186 for a description of the A(3:2) bits |
| 1011 | APACC [35 bits] | Access port access register Initiates an access port and allows access to an access port register.
There are many AP Registers (see AHB-AP) addressed as the combination of:
|
| 1000 | ABORT [35 bits] | Abort register
|
Table 186. 32-bit debug port registers addressed through the shifted value A[3:2]
| Address | A(3:2) value | Description |
|---|---|---|
| 0x0 | 00 | Reserved, must be kept at reset value. |
| 0x4 | 01 | DP CTRL/STAT register. Used to:
|
Table 186. 32-bit debug port registers addressed through the shifted value A[3:2] (continued)
| Address | A(3:2) value | Description |
|---|---|---|
| 0x8 | 10 | DP SELECT register: Used to select the current access port and the active 4-words register window.
|
| 0xC | 11 | DP RDBUFF register: Used to allow the debugger to get the final result after a sequence of operations (without requesting new JTAG-DP operation) |
33.8 SW debug port
33.8.1 SW protocol introduction
This synchronous serial protocol uses two pins:
- • SWCLK: clock from host to target
- • SWDIO: bidirectional
The protocol allows two banks of registers (DPACC registers and APACC registers) to be read and written to.
Bits are transferred LSB-first on the wire.
For SWDIO bidirectional management, the line must be pulled-up on the board (100 k \( \Omega \) recommended by Arm).
Each time the direction of SWDIO changes in the protocol, a turnaround time is inserted where the line is not driven by the host nor the target. By default, this turnaround time is one bit time, however this can be adjusted by configuring the SWCLK frequency.
33.8.2 SW protocol sequence
Each sequence consist of three phases:
- 1. Packet request (8 bits) transmitted by the host
- 2. Acknowledge response (3 bits) transmitted by the target
- 3. Data transfer phase (33 bits) transmitted by the host or the target
Table 187. Packet request (8-bits)
| Bit | Name | Description |
|---|---|---|
| 0 | Start | Must be “1” |
| 1 | APnDP | 0: DP Access 1: AP Access |
| 2 | RnW | 0: Write Request 1: Read Request |
| Bit | Name | Description |
|---|---|---|
| 4:3 | A(3:2) | Address field of the DP or AP registers (refer to Table 186 ) |
| 5 | Parity | Single bit parity of preceding bits |
| 6 | Stop | 0 |
| 7 | Park | Not driven by the host. Must be read as “1” by the target because of the pull-up |
Refer to the Cortex-M4 ® F r0p1 TRM for a detailed description of DPACC and APACC registers.
The packet request is always followed by the turnaround time (default 1 bit) where neither the host nor target drive the line.
Table 188. ACK response (3 bits)| Bit | Name | Description |
|---|---|---|
| 0..2 | ACK | 001: FAULT 010: WAIT 100: OK |
The ACK Response must be followed by a turnaround time only if it is a READ transaction or if a WAIT or FAULT acknowledge has been received.
Table 189. DATA transfer (33 bits)| Bit | Name | Description |
|---|---|---|
| 0..31 | WDATA or RDATA | Write or Read data |
| 32 | Parity | Single parity of the 32 data bits |
The DATA transfer must be followed by a turnaround time only if it is a READ transaction.
33.8.3 SW-DP state machine (reset, idle states, ID code)
The State Machine of the SW-DP has an internal ID code which identifies the SW-DP. It follows the JEP-106 standard. This ID code is the default Arm ® one and is set to 0x1BA01477 (corresponding to Cortex-M4 ® F r0p1).
Note: Note that the SW-DP state machine is inactive until the target reads this ID code.
- • The SW-DP state machine is in RESET STATE either after power-on reset, or after the DP has switched from JTAG to SWD or after the line is high for more than 50 cycles
- • The SW-DP state machine is in IDLE STATE if the line is low for at least two cycles after RESET state.
- • After RESET state, it is mandatory to first enter into an IDLE state AND to perform a READ access of the DP-SW ID CODE register. Otherwise, the target issues a FAULT acknowledge response on another transactions.
Further details of the SW-DP state machine can be found in the Cortex-M4 ® F r0p1 TRM and the CoreSight Design Kit r0p1 TRM .
33.8.4 DP and AP read/write accesses
- • Read accesses to the DP are not posted: the target response can be immediate (if ACK=OK) or can be delayed (if ACK=WAIT).
- • Read accesses to the AP are posted. This means that the result of the access is returned on the next transfer. If the next access to be done is NOT an AP access, then the DP-RDBUFF register must be read to obtain the result.
The READOK flag of the DP-CTRL/STAT register is updated on every AP read access or RDBUFF read request to know if the AP read access was successful. - • The SW-DP implements a write buffer (for both DP or AP writes), that enables it to accept a write operation even when other transactions are still outstanding. If the write buffer is full, the target acknowledge response is “WAIT”. With the exception of IDCODE read or CTRL/STAT read or ABORT write which are accepted even if the write buffer is full.
- • Because of the asynchronous clock domains SWCLK and HCLK, two extra SWCLK cycles are needed after a write transaction (after the parity bit) to make the write effective internally. These cycles should be applied while driving the line low (IDLE state)
This is particularly important when writing the CTRL/STAT for a power-up request. If the next transaction (requiring a power-up) occurs immediately, it fails.
33.8.5 SW-DP registers
Access to these registers are initiated when APnDP=0
Table 190. SW-DP registers
| A(3:2) | R/W | CTRLSEL bit of SELECT register | Register | Notes |
|---|---|---|---|---|
| 00 | Read | - | IDCODE | The manufacturer code is not set to ST code 0x2BA01477 (identifies the SW-DP) |
| 00 | Write | - | ABORT | - |
| 01 | Read/Write | 0 | DP-CTRL/STAT | Purpose is to: – request a system or debug power-up – configure the transfer operation for AP accesses – control the pushed compare and pushed verify operations. – read some status flags (overrun, power-up acknowledges) |
| 01 | Read/Write | 1 | WIRE CONTROL | Purpose is to configure the physical serial port protocol (like the duration of the turnaround time) |
| 10 | Read | - | READ RESEND | Enables recovery of the read data from a corrupted debugger transfer, without repeating the original AP transfer. |
Table 190. SW-DP registers (continued)
| A(3:2) | R/W | CTRLSEL bit of SELECT register | Register | Notes |
|---|---|---|---|---|
| 10 | Write | - | SELECT | The purpose is to select the current access port and the active 4-words register window |
| 11 | Read/Write | - | READ BUFFER | This read buffer is useful because AP accesses are posted (the result of a read AP request is available on the next AP transaction). This read buffer captures data from the AP, presented as the result of a previous read, without initiating a new transaction |
33.8.6 SW-AP registers
Access to these registers are initiated when APnDP=1
There are many AP Registers (see AHB-AP) addressed as the combination of:
- • The shifted value A[3:2]
- • The current value of the DP SELECT register
33.9 AHB-AP (AHB access port) - valid for both JTAG-DP and SW-DP
Features:
- • System access is independent of the processor status.
- • Either SW-DP or JTAG-DP accesses AHB-AP.
- • The AHB-AP is an AHB master into the Bus Matrix. Consequently, it can access all the data buses (Dcode Bus, System Bus, internal and external PPB bus) but the ICode bus.
- • Bitband transactions are supported.
- • AHB-AP transactions bypass the FPB.
The address of the 32-bits AHP-AP resisters are 6-bits wide (up to 64 words or 256 bytes) and consists of:
- Bits [7:4] = the bits [7:4] APBANKSEL of the DP SELECT register
- Bits [3:2] = the 2 address bits of A(3:2) of the 35-bit packet request for SW-DP.
The AHB-AP of the Cortex-M4 ® F includes 9 x 32-bits registers:
Table 191. Cortex-M4 ® F AHB-AP registers
| Address offset | Register name | Notes |
|---|---|---|
| 0x00 | AHB-AP Control and Status Word | Configures and controls transfers through the AHB interface (size, hprot, status on current transfer, address increment type) |
| 0x04 | AHB-AP Transfer Address | - |
| 0x0C | AHB-AP Data Read/Write | - |
| 0x10 | AHB-AP Banked Data 0 | Directly maps the 4 aligned data words without rewriting the Transfer Address Register. |
| 0x14 | AHB-AP Banked Data 1 | |
| 0x18 | AHB-AP Banked Data 2 | |
| 0x1C | AHB-AP Banked Data 3 | |
| 0xF8 | AHB-AP Debug ROM Address | Base Address of the debug interface |
| 0xFC | AHB-AP ID Register | - |
Refer to the Cortex-M4 ® F r0p1 TRM for further details.
33.10 Core debug
Core debug is accessed through the core debug registers. Debug access to these registers is by means of the Advanced High-performance Bus (AHB-AP) port. The processor can access these registers directly over the internal Private Peripheral Bus (PPB).
It consists of 4 registers:
Table 192. Core debug registers
| Register | Description |
|---|---|
| DHCSR | The 32-bit Debug Halting Control and Status Register This provides status information about the state of the processor enable core debug halt and step the processor |
| DCRSR | The 17-bit Debug Core Register Selector Register: This selects the processor register to transfer data to or from. |
| DCRDR | The 32-bit Debug Core Register Data Register: This holds data for reading and writing registers to and from the processor selected by the DCRSR (Selector) register. |
| DEMCR | The 32-bit Debug Exception and Monitor Control Register: This provides Vector Catching and Debug Monitor Control. This register contains a bit named TRCENA which enable the use of a TRACE. |
Note: Important: these registers are not reset by a system reset. They are only reset by a power-on reset.
Refer to the Cortex-M4 ® F r0p1 TRM for further details.
To Halt on reset, it is necessary to:
- • enable the bit0 (VC_CORRESET) of the Debug and Exception Monitor Control Register
- • enable the bit0 (C_DEBUGEN) of the Debug Halting Control and Status Register.
33.11 Capability of the debugger host to connect under system reset
The STM32F302xx MCUs' reset system comprises the following reset sources:
- • POR (power-on reset) which asserts a RESET at each power-up.
- • Internal watchdog reset
- • Software reset
- • External reset
The Cortex-M4 ® F differentiates the reset of the debug part (generally PORRESETn) and the other one (SYSRESETn)
This way, it is possible for the debugger to connect under System Reset, programming the Core Debug Registers to halt the core when fetching the reset vector. Then the host can release the system reset and the core immediately halt without having executed any instructions. In addition, it is possible to program any debug features under System Reset.
Note: It is highly recommended for the debugger host to connect (set a breakpoint in the reset vector) under system reset.
33.12 FPB (Flash patch breakpoint)
The FPB unit:
- • implements hardware breakpoints
- • patches code and data from code space to system space. This feature gives the possibility to correct software bugs located in the Code Memory Space.
The use of a Software Patch or a Hardware Breakpoint is exclusive.
The FPB consists of:
- • 2 literal comparators for matching against literal loads from Code Space and remapping to a corresponding area in the System Space.
- • 6 instruction comparators for matching against instruction fetches from Code Space. They can be used either to remap to a corresponding area in the System Space or to generate a Breakpoint Instruction to the core.
33.13 DWT (data watchpoint trigger)
The DWT unit consists of four comparators. They are configurable as:
- • a hardware watchpoint or
- • a trigger to an ETM or
- • a PC sampler or
- • a data address sampler
The DWT also provides some means to give some profiling informations. For this, some counters are accessible to give the number of:
- • Clock cycle
- • Folded instructions
- • Load store unit (LSU) operations
- • Sleep cycles
- • CPI (clock per instructions)
- • Interrupt overhead
33.14 MCU debug component (DBGMCU)
The MCU debug component helps the debugger provide support for:
- • Low-power modes
- • Clock control for timers, watchdog, I2C and bxCAN during a breakpoint
- • Control of the trace pins assignment
33.14.1 Debug support for low-power modes
To enter low-power mode, the instruction WFI or WFE must be executed.
The MCU implements several low-power modes which can either deactivate the CPU clock or reduce the power of the CPU.
The core does not allow FCLK or HCLK to be turned off during a debug session. As these are required for the debugger connection, during a debug, they must remain active. The MCU integrates special means to allow the user to debug software in low-power modes.
For this, the debugger host must first set some debug configuration registers to change the low-power mode behavior:
- • In Sleep mode, DBG_SLEEP bit of DBGMCU_CR register must be previously set by the debugger. This feeds HCLK with the same clock that is provided to FCLK (system clock previously configured by the software).
- • In Stop mode, the bit DBG_STOP must be previously set by the debugger. This enables the internal RC oscillator clock to feed FCLK and HCLK in STOP mode.
33.14.2 Debug support for timers, watchdog, bxCAN and I 2 C
During a breakpoint, it is necessary to choose how the counter of timers and watchdog should behave:
- • They can continue to count inside a breakpoint. This is usually required when a PWM is controlling a motor, for example.
- • They can stop to count inside a breakpoint. This is required for watchdog purposes.
For the bxCAN, the user can choose to block the update of the receive register during a breakpoint.
For the I 2 C, the user can choose to block the SMBUS timeout during a breakpoint.
For timers having complementary outputs, when the counter is stopped (DBG_TIMx_STOP=1), the outputs are disabled (as if the MOE bit was reset) for safety purposes.
33.14.3 Debug MCU configuration register
This register allows the configuration of the MCU under DEBUG. This concerns:
- • Low-power mode support
- • Timer and watchdog counter support
- • bxCAN communication support
- • Trace pin assignment
This DBGMCU_CR is mapped on the External PPB bus at address 0xE0042004.
It is asynchronously reset by the PORESET (and not the system reset). It can be written by the debugger under system reset.
If the debugger host does not support these features, it is still possible for the user software to write to these registers.
DBGMCU_CR
Address: 0xE004 2004
Only 32-bit access supported
POR Reset: 0x0000 0000 (not reset by system reset)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
| Res | Res | Res | Res | Res | Res | Res | Res | TRACE_ MODE [1:0] | TRACE _ IOEN | Res. | Res. | DBG_ STAND BY | DBG_ STOP | DBG_ SLEEP | |
| rw | rw | rw | rw | rw | rw | ||||||||||
Bits 31:8 Reserved, must be kept at reset value.
Bits 7:5 TRACE_MODE[1:0] and TRACE_IOEN : Trace pin assignment control
– With TRACE_IOEN=0:
TRACE_MODE=xx: TRACE pins not assigned (default state)
– With TRACE_IOEN=1:
- – TRACE_MODE=00: TRACE pin assignment for Asynchronous Mode
- – TRACE_MODE=01: TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 1
- – TRACE_MODE=10: TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 2
- – TRACE_MODE=11: TRACE pin assignment for Synchronous Mode with a TRACEDATA size of 4
Note: In STM32F302x6/8 devices, synchronous trace is not available, thus bits 7:5 are reserved and must be kept at 0.
Bits 4:3 Reserved, must be kept at reset value.
Bit 2 DBG_STANDBY: Debug Standby mode0: (FCLK=Off, HCLK=Off) The whole digital part is unpowered.
From software point of view, exiting from Standby is identical than fetching reset vector (except a few status bit indicated that the MCU is resuming from Standby)
1: (FCLK=On, HCLK=On) In this case, the digital part is not unpowered and FCLK and HCLK are provided by the internal RC oscillator which remains active. In addition, the MCU generate a system reset during Standby mode so that exiting from Standby is identical than fetching from reset
Bit 1 DBG_STOP: Debug Stop mode0: (FCLK=Off, HCLK=Off) In STOP mode, the clock controller disables all clocks (including HCLK and FCLK). When exiting from STOP mode, the clock configuration is identical to the one after RESET (CPU clocked by the 8 MHz internal RC oscillator (HSI)). Consequently, the software must reprogram the clock controller to enable the PLL, the Xtal, etc.
1: (FCLK=On, HCLK=On) In this case, when entering STOP mode, FCLK and HCLK are provided by the internal RC oscillator which remains active in STOP mode. When exiting STOP mode, the software must reprogram the clock controller to enable the PLL, the Xtal, etc. (in the same way it would do in case of DBG_STOP=0)
Bit 0 DBG_SLEEP: Debug Sleep mode0: (FCLK=On, HCLK=Off) In Sleep mode, FCLK is clocked by the system clock as previously configured by the software while HCLK is disabled.
In Sleep mode, the clock controller configuration is not reset and remains in the previously programmed state. Consequently, when exiting from Sleep mode, the software does not need to reconfigure the clock controller.
1: (FCLK=On, HCLK=On) In this case, when entering Sleep mode, HCLK is fed by the same clock that is provided to FCLK (system clock as previously configured by the software).
33.14.4 Debug MCU APB1 freeze register (DBGMCU_APB1_FZ)
The DBGMCU_APB1_FZ register is used to configure the MCU under DEBUG. It concerns the APB1 peripherals:
- • Timer clock counter freeze
- • I2C SMBUS timeout freeze
- • Window watchdog and independent watchdog counter freeze support
This DBGMCU_APB1_FZ is mapped on the external PPB bus at address 0xE0042008.
The register is asynchronously reset by the POR (and not the system reset). It can be written by the debugger under system reset.
Address: 0xE004 2008
Only 32-bit access are supported.
Power on reset (POR): 0x0000 0000 (not reset by system reset)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res | DBG_I2C3_SMBUS_TIMEOUT (1) | Res | Res | Res | Res | DBG_CAN_STOP | Res | Res | DBG_I2C2_SMBUS_TIMEOUT | DBG_I2C1_SMBUS_TIMEOUT | Res | Res | Res | Res | Res |
| rw | rw | rw | |||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res | Res | Res | DBG_IWDG_STOP | DBG_WWDG_STOP | DBG_RTC_STOP | Res | Res | Res | Res | Res | DBG_TIM6_STOP | Res | DBG_TIM4_STOP (2) | DBG_TIM3_STOP (2) | DBG_TIM2_STOP |
| rw | rw | rw | rw | rw | rw | rw |
1. Only in STM32F302x6/8 and STM32F302xD/E devices.
2. Only in STM32F302xB/C/D/E devices.
Bits 31 Reserved, must be kept at reset value.
Bit 30
DBG_I2C3_SMBUS_TIMEOUT
: SMBUS timeout mode stopped when core is halted
0: Same behavior as in normal mode
1: The SMBUS timeout is frozen
Bits 29:26 Reserved, must be kept at reset value.
Bit 25
DBG_CAN_STOP
: Debug CAN stopped when core is halted
0: Same behavior as in normal mode
1: The CAN2 receive registers are frozen
Bits 24:23 Reserved, must be kept at reset value.
- Bit 22
DBG_I2C2_SMBUS_TIMEOUT
: SMBUS timeout mode stopped when core is halted
0: Same behavior as in normal mode
1: The SMBUS timeout is frozen - Bit 21
DBG_I2C1_SMBUS_TIMEOUT
: SMBUS timeout mode stopped when core is halted
0: Same behavior as in normal mode
1: The SMBUS timeout is frozen - Bits 20:13 Reserved, must be kept at reset value.
- Bit 12
DBG_IWDG_STOP
: Debug independent watchdog stopped when core is halted
0: The independent watchdog counter clock continues even if the core is halted
1: The independent watchdog counter clock is stopped when the core is halted - Bit 11
DBG_WWDG_STOP
: Debug window watchdog stopped when core is halted
0: The window watchdog counter clock continues even if the core is halted
1: The window watchdog counter clock is stopped when the core is halted - Bit 10
DBG_RTC_STOP
: Debug RTC stopped when core is halted
0: The clock of the RTC counter is fed even if the core is halted
1: The clock of the RTC counter is stopped when the core is halted - Bits 9:5 Reserved, must be kept at reset value.
- Bit 4
DBG_TIM6_STOP
: TIM6 counter stopped when core is halted
0: The counter clock of TIM6 is fed even if the core is halted
1: The counter clock of TIM6 is stopped and the output is disabled when the core is halted - Bit 3 Reserved, must be kept at reset value.
- Bit 2
DBG_TIM4_STOP
: TIM4 counter stopped when core is halted (Available on STM32F302xB/C devices only)
0: The counter clock of TIM4 is fed even if the core is halted
1: The counter clock of TIM4 is stopped and the output is disabled when the core is halted - Bit 1
DBG_TIM3_STOP
: TIM3 counter stopped when core is halted
0: The counter clock of TIM3 is fed even if the core is halted
1: The counter clock of TIM3 is stopped and the output is disabled when the core is halted - Bit 0
DBG_TIM2_STOP
: TIM2 counter stopped when core is halted
0: The counter clock of TIM2 is fed even if the core is halted
1: The counter clock of TIM2 is stopped and the output is disabled when the core is halted
33.14.5 Debug MCU APB2 freeze register (DBGMCU_APB2_FZ)
The DBGMCU_APB2_FZ register is used to configure the MCU under DEBUG. It concerns APB2 peripherals:
- • Timer clock counter freeze
This register is mapped on the external PPB bus at address 0xE004 200C
It is asynchronously reset by the POR (and not the system reset). It can be written by the debugger under system reset.
Address: 0xE004 200C
Only 32-bit access is supported.
POR: 0x0000 0000 (not reset by system reset)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res. | DBG_TIM17_STOP | DBG_TIM16_STOP | DBG_TIM15_STOP | Res | DBG_TIM1_STOP |
| rw | rw | rw | rw | rw |
Bits 31:5 Reserved, must be kept at reset value.
Bits 4:0 DBG_TIMx_STOP : TIMx counter stopped when core is halted (x=1, 8, 15..17)
- 0: The clock of the involved timer counter is fed even if the core is halted
- 1: The clock of the involved timer counter is stopped and the outputs are disabled when the core is halted
Note: Bit1 and Bit 5 are reserved.
33.15 TPIU (trace port interface unit)
33.15.1 Introduction
The TPIU acts as a bridge between the on-chip trace data from the ITM and the ETM.
The output data stream encapsulates the trace source ID, that is then captured by a trace port analyzer (TPA).
The core embeds a simple TPIU, especially designed for low-cost debug (consisting of a special version of the CoreSight TPIU).
Figure 400. TPIU block diagram
![Figure 400. TPIU block diagram. The diagram illustrates the internal components of the TPIU. On the left, within the CLK domain, are the ETM and ITM blocks. These connect to two separate Asynchronous FIFO blocks. These FIFOs feed into a central TPIU formatter. The formatter interacts with a Trace out (serializer) block located in the TRACECLKIN domain. The serializer outputs several signals: TRACECLKIN, TRACECK, TRACEDATA [3:0], and TRACESWO. An External PPB bus at the bottom connects to the FIFOs and the serializer. The diagram is labeled ai17114 at the bottom right.](/RM0365-STM32F302xB-C-D-E-302x6-8/964bfe4a5c7341d6dbe5eb8864f94e30_img.jpg)
33.15.2 TRACE pin assignment
- Asynchronous mode
The asynchronous mode requires 1 extra pin and is available on all packages. It is only available if using Serial Wire mode (not in JTAG mode).
Table 193. Asynchronous TRACE pin assignment
| TPIU pin name | Trace synchronous mode | STM32F302xx pin assignment | |
|---|---|---|---|
| Type | Description | ||
| TRACESWO | O | TRACE Async Data Output | PB3 |
- ● Synchronous mode
The synchronous mode requires from 2 to 6 extra pins depending on the data trace size and is only available in the larger packages. In addition it is available in JTAG mode and in Serial Wire mode and provides better bandwidth output capabilities than asynchronous trace.
Table 194. Synchronous TRACE pin assignment
| TPUI pin name | Trace synchronous mode | STM32F302xx pin assignment | |
|---|---|---|---|
| Type | Description | ||
| TRACECK | O | TRACE Clock | PE2 |
| TRACED[3:0] | O | TRACE Sync Data Outputs Can be 1, 2 or 4. | PE[6:3] |
TPUI TRACE pin assignment
By default, these pins are NOT assigned. They can be assigned by setting the TRACE_IOEN and TRACE_MODE bits in the MCU Debug component configuration register . This configuration has to be done by the debugger host.
In addition, the number of pins to assign depends on the trace configuration (asynchronous or synchronous).
- • Asynchronous mode: 1 extra pin is needed
- •
Synchronous mode
(Available in STM32F302xx only): from 2 to 5 extra pins are needed depending on the size of the data trace port register (1, 2 or 4) :
- – TRACECK
- – TRACED(0) if port size is configured to 1, 2 or 4
- – TRACED(1) if port size is configured to 2 or 4
- – TRACED(2) if port size is configured to 4
- – TRACED(3) if port size is configured to 4
To assign the TRACE pin, the debugger host must program the bits TRACE_IOEN and TRACE_MODE[1:0] of the Debug MCU configuration Register (DBGMCU_CR). By default the TRACE pins are not assigned.
This register is mapped on the external PPB and is reset by the PORESET (and not by the SYSTEM reset). It can be written by the debugger under SYSTEM reset.
Table 195. Flexible TRACE pin assignment
| DBGMCU_CR register | Pins assigned for: | TRACE IO pin assigned | ||||||
|---|---|---|---|---|---|---|---|---|
| TRACE_IOEN | TRACE_MODE [1:0] | PB3 / JTDO/ TRACESWO | PE2 / TRACECK | PE3 / TRACED[0] | PE4 / TRACED[1] | PE5 / TRACED[2] | PE6 / TRACED[3] | |
| 0 | XX | No Trace (default state) | Released (1) | - | ||||
| 1 | 00 | Asynchronous Trace | TRACESWO | - | - | Released (usable as GPIO) | ||
Table 195. Flexible TRACE pin assignment (continued)
| DBGMCU_CR register | Pins assigned for: | TRACE IO pin assigned | ||||||
|---|---|---|---|---|---|---|---|---|
| TRACE_IOEN | TRACE_MODE [1:0] | PB3 / JTDO/ TRACESWO | PE2 / TRACECK | PE3 / TRACED[0] | PE4 / TRACED[1] | PE5 / TRACED[2] | PE6 / TRACED[3] | |
| 1 | 01 | Synchronous Trace 1 bit | Released (1) | TRACECK | TRACED[0] | - | - | - |
| 1 | 10 | Synchronous Trace 2 bit | TRACECK | TRACED[0] | TRACED[1] | - | - | |
| 1 | 11 | Synchronous Trace 4 bit | TRACECK | TRACED[0] | TRACED[1] | TRACED[2] | TRACED[3] | |
1. When Serial Wire mode is used, it is released. But when JTAG is used, it is assigned to JTDO.
Note: By default, the TRACECLKIN input clock of the TPIU is tied to GND. It is assigned to HCLK two clock cycles after the bit TRACE_IOEN has been set.
Synchronous trace port availability depends on the chosen package.
The debugger must then program the Trace Mode by writing the PROTOCOL[1:0] bits in the SPP_R (Selected Pin Protocol) register of the TPIU.
- • PROTOCOL=00: Trace Port Mode (synchronous)
- • PROTOCOL=01 or 10: Serial Wire (Manchester or NRZ) Mode (asynchronous mode). Default state is 01
It then also configures the TRACE port size by writing the bits [3:0] in the CPSPS_R (Current Sync Port Size Register) of the TPIU:
- • 0x1 for 1 pin (default state)
- • 0x2 for 2 pins
- • 0x8 for 4 pins
33.15.3 TPUI formatter
The formatter protocol outputs data in 16-byte frames:
- • seven bytes of data
- • eight bytes of mixed-use bytes consisting of:
- – 1 bit (LSB) to indicate it is a DATA byte ('0) or an ID byte ('1).
- – 7 bits (MSB) which can be data or change of source ID trace.
- • one byte of auxiliary bits where each bit corresponds to one of the eight mixed-use bytes:
- – if the corresponding byte was a data, this bit gives bit0 of the data.
- – if the corresponding byte was an ID change, this bit indicates when that ID change takes effect.
Note: Refer to the Arm ® CoreSight Architecture Specification v1.0 (Arm ® IHI 0029B) for further information

33.15.4 TPUI frame synchronization packets
The TPUI can generate two types of synchronization packets:
- • The Frame Synchronization packet (or Full Word Synchronization packet)
It consists of the word: 0x7F_FF_FF_FF (LSB emitted first). This sequence can not occur at any other time provided that the ID source code 0x7F has not been used.
It is output periodically between frames.
In continuous mode, the TPA must discard all these frames once a synchronization frame has been found.
- • The Half-Word Synchronization packet
It consists of the half word: 0x7F_FF (LSB emitted first).
It is output periodically between or within frames.
These packets are only generated in continuous mode and enable the TPA to detect that the TRACE port is in IDLE mode (no TRACE to be captured). When detected by the TPA, it must be discarded.
33.15.5 Transmission of the synchronization frame packet
There is no Synchronization Counter register implemented in the TPIU of the core. Consequently, the synchronization trigger can only be generated by the DWT . Refer to the registers DWT Control Register (bits SYNCTAP[11:10]) and the DWT Current PC Sampler Cycle Count Register.
The TPUI Frame synchronization packet (0x7F_FF_FF_FF) is emitted:
- • after each TPIU reset release. This reset is synchronously released with the rising edge of the TRACECLKIN clock. This means that this packet is transmitted when the TRACE_IOEN bit in the DBGMCU_CFG register is set. In this case, the word 0x7F_FF_FF_FF is not followed by any formatted packet.
- • at each DWT trigger (assuming DWT has been previously configured). Two cases occur:
- – If the bit SYNENA of the ITM is reset, only the word 0x7F_FF_FF_FF is emitted without any formatted stream which follows.
- – If the bit SYNENA of the ITM is set, then the ITM synchronization packets will follow (0x80_00_00_00_00_00), formatted by the TPUI (trace source ID added).
33.15.6 Synchronous mode
The trace data output size can be configured to 4, 2 or 1 pin: TRACED(3:0)
The output clock is output to the debugger (TRACECK)
Here, TRACECLKIN is driven internally and is connected to HCLK only when TRACE is used.
Note: In this synchronous mode, it is not required to provide a stable clock frequency.
The TRACE I/Os (including TRACECK) are driven by the rising edge of TRACLKIN (equal to HCLK). Consequently, the output frequency of TRACECK is equal to HCLK/2.
33.15.7 Asynchronous mode
This is a low-cost alternative to output the trace using only 1 pin: this is the asynchronous output pin TRACESWO. Obviously there is a limited bandwidth.
TRACESWO is multiplexed with JTDO when using the SW-DP pin. This way, this functionality is available in all STM32F302xx packages.
This asynchronous mode requires a constant frequency for TRACECLKIN. For the standard UART (NRZ) capture mechanism, 5% accuracy is needed. The Manchester encoded version is tolerant up to 10%.
33.15.8 TRACECLKIN connection inside the STM32F302xx
In the STM32F302xx, this TRACECLKIN input is internally connected to HCLK. This means that when in asynchronous trace mode, the application is restricted to use to time frames where the CPU frequency is stable.
Note: Important: when using asynchronous trace: it is important to be aware that:
The default clock of the STM32F302xx MCUs is the internal RC oscillator. Its frequency under reset is different from the one after reset release. This is because the RC calibration is the default one under system reset and is updated at each system reset release.
Consequently, the trace port analyzer (TPA) should not enable the trace (with the TRACE_IOEN bit) under system reset, because a Synchronization Frame Packet will be issued with a different bit time than trace packets which will be transmitted after reset release.
33.15.9 TPIU registers
The TPIU APB registers can be read and written only if the bit TRCENA of the Debug Exception and Monitor Control Register (DEMCR) is set. Otherwise, the registers are read as zero (the output of this bit enables the PCLK of the TPIU).
Table 196. Important TPIU registers
| Address | Register | Description |
|---|---|---|
| 0xE0040004 | Current port size | Allows the trace port size to be selected: Bit 0: Port size = 1 Bit 1: Port size = 2 Bit 2: Port size = 3, not supported Bit 3: Port Size = 4 Only 1 bit must be set. By default, the port size is one bit. (0x00000001) |
| 0xE00400F0 | Selected pin protocol | Allows the Trace Port Protocol to be selected: Bit1:0= 00: Sync Trace Port Mode 01: Serial Wire Output - manchester (default value) 10: Serial Wire Output - NRZ 11: reserved |
| 0xE0040304 | Formatter and flush control | Bit 31-9 = always '0 Bit 8 = TrigIn = always '1 to indicate that triggers are indicated Bit 7-4 = always 0 Bit 3-2 = always 0 Bit 1 = EnFCont. In Sync Trace mode (Select_Pin_Protocol register bit1:0=00), this bit is forced to '1: the formatter is automatically enabled in continuous mode. In asynchronous mode (Select_Pin_Protocol register bit1:0 <> 00), this bit can be written to activate or not the formatter. Bit 0 = always 0 The resulting default value is 0x102 Note: In synchronous mode, because the TRACECTL pin is not mapped outside the chip, the formatter is always enabled in continuous mode -this way the formatter inserts some control packets to identify the source of the trace packets). |
| 0xE0040300 | Formatter and flush status | Not used in Cortex-M4 ® F, always read as 0x00000008 |
33.15.10 Example of configuration
- • Set the bit TRCENA in the Debug Exception and Monitor Control Register (DEMCR)
- • Write the TPIU Current Port Size Register to the desired value (default is 0x1 for a 1-bit port size)
- • Write TPIU Formatter and Flush Control Register to 0x102 (default value)
- • Write the TPIU Select Pin Protocol to select the sync or async mode. Example: 0x2 for async NRZ mode (UART like)
- • Write the DBGMCU control register to 0x20 (bit IO_TRACEN) to assign TRACE I/Os for async mode. A TPIU Sync packet is emitted at this time (FF_FF_FF_7F)
- • Configure the ITM and write the ITM Stimulus register to output a value
33.16 DBG register map
Table 197. DBG register map and reset values
| Addr. | Register | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0xE004 2000 | DBGMCU_IDCODE | REV_ID | Res | Res | Res | Res | DEV_ID | |||||||||||||||||||||||||||
| Reset value (1) | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | ||||||
| 0xE004 2004 | DBGMCU_CR | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | TRACE_MODE[1:0] | TRACE_IOEN | Res | Res | DBG_STANDBY | DBG_STOP | DBG_SLEEP | ||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||||||||||||
| 0xE004 2008 | DBGMCU_APB1_FZ | Res | DBG_I2C3_SMBUS_TIMEOUT | Res | Res | Res | Res | DBG_CAN_STOP | Res | Res | DBG_I2C2_SMBUS_TIMEOUT | DBG_I2C1_SMBUS_TIMEOUT | Res | Res | Res | Res | Res | Res | Res | Res | DBG_IWDG_STOP | DBG_WWDG_STOP | DBG_RTC_STOP | Res | Res | Res | Res | Res | Res | DBG_TIM6_STOP | Res | DBG_TIM4_STOP | DBG_TIM3_STOP | DBG_TIM2_STOP |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||||||||
| 0xE004 200C | DBGMCU_APB2_FZ | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | Res | DBG_TIM17_STOP | DBG_TIM16_STOP | DBG_TIM15_STOP | Res | DBG_TIM1_STOP |
| Reset value | 0 | 0 | 0 | 0 | ||||||||||||||||||||||||||||||
1. The reset value is product dependent. For more information, refer to Section 33.6.1: MCU device ID code .