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/CC2640R2F: No serial terminal output with CCS

Part Number: CC2640R2F

Tool/software: Code Composer Studio

Hello,

When I open a serial terminal in CCS(desktop version), I am not getting printed output from ble5_simple_peripheral. I stopped debugging, opened the serial terminal, rebuilt and started the debugging session, and no output. Other than configuring the serial connection, do I need to do something else?

Patrick

  • Hi,

    I am not able to reproduce what you are seeing here with out of box example ble5_simple_peripheral.
    Are you able to see output using terminal from other tools?

    if you have changed a lot in the software, can you provide the changes so we can better assist you.
  • Closing the thread due to inactivity.
  • Hi Christin,

    Finally getting back to this. Here's a little more information. I'm implementing the SaBLE-x-R2 module from Laird/LSR. They implemented the CC2640r2 in their module and sell it as a precertified BLE5 module. I would like to support display_printf() to the console. I'm following the example shown in the SimpleLink Academy - debug printing::Task4 Display_printf output to the IDE console. The implementation in the SABLEX-R2 board file with my inclusion of TI's SimpleLink example and their display code stubbed out is shown below.

    /*
     *  ====================== SABLEXR2_DEV_BOARD.c ===================================
     *  This file is responsible for setting up the board specific items for the
     *  SaBLE-x-R2 module on the SaBLE-x Dev Board.
     */
    
    #include <xdc/std.h>
    #include <xdc/runtime/System.h>
    #include <ti/sysbios/family/arm/m3/Hwi.h>
    
    #include <ti/devices/cc26x0r2/driverlib/ioc.h>
    #include <ti/devices/cc26x0r2/driverlib/udma.h>
    #include <ti/devices/cc26x0r2/inc/hw_ints.h>
    #include <ti/devices/cc26x0r2/inc/hw_memmap.h>
    
    #include "SABLEXR2_DEV_BOARD.h"
    
    #if 0
    #include <ti/display/Display.h>
    #include <ti/display/DisplayUart.h>
    
    #ifndef BOARD_DISPLAY_UART_STRBUF_SIZE
    #define BOARD_DISPLAY_UART_STRBUF_SIZE    128
    #endif
    
    DisplayUart_Object     displayUartObject;
    
    static char uartStringBuf[BOARD_DISPLAY_UART_STRBUF_SIZE];
    
    const DisplayUart_HWAttrs displayUartHWAttrs = {
        .uartIdx      = CC2640R2_SABLEXR2_UART0,
        .baudRate     = 115200,
        .mutexTimeout = (unsigned int)(-1),
        .strBuf       = uartStringBuf,
        .strBufLen    = BOARD_DISPLAY_UART_STRBUF_SIZE,
    };
    
    #ifndef BOARD_DISPLAY_USE_UART
    #define BOARD_DISPLAY_USE_UART 1
    #endif
    #ifndef BOARD_DISPLAY_USE_UART_ANSI
    #define BOARD_DISPLAY_USE_UART_ANSI 0
    #endif
    #ifndef BOARD_DISPLAY_USE_LCD
    #define BOARD_DISPLAY_USE_LCD 0
    #endif
    
    /*
     * This #if/#else is needed to workaround a problem with the
     * IAR compiler. The IAR compiler doesn't like the empty array
     * initialization. (IAR Error[Pe1345])
     */
    #if (BOARD_DISPLAY_USE_UART)
    
    const Display_Config Display_config[] = {
    #if (BOARD_DISPLAY_USE_UART)
        {
    #  if (BOARD_DISPLAY_USE_UART_ANSI)
            .fxnTablePtr = &DisplayUartAnsi_fxnTable,
    #  else /* Default to minimal UART with no cursor placement */
            .fxnTablePtr = &DisplayUartMin_fxnTable,
    #  endif
            .object      = &displayUartObject,
            .hwAttrs     = &displayUartHWAttrs,
        },
    #endif
    };
    
    const uint_least8_t Display_count = sizeof(Display_config) / sizeof(Display_Config);
    
    #else
    
    const Display_Config *Display_config = NULL;
    const uint_least8_t Display_count = 0;
    
    #endif /* (BOARD_DISPLAY_USE_UART || BOARD_DISPLAY_USE_LCD) */
    #else
    /*
     *  =============================== Display ===============================
     */
    #include <ti/display/Display.h>
    #include <ti/display/DisplayHost.h>
    
    #define MAXPRINTLEN 256
    
    static char displayBuf[MAXPRINTLEN];
    
    DisplayHost_Object displayHostObject;
    
    const DisplayHost_HWAttrs displayHostHWAttrs = {
        .strBuf = displayBuf,
        .strBufLen = MAXPRINTLEN
    };
    
    const Display_Config Display_config[] = {
        {
            .fxnTablePtr = &DisplayHost_fxnTable,
            .object = &displayHostObject,
            .hwAttrs = &displayHostHWAttrs
        }
    };
    
    const uint_least8_t Display_count = sizeof(Display_config) / sizeof(Display_Config);
    #endif
    

    This does not display on Display_printf() on the console. I would like to see the output of the following code on the console as an example. This code snippet can be found in the SimplePeripheral example on or around line 1150.

           // Display device address
            Display_printf(dispHandle, SP_ROW_IDA, 0, "%s Addr: %s",
                           (addrMode <= ADDRMODE_RANDOM) ? "Dev" : "ID",
                           Util_convertBdAddr2Str(pPkt->devAddr));

    I've made the other few changes described in the SimpleLink Academy. Do you see anything that I've done wrong in my implementation or maybe something else that I need to do?

    Thanks,

    Patrick

  • I forgot to declare the display in SimplePeripheral_taskFxn().  Place this code directly under SimplePeripheral_init().

      Display_Handle display;
    
          display = Display_open(Display_Type_HOST, NULL);

    (note HOST declaration). This code will allow your program to write directly to the "console" in CCS.