« Back to “Tracing on STM32 discovery”

Comments for “Tracing on STM32 discovery”

Hi Petteri,

About the following you wrote:
The STM32 and LPC17xx microcontrollers I have tried so far all disable the debug unit, including trace blocks, until a debugger has connected. So in practice you have to connect a debugger anyway atleast once after power on reset, even if you configure tracing in code like in the example.

At least for the STM's it's not exactly that they disable the debug unit. It's rather, that they enable it for JTAG. (This disables SWD!) Since we are using SWD we have to enable it, as described in reference Manual. 

For STM32F103 this is described in RM0008 31.3.1:
Mechanism to select the JTAG-DP or the SW-DP

[...]
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

So yeah, either let some debugger do this for you or do it yourself ;)

Good work!
 - Thorsten

— Thorsten Heinrichs on 01.05.2017 at 09:28 (UTC)

@Thorsten

Ah, good information :)

— Petteri Aimonen on 01.05.2017 at 10:18 (UTC)

Hi Petteri,

Do you know if it is possible to decode ETM trace data produced via TRACEDATA[0-3] and TRACECLK pins with sigrok?

Thank you for this tutorial!

— Augusto on 22.06.2020 at 21:00 (UTC)

@Augusto I don't think there is a decoder implemented for that yet, but one should be pretty easy to make. After the parallel data is decoded into bytes, it can be fed to the same ETM decoder.

— Petteri Aimonen on 23.06.2020 at 05:09 (UTC)

@Petteri alright, I'll investigate it. Thanks!

— Augusto on 23.06.2020 at 12:47 (UTC)