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.

CC1352R: Routing SWO Trace to UART

Part Number: CC1352R
Other Parts Discussed in Thread: SYSCONFIG, TMDSEMU110-U

Hi!

My environment:

CCS: 10.1
SDK: 4.30.00.54
Device: Launchpad CC1352R1 rev. B

Problem:

I use CC1352R with XDC110 debug probe. I have SWO connected to TDO pin of debug probe. I can see the trace output using Event Analizator in CCS, but I want to use an external tool e.g. putty to view a trace output via COM port.

I wonder how can I route SWO (TDO) trace directly to XDS110 Application/User UART COM port?

  • Could you see if the following helps you getting started:

    software-dl.ti.com/.../emu_swo_trace.html

    e2e.ti.com/.../525815

  • Hi TER,

    We've seen this information, and we've already started on the subject.
    According to, what Robert stated, we can see the SWO trace in CCS using  Code Analysis->Event Analysis.

    Our issue can be defined as follows:
    We attempt to generate and capture SWO trace without launching a debug session and without using CCS.
    We want to use the SWO trace only for message logging.

    Questions:
    1)
    Where can we find an example code to initiate SWO trace message logging for CC13x2 (without debugging session)?
    I've already found this information:
    www.segger.com/.../UM08001
    3.8.4 Configure SWO output after device reset

    We can find more information related to appropriate registers in the TRM of CC13x2:
    2.9.3 CPU_ITM_map1 Registers
    2.9.5.3 ACPR Register (Offset= 10h) [reset= 0h]
    Nevertheless, it's quite challanging to find out all the registers that are necessary to configure trace output.

    2)
    What is the maximum frequency of the SWO trace generated by ITM in CC13x2?
    Is it equal to the HF_OSC frequency?

    3)
    We use J-link ULTRA to capture the SWO trace, but we also want to use XDS110 to capture it.
    Assuming we connect SWO to the TDO of the XDS110 probe,
    what is the maximum frequency of the SWO trace the XDS110 can handle?

    Last but not least...
    4)
    How can we force the XDS110 (using CLI) to output the SWO trace (TDO) via the UART COM port ?

    Regards
    Adam

  • Hi Adam,

    I would suggest you look into the ITM driver and example in the SDK:

    https://dev.ti.com/tirex/explore/node?node=AP24VgJ7gbuZWQrdF16tIg__pTTHBmu__LATEST

    https://dev.ti.com/tirex/explore/node?node=AEn1RqQiUw42NQmSdq1XEA__pTTHBmu__LATEST

    I can't comment about the actual maximum frequency but up to 12 MHz should work on the LaunchPad. The output can be routed to any PIN (compared to the CC32xx and MSP432) and on our LaunchPad platform, this correspond to DIO18. You might have noted that TDO and SWO are not the same pin, the pin that is marked as "SWO" is in default routed to the "Auxiliary UART" COM port (meaning you should be fine just using the ITM driver to output to DIO18 corresponding to the "SWO" pin).

  • Hi M-W,

    Thanks for the information. I think this ITM driver will help in our case.

    M-W said:
    You might have noted that TDO and SWO are not the same pin


    Yes, I've seen this. In our case, we have SWO connected to the TDO pin.
    We use our regular debug connector and the standalone version of XDS110.

    M-W said:
    (...) the pin that is marked as "SWO" is in default routed to the "Auxiliary UART" COM port (meaning you should be fine just using the ITM driver to output to DIO18 corresponding to the "SWO" pin)


    We have to use a TDO pin of the debug probe as a "trace output".
    Assuming this, how can we adapt this approach:
    dev.ti.com/.../node
    to our case?

    How can we configure a standalone XDS110 to see the trace output via the TDO pin?
    Can we route this pin to the User UART COM port?

    Regards
    Adam

  • Hi Adam,

    For the purpose of selecting pin, the ITM driver does not care which IO you assign it to, this means you can assign it to the TDO port if that is what you wish (it is part of the SysConfig setup of the driver). 

    From this point, I'm not a 100% sure what you are going for in terms of "viewing" the TDO output in standalone. Are you referring to getting a printout over the COM port or in another tool (as I understand you do not want the debugger session active)?

  • Hi M-W,

    M-W said:
    For the purpose of selecting pin, the ITM driver does not care which IO you assign it to

    I understand. I can route SWO to any PIN in the CC13x2.
    However, in our particular custom board we have a debug connector with:

    • VTRef
    • SWDIO / TMSC
    • nRESET
    • SWCLK / TCKC
    • GND
    • SWO / TDO

    M-W said:
    From this point, I'm not a 100% sure what you are going for in terms of "viewing" the TDO output in standalone.

    There are two possible ways we can connect SWO to the XDS110 (TMDSEMU110-U):

    Let's assume we do have a custom board connected to the debug probe in a way which is the exact copy of the below launchpad connection (GND, 3V3, RST, TMS, TCK, TDO)

    How can I adapt the approach presented in (Example Usage) of

    https://dev.ti.com/tirex/explore/node?node=AEn1RqQiUw42NQmSdq1XEA__pTTHBmu__LATEST

    to my case?

    How can I force the XDS110 debug probe to output the TDO signal to one of its COM ports (UARTs)?
    Finally, we want to write our custom viewer, that will translate "mnemonic" logs to the full human-readable version on the fly.

    Regards

    Adam

  • Hi Adam,

    I'm not sure there is a convenient way to "force" the debugger to output the TDO to the COM port while not in an active debug session. As you have seen above you can choose how to route this while debugging is active but when disconnected, it defaults back to "XDS110 SWO -> Aux COM port"

    If you have a XDS110 maybe jump the TDO with the SWO (unless you need the 4-wire mode) . How the Jlink can be setup I'm not that familiar with and I will try to get a second opinion from an XDS expert on to what degree you could route the AUX COM path without entering into a debug session.  

    As for the custom viewer, we (TI) are developing a generic solution for this and a preview is available in the SDK today (early alfa if you will). I would recommend you have a look at the example as it might save you some work in the end if you find it suits your need :)

    https://dev.ti.com/tirex/explore/node?node=AAiaJr4iKfBztqk6--1rag__pTTHBmu__LATEST

  • Hi M-W,

    M-W said:
    I'm not sure there is a convenient way to "force" the debugger


    I'm also interested in getting even non-convenient ways.

    M-W said:
    I'm not that familiar with and I will try to get a second opinion from an XDS expert on to what degree you could route the AUX COM path without entering into a debug session.


    I will be very grateful if you can consult the expert and dig deeper into my case.

    There are some tools in \ti\ccs1010\ccs\ccs_base\common\uscif\

    • dbgjtag
    • xdsdfu

    but I have no idea if they are appropriate in this particular case.

    Regards

    Adam

  • Hi Adam,

    I did look into the uscif tools but they do not seem to help a lot here. The "non-convenient" way would be to run a full debug session with the debugger connected to the target. The alternative is to on the XDC110 side wire jump TDO and SWO so that you can always use the AUX UART COM port no matter the debug state of the device.

  • Hi M-W,

    Let's wait, maybe the XDS expert will shed some light on the subject.

    Regards
    Adam

  • Hi M-W,

    Is there any information from the XDS expert?

    Regards
    Adam

  • Hi Adam,

    I have yet to find any good feedback on this. From what I can tell, there is no tools shipped today that allows you to configure this outside of the target file as in CCS.