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.

CCS/CC2538: ITM Debug Printf

Part Number: CC2538
Other Parts Discussed in Thread: CCSTUDIO, SEGGER

Tool/software: Code Composer Studio

In previous lifetime instantiations of myself, I've been able to use an "ITM Debug Printf" feature to perform a debug printf which very little impact to device performance.  My current project uses a CC2538,

which I am writing embedded software for using CCStudio 6.  The project doesn't have a connection to a debug UART.

Has anyone performed an ITM Printf with code composer before ?  Is this available for the settup I'm using?  Where would I look?

  • Eric Texley said:
    Where would I look?

    The Wiki page http://processors.wiki.ti.com/index.php/SWO_Trace#Software_Messages: contains some sample code to send text messages to the CCS debugger using the Cortex-M ITM.

    [I haven't tested this myself]

  • Hey Chester, thanks very much for the follow-up, that's exactly what I need.  

    Now when i go to Tools->Hardware Trace Analyzer->Custom core trace (as per the instructions) The CCS consistently returns "the specified breakpoint type Trace does not exist on this target."  Really?  The datasheet for the CC2538 says it does.

    This was the closest thread which I could find on this issue https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/362148

    I've tried three different versions of code composer, thus different versions of "TI Emulators."  The result is the same.

    Now I'm going to take a look at the way the 2538 is described to CCS in the gel files.  I don't believe for a second that many people don't use this feature with their projects.

  • Eric Texley said:
    Now when i go to Tools->Hardware Trace Analyzer->Custom core trace (as per the instructions) The CCS consistently returns "the specified breakpoint type Trace does not exist on this target."  Really?  The datasheet for the CC2538 says it does.

    The "the specified breakpoint type Trace does not exist on this target" error can also be reported if the debug probe doesn't support SWO.

    Which debug probe are you using?

    The XDS110 and XDS200 support SWO under CCS.

    While the Segger J-Link supports SWO, CCS doesn't currently support SWO with a Segger J-Link - see https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/559191

  • Thanks again...I'm using xds200. I got it for this specific reason, because I wanted the ITM Debug trace.
  • Eric Texley said:
    Now I'm going to take a look at the way the 2538 is described to CCS in the gel files.  I don't believe for a second that many people don't use this feature with their projects.

    Looking at a CCS 6.2 and CCS 7.0 installations shows devices which support trace have an XML file in the <ccs_install_root>\<ccs_version>\ccs_base\emulation\analysis\xmldb\trace_config\devices directory. I can't see a file for CC2538 in that directory for neither CCS 6.2 nor 7.0, which I think explains the "the specified breakpoint type Trace does not exist on this target" error when you attempted to use SWO trace on a CC2538 with a XDS200.

    I don't know if you can add CC2538 SWO trace support just by adding a new device_cc2538.xml to the directory, or if other CCS changes are required.

    Pending a reply from a TI employee maybe you could try copying the device_cc26xx.xml XML file for an existing Cortex-M3 device with trace support to a new device_cc2538.xml and make the following changes:

    a) Change the value in the <device> section to "0x8B96402F" which is the JTAG ID code for a CC2538 (taken from section 6.4.1 ICEPick Module of SWRU319C). The JTAG ID code seems to be used by the CCS trace sub-system to identify the device.

    b) In the <characteristics> section of the MOD_EXCEPTIONMAP replace the numeric ID and textual value for the exceptions (interrupts) for 16 and above with those for the CC2538 (as per Table 5-2. Interrupts of SWRU319C).

    c) Remove the MOD_SYSCLK component. This is because I don't know what the registers settings are to allow CCS to automatically determine the system/trace clock for the CC2538. As a side effect I think when configuring SWO trace in CCS you will need to manually specify the system frequency.

    Note that I don't have a CC2538 to test these changes myself.

  • Chester Gillon said:
    I don't know if you can add CC2538 SWO trace support just by adding a new device_cc2538.xml to the directory, or if other CCS changes are required.

    Using CCS 6.1.3.00033 I added a new device_cc2538.xml as suggested above.

    That had an effect, as when using a CC2538SF53 connected with a XDS110 using "cJTAG (1149.7) 2-pin advanced mode" and "Aux COM port is target TDO pin" when used Tools -> Hardware Trace Analyzer -> Custom Core Trace can now get to the "Hardware Trace Analysis Configuration" dialog. At the dialog set a manual clock frequency of 32 MHz to match the CC2538 CPU frequency:

    However, when attempt to start the hardware trace analyzer get the following error:

    The trace logging shows the following at the time the above error is reported:

    M     19:03:52:904 | DevId: checking for match with 0xf0f0f0f0/0xffffffff
    M     19:03:52:904 | DevId: did not match ID 0x8b96402f
    M     19:03:52:904 | DevId: checking for match with 0x0b9af02f/0x0fffffff
    M     19:03:52:904 | DevId: did not match ID 0x8b96402f
    M     19:03:52:904 | DevId: checking for match with 0x0b99a02f/0x0fffffff
    M     19:03:52:904 | DevId: did not match ID 0x8b96402f
    M     19:03:52:904 | DevId: checking for match with 0x0b9be02f/0x0fffffff
    M     19:03:52:904 | DevId: did not match ID 0x8b96402f
    M     19:03:52:920 | Trace Server: SWO trace is not supported by this device.
    M     19:03:52:920 | Trace Server: OnChannelEvent to client 0x4f3bfcb4
    M     19:03:52:920 | cTools: Receiver channel event 15 for Texas Instruments XDS110 USB Debug Probe/Cortex_M3_0.
    M     19:03:52:920 | Trace Server: OnChannelEvent to client 0x4fe2dc08
        E 19:03:52:920 | Trace Operation: Error Set:  unable to select receiver:  SWO trace is not supported by this device.

    The device ID 0x8b96402f is that of the CC2538. The device IDs 0xf0f0f0f0, 0x0b9af02f, 0x0b99a02f and 0x0b9be02f which were attempted to be matched are for the device_stellaris.xml, device_m4u.xml, device_cc26xx.xml and device_cc13xx.xml files for which CCS already supported SWO trace.

    Not sure if the "SWO trace is not supported by this device" error for the CC2538 is due to not editing some XML file property, or if the devices with SWO support is fixed in the CCS executable.

  • Eric Texley said:
    Now when i go to Tools->Hardware Trace Analyzer->Custom core trace (as per the instructions) The CCS consistently returns "the specified breakpoint type Trace does not exist on this target."  Really?  The datasheet for the CC2538 says it does.

    On further investigation think the issue is that the CC2538 doesn't allow for the Serial View Viewer (SWV) output to be routed to a device pin. I raised CCS/CC2538: Does the CC2538 support SWO trace? to query this.