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.

Compiler/TDA2SX: RTOS/tda2x: How to hold uart2 config and add uart1 config to make work together

Part Number: TDA2SX

Tool/software: TI C/C++ Compiler

using RTOS/tda2x,I want use uart1 and uart2 work together in IPU1,but I have some problem with utils_uart.c, as following:

#define XBAR_CPU (CSL_XBAR_IRQ_CPU_ID_IPU1)
#define UART_INT_ID (60U)
#define XBAR_INST (CSL_XBAR_INST_IPU1_IRQ_60)
#define XBAR_INTR_SOURCE (CSL_XBAR_UART2_IRQ)
how to hold uart2 config ,and add uart1 config,please give me some advice
  • Hi,

    You can route the UART1 interrupt to another interrupt number through the corresponding crossbar instance.
    Define interrupt source as UART1_IRQ,
    Define another unused interrupt number in your system, say 61.

    Check the APIs which are using these defines for UART2 and call the same APIs again with the UART1 specific macros.

    Regards,
    Prasad

  • AS FOLLOWIING:

    #define XBAR_CPU (CSL_XBAR_IRQ_CPU_ID_IPU1)
    #define UART_INT_ID (44U)
    #define XBAR_INST (CSL_XBAR_INST_IPU1_IRQ_44)
    #define XBAR_INTR_SOURCE (CSL_XBAR_UART1_IRQ)
    retval = PMHALModuleModeSet(PMHAL_PRCM_MOD_UART1,
                                                         PMHAL_PRCM_MODULE_MODE_ENABLED,
                                                         PM_TIMEOUT_INFINITE);

    Bsp_platformSetPinmuxRegs((UInt32) 0x04,
                                                    (UInt32) CTRL_CORE_PAD_UART1_RXD,
                                                     BSP_PLATFORM_IOPAD_CFG_DEFAULT);
    Bsp_platformSetPinmuxRegs((UInt32) 0x00,
                                                    (UInt32) CTRL_CORE_PAD_UART1_TXD,
                                                    BSP_PLATFORM_IOPAD_CFG_DEFAULT);
    /* Crossbar registers are already unlocked, so connect directly */
    //CSL_xbarIrqConfigure(XBAR_CPU, XBAR_INST, XBAR_INTR_SOURCE);
    BspOsal_irqXbarConnect(CSL_XBAR_INST_IPU1_IRQ_44, CSL_XBAR_UART1_IRQ);
    but some problem,can not work.could I change?
  • Hi,

    You need to enable two separate interrupts for UART1 and UART2.
    PDK has an example for UART in interrupt mode for UART1 at below location which you can refer for details.
    <pdk_install_dir>\packages\ti\csl\example\uart\uart_intr\main.c

    Also are you able to get single instance at a time to work for both UART1 and UART2?
    I think this should be first step to get started before trying for both together.

    Regards,
    Prasad

  • I have solved the problem。the uart4 work mode is right,and UART4_IRQ is only suitable with CSL_XBAR_INST_IPU1_IRQ_61,the other intr num does not work.

    Bsp_platformSetPinmuxRegs((UInt32) 0x1, (UInt32) CTRL_CORE_PAD_SPI1_CS3, BSP_PLATFORM_IOPAD_CFG_DEFAULT);
    Bsp_platformSetPinmuxRegs((UInt32) 0x1, (UInt32) CTRL_CORE_PAD_SPI1_CS2, BSP_PLATFORM_IOPAD_CFG_DEFAULT);
    BspOsal_irqXbarConnect(CSL_XBAR_INST_IPU1_IRQ_61, CSL_XBAR_UART4_IRQ);