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.

RTOS/CC2650: Serial communication through XDS110 for debug

Part Number: CC2650

Tool/software: TI-RTOS

Hello,

I am working on a custom board using CC2650 and XDS110 debugger and willing to use the serial port of XDS110 to send debug information to PC from my CC2650 application. The question may seem trivial to one who has a lot of experience with CC2650; however, although there are several tens of links that explain the procedure of adding serial communication to a project, I still feel the information messy and struggling to find a systematic, well explained instruction. In particular:

- In the PC, two virtual serial ports of XDS110 are recognized:

1. XDS110 Class Application/User UART
2. XDS110 Class Auxiliary Data Port

As I understand it, for our user application purposes, i.e. debug we have to use 1. XDS110 Class Application/User UART, is that right?   What is then the purpose of the second serial port of XDS110?

Also, the lines of the XDS110 debugger that are normally used for programming, take alternative function as serial port communication lines once the CC2650 is programmed and application on it is started. Is that right? If right, which of the JTAG XDS110 lines serve as Tx and Rx for the XDS110 Class Application/User UART and is there any procedure to follow in order to use the serial port of the XDS110 right after it was used for programming the CC2650?

- At the CC2650 side, it seems there are different choices, such as adding UART driver ( processors.wiki.ti.com/.../Cc2640_Adding_a_UART_or_SPI_driver_to_a_Sample_Project )  or  printf support (http://processors.wiki.ti.com/index.php/CC26xx_Adding_basic_printf_over_uart_with_TI-RTOS), or use System_printf ... but which is the optimal solution for CC2650 debug using the serial port of XDS110?

Please, help to figure out the right solution, or suggest appropriate relevant materials/instructions.

Kind regards

  • Hi,

    The XDS110 Class Auxiliary Data Port is used for communication with the XDS110 only. And the XDS110 Class Application/User UART is connected to the UART on the CC26xx.

    For example of an application that uses the UART, see here:
    github.com/.../spp_ble.md

    Best wishes
  • Dear Zahid,

    Thanks for the answer.
    1. I have run the simple_central project succesfully in Launchpad. After investigating the project, I found that transmission is probably done through IOID_16 of CC2650 (as shown in the definitions below) which is the same line used for JTAG_TDO and this conclusion answers the first part of my question above. In simple words, I just want to confirm that having connected the XDS110 JTAG lines to CC2650 provides also a serial port channel that can be used for debug (even in a custom board that has no other dedicated serial port capability, taking into account the pin map in the different package types)  


    #define PINCC26XX_MUX_MCU_UART0_TX       IOC_PORT_MCU_UART0_TX    // MCU UART0 Transmit Pin (defined in PINCC26XX.h)
    #define IOC_PORT_MCU_UART0_TX         0x00000010  // MCU UART0 Transmit Pin   (defined in ioc.h)
    #define IOID_16                     0x00000010  // IO Id 16 (defined in ioc.h)



    2. Still, the second part of my question remains: what are the optimal, simplest steps to enable serial port printf function for the sake of debug,
    in e.g. simpleBLEperipheral?

  • Hello, any advice on the second question?!...
  • Hi, 

    Project Zero has a good example on using printf for debugging:

    Best wishes

  • Dear Zahid,
    Thanks for reply. I am able to use printf and system_printf to send information to IAR console.
    However, to enter debug mode every time is quite inconvenient and I wonder:
    1) is there any way to receive information to the IAR console without being in debug mode?
    2) is there any way to use the XDS110 debugger but receive the information into independent terminal console on PC but not that of IAR?
    3) as if 1 and 2 are not possible, then the solution should be to re-direct the UART tx pin and just provide CC2650 with a regular serial port, and no further modifications to the project code would be required. Is that right?
    Kind regards
  • Hi Kamen,

    The user port of XDS110 is a simple UART channel. With this in mind, you don't need debugger for printing messages on PC. What you need are
    (1) A driver in target side to send out the message.
    (2) A program to receive message at the PC side.

    For (1), as you mentioned, printf() or System_printf() could be used. For myself, I design my own driver called tracer_log(). You can design your own driver, too.

    For CC26xx, the CPU supports SWO output. This means you can either output log messages through the SWO port or through an UART port.
    (a) SWO port: you have to configure SWO registers and use SWIF protocol.... well, this would be a little complicated. But I use this method so that UART ports won't be occupied.
    (b) UART port: you only need to design a normal UART driver. Or, TI might have driver ready for you.

    For (2), PC already has UART driver. So, you need a console program. Fo myself, I design my own program to receive and display log messages.

    Btw, you have to configure the same baud rate, parity, stop-bits for both sides.