cancel
Showing results for 
Search instead for 
Did you mean: 

Use STM32H7 ETM without debugging tool

Gpeti
Senior II

I need to use the ETM on a STM32H753 but without debugging tool. The idea is to record the execution trace all the time, and when the firmware encounter a critiical issue, output the trace to an external tool or program it to flash for later analysis. It is designed to work in operational mode, not through a debugging tool.

The documentation of ARM is very confusing on the topic. Some documents mentions the ETB (Embedded Trace Buffer) other documents mentions the ETF (Embedded Trace FIFO) but I couldn't really understand which is doing what.

I don't really understand what functionality of the STM32 to use to implement what I need, and also how to do it. Strangely enough, I didn't find any code example of discussion about this online. it's surprising because recording execution trace sounds like a very interesting functionality in safety critical environments in particular.

24 REPLIES 24
Bob Boys
Senior

Hello

If you have a ULINKpro (or Segger J-Trace or IAR iJetTrace) you can observe a working ETM system to save time. You can examine various registers to see what works.

ULINKpro can also access ETB - although I have not tried it on your processor.

Bob Boys

Arm

I don't have a trace capable device (yet). It sounds surprising that it is the only solution to understand how this is working...

Bob Boys
Senior

Hi

It isn't the only method - all the necessary documents are on the Arm website.

ETM can be challenging - if a way can be found to not have to reinvent the wheel it should save you time.

Bob

ranran
Senior II

Hello,

Did anyone managed to trace stm32 ?

We want to use IAR with j-trace, and we get trouble with it.

Yet using Segger's demo for stm343 it work (https://wiki.segger.com/STM32H7#Tracing_on_ST_STM32H743)

It seems that demo uses pex file which is a MUST, otherwise the function trace is disabled.

Yet, I am not sure what's inside that pex. (If I open a new project swd+ trace buffer configuration, I get no trace, unless I will the .pex file into that project).

Using IAR I get an empty function trace window, and no errors or complaints, but just an empty window.

Another thing, the project setting (Ozone) uses ETB ( and not ETM), and I am not sure what's the difference between ETB and ETM ? Doesn't ETB uses trace pins ?

Thanks

ranran
Senior II

Hi,

One more note,

Seems that with I-jest it works( while with j-link it doesn't !)

j-link prints on start debug: 

https://pastebin.com/4xcGWKLx

I-jet prints on start debug: 

https://pastebin.com/SjY7i2mh

Any idea why these debuggers behave different ?

Thanks