Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: CC2650
Tool/software: Code Composer Studio
Hi!
I am using CC2650 launchpad with CCS and I am trying to send out received advdata(of beacons) to my PC through UART.
I have made changes in the code in the simple_peripheral_observer.c file and the main.c file. Here is my code -
Includes -
#include <string.h> #include<stdio.h> #include <ti/sysbios/BIOS.h> #include <ti/sysbios/knl/Swi.h> #include <ti/sysbios/knl/Task.h> #include <ti/sysbios/knl/Queue.h> #include <ti/sysbios/knl/Clock.h> #include <ti/sysbios/knl/Semaphore.h> #include <ti/sysbios/family/arm/m3/Hwi.h> #include "hci_tl.h" #include "gatt.h" #include "linkdb.h" #include "gapgattserver.h" #include "gattservapp.h" #include "devinfoservice.h" #include "simple_gatt_profile.h" #if defined(FEATURE_OAD) || defined(IMAGE_INVALIDATE) #include "oad_target.h" #include "oad.h" #endif //FEATURE_OAD || IMAGE_INVALIDATE #include "peripheral_observer.h" #include "gapbondmgr.h" #include "osal_snv.h" #include "icall_apimsg.h" #include "util.h" #ifdef USE_RCOSC #include "rcosc_calibration.h" #endif //USE_RCOSC #include <ti/mw/display/Display.h> #include "board_key.h" #include "board.h" #include "simple_peripheral_observer.h" #include <ti/drivers/UART.h> #include <ti/drivers/uart/UARTCC26XX.h> #include <ti/drivers/PIN.h> #include "inc/hw_memmap.h" #include "inc/hw_ints.h" #include <stdint.h> #include <xdc/std.h> #include <xdc/runtime/System.h> #include "ICall.h" #include "hal_types.h"
Function declaration in main.c -
extern void SimpleUART_createTask(void);
Function declaration in simple_peripheral_observer.c -
static void SimpleUART_taskFxn(UArg a0, UArg a1);
Function call from main.c -
SimpleUART_createTask();
Function body in simple_peripheral_observer.c -
void SimpleUART_createTask(void)
{
Task_Params taskParams;
//Board_initGeneral();
//Board_initUART();
Task_Params_init(&taskParams);
taskParams.stackSize = TASKSTACKSIZE;
taskParams.stack = &task0Stack;
Task_construct(&task0Struct, (Task_FuncPtr)SimpleUART_taskFxn, &taskParams, NULL);
}
Function body in simple_peripheral_observer.c -
static void SimpleUART_taskFxn(UArg a0, UArg a1)
{
UART_Handle uart;
UART_Params uartParams;
//UART_init();
const char hello[] = "UART is working.\n";
UART_Params_init(&uartParams);
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readReturnMode = UART_RETURN_FULL;
uartParams.readEcho = UART_ECHO_OFF;
uartParams.baudRate = 9600;
uart = UART_open(Board_UART0, &uartParams);
if (uart == NULL)
{
fflush(stdout);
printf("UART did not open.");
}
int number;
number = UART_write(uart, hello, sizeof(hello));
fflush(stdout);
printf("UART wrote %d bytes.\n", number);
}
The code builds perfectly, without any errors. However, I get the warning -
"Invalid project path: Duplicate path entries found (/simple_peripheral_observer_cc2650lp_app [Include path] isSystemInclude:true includePath:C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/tidrivers_cc13xx_cc26xx_2_20_01_10/packages), path: [/simple_peripheral_observer_cc2650lp_app]"
The code starts to debug, however the UART port is not opening. Is my code wrong? Or is there something I need to change in any of the header files? Or is my code not working due to the warning?
Please suggest me with a solution. Thanks in advance.