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.

UART module is deprecated?

Other Parts Discussed in Thread: SYSBIOS

I recently added the UART module to my RTOS AP. Now I get warnings when I compile my AP. Please see the warning messages below. I followed the suggestion and added the TIRTOS.useUART to my .cfg file, but it continues to get the warnings. I've also pasted the .cfg file below for your review.

In my .c file, I have #include <ti/drivers/UART.h>

I have "use" UART in my .cfg outline.

Your advice will be deeply appreciated.

Jonathan

Description Resource Path Location Type

#552-D variable "transferOK" was set but never used spiloopback.c /ESU_Firmware_UART line 915 C/C++ Problem
#552-D variable "transferOK" was set but never used spiloopback.c /ESU_Firmware_UART line 983 C/C++ Problem
<a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "SysCtlDelay" declared implicitly spiloopback.c /ESU_Firmware_UART line 1381 C/C++ Problem
<a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "SysCtlDelay" declared implicitly spiloopback.c /ESU_Firmware_UART line 1395 C/C++ Problem
<a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "UARTBusy" declared implicitly spiloopback.c /ESU_Firmware_UART line 1680 C/C++ Problem
<a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "UARTCharsAvail" declared implicitly spiloopback.c /ESU_Firmware_UART line 1775 C/C++ Problem
The UART module is deprecated. Please set ti.tirtos.TIRTOS.useUART to true in the .cfg instead (via graphical tool or text editor). spiloopback.cfg /ESU_Firmware_UART ti.tirtos.TIRTOS XDCTools Configuration Marker
ti.tirtos.TIRTOS : The UART module is deprecated. Please set ti.tirtos.TIRTOS.useUART to true in the .cfg instead (via graphical tool or text editor). .xdchelp /ESU_Firmware_UART line 112 C/C++ Problem

/*
* Copyright (c) 2015, 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.
*/

/*
* ======== spiloopback.cfg ========
*/

/* ================ General configuration ================ */
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');

var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Timer = xdc.useModule('ti.sysbios.hal.Timer');
var Idle = xdc.useModule('ti.sysbios.knl.Idle');
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
var GateAll = xdc.useModule('ti.sysbios.gates.GateAll');
var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
var Log = xdc.useModule('xdc.runtime.Log');
var UART = xdc.useModule('ti.drivers.UART');

/*
* Program.stack is ignored with IAR. Use the project options in
* IAR Embedded Workbench to alter the system stack size.
*/
if (!Program.build.target.$name.match(/iar/)) {
/*
* Reducing the system stack size (used by ISRs and Swis) to reduce
* RAM usage.
*/
Program.stack = 4096;
}

/*
* Comment this line to allow module names to be loaded on the target.
* The module name strings are placed in the .const section. Setting this
* parameter to false will save space in the .const section. Error and
* Assert messages will contain an "unknown module" prefix instead
* of the actual module name.
*/
//Defaults.common$.namedModule = false;
Defaults.common$.namedModule = true;

/*
* Minimize exit handler array in System. The System module includes
* an array of functions that are registered with System_atexit() to be
* called by System_exit().
*/
System.maxAtexitHandlers = 2;

/*
* Comment this line to allow Error, Assert, and Log strings to be
* loaded on the target. These strings are placed in the .const section.
* Setting this parameter to false will save space in the .const section.
* Error, Assert and Log message will print raw ids and args instead of
* a formatted message.
*/
//Text.isLoaded = false;
Text.isLoaded = true;

/* ================ System configuration ================ */
var SysMin = xdc.useModule('xdc.runtime.SysMin');
System.SupportProxy = SysMin;
SysMin.bufSize = 128;

/* Enable Semihosting for GNU targets to print to CCS console */
if (Program.build.target.$name.match(/gnu/)) {
var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
}

/* ================ BIOS configuration ================ */
/*
* Disable unused BIOS features to minimize footprint.
* This example uses Tasks but not Swis or Clocks.
*/
BIOS.libType = BIOS.LibType_Custom;
BIOS.logsEnabled = true;
//BIOS.assertsEnabled = true;
//BIOS.logsEnabled = false;
BIOS.assertsEnabled = false;

BIOS.heapSize = 4096;

/* Runtime stack checking is performed */
Task.checkStackFlag = true;
Hwi.checkStackFlag = true;

/* Reduce the number of task priorities */
Task.numPriorities = 16;

/* ================ Driver configuration ================ */
var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
TIRTOS.useGPIO = true;
TIRTOS.useSPI = true;
TIRTOS.useUART = true;
var semaphore2Params = new Semaphore.Params();
semaphore2Params.instance.name = "ISRSem";
semaphore2Params.mode = Semaphore.Mode_COUNTING_PRIORITY;
Program.global.ISRSem = Semaphore.create(null, semaphore2Params);
var semaphore3Params = new Semaphore.Params();
semaphore3Params.instance.name = "miscompareSem";
semaphore3Params.mode = Semaphore.Mode_COUNTING_PRIORITY;
Program.global.miscompareSem = Semaphore.create(null, semaphore3Params);
Idle.idleFxns[0] = null;
Idle.idleFxns[1] = null;
var task3Params0 = new Task.Params();
task3Params0.instance.name = "miscompareFxnTask";
Program.global.miscompareFxnTask = Task.create("&miscompareFxn", task3Params0);
BIOS.cpuFreq.lo = 80000000;
LoggingSetup.sysbiosTaskLogging = true;
LoggingSetup.loadLogging = true;
LoggingSetup.mainLogging = true;
LoggingSetup.mainLoggingRuntimeControl = false;
LoggingSetup.sysbiosSemaphoreLogging = true;
Hwi.dispatcherAutoNestingSupport = false;
var hwi0Params = new Hwi.Params();
hwi0Params.instance.name = "syncManagerISR_HWI";
hwi0Params.maskSetting = xdc.module("ti.sysbios.interfaces.IHwi").MaskingOption_SELF;
Program.global.syncManagerISR_HWI = Hwi.create(19, "&syncManagerISR", hwi0Params);
TIRTOS.libType = TIRTOS.LibType_NonInstrumented;
var gateAll0Params = new GateAll.Params();
gateAll0Params.instance.name = "gateAll0";
Program.global.gateAll0 = GateAll.create(gateAll0Params);
var task2Params = new Task.Params();
task2Params.instance.name = "SPI_Init_Task";
task2Params.priority = 10;
Program.global.SPI_Init_Task = Task.create("&ESU_SPI_Init", task2Params);
LoggingSetup.sysbiosSwiLogging = true;
var task2Params0 = new Task.Params();
task2Params0.instance.name = "echoFxn_Task";
Program.global.echoFxn_Task = Task.create("&echoFxn", task2Params0);

  • What version of TIRTOS are you on?

    Judah

  • My installation path shows:

    C:\ti\tirtos_tivac_2_14_00_10

    So, I'm guessing it's version 2.14.00.10.

  • Yes, it was deprecated in that release.  You should do the following now:

    var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
    TIRTOS.useUART == true;

    Judah

  • If you scroll up, in my .cfg file that I pasted to this thread, I already have those two lines at lines 128 and 131. Any other ideas? Thank you.

    /* ================ Driver configuration ================ */
    var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');
    TIRTOS.useGPIO = true;
    TIRTOS.useSPI = true;
    TIRTOS.useUART = true;

  • Please remove this line from your .cfg file.  This is the line getting the deprecation warning:

    var UART = xdc.useModule('ti.drivers.UART');

    Can you attach your spiloopback.c file here?

    Judah

  • Hi,

    The deprecation warning went away after I removed the line from my .cfg file. Not sure how that line got into my .c file in the first place. Thank you.

    However, I am still getting the "declared implicitly" warnings, even though I have included uart.h in my .c file. Not understanding this. Please see below:

    It wouldn't be good to publish my spiloopback.c file here. I'll be glad to email my spiloopback.c file to your private email address. Or, is there a particular section of that file your are interested in? I may be able to paste some excerpts of it here for your review.

    Jonathan

    Warning messages:

    Description Resource Path Location Type

    <a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "UARTBusy" declared implicitly spiloopback.c /ESU_Firmware_UART line 1693 C/C++ Problem
    <a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "UARTCharsAvail" declared implicitly spiloopback.c /ESU_Firmware_UART line 1813 C/C++ Problem

    excerpts from my .c file :

    /* XDCtools Header files */
    #include <xdc/std.h>
    #include <xdc/cfg/global.h>
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/Timestamp.h>
    #include <xdc/runtime/Log.h>

    /* BIOS Header files */
    #include <ti/sysbios/BIOS.h>


    /* TI-RTOS Header files */
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/SPI.h>
    #include <ti/drivers/UART.h>

    /* Example/Board Header files */
    #include "Board.h"

    //#include <ti/drivers/gpio/GPIOTiva.h>

    #include "uc9252.h"

    #include "inc/hw_gpio.h"
    #include "inc/hw_memmap.h"
    #include "driverlib/qei.h"
    #include "inc/hw_sysctl.h"
    #include "inc/hw_types.h"
    #include "inc/hw_qei.h"

    #include "inc/hw_ssi.h"

  • Did you ever resolve your issue?

    I don't know where UARTBusy or UARTCharsAvail is defined.

    I don't believe those are in the TIRTOS:  UART.h file

    Judah

  • Hi,

    I included the following line into my spiloopback.c file where UARTBusy and UARTCharsAvail are called from. The warnings went away. Those two functions are defined in this .h file. Inquiring mind would like to know what is the difference between TIRTOS:  UART.h and driverlib/uart.h?

    #include "driverlib/uart.h"

    Jonathan

  • "driverlib" is basically low level code that read/writes the peripheral registers directly.

    TIRTOS drivers are typically built on top of "driverlib".  Its basically a set of APIs that allow you to use the peripheral without having to know the peripheral register set.  Usually, but not always, you should not need to call the driverlib APIs when using TIRTOS.

    I will go ahead and close this thread.

    Judah

  • Thank you for the explanation. Please go ahead and close this thread.