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.

RTOS/TDA2P-ACD: Supporting UART4 on custom board based on TDA2PX

Part Number: TDA2P-ACD

Tool/software: TI-RTOS

Hello All,

With reference to earlier thread i am able to create the UART TX and UART Rx channel for the attached GPS device but I am not getting any data from GPS chip on UART channel.

I can read GPS data over I2C channel.  I have configured the UART4 parameters as follows

    uartParams              = Uart_PARAMS;
    uartParams.opMode       = UART_OPMODE_INTERRUPT;
    uartParams.hwiNumber    = 8u;

    uartParams.baudRate     = UART_BAUDRATE_9_6K;
    uartParams.charLen = UART_CHARLEN_8;
    uartParams.stopBits = UART_NUMSTOPBITS_1;
    uartParams.parity = UART_PARITY_NO;
    uartParams.prcmDevId    = 3;
    uartParams.enableCache = (Bool)FALSE;

The GPS UART interface is also having the same UART setting, but when I give the command GIO_read() API to read the data available with GPS, it never come out of the API call.

GIO_write() also has the same result, am i missing anything here ?

Please let me know your reply on the same.

regards

Hrishikesh
 

  • Hi Hrishikesh,

    Have you done the crossbar mapping for UART4 interrupts?

    Regards,
    Rishabh
  • Hi Rishabh,

    Thanks for the reply, i am following the utils_uart.c from PSDK  in which for  UART 1 (normal console) following settings

    are done 

    chanParams.crossBarEvtParam.isCrossBarIntEn = (Bool)FALSE;

    chanParams.crossBarEvtParam.intNumToBeMapped = 0xFFU;

    and  uartParams.hwiNumber is assigned as 8, I have done the same settings for UART4

    will you please give more details on it ?

    regards

    Hrishikesh

  • Hi Hrishikesh,

    You might not need crossbar mapping for UART1.
    Can you check TDA2Px TRM if UART4 interrupt is directly connected to the interrupt line of the particular CPU where you are running this code.
    If yes then you should use that particular interrupt number.
    If no you should specify the interrupt number you want to use and set isCrossBarIntEn to TRUE.

    Regards,
    Rishabh
  • Hi Rishabh,

    Thanks for the reply,

    From TRM , as per my understanding UART4IRQ is mapped to MPU_IRQ_70 and can be accessed through IRQ_CROSSBAR_65 (Table 19-11. Connection of Device IRQs to IRQ_CROSSBAR Inputs ).

    So I have added following in the code

      chanParams.crossBarEvtParam.isCrossBarIntEn  = (UInt32) TRUE;
            chanParams.crossBarEvtParam.intNumToBeMapped = 65;  
            IntXbar_connectIRQ(UART4_INT, UART4_IRQ);
            cookie = Hwi_disable();
            Hwi_enableInterrupt(UART4_INT);
             /* Restore interrupts */
             Hwi_restore(cookie);
            ioParams.chanParams = (Ptr) & chanParams;
        Uart4RxHandle = GIO_create(uartDeviceName1, (UInt32)GIO_INPUT,&ioParams, &eb);

    where UART4_INT is defined as 65.

    There is one more parameter uartParams.hwiNumber    which is defined at 8.

    Is it correct ?

    The code is crashing at  UARTIntEnable((UInt32) instHandle->deviceInfo.baseAddress,
                                  (UInt32) UART_INTR_RLS); in the file bspdrv_uart.c (line 1085) when it tries to update the register using call

     HW_WR_REG32(baseAddr + UART_IER, HW_RD_REG32(baseAddr + UART_IER) |
                    (intFlag & 0x0FU)) in uart.c (line 793).

    Will you please let me know if i am missing anything here.

    regards

    Hrishikesh

  • Hi Hrishikesh,

    Are you running this code on A15? I thought you were running on IPU1_0.

    Regards,
    Rishabh
  • Hi Rishabh

    I am running it on ipu1_0 only

    Regards

    Hrishikesh

  • Hi Hrishikesh,

    You need to check the IPU Crossbar mapping section of the TRM (in same chapter) in that case and update the parameters accordingly.
    You also need to update the HWI number accordingly.

    Regards,
    Rishabh
  • Hi Rishabh
    In table 19.11 UART4 has following entry
    IRQ_CROSSBAR_65 UART4_IRQ UART4 UART4 interrupt

    In Table 19-5. IPU1_Cx_INTC Default Interrupt Mapping there is no mention for UART4 interrupt,
    after commenting the code
    cookie = Hwi_disable();
    Hwi_enableInterrupt(UART4_INT);
    /* Restore interrupts */
    Hwi_restore(cookie);
    the code is not crashing but it is stuck up in the gio_read () function.
    Is my settings correct? do i need to update the any IRQ_CROSSBAR Configuration Register ?
    regards
    Hrishikesh
  • Hi Hrishikesh,

    Kindly see below and modify the code:
    HWI is the interrupt line on the CPU side you want to use.
    Crossbar is used to connect an interrupt source and interrupt line.
    Interrupt source ids are mentioned in chapter "Mapping of Device Interrupts to IRQ_CROSSBAR Inputs" of TRM.
    You can choose an interrupt line from chapter "Interrupt Requests to IPU1_Cx_INTC" of TRM for IPU interrupts.
    You need to make sure the particular interrupt line has a valid value in IRQ_CROSSBAR Instance Number.
    Hope this helps.

    Regards,
    Rishabh
  • Hi Rishabh

    Thanks for replying

    I am using the API CSL_xbarIrqConfigure()

    to configure the Xbar connections with following arguments

    CSL_XbarIrqCpuId CSL_XBAR_IRQ_CPU_ID_IPU1 /* CPU ID for processor */

    irqNumIdx = CSL_XBAR_INST_IPU1_IRQ_27 /* Interrupt line number IRQ27 since it is reserved but can be used for valid interrupt source*/

    CSL_XbarIrq= CSL_XBAR_UART4_IRQ /*Xbar instance for UART4 */

    from the IPU1_Cx_INTC Default Interrupt Mapping table from TRM, CSL_XBAR_INST_IPU1_IRQ_27 is mapped to IRQ_CROSSBAR

    Instance Number 5 so I am assigning it to uartParams.hwiNumber = 5u;

    and

    chanParams.crossBarEvtParam.isCrossBarIntEn = (UInt32) TRUE;

    chanParams.crossBarEvtParam.intNumToBeMapped = 5;

    And the xbar API code segment is as follows

    ioParams.model=GIO_Model_STANDARD;

    chanParams.crossBarEvtParam.isCrossBarIntEn = (UInt32) TRUE;

    CSL_xbarIrqConfigure(CSL_XBAR_IRQ_CPU_ID_IPU1, CSL_XBAR_INST_IPU1_IRQ_27, CSL_XBAR_UART4_IRQ);

    Is it correct ?

    Do I need to enable the interrupt line CSL_XBAR_INST_IPU1_IRQ_27 ?

    Are more steps/settings are needed after this ?

    On executing the code, after UART handle creation, the code goes into loop without entering into UART read task_create call, when I pause the core, I see the call stack in CCS starting from HWi_dispatch () to idle function.

    Please let me know as I am totally stuck on this.

    regards

    Hrishikesh
  • Hi Hrishikesh,

    I checked the code and it seems chanParams.crossBarEvtParam is not used for TDA devices.

    Can you quickly try by changing CSL_XBAR_UART1_IRQ to CSL_XBAR_UART4_IRQ in PROCESSOR_SDK_VISION_03_04_00_00\ti_components\drivers\pdk_01_10_00_08\packages\ti\drv\vps\src\platforms\src\bsp_platformTda2xx.c and use the code mentioned in the original question.

    Regards,
    Rishabh
  • Hi Rishabh,

    Thanks for replying, now I have made following changes

    In ../PROCESSOR_SDK_VISION_03_03_00_00/ti_components/drivers/pdk_01_09_00_17/packages/ti/drv/vps/src/platforms/src\bsp_platformTda2xx.c (we are working with PDK 3.03) changed line  no. 990 to  BspOsal_irqXbarConnect(CSL_XBAR_INST_IPU1_IRQ_44, CSL_XBAR_UART4_IRQ);

    from  BspOsal_irqXbarConnect(CSL_XBAR_INST_IPU1_IRQ_44, CSL_XBAR_UART1_IRQ); and reverted the changes in UART4 initialization code to

    following

     uartParams.hwiNumber    = 8u;

     ioParams.model=GIO_Model_STANDARD;
            chanParams.crossBarEvtParam.isCrossBarIntEn  = (UInt32) FALSE;
            chanParams.crossBarEvtParam.intNumToBeMapped = 0xFFU;  
       
          //  CSL_xbarIrqConfigure(CSL_XBAR_IRQ_CPU_ID_IPU1, CSL_XBAR_INST_IPU1_IRQ_27, CSL_XBAR_UART4_IRQ);

            ioParams.chanParams = (Ptr) & chanParams;
           //  cookie = Hwi_disable();
           //  Hwi_enableInterrupt(CSL_XBAR_INST_IPU1_IRQ_27);
            //  Hwi_restore(cookie);

        Uart4RxHandle = GIO_create(uartDeviceName1, (UInt32)GIO_INPUT,&ioParams, &eb);

    The Uart4RxHandle is created but when I create the task to read the uart data, it does not go to task function and goes to loop mode, please find attached screenshot for the call stack when I pause the IPU1_0

    Please let me know your feedback regarding the same

    regards

    Hrishikesh

  • Hi Hrishikesh,

    Can you check if the base address used for reading the UART registers is for UART4 itself?
    Can you check before exiting the uartIsr whether the IPR bit is cleared in UART_IIR register?

    Regards,
    Prasad
  • Hi Prasad,Rishabh

    After changing UART Mode to Polled and mapping it to IRQ33 using API

      BspOsal_irqXbarConnect(CSL_XBAR_INST_IPU1_IRQ_33, CSL_XBAR_UART4_IRQ);

    and assigning hwi number to CSL_XBAR_INST_IPU1_IRQ_33, I am getting data from GPS device.

    I guess there should not be any difference in data reception if mode is changed to POLLED from INTERRUPT

    Pl. confirm.

    regards

    Hrishikesh

  • Hi Hrishikesh,

    The data will not be different between polled vs interrupt mode.
    Mode should be decided depending on the software design/requirement.

    Regards,
    Rishabh
  • Hi,

    I haven't heard back from you, I'm assuming you were able to resolve your issue.
    If not, just post a reply below (or create a new thread if the thread has locked due to time-out).

    Regards,
    Rishabh
  • Hi Rishabh,

    Yes you can close this thread. thanks for your support.

    regards

    Hrishikesh