This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Difference between ITM and ETM and why we go for ETM

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?

Parents
  • 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.

Reply
  • 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.

Children