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.

TDA2EG-17: How to use Uart5?

Part Number: TDA2EG-17

Hi, 

 I need uart5 to receive gps signal.

So I added utils_uart_0.c, when I run System_uartInit () the system hangs.

How can I solve it??

SDK : PROCESSOR_SDK_VISION_03_04_00_00

Board : Custom Board

The System_uart0Init() code below

Void System_uart0Init(void)
{
    Uart_ChanParams chanParams;
    Error_Block eb;
    GIO_Params  ioParams;
    static char uartName[16]; /* device name MUST be global or static variable */
    static DEV_Struct uartDevObj;
    static GIO_Struct uartTxObj;
    static GIO_Struct uartRxObj;
    static SyncSem_Struct uartTxSyncSemObj;
    static SyncSem_Struct uartRxSyncSemObj;
    static Semaphore_Struct uartTxSemObj;
    static Semaphore_Struct uartRxSemObj;
    static IOM_Packet       uartTxIomObj[UART_ASYNC_IOM_PACKET_MAX];
    static IOM_Packet       uartRxIomObj[UART_ASYNC_IOM_PACKET_MAX];
    DEV_Params    devParams;
    Uart_Params   uartParams;
    SyncSem_Params syncSemParams;
    Semaphore_Params semParams;

    Int32 devId;

    Error_init(&eb);

    /*
     * Initialize channel attributes.
     */
    GIO_Params_init(&ioParams);

	//Jay do not do it again, cause System_uartInit had already do Uart_init
    //Uart_init();


    if(Bsp_platformIsTda2xxFamilyBuild())
    {
    //Harware HD-AVM-0302 for GPS
        strcpy(uartName, "/uart4");
        devId = 4;
       /* Set the pin Mux */
        //Bsp_boardSetPinMux(BSP_DRV_ID_UART, BSP_DEVICE_UART_INST_ID_4, BSP_BOARD_MODE_DEFAULT);
       HW_WR_REG32(0x4A003440,0x00050008);// uart5_rxd Pinmux
       HW_WR_REG32(0x4A003444,0x00010008);// uart5_txd Pinmux
    }
    else if(Bsp_platformIsTda3xxFamilyBuild())
    {
#if 0	    //adas_0101
			//'
			strcpy(uartName, "/uart0");  //0x00050000 uart1
			devId = 0;					//0x00050000 uart1
			HW_WR_REG32(0x4A0035BC,0x00050000);//0x00050000 uart1_rxd
			HW_WR_REG32(0x4A0035C0,0x00010000);//0x00010000 uart1_txd
#endif
#if 1
			//Harware BSD-0101 for GPS
			/* Set the pin Mux */
			strcpy(uartName, "/uart1");  // uart2
			devId = 1;					// uart2
			HW_WR_REG32(0x4A003450,0x00050002);//0x00050000 Pinmux uart2_rxd
#endif
    }
    else
    {
        Vps_printf("NOT TDA2XX AND TDA3XX!! PLEASE CHECK YOUR HARDWARE!!\n");
    }

	Vps_printf("######Jay uart devId = %d###########\n",devId);
    uartParams              = Uart_PARAMS;
    uartParams.opMode       = UART_OPMODE_INTERRUPT;
    uartParams.hwiNumber    = 8u;
    uartParams.rxThreshold  = UART_RXTRIGLVL_8;
    uartParams.txThreshold  = UART_TXTRIGLVL_56;
    uartParams.baudRate     = UART_BAUDRATE_9_6K; //radar    230400U UART_BAUDRATE_9_6K
    uartParams.prcmDevId    = 0;
    /* INVARIANT_CONDITION.UNREACH
    * MISRAC_2004_Rule_13.7
    * MISRAC_WAIVER:
    * Code is currently unreachable.
    * This is kept to ensure future updates to modes.
    */
    if(uartParams.opMode == UART_OPMODE_POLLED)
    {
        Vps_printf(" SYSTEM: UART: POLLED Mode is Selected \n");
    }
    else if(uartParams.opMode == UART_OPMODE_INTERRUPT)
    {
        Vps_printf(" SYSTEM: UART: INTERRUPT Mode is Selected \n");
    }
    else
    {
        /* MISRA WARNING */
    }
    uartParams.enableCache = (Bool)FALSE;

    /* initialise the edma library and get the EDMA handle */
    chanParams.hEdma = NULL;

    /* If cross bar events are being used then make isCrossBarIntEn = TRUE and
     * choose appropriate interrupt number to be mapped (assign it to
     * intNumToBeMapped)
     */
    chanParams.crossBarEvtParam.isCrossBarIntEn = (Bool)FALSE;

    chanParams.crossBarEvtParam.intNumToBeMapped = 0xFFU;

#if 0 //Not sure whether to do it
    //Add by TIM for HD_AVM_0302 //IRQ 59、OK
    if(Bsp_platformIsTda2xxFamilyBuild())
    {
        UInt32 cookie = 0;
        uartParams.prcmDevId    = 4;//Uart5
        uartParams.hwiNumber = CSL_XBAR_INST_IPU1_IRQ_59;
        /* Configure the crossbar */
        BspOsal_irqXbarConnectIrq((UInt32) CSL_XBAR_INST_IPU1_IRQ_59, (UInt32)CSL_XBAR_UART5_IRQ);
        /* Configure the Interrupt */
        cookie = BspOsal_disableInterrupt();
        Hwi_enableInterrupt(CSL_XBAR_INST_IPU1_IRQ_59);
        /* Restore interrupts */
        BspOsal_restoreInterrupt(cookie);
    }
#endif

    ioParams.chanParams = (Ptr)&chanParams;

#if 1
    DEV_Params_init(&devParams);
    devParams.deviceParams = &uartParams;
    devParams.initFxn = NULL;
    devParams.devid = devId;

/* MISRA.CAST.CONST
 * MISRAC_2004 Rule_11.5
 * MISRAC_WAIVER:
 * External package errors like bios which are not
 * part of VSDK package can't be fixed
 */

    DEV_construct(&uartDevObj, uartName, (Ptr)&Uart_IOMFXNS, &devParams, &eb);

#if 1
    SyncSem_Params_init(&syncSemParams);

    Semaphore_Params_init(&semParams);
    semParams.mode = Semaphore_Mode_BINARY;

    Semaphore_construct(&uartTxSemObj, 0, &semParams);

    syncSemParams.sem = Semaphore_handle(&uartTxSemObj);

    SyncSem_construct(&uartTxSyncSemObj, &syncSemParams, &eb);

    ioParams.sync =
        SyncSem_Handle_upCast(
            SyncSem_handle(
                &uartTxSyncSemObj
            )
        )
        ;

    if(ioParams.numPackets > UART_ASYNC_IOM_PACKET_MAX)
    {
        UTILS_assert(ioParams.numPackets <= UART_ASYNC_IOM_PACKET_MAX);
    }

    memset(&uartTxIomObj[0], 0, ioParams.numPackets * sizeof (IOM_Packet));
    ioParams.packets = &uartTxIomObj[0];
#endif
    /* create the required channels(TX/RX) for the UART demo */
    GIO_construct(&uartTxObj, uartName, (UInt32)GIO_OUTPUT, &ioParams, &eb);


#if 1
    SyncSem_Params_init(&syncSemParams);

    Semaphore_Params_init(&semParams);
    semParams.mode = Semaphore_Mode_BINARY;

    Semaphore_construct(&uartRxSemObj, 0, &semParams);

    syncSemParams.sem = Semaphore_handle(&uartRxSemObj);

    SyncSem_construct(&uartRxSyncSemObj, &syncSemParams, &eb);

    ioParams.sync =
        SyncSem_Handle_upCast(
            SyncSem_handle(
                &uartRxSyncSemObj
            )
        )
        ;

    memset(&uartRxIomObj[0], 0, ioParams.numPackets * sizeof (IOM_Packet));
    ioParams.packets = &uartRxIomObj[0];
#endif
    GIO_construct(&uartRxObj, uartName, (UInt32)GIO_INPUT, &ioParams, &eb);

    uart0TxHandle = GIO_handle(&uartTxObj);
    uart0RxHandle = GIO_handle(&uartRxObj);
#endif

    /* INVARIANT_CONDITION.UNREACH
    * MISRAC_2004_Rule_13.7
    * MISRAC_WAIVER:
    * Code is currently unreachable.
    * This is kept to ensure future updates by the called function.
    */
    if ((NULL == uart0RxHandle) || (NULL == uart0TxHandle))
    {
        Vps_printf(" SYSTEM: UART: ERROR: GIO_create(%s) Failed !!!\n", uartName);
    }
    else
    {
        Init0Done = (Bool)TRUE;
    }
}

  • Can you please check if you have setup pinmux correctly?

    Rgds,

    Brijesh

  • Thans your reply

    I set the pinmux use HW_WR_REG32, and searched for TRM.

    Is the setting correct?

    HW_WR_REG32(0x4A003440,0x00050008);// uart5_rxd Pinmux

    HW_WR_REG32(0x4A003444,0x00010008);// uart5_txd Pinmux

  • Hi, Did not receive your reply.

    Supplementary explanation , I have confirmed that PRCM is turned on, PINMUX is correct, and CROSSBAR is set.

    But when I call uart0Read there is no response from the task.

    Add the UART5 crossbar map  in the Bsp_platformTda2xxXbarConfig

     /* XBAR UART5_IRQ to IPU1_59 */
        BspOsal_irqXbarConnect(CSL_XBAR_INST_IPU1_IRQ_59, CSL_XBAR_UART5_IRQ); //Add by Tim

    Use the  PMHALModuleModeSet API to open the UART5 module

    //Uart 5 CLKCTRL
    PMHALModuleModeSet(PMHAL_PRCM_MOD_UART5,
    PMHAL_PRCM_MODULE_MODE_ENABLED,
    PM_TIMEOUT_INFINITE);

    The pinmux code :

    /* Set the pin Mux */
            Bsp_platformSetPinmuxRegs((UInt32) 8U, (UInt32) CTRL_CORE_PAD_GPMC_A0,
            BSP_PLATFORM_IOPAD_CFG_INPUTENABLE_OUT |
            BSP_PLATFORM_IOPAD_CFG_PULLUDENABLE_ENABLE |
            BSP_PLATFORM_IOPAD_CFG_PULLTYPESELECT_UP);
    
    
            Bsp_platformSetPinmuxRegs((UInt32) 8U, (UInt32) CTRL_CORE_PAD_GPMC_A1,
            BSP_PLATFORM_IOPAD_CFG_INPUTENABLE_BI |
            BSP_PLATFORM_IOPAD_CFG_PULLUDENABLE_DISABLE |
            BSP_PLATFORM_IOPAD_CFG_PULLTYPESELECT_DOWN);

    Set the hwi Number 、prcmDevId :
    #if 1 //Not sure whether to do it
        //Add by TIM for HD_AVM_0302 //IRQ 59、IRQ76  OK
        if(Bsp_platformIsTda2xxFamilyBuild())
        {
            // Do the cross bar map in the file bsp_platformTda2xx.c  Bsp_platformTda2xxXbarConfig funtion
            uartParams.prcmDevId    = 4;//Uart5
            uartParams.hwiNumber = CSL_XBAR_INST_IPU1_IRQ_59;
        }
    #endif
  • Hi,

    No reply received in a while

    Is TI still support?

  • Hi YiTing,

    I have the following questions:

    1) Any particular reason you are still on 3.04 and not on the latest SDK. http://software-dl.ti.com/processor-sdk-vision/esd/TDAx/vision-sdk/latest/index_FDS.html?

    2) When you say Hang you stop seeing the console UART responding as well?

    Regards,
    Keerthy

  • Hi,

    (1)

    I compared SDK 0308 and 0304 about the crossbar configuration in "bsp_platformTda2xx.c" and uartInit in utils_uart.c.
    I think these two versions have not been modified.

    (2)

    The console UART work well, i can see the ttl print message but the task will stop when the task call "uart0Read" funtion

    Below is my uart initialization code:


    /*
    Copyright (c) [2012 - 2017] Texas Instruments Incorporated
    
    All rights reserved not granted herein.
    
    Limited License.
    
     Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
     license under copyrights and patents it now or hereafter owns or controls to
     make,  have made, use, import, offer to sell and sell ("Utilize") this software
     subject to the terms herein.  With respect to the foregoing patent license,
     such license is granted  solely to the extent that any such patent is necessary
     to Utilize the software alone.  The patent license shall not apply to any
     combinations which include this software, other than combinations with devices
     manufactured by or for TI ("TI Devices").  No hardware patent is licensed
     hereunder.
    
     Redistributions must preserve existing copyright notices and reproduce this
     license (including the above copyright notice and the disclaimer and
     (if applicable) source code license limitations below) in the documentation
     and/or other materials provided with the distribution
    
     Redistribution and use in binary form, without modification, are permitted
     provided that the following conditions are met:
    
     * No reverse engineering, decompilation, or disassembly of this software
       is permitted with respect to any software provided in binary form.
    
     * Any redistribution and use are licensed by TI for use only with TI Devices.
    
     * Nothing shall obligate TI to provide you with source code for the software
       licensed and provided to you in object code.
    
     If software source code is provided to you, modification and redistribution of
     the source code are permitted provided that the following conditions are met:
    
     * Any redistribution and use of the source code, including any resulting
       derivative works, are licensed by TI for use only with TI Devices.
    
     * Any redistribution and use of any object code compiled from the source code
       and any resulting derivative works, are licensed by TI for use only with TI
       Devices.
    
     Neither the name of Texas Instruments Incorporated nor the names of its
     suppliers may be used to endorse or promote products derived from this software
     without specific prior written permission.
    
     DISCLAIMER.
    
     THIS SOFTWARE IS PROVIDED BY TI AND TI�S LICENSORS "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 TI AND TI�S LICENSORS 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.
    */
    
    /**
     *******************************************************************************
     * \file utils_uart.c
     *
     * \brief  This file has the implementataion for UART
     *
     * \version 0.0 (Jun 2013) : [NN] First version
     * \version 0.1 (Jul 2013) : [NN] Updates as per code review comments
     *
     *******************************************************************************
    */
    
    /*******************************************************************************
     *  INCLUDE FILES
     *******************************************************************************
     */
    
    #include <xdc/std.h>
    #include <string.h>
    #include <stdlib.h>
    #include <xdc/runtime/Memory.h>
    #include <xdc/runtime/Log.h>
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/System.h>
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/io/GIO.h>
    #include <ti/sysbios/io/DEV.h>
    #include <ti/sysbios/syncs/SyncSem.h>
    #include <ti/sysbios/knl/Semaphore.h>
    #include <ti/drv/bsp_lld/uart/bsp_uart.h>
    #include <ti/drv/vps/include/platforms/bsp_platform.h>
    #include <ti/drv/vps/include/boards/bsp_board.h>
    #include <ti/drv/vps/include/devices/bsp_device.h>
    #include <src/rtos/utils_common/include/utils_uart.h>
    //Jay add
    #include <ti/csl/hw_types.h>
    //Tim add for set IRQ
    #include <ti/csl/soc.h>
    /* Include Family specific hwi files */
    #if defined (__TI_ARM_V7M4__) || defined (BUILD_M3)
    #include <ti/sysbios/family/arm/m3/Hwi.h>
    #elif defined (_TMS320C6X)
    #include <ti/sysbios/family/c64p/Hwi.h>
    #elif defined (__ARM_ARCH_7A__)
    #include <ti/sysbios/family/arm/gic/Hwi.h>
    #elif defined (BUILD_A8)
    #include <ti/sysbios/family/arm/a8/intcps/Hwi.h>
    #elif defined (BUILD_ARP32)
    #include <ti/sysbios/family/arp32/Hwi.h>
    #else
    #include <ti/sysbios/hal/Hwi.h>
    #endif
    
    
    
    /**
     *  GIO_Params_init will initialize the async packet to 2.
     */
    #define UART_ASYNC_IOM_PACKET_MAX                                           (2U)
    
    /**
     *******************************************************************************
     * \brief Buffer to read from UART console
     *******************************************************************************
     */
    /* MISRA.PRAGMA
     * MISRAC_2004 Rule_3.4
     * MISRAC_WAIVER:
     * KW tool cannot understand the pragma supported by CGTools like
     * DATA_ALIGN and DATA_SECTION. But these are valid pragmas.
     */
    #pragma DATA_ALIGN(uart0ReadBuffer, 128);
    static char       uart0ReadBuffer[UART_BUFFER_SIZE];
    
    /**
     *******************************************************************************
     * \brief UART handle for input stream
     *******************************************************************************
     */
    GIO_Handle       uart0RxHandle;
    
    /**
     *******************************************************************************
     * \brief UART handle for output stream
     *******************************************************************************
     */
    GIO_Handle       uart0TxHandle;
    
    /**
     *******************************************************************************
     * \brief Global to check whether UART is initialized or not
     *******************************************************************************
     */
    static Bool    Init0Done  = FALSE;
    
    /**
     *******************************************************************************
     *
     * \brief Return TRUE if UART init is done
     *
     * \return  TRUE if UART init is done, else FALSE
     *
     *******************************************************************************
     */
    
    Bool System_isUart0InitDone(void)
    {
        return Init0Done;
    }
    
    /**
     *******************************************************************************
     *
     * \brief Initializes the UART and sets the GIO handles for the Tx and Rx
     *
     * \return  None
     *
     *******************************************************************************
     */
    Void System_uart0Init(void)
    {
        Uart_ChanParams chanParams;
        Error_Block eb;
        GIO_Params  ioParams;
        static char uartName[16]; /* device name MUST be global or static variable */
        static DEV_Struct uartDevObj;
        static GIO_Struct uartTxObj;
        static GIO_Struct uartRxObj;
        static SyncSem_Struct uartTxSyncSemObj;
        static SyncSem_Struct uartRxSyncSemObj;
        static Semaphore_Struct uartTxSemObj;
        static Semaphore_Struct uartRxSemObj;
        static IOM_Packet       uartTxIomObj[UART_ASYNC_IOM_PACKET_MAX];
        static IOM_Packet       uartRxIomObj[UART_ASYNC_IOM_PACKET_MAX];
        DEV_Params    devParams;
        Uart_Params   uartParams;
        SyncSem_Params syncSemParams;
        Semaphore_Params semParams;
    
        Int32 devId;
    
        Error_init(&eb);
    
        /*
         * Initialize channel attributes.
         */
        GIO_Params_init(&ioParams);
    
    	//Jay do not do it again, cause System_uartInit had already do Uart_init
        //Uart_init();
    
        if(Bsp_platformIsTda2xxFamilyBuild())
        {
            //Harware HD-AVM-0302 for GPS
            strcpy(uartName, "/uart4");
            devId = 4;
           /* Set the pin Mux */
           /*
            Bsp_platformSetPinmuxRegs((UInt32) 8U, (UInt32) CTRL_CORE_PAD_GPMC_A0,
            BSP_PLATFORM_IOPAD_CFG_INPUTENABLE_OUT |
            BSP_PLATFORM_IOPAD_CFG_PULLUDENABLE_ENABLE |
            BSP_PLATFORM_IOPAD_CFG_PULLTYPESELECT_UP);
    
            Bsp_platformSetPinmuxRegs((UInt32) 8U, (UInt32) CTRL_CORE_PAD_GPMC_A1,
            BSP_PLATFORM_IOPAD_CFG_INPUTENABLE_BI |
            BSP_PLATFORM_IOPAD_CFG_PULLUDENABLE_DISABLE |
            BSP_PLATFORM_IOPAD_CFG_PULLTYPESELECT_DOWN);*/
            HW_WR_REG32(0x4A003440,0x00050008);// uart5_rxd Pinmux
            HW_WR_REG32(0x4A003444,0x00010008);// uart5_txd Pinmux
        }
        else if(Bsp_platformIsTda3xxFamilyBuild())
        {
    #if 0	    //adas_0101
    			//'
    			strcpy(uartName, "/uart0");  //0x00050000 uart1
    			devId = 0;					//0x00050000 uart1
    			HW_WR_REG32(0x4A0035BC,0x00050000);//0x00050000 uart1_rxd
    			HW_WR_REG32(0x4A0035C0,0x00010000);//0x00010000 uart1_txd
    #endif
    #if 1
    			//Harware BSD-0101 for GPS
    			/* Set the pin Mux */
    			strcpy(uartName, "/uart1");  // uart2
    			devId = 1;					// uart2
    			HW_WR_REG32(0x4A003450,0x00050002);//0x00050000 Pinmux uart2_rxd
    #endif
        }
        else
        {
            Vps_printf("NOT TDA2XX AND TDA3XX!! PLEASE CHECK YOUR HARDWARE!!\n");
        }
    
    	Vps_printf("######Jay uart devId = %d###########\n",devId);
        uartParams              = Uart_PARAMS;
        uartParams.opMode       = UART_OPMODE_INTERRUPT;
        uartParams.hwiNumber    = 8u;
        uartParams.rxThreshold  = UART_RXTRIGLVL_8;
        uartParams.txThreshold  = UART_TXTRIGLVL_56;
        uartParams.baudRate     = UART_BAUDRATE_9_6K; //radar    230400U UART_BAUDRATE_9_6K
        uartParams.prcmDevId    = 0;
        /* INVARIANT_CONDITION.UNREACH
        * MISRAC_2004_Rule_13.7
        * MISRAC_WAIVER:
        * Code is currently unreachable.
        * This is kept to ensure future updates to modes.
        */
        if(uartParams.opMode == UART_OPMODE_POLLED)
        {
            Vps_printf(" SYSTEM: UART: POLLED Mode is Selected \n");
        }
        else if(uartParams.opMode == UART_OPMODE_INTERRUPT)
        {
            Vps_printf(" SYSTEM: UART: INTERRUPT Mode is Selected \n");
        }
        else
        {
            /* MISRA WARNING */
        }
        uartParams.enableCache = (Bool)FALSE;
    
        /* initialise the edma library and get the EDMA handle */
        chanParams.hEdma = NULL;
    
        /* If cross bar events are being used then make isCrossBarIntEn = TRUE and
         * choose appropriate interrupt number to be mapped (assign it to
         * intNumToBeMapped)
         */
        chanParams.crossBarEvtParam.isCrossBarIntEn = (Bool)FALSE;
    
        chanParams.crossBarEvtParam.intNumToBeMapped = 0xFFU;
    
    #if 1 //Not sure whether to do it
        //Add by TIM for HD_AVM_0302 //IRQ 59�BIRQ76  OK
        if(Bsp_platformIsTda2xxFamilyBuild())
        {
            //Do the cross bar map in the bsp_platformTda2xx.c  Bsp_platformTda2xxXbarConfig() funtion
            //chanParams.crossBarEvtParam.isCrossBarIntEn = (Bool)TRUE;
            //chanParams.crossBarEvtParam.intNumToBeMapped = CSL_XBAR_INST_IPU1_IRQ_59;
            uartParams.prcmDevId    = 4;//Uart5
            uartParams.hwiNumber = CSL_XBAR_INST_IPU1_IRQ_59;
        }
    #endif
    
    #if 1
            //Add by TIM for HD_BOX_0101
    
            if(Bsp_platformIsTda3xxFamilyBuild())
            {
                //Already do the cross bar map in the bsp_platformTda3xx.c  Bsp_platformTda3xxInit() funtion
                uartParams.prcmDevId    = 1; //Uart2
                uartParams.hwiNumber    = CSL_XBAR_INST_IPU1_IRQ_43;
            }
    #endif
    
        ioParams.chanParams = (Ptr)&chanParams;
    
    #if 1
        DEV_Params_init(&devParams);
        devParams.deviceParams = &uartParams;
        devParams.initFxn = NULL;
        devParams.devid = devId;
    
    /* MISRA.CAST.CONST
     * MISRAC_2004 Rule_11.5
     * MISRAC_WAIVER:
     * External package errors like bios which are not
     * part of VSDK package can't be fixed
     */
    
        DEV_construct(&uartDevObj, uartName, (Ptr)&Uart_IOMFXNS, &devParams, &eb);
    
    #if 1
        SyncSem_Params_init(&syncSemParams);
    
        Semaphore_Params_init(&semParams);
        semParams.mode = Semaphore_Mode_BINARY;
    
        Semaphore_construct(&uartTxSemObj, 0, &semParams);
    
        syncSemParams.sem = Semaphore_handle(&uartTxSemObj);
    
        SyncSem_construct(&uartTxSyncSemObj, &syncSemParams, &eb);
    
        ioParams.sync =
            SyncSem_Handle_upCast(
                SyncSem_handle(
                    &uartTxSyncSemObj
                )
            )
            ;
    
        if(ioParams.numPackets > UART_ASYNC_IOM_PACKET_MAX)
        {
            UTILS_assert(ioParams.numPackets <= UART_ASYNC_IOM_PACKET_MAX);
        }
    
        memset(&uartTxIomObj[0], 0, ioParams.numPackets * sizeof (IOM_Packet));
        ioParams.packets = &uartTxIomObj[0];
    #endif
        /* create the required channels(TX/RX) for the UART demo */
        GIO_construct(&uartTxObj, uartName, (UInt32)GIO_OUTPUT, &ioParams, &eb);
    
    
    #if 1
        SyncSem_Params_init(&syncSemParams);
    
        Semaphore_Params_init(&semParams);
        semParams.mode = Semaphore_Mode_BINARY;
    
        Semaphore_construct(&uartRxSemObj, 0, &semParams);
    
        syncSemParams.sem = Semaphore_handle(&uartRxSemObj);
    
        SyncSem_construct(&uartRxSyncSemObj, &syncSemParams, &eb);
    
        ioParams.sync =
            SyncSem_Handle_upCast(
                SyncSem_handle(
                    &uartRxSyncSemObj
                )
            )
            ;
    
        memset(&uartRxIomObj[0], 0, ioParams.numPackets * sizeof (IOM_Packet));
        ioParams.packets = &uartRxIomObj[0];
    #endif
        GIO_construct(&uartRxObj, uartName, (UInt32)GIO_INPUT, &ioParams, &eb);
    
        uart0TxHandle = GIO_handle(&uartTxObj);
        uart0RxHandle = GIO_handle(&uartRxObj);
    #endif
    
        /* INVARIANT_CONDITION.UNREACH
        * MISRAC_2004_Rule_13.7
        * MISRAC_WAIVER:
        * Code is currently unreachable.
        * This is kept to ensure future updates by the called function.
        */
        if ((NULL == uart0RxHandle) || (NULL == uart0TxHandle))
        {
            Vps_printf(" SYSTEM: UART: ERROR: GIO_create(%s) Failed !!!\n", uartName);
        }
        else
        {
            Init0Done = (Bool)TRUE;
        }
    }
    
    /**
     *******************************************************************************
     *
     * \brief Prints the string in UART console , System_uartInit must succeed
     *        Before a call to this function
     *
     * \param  string     [IN] Input string
     *
     * \return  None
     *
     *******************************************************************************
     */
    void uart0Print(char *string)
    {
        size_t len;
        Int32    status  = IOM_COMPLETED;
        if(Init0Done == (Bool)TRUE)
        {
            len = strlen(string);
    
            /* Transmit the string*/
            status = GIO_write(uart0TxHandle, string, &len);
    
            if (IOM_COMPLETED != status)
            {
                printf(" SYSTEM: UART: ERROR: GIO_write failed (status = %d) !!! \n",status);
            }
        }
        else
        {
            /*
            printf("\n System_uartInit needs to be called prior to any uartprint");
            */
        }
    }
    
    /**
     *******************************************************************************
     *
     * \brief Reads the Input message from the UART console
     *        System_uartInit needs to be called prior to any uarRead
     *
     * \param  pOption     [OUT] Character read from UART
     *
     * \return  None
     *
     *******************************************************************************
     */
    Void uart0Read(Int8 *pOption)
    {
        Int32   nStatus  = IOM_COMPLETED;
        size_t  nLen    = 1u ;
    
        nStatus = GIO_read(uart0RxHandle, &uart0ReadBuffer, &nLen);
        if (IOM_COMPLETED != nStatus)
        {
            printf(" SYSTEM: UART: ERROR: GIO_read failed (status = %d) !!! \n",nStatus);
        }
    
        /* copy only one char */
        *pOption = (Int8)uart0ReadBuffer[nLen - 1U];
    
    }
    
    

  • Hi,

    The Uart UT provides testing of the UART5 in Tx mode on the EVM.
    For module enable and interrupt crossbar configuration you can refer the function "st_uartEnableUartModule" in below file
    <pdk_install_dir>\packages\ti\drv\bsp_lld\uart\unit_test\uartUt\testLib\st_uartPlatform.c

    Also you need to check your board schematics the gps signals are coming on which pad of the Soc to capture from UART5.
    Configure the pad configuration corresponding to those pads for mux mode of UART5.

    Regards,
    Prasad