This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am working on updating a TM4C123 design to a TM4C129 and trying to make as many improvements as possible in the process. To date we have used the ICDI debugger from an EK-TM4C123GXL to load software and debug (single-step, set breakpoints, view memory, etc.). We use a Tag-Connect cable with a customized pinout which includes the UART0 signals, reset, and power for the target. It has served us well, but I wonder what we are leaving on the table with regard to debugger speed and trace capabilities. So I am trying to figure out whether we should switch to or add a different debug connector and which debugger hardware would let us take advantage of the new capabilities.
I have been looking at the XDS110 and XDS200. It looks like they use the 0.05” pitch 20-pin TI CTI connector and pinout, with adapters for other connectors. Most of the examples I have seen for TM4C129 boards seem to use the 0.05” pitch 10-pin Cortex debug connector, which omits a number of the signals. What would I give up by using the smaller connector with either of those debuggers? It looks like you can access the Embedded Trace Macrocell (ETM) with any XDS debugger (though not with ICDI). [Correction: The XDS110 can access the ETB, not ETM, on MCUs which have one; the TM4C129 does not.] Does the ETM give backtrace capabilities (after a crash) with CCS?
Does the XDS200 provide significant advantages over the XDS110 when used with the TM4C129? I see that it has active JTAG clocking while the XDS110 does not, but I don’t think the TM4C129 supports that anyway. Is the XDS200 faster even without active JTAG clocking? Is that a big advantage when loading software, or is the load time already dominated by the time it takes to program the MCU’s flash after it is transferred? Are there functional advantages of the XDS200?
If we took the leap to the XDS560v2, would the 20-pin connector support all of the additional features it would provide, or does that require a 60-pin connector? Or maybe the TM4C129 doesn’t support those features at all?
Thanks,
Steve
Hello Steve,
Going to answer this a little backwards to start because I don't know all the answer here but for starters:
If we took the leap to the XDS560v2, would the 20-pin connector support all of the additional features it would provide, or does that require a 60-pin connector? Or maybe the TM4C129 doesn’t support those features at all?
There are no added benefits provided by using a larger than 10-pin header. The TM4C1290NCPDT does not have additional JTAG connections to plug into with more advanced headers.
Our JTAG User's Guide walks through the header pin outs and TM4C12x connections in Sections 3.1 and 3.2 and you'll see that all the TM4C12x connections are accounted for with the 10-pin header: https://www.ti.com/lit/an/spma075/spma075.pdf?ts=1636579798982
There is a note about EMU0/EMU1 being dependent on target device and I am not sure why it is mentioned like that as those pins are not used for TM4C devices.
Most of the examples I have seen for TM4C129 boards seem to use the 0.05” pitch 10-pin Cortex debug connector, which omits a number of the signals. What would I give up by using the smaller connector with either of those debuggers? It looks like you can access the Embedded Trace Macrocell (ETM) with any XDS debugger (though not with ICDI).
As alluded to above, no functionality would be lost.
I see that it has active JTAG clocking while the XDS110 does not, but I don’t think the TM4C129 supports that anyway. Is the XDS200 faster even without active JTAG clocking? Is that a big advantage when loading software, or is the load time already dominated by the time it takes to program the MCU’s flash after it is transferred
I believe the flash programming is the main bottle neck but the SW Tools team can comment otherwise if I am wrong.
Does the ETM give backtrace capabilities (after a crash) with CCS?
Does the XDS200 provide significant advantages over the XDS110 when used with the TM4C129?
Are there functional advantages of the XDS200?
I will need to defer to our SW Tools experts for these questions. I will ask them to comment on this thread.
Best Regards,
Ralph Jacobi
It looks like you can access the Embedded Trace Macrocell (ETM) with any XDS debugger (though not with ICDI)
I think the only XDS debugger which supports ETM is the XDS560v2 PRO TRACE Receiver & Debug Probe. However, looking at the product page Cortex-M devices are *not* listed in the supported devices for ARM core pin trace (ETM).
The XDS110 and XDS200 do support SWO Trace for Cortex-M devices. SWO Trace is low-bandwidth trace compared to ETM, but does allow tracing without having to instrument the code.
Segger have the J-Trace PRO Cortex-M , but looking at the Full J-Link/J-Trace Support CCS doesn't support SWO or ETM trace with a J-Trace.
Trace Analyzer User’s Guide has some information about trace in CCS, albeit it was last updated in 2014.
J-Trace that Chester mentioned is a good option for using ETM. There is a version called J-Trace Pro Cortex M. You would not be able to display the trace data inside CCS but SEGGER provides a tool that can be used for that called Ozone.
You would need to put the appropriate header on your board. Typically the Arm Cortex 20pin header would be what you would use. Basically, it is the Arm Cortex 10pin header with extra pins for trace. You could connect an XDS110 to the debug side of the header and do the majority of your debugging in CCS. Then when you want to do trace you would disconnect the XDS110 and connect your Segger J-Trace.
For TM4C I would not bother with an XDS200, the XDS110 is good enough.
Regards,
John
Thanks for the follow up, Ralph. I'm still trying to sort through things.
Ralph Jacobi said:
There are no added benefits provided by using a larger than 10-pin header. The TM4C1290NCPDT does not have additional JTAG connections to plug into with more advanced headers.
I agree that there are no more JTAG connections, but for trace it might be a different story...
Ralph Jacobi said:
There is a note about EMU0/EMU1 being dependent on target device and I am not sure why it is mentioned like that as those pins are not used for TM4C devices.
System Design Guidelines for the TM4C129x Family of Tiva C Series Microcontrollers (SPMA056) says:
The TM4C129x family of microcontrollers includes ARM's Embedded Trace Macrocell (ETM) for instruction trace capture. Trace data is output on pins TRD0-3 and clocked with TRCLK.
Tiva TM4C1290NCPDT Microcontroller DATA SHEET (DS-TM4C1290NCPDT-15863.2743 SPMS429B) Table 25-3 shows that pin 44 (PF2) can be assigned to function TRD0, with the description "Trace Data 0". TRD1, TRD2 and TRD3 are there as well.
So perhaps the trace data is available, but on pins named TRD0-3 rather than EMU...?
Thanks, Chester. I conflated the ETM and a ETB and ended up thinking that the TM4C129 had both. It appears to me now that it does have an ETM but does not have an ETB. So the info about the XDS110 being able to access the ETB isn't relevant. I'm thinking that the ETM is what puts trace info on the TRD0-3 pins (see my response to Ralph Jacobi).
The TM4C1290NCPDT does support "Serial Wire Trace" (SWO), through the ATB (ARM trace bus) interface. It appears to use a subset of the same pins as JTAG, so should be supported using the 10-pin connector. As you noted, it should be readable using a XDS110. It looks like the XDS debugger creates a virtual COM port which you then tell your debug software to read from (per the Trace Analyzer User’s Guide, SPRUHM7B). That guide suggests that SWO trace supports four configurations in CCS:
It says that the PC trace configuration, which it suggests helps with figuring out what happened leading up to a crash, is not supported. But in section 3.3.12 it talks about the custom core trace configuration which is supported. It isn't clear to me how it is different (other than supporting only a single core). Does it also provide some sort of backtrace capability? That is what I am most interested in. If SWO trace will do it (even if with a limited buffer size and slow speed), the 10-pin connector and XDS110 will be enough for what I care about. Otherwise, I think I'll keep pursuing ETM support as a way to get there.
Thanks, JohnS, for the info on J-Trace and Ozone. The price for the hardware is pretty steep, but I've burned that much in time searching for a bad bug, so it probably makes sense. At least Ozone is included free.
Regarding connectors, for space reasons I would like to stay with a 0.05" pitch. The J-Trace PRO comes with a Cortex-M Trace Reference Board which appears to have such a connector (https://www.segger.com/products/debug-probes/j-trace/). I presume its pinout is the one shown here: https://www.segger.com/products/debug-probes/j-link/accessories/adapters/19-pin-cortex-m-adapter/. But that pinout doesn't show the extra (besides JTAG/SWD) pins I expected to be needed for full hardware trace. I must be missing something.
I found a similar pinout in Figure 26 of https://www.ti.com/lit/an/spma056/spma056.pdf, it appears that TI suggests connecting the trace signals on pins 14, 16, 18 and 20. Are they not used by the J-Trace debugger? Maybe the adapter I found just isn't connecting them, but the debugger's included 0.05" pitch cable does.
That adapter looks like it is for connecting an old style ARM20pin to the newer Cortex 20/19 header. The ARM20 does not support trace so those pins would not be connected.
The J-Trace probe has both Cortex 20 and ARM20 connectors and cables.
In the picture above you can see the small cortex20 (0.05 pitch) connector on the left and then the old style ARM20 (0.1 pitch) on the right. You don't want to be using an adapter. You want to put the 0.05 Cortex20 header on your board and then connect it to the J-Trace with the supplied cable. No need for an adapter.
Regards,
John
Hi Steve,
I was looking through the JTAG section and for some reason that isn't even mentioned there, you have to find it in the pinout like you did which is why I did not realize that.
I did some more digging and this prior post from Bob Crosby gives some detail about what to expect with these pins: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/642010/tm4c123gh6pm-about-the-embedded-trace-macrocell-and-jtag-swd/2370532#2370532
I don't really have more details myself as I've never tried to use that interface and it's not really well documented. Since it is ETM Trace macro-cell perhaps Arm would have more documentation on the use cases.
Best Regards,
Ralph Jacobi
Thanks again, guys, for your help figuring all of this out. I'm going to try to summarize things based on what you have written and what I have been able to dig out of the various docs. Please correct me if I get it wrong. I left a few questions, but I may have to wait and test to get answers. If anyone out there has the ability to update documentation, this seems like a good place to start :)
Regarding a UART connection to the target:
There are apparently several other alternatives to using UART0 for console and debug messages. Some info about these came from https://mcuoneclipse.com/2016/10/17/tutorial-using-single-wire-output-swo-with-arm-cortex-m-and-eclipse/ and the pages it links to. I haven't used any of them:
So it seems to me that the primary reason one might choose the CTI-20 connector is that you don't need an adapter to use it with the XDS110 (and similar) debuggers. But most folks use the 10-pin Cortex Debug Connector, and if you want trace, you can use the 20-pin Cortex + ETM connector and either plug into just half of it to get the same debug interface as the 10-pin version, or you can plug into the whole thing for debug + trace (with a debugger which supports both). None of those (except a non-standard modification to the Cortex + ETM pinout) support a UART connection for debug/console messages, but there are other options for that (separate wiring or several options using the debug hardware interface).
Whatever trace features are available with SWO, which is completely separate from the external hardware-based trace mentioned above, can be accessed using any of the debugger connectors. You have to use SWD rather than JTAG mode and a debugger which supports SWO trace (such as the XDS110).
Did I get all of that right? Did I miss anything important? Is anyone using SWO trace to output debug messages? Does anyone know if the "custom core trace" configuration in CCS which is supported through SWO supports backtrace after a crash, either with CCS or some other debugger software?
My current plan is to implement the 20-pin Cortex + ETM connector (perhaps with added UART pins) and use an XDS110 with an adapter. Since the SWD/SWO signals are relatively slow, I think the adapter will be OK. I'll try SWO trace and see what it gives me. If I ever need hardware-based trace, I should be able to get a J-Trace and plug it in directly. Does that make sense? Would I be better off with a low-end J-Link than the XDS110 for debugging, either because the hardware is different or because of the associated software capabilities?
Thanks again for your help.
Steve,
The XDS560v2 PRO TRACE does not support the ETM on TM4C.
My personal opinion would be to start with the XDS110. It is cheap. With your plan for the 20pin cortex you can just connect the 110 to the debug half of the header. The 110 comes with a cTI20 to Cortex 10 adapter. I use those all the time. Then if the need arises you have the option of purchasing the SEGGER J-Trace Cortex M and connecting it to the full 20pin header.
As you found the standalone XDS110 has a little breakout board that has pins that you can connect a UART to. So you could just expose a couple pins on your board and then connect wires to the breakout board and not have to worry about messing with pins on the standard Cortex 20.
Regards
John
Can anyone speak to how this method compares with using UART0, specifically regarding transfer speed and the ability to make it run without blocking (interrupt driven output from a buffer)? Looking at the implementaion of function port_wait() here
CCS/MSP-EXP432E401Y: Statistical Function Profiling using a XDS110 causes CCS to hang if try any select a Sampling Interval of 832 cycles (or lower) has some information about the SWO baud rate seen in previous tests. With a XDS110 and a TM4C129 device:
Not sure if anything has changed since that previous investigation to increase the available baud rate of the XDS110.
The referenced thread also highlighted that the XDS110 had higher SWO trace performance than a XDS200.
As for can the SWO can be interrupt driven for sending messages, according to Cortex M3 ITM trace on the ARM forum the answer is No.
Thanks, Chester, for following up on that. It is kind of a shame that there isn't an interrupt for it. Perhaps 15Mbaud is fast enough for me to not care that it blocks a bit. And when something crashes, it is nice if all of the messages which have been printed have actually been output and aren't just sitting in a buffer waiting to be sent. If it is really important for it to be non-blocking, I suppose a timer interrupt could pull from a buffer and feed the ITM; it might just have to fire really often (assuming there is little/no hardware fifo). If it fires often enough, it will essentially become blocking (except to higher-priority interrupts). Fun!
Thanks, JohnS. Going that way leaves my options open; I can spend more money for trace if/when it is justified.
Since I last wrote, I found a bunch of YouTube videos which pretty much confirm the things we figured out earlier in this thread. They were more straightforward than all of the written documentation I found. The videos from Lauterbach were especially good (I'll provide a link in another message). I think TI would do well to update their existing documentation (not just create something additional) to clarify things. A table showing what is and isn't supported by various debuggers and connection types would be a good starting point. At a minimum, it should include info like this:
If using the 10-pin connector (or half of the 20-pin), the XDS110 debugger is probably the best choice from TI, perhaps even preferable to the (more expensive) XDS200. A SEGGER J-Link debugger is another popular choice. Pros and cons...???
If using the 20-pin Cortex+ETM connector, the above debugger options will work for debugging but will not provide instruction trace.
Note that the XDS110 uses a 20-pin connector which has a different pinout than the Cortex+ETM connector. It does not generally include the ETM signals, so to support trace you should use one of the Cortex connectors and pinouts instead. The XDS110 does come with adapters which will work with either of the Cortex connectors.
It would be nice to have a speed comparison of all of the debugger options, but I don't have that info.
For anyone trying to dig deeper, retrace my steps, or update the docs (please!), these URLs lead to most of the TI info I found:
These were referenced by others in this thread:
And I just recently found these:
Does anyone know if the "custom core trace" configuration in CCS which is supported through SWO supports backtrace after a crash, either with CCS or some other debugger software?
The limitation of the Cortex-M ITM which outputs SWO messages is that the only automated PC sampling operation is "statistical" sampling where the current PC is sampled at a regular interval. This is suitable for profiling to see which the percentage of time seen in different functions, but not sufficient to allow the backtrace to be determined as may miss some branches.
I found Cortex-M Trace Training and ARM-ETM Training from Lauterbach with more information on tracing which explains this.
Thanks. It all makes sense once you sort through it, but it is rather confusing until then:
Thanks for helping me figure it all out!
Steve