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.

LAUNCHXL-CC2650: Simplest form to ADD UART to simple_peripheral_example

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: CC2650

Hi all,

Is there a simple way to add UART to simple_peripheral_example for CC2650 ?

I want to send data using UART to a PC in PeriodicTask()

as simple like :

#define library

UART_Params_init ();

UART_open(); 

my data to prinft()

UART_write();

UART_close();

??

I was able to added the UART using SCS, but if the CC2650 have a UART peripheral module is better use it instead of a virtual UART...

  • Hi,

    You can download following sample code and check "spp_over_ble"

    github.com/.../ble_examples
  • Hi YiKai,

    I tried to follow the "Transport Layer Implementation" the "easiest" way to push out data using UART hardware, but I am not able to send data via UART. at first I had an issue finding the tl.c and ti.h I got them from the following thread:

    I tried Using "basic printf over TI-RTOS" but I am stuck I could not find the appBLE.cfg for simple_peripheral example.

    and following "Using TI RTOS Drivers"

    #include <ti/drivers/UART.h>
    #include <ti/drivers/uart/UARTCC26XX.h>

    on init funtion

     UART_init();

    on performPeriodicTask()

        UART_Handle handle;
          UART_Params params;
          uint8_t txBuf[] = "Hello World";    // Transmit buffer
          // Init UART and specify non-default parameters
          UART_Params_init(&params);
          params.baudRate      = 9600;
          params.writeDataMode = UART_DATA_BINARY;
          // Open the UART and do the write
          handle = UART_open(Board_UART, &params);
        UART_write(handle, txBuf, sizeof(txBuf));

    and the app goes freeze when is at performPeriodicTask after the 

    UART_write(handle, txBuf, sizeof(txBuf));

    I am expecting the UART TX(output) from DIO3

  • Hi Yikai,
    I ported the code from echo example to simple_peripheral and now is working pretty good.

    I have an additional question is possible print via serial uint_8 or just const char values? I mean I want to send number from 0x00-0xFF from a unit_8 var, but it is no possible for me 

    UART_write(uart, txBuf, sizeof(txBuf));
    

    txBuf is only for char or string values

  • Yes, you can use sprintf to format uint8 to a string buffer and call UART write to output the buffer.