Other Parts Discussed in Thread: SYSCONFIG, MSP430FR2355, CC2650
Tool/software: TI C/C++ Compiler
I was able to compile and load the uartecho.c demo program. I then took the core code from the uart task and added it into the rfEchoRx.c demo program. I add the various .h files that were in the uartecho.c demo. I had undefined errors on the macro constant CONFIG_UART_0 , and some undefined symbol problems:
undefined first referenced
symbol in file
--------- ----------------
UART_config C:/ti/simplelink_cc13x2_26x2_sdk_3_40_00_02/source/ti/drivers/lib/drivers_cc13x2.aem4f<UART.oem4f>
UART_count C:/ti/simplelink_cc13x2_26x2_sdk_3_40_00_02/source/ti/drivers/lib/drivers_cc13x2.aem4f<UART.oem4f>
So my question is when you want to use a peripheral in TI-RTOS, is where a reference where you can see what you have to include ?
Enclosed is the file that won't compile, the main_tirtos.c I modifed from the "stock" rfEchoRx.c example.
Windows 10, latest versions of everything downloaded 3/22/2020. CCS Version: 10.0.0.00010 LAUNCHSL-CC1312R has 'E' version chip on it (latest vesrion)
- pete
/* * Copyright (c) 2016-2017, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * ======== main_tirtos.c ======== */ #include <stdint.h> #include <stddef.h> /* POSIX Header files */ #include <pthread.h> /* RTOS header files */ #include <ti/sysbios/BIOS.h> /* Driver configuration */ #include <ti/drivers/Board.h> /*// PDH UART head file */ #include <ti/drivers/GPIO.h> #include <ti/drivers/UART.h> // include this so can do System_printf #include <xdc/runtime/System.h> /* Driver configuration */ #include "ti_drivers_config.h" extern void *mainThread(void *arg0); /* Stack size in bytes */ #define THREADSTACKSIZE 1024 /* * ======== main ======== */ int main(void) { pthread_t thread; pthread_attr_t attrs; struct sched_param priParam; int retc; int detachState; /* Call driver init functions */ Board_init(); Board_initGeneral(); /* Set priority and stack size attributes */ pthread_attr_init(&attrs); priParam.sched_priority = 1; detachState = PTHREAD_CREATE_DETACHED; retc = pthread_attr_setdetachstate(&attrs, detachState); if (retc != 0) { /* pthread_attr_setdetachstate() failed */ while (1); } pthread_attr_setschedparam(&attrs, &priParam); retc |= pthread_attr_setstacksize(&attrs, THREADSTACKSIZE); if (retc != 0) { /* pthread_attr_setstacksize() failed */ while (1); } retc = pthread_create(&thread, &attrs, mainThread, NULL); if (retc != 0) { /* pthread_create() failed */ while (1); } BIOS_start(); //// Uart Code from the uartecho.c demo UART_Handle uart; UART_Params uartParams; const unsigned char uartBootMessage[] = "Hello World\n"; /* Call driver init functions */ GPIO_init(); UART_init(); /* Create a UART with data processing off. */ 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 = 115200; // uart = UART_open(CONFIG_UART_0, &uartParams); // got undefined on CONFIG_UART_0 uart = UART_open(0, &uartParams); if (uart == NULL) { /* UART_open() failed */ while (1); } // Print a boot message retc = UART_write(uart, uartBootMessage, sizeof(uartBootMessage)); System_printf("The UART wrote %d bytes\n", retc); return (0); }