29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RM0008<br />

Debug support (DBG)<br />

Table 209.<br />

Main ETM registers<br />

Address Register Details<br />

0xE0041FB0 ETM Lock Access<br />

Write 0xC5ACCE55 to unlock the write acess to the other<br />

ETM registers.<br />

0xE0041000<br />

0xE0041010<br />

ETM Control<br />

ETM Status<br />

This register controls the general operation of the ETM,<br />

for instance how tracing is enabled.<br />

This register provides information about the current status<br />

of the trace <strong>and</strong> trigger logic.<br />

0xE0041008 ETM Trigger Event This register defines the event that will control trigger.<br />

0xE004101C ETM Trace Enable Control This register defines which comparator is selected.<br />

0xE0041020 ETM Trace Enable Event This register defines the trace enabling event.<br />

0xE0041024<br />

ETM Trace Start/Stop<br />

This register defines the traces used by the trigger source<br />

to start <strong>and</strong> stop the trace, respectively.<br />

29.15.4 Configuration example<br />

To output a simple value to the TPIU:<br />

●<br />

●<br />

●<br />

●<br />

●<br />

●<br />

●<br />

Configure the TPIU <strong>and</strong> enable the I/IO_TRACEN to assign TRACE I/Os in the highdensity<br />

device’s debug configuration register<br />

Write 0xC5ACCE55 to the ETM Lock Access Register to unlock the write access to the<br />

ITM registers<br />

Write 0x00001D1E to the control register (configure the trace)<br />

Write 0000406F to the Trigger Event register (define the trigger event)<br />

Write 0000006F to the Trace Enable Event register (define an event to start/stop)<br />

Write 00000001 to the Trace Start/stop register (enable the trace)<br />

Write 0000191E to the ETM Control Register (end of configuration)<br />

29.16 MCU debug component (MCUDBG)<br />

The MCU debug component helps the debugger provide support for:<br />

● Low-power modes<br />

● Clock control for timers, watchdog, I2C <strong>and</strong> bxCAN during a breakpoint<br />

● Control of the trace pins assignment<br />

29.16.1 Debug support for low-power modes<br />

To enter low-power mode, the instruction WFI or WFE must be executed.<br />

The MCU implements several low-power modes which can either deactivate the CPU clock<br />

or reduce the power of the CPU.<br />

The core does not allow FCLK or HCLK to be turned off during a debug session. As these<br />

are required for the debugger connection, during a debug, they must remain active. The<br />

MCU integrates special means to allow the user to debug software in low-power modes.<br />

Doc ID 13902 Rev 9 971/995

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!