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.

SWD/SWO Trace for CC2650 with XDS200 & IAR

Other Parts Discussed in Thread: CC2650, CC2540

Is SWD/SWO trace possible from CC2650 to IAR via XDS200? 

When i look in the IAR options for the XDS200, there is no option (unlike in CCS) to enable SWO trace. I see the feature is "disabled" in the configuration file for the xds200 in IAR. Before i start modifying the configuration file, i just wanted to know if it should be generally possible and why it's disabled by default.

Related, more of a general question, is SWO trace available via 2-wire cJTAG?

  • Hi,

    This functionality wasn't tested on IAR - it's best to use CCS.

    Best wishes
  • Are there any plans to make this available in IAR?

    Unfortunately i am unable to get CCS to work: e2e.ti.com/.../411889

  • I have been trying to get this to work in CCS but no luck. 

    I am using CCS6.1 and XDS200 connected to a SensorTag via 10pin header. 

    I created a new target configuration selecting CC2650 and XDS200 and selected SWD/Trace. The error iam getting from CCS is below. I can program and otherwise communicate with the target in 2 and 4 pin mode without any problems.

    An error occurred while hard opening the controller.
    
    -----[An error has occurred and this utility has aborted]--------------------
    
    This error is generated by TI's USCIF driver or utilities.
    
    The value is '-615' (0xfffffd99).
    The title is 'SC_ERR_SWD_PROTOCOL'.
    
    The explanation is:
    The target failed to see a correctly formatted SWD header. The 
    connection to the target may be unreliable. Try lowering the 
    TCLK setting before trying again.

  • Hello Pix,

    It looks like you selected the wrong wMCU. You selected CC2640F128 instead of CC2650F128
  • I have tried the SensorTag with 50 and 40, same result. Also our board uses 40 and i get the same result, regardless of 40/50 selection.

    Can you confirm that you are able to SWD/Trace from XDS200 to SensorTag and if so, can you post a screenshot of the target configuration settings?

    Thanks.

  • Hi,

    Looping in the Tools team to have a look at this. It may not be supported currently.

    The reason is, the CC26xx does not have SWD support, only c-/JTAG. But it is possible to route the SWO signal out nevertheless, but it is not a 'typical' configuration, which it looks like CCS is trying to do. With IAR and the I-Jet debugger, re-routing SWO to a custom pin on the debugger is supported out of the box, and this is the only setup I've tried and got working so far.

    Best regards,
    Aslak
  • Hi, thanks for looking into this. 

    We didn't know I-Jet works with CC26xx and bought a XDS200 specifically for that. How does J-Jet speed compare to XDS200? Does I-Jet work from CCS?

  • pixbroker,
    The IAR's I-Jet debugger is not supported in CCS.

    The XDS200 hardware is SWO trace enabled, but I believe the XDS drivers do not support SWO trace in combination with 2-pin cJTAG today. I'll try to get a timeline for this and get back to you.

    Br,
    TIABO
  • Hi,

    Do you have an update on this? Or is there another way to enable trace with CCS? Also, we have XDS100v3 emulators - it looks to me like trace wouldn't work with them; we would need at least XDS200. Is that true?

  • Hi,

    Sorry for not getting back to you. I've not received a timeline yet, but I'm pushing to get an answer. 

    XDS100v3 emulators do not support trace, I believe you need the XDS200 (or XDS110). The XDS110 does not support trace together with cJTAG at the moment, so XDS200 is the recommended option.

    Br,
    TIABO

  • I've received an update on this:
    SWO trace support for XDS200 and XDS110 (in 2-pin cJTAG or 4-pin JTAG mode) is expected in Sept/Oct 2015.

    Br,
    TIABO
  • Thank you for following up! To prepare for this update, do you know how to get SWO out of the CC2650 (and what pin it will come out on), and which pin on the XDS header it should be connected to?
  • CC2650: You can pretty much output SWO trace to any pin.

    In 2-pin cJTAG mode, I believe the emulators will expect SWO trace on the TDO pin.

    Snippet for configuring CC2650:

    #define ITM_Port32(n) (*((volatile unsigned int *)(0xE0000000+4*n))) 
    
    // Map SWV to DIO_25 (can be any IO)
    IOCPortConfigureSet(IOID_25, IOC_PORT_MCU_SWV, IOC_STD_OUTPUT); 
    
    // Make sure data has been clocked out before sending 
    while(ITM_Port32(1) == 0x00); 
    ITM_Port32(1) = 42; 
  • OK, thanks. So it seems that would be a way to allow software generated trace data to be output on SWO. But what I'm really looking for is a way to trace all instructions executed and possibly data accesses via a hardware trace mechanism like ETM. This is useful, for example, for debugging exceptions and you want to see what instructions were executed leading up to the exception. Is there a way to enable that?

  • Hi,

    No, there's no ETM on the chip, so no retention of execution history. If you look at the BLE Software Developers guide (PDF in the installer) there's a section on how to look at the exception frame to tentatively find out what instruction was active as the exception occurred.

    BR,
    Aslak
  • I wanted to follow up on this. I just tried this again, CC2540, XDS200 and CCS 6.1.0.00104. Choosing "Enable SWD Mode with SWO Trace enabled" still doesn't work.

    We have all 4 JTAG pins connected via CTI20 connector.

    Is this supposed to work now or not yet?

    Thanks,
    -r


    %ccs_base%/common/uscif/dbgjtag -f %boarddatafile% -rv -o -S integrity
    This utility has selected a 560/2xx-class product.
    This utility will load the program 'xds2xxu.out'.
    The library build date was 'Jul 23 2015'.
    The library build time was '20:48:11'.
    The library package version is '6.0.14.0'.
    The library component version is '35.35.0.0'.
    The controller does not use a programmable FPGA.
    An error occurred while hard opening the controller.
    This error is generated by TI's USCIF driver or utilities.
    The value is '-615' (0xfffffd99).
    The title is 'SC_ERR_SWD_PROTOCOL'.
    The explanation is:
    The target failed to see a correctly formatted SWD header. The
    connection to the target may be unreliable. Try lowering the
    TCLK setting before trying again.
  • Hi,

    I assume you mean CC2650, not CC2540.

    CC2650 is not SWD enabled, so using CC2650  in Serial Wire Debug (SWD) will never work.

    XDS200 support for 2-pin cJTAG + SWO trace will be included in the next XDS emulation driver bundle. The last information I have is that it is expected around October November (updated 2015-09-17).

    Br,
    TIABO

  • TIABO,

    thanks for the response. Can you clarify what is the difference of using 2 wire JTAG and 4 wire JTAG with CC26xx? Specifically, what are the advantages & feature difference of using XDS200 over XDS100/110 with CC26xx and CC13xx?

    Thanks
  • Off the top of my head, 2-pin cJTAG occupies less I/O on the CC26xx than 4-pin JTAG. CC26xx powers up in 2-pin mode and a switching sequence must be done by the emulators to enable TDO and TDI pins.

    2-pin cJTAG time-multiplexes TMS, TDO and TDI signals, so the throughput may be somewhat lower than 4-pin JTAG. There are however optimized scan formats that minimizes this difference.

    The XDS200 emulator has a higher data throughput, so the time it takes to program the device flash is less than for example XDS100v3.
    XDS110 has a performance in terms of throughput somewhere between XDS100v3 and XDS200. XDS110 and XDS200 hardware is SWO trace enabled (support in the driver stack to come).


    Br,
    TIABO

  • Thank you!
  • Update: I've been informed that the next XDS emulation release has been pushed to November, that is, XDS200 SWO support in cJTAG mode is expected in November.
  • While we are waiting for SWO support in the XDS200 emulation driver, what's the easiest way to do something like printf() from CC2650 to the IAR console?
  • Hi,

    Today, the IAR I-Jet supports SWO trace in IAR with CC13xx/CC26xx.

    Br,
    TIABO

  • Pixbroker,

    If you don't need real-time printf functionality you could for example use UART as described on this page:
    processors.wiki.ti.com/.../CC26xx_Adding_basic_printf_over_uart_with_TI-RTOS

    Regards,
    Svend
  • Hi,

    The easiest way to just get some printf in IAR is also the worst way.. You can use semi-hosted i/o which uses the debugger to read out memory and print it in the terminal window.

    The reason it's not so ideal is that it will break execution for a while while performing the printf. To enable this, go to your project options -> General Options -> Library Configuration -> Library low-level interface implementation -> Semihosted -> stdout -> via semihosting.

    You can in the Library Options choose to use 'buffered terminal output' which is probably less intrusive than the alternative, but I don't have any timing numbers.

    To use this later, you include stdio.h and use printf(..) as you normally would. The output is then in View->Terminal I/O.

    A slightly better approach is to use the UART to print out. See  on our wiki for details.

    Best regards,
    Aslak

  • Aslak N. said:

    ...printf in IAR is also the worst way.. 

    Thanks for your details on how to get printf working.

    Is there a way to do "printf-like" debugging that does not break execution?