tracing using HW support (ETM, ARM CoreSight)


roman.fedoryak@...
 

Hello all,
We are developing SW for medical devices. Obviously we have specific requirements for code certification - we need to do detailed unit tests, gather Code Coverage, etc. We do this with instruction trace features supported by ETM (embedded trace macrocell) from ARM CoreSight Architecture of Cortex microcontrollers, and TraceData pins for data transmission. This feature is supported by Segger HW debuggers and also by "major" IDEs like Keil's MDK-ARM.
But I have not found any notes about such sort of tracing in Zephyr's docs. Averything I see is discussions about Segger SystemView, RTT console - yes, these are tracing tools, but only SW tracing, with no ETM involvement.

My request is - If someone has any info regarding this matter, namely - how to do this, examples, info, - please share it.

Best Regards,
Roman Fedoryak.


Kevin Townsend
 

Hi Roman,

My request is - If someone has any info regarding this matter, namely - how to do this, examples, info, - please share it.

It isn't something I've used myself, but you can access TRACE functionality from JLinkExe on the command-line with an appropriate J-Trace debugger.

Checking the list of commands from the tool, I can see:

---- TRACE -----------
TClear     TRACE - Clear buffer
TSetSize   TRACE - Set Size of trace buffer
TSetFormat TRACE - SetFormat
TSR        TRACE - Show Regions (and analyze trace buffer)
TStart     TRACE - Start
TStop      TRACE - Stop

Another platform-neutral option is the free (if you have a supported debugger, which the J-Trace is) Ozone graphical debug tool from Segger, which you can use to point to a Zephyr image, and then access the trace features from the Tools > Trace Settings menu item, setting the source to Trace Pins.

Best regards,
Kevin