Recently, I came to know about ETM(Embedded Trace Macrocell). This is to trace instruction of program to know the bugs. The same can be achieved by ITM(Instrumentation Trace Macrocell) by using printf() statement.We can know the bugs by using ITM also. This is not using any controller ports.
Then what is the importance of ETM? Can anyone tell? I couldn't understand it. Debuggers with ETM are higher in cost. What's the purpose of that?
ITM means you can create a debug channel for sending messages from your code to the debugger.
ETM means that the chip hardware can stream out step-by-step how it walks through the instruction stream. There is heavy data compression involved so it basically just informs the debugger with "y", "n", "n", "y" if it takes jumps or not. This means the debugger on the PC can recreate a virtual copy of the instruction sequence the processor performs.
So you can look back in time and evaluate the instruction sequence that led the program into a specific state.
This is a big advantage if you need to solve issues with magically hanging software, programs making unexpected jumps, getting stuck in interrupt service routines etc.
So ETM is very good when your program performs unexpected crash-and-burn magic. And ITM is good for getting some trace output of the performance of your business logic "config saved", "motor started", "user intervention timeout", ...
You pay extra for a ULINKpro just because it gives an additional professional feature intending to cut down debug times when something is really off and you can't just rely on single-stepping through the program. Single-stepping doesn't work well in a real-time system where the external hardware doesn't stop the time just because you want to stop the time in the debugger.
So ETM is in some ways a flight data recorder (black box) crash protected memory. Expensive but valuable.
Is anyone of you (who are reading this) using Ulinkpro?
ETM is only for instruction tracing or also used for DATA trace?
Someone of KEIL technical persons said ETM is for instruction trace and SWO(ITM) is for Data trace but in "Embedded Trace Macrocell™ ETMv1.0 to ETMv3.5 Architecture Specification", it is telling that ETM is for both instruction trace and data trace. Which one is correct?
In ULINKPro documentation there is given that accurate code coverage and performance analyzing will be given by this Ulink pro debugger. Code coverage and performance analyzer options are already there in KEIL then what extra advantage this ULINKPro debugger is giving?
I have started using SWO (Serial Wire output) which is serial wire tracing. While I am trying this, it only showing the interrupt events and hardfault handler events. Is this really meant for interrupts tracing only. Other than these interrupt executions I couldn't see any other.
Anyone of you please explain the different tracing options and what are the reasons to go to next level.
Without ETM your debugger will never see any instruction trace other than when using the simulator. And the simulator can't simulate a full chip and may not know to add additional clock cycles when the processor core stalls on some I/O or waiting for instructions from the flash.
With other options you may get some background reads of memory content but then you need breakpoints and single-stepping to see what the processor is doing.
View all questions in Keil forum