I would like to capture, decode, and view ITM trace information for a Cortex-M4 MCU (in my case, an Atmel SAM4S). In particular, I want to capture exceptions and user trace data relative to other signals on my board (i.e. show all signals and trace information on same timeline).
相关问题
- Disabling interrupt in interrupt handler STM32F407
- Serving static html files using DefaultServlet on
- How to check if uint8_t exists as a type, instead
- Easiest way to merge 2 or more ELF files
- How do I resolve a “section type conflict” compile
相关文章
- infinite abort() in a backrace of a c++ program co
- Difference between arm-none-eabi and arm-linux-gnu
- Decode Base64 string to byte array
- Problem with time() function in embedded applicati
- Where to find information on Embedded C++?
-
Using
as a timer in bare-metal microcontr - What is zalloc in embedded programming?
- How to properly set up serial communication on Lin
This can be done using the following steps:
JLinkGDBServer -if swd
Convert the data to a format usable by sigrok. Using the Saleae to capture the data, this comprises the following steps:
trace.bin
, writing a byte for every sample.Convert to a trace.sr file using:
sigrok-cli -i trace.bin -I binary:samplerate=100000000,numchannels=4 -o trace.sr
trace.sr
file in PulseView.See http://www.sigrok.org/blog/new-protocol-decoders-arm-tpiu-itm-etmv3 for more information.
Example Ada code for SAM4S Trace:
sam4s-trace.ads:
sam4s-trace.adb:
As you tagged it with "logic analyzer", this may be off-topic, but I found the following extremely helpful. With Keil uVision (and probably with other IDEs as well) you can reroute ITM data to file using a custom .ini file.
Enable SWJ in your debugger, use SW Port. Enable Trace, enable the stimulus ports that you want to use.
Write a .ini file with an content like this:
This wil reroute ITM channel 0 to a file named "debug.log", and channel 1 to "testlog.xml" (file syntax from here).
To use the channels easily with fprinf in you c-code I use following setup:
And usage within the project:
Reference: link