Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

RTOS/AM5728: UART5 alternate PIN issues

$
0
0

Part Number:AM5728

Tool/software: TI-RTOS

I'm using the AM5728 on a custom board that utilizes UART5 for the peripheral communications and UART6 for debugging purposes. UART5 TX/RX are on pins AC6(uart5_txd in register CTRL_CORE_PAD_MMC3_DAT1) and AC7(uart5_rxd in register CTRL_CORE_PAD_MMC3_DAT0). UART6 TX/RX are on pins F12(uart6_txd in register CTRL_CORE_PAD_MCASP1_AXR1) and G12(uart6_rxd in register CTRL_CORE_PAD_MCASP1_AXR0).

I've modified the <board_name>.clock.c and boardPadDelayInit.c files to enable the clocks and set the pin configuration. Then I rebuilt the board library using gmake board_lib_clean and gmake board_lib. Both TX and RX work on UART6, but only the TX is working on UART5. I searched through the boardPadDelayInit.c file to make sure nothing else was attempting to access pin AC7 and my UART5 modification is the only thing referencing it. Below are the changes I made to the board library and UART initialization.

<board_name>.clock.c:

    CSL_FINST(l4PerCmReg->CM_L4PER_UART5_CLKCTRL_REG,
        L4PER_CM_CORE_COMPONENT_CM_L4PER_UART5_CLKCTRL_REG_MODULEMODE, ENABLE);

    while(CSL_L4PER_CM_CORE_COMPONENT_CM_L4PER_UART5_CLKCTRL_REG_IDLEST_FUNC !=
       CSL_FEXT(l4PerCmReg->CM_L4PER_UART5_CLKCTRL_REG,
        L4PER_CM_CORE_COMPONENT_CM_L4PER_UART5_CLKCTRL_REG_IDLEST));

    CSL_FINST(ipuCmReg->CM_IPU_UART6_CLKCTRL_REG,
        IPU_CM_CORE_AON_CM_IPU_UART6_CLKCTRL_REG_MODULEMODE, ENABLE);

    while(CSL_IPU_CM_CORE_AON_CM_IPU_UART6_CLKCTRL_REG_IDLEST_FUNC !=
       CSL_FEXT(ipuCmReg->CM_IPU_UART6_CLKCTRL_REG,
        IPU_CM_CORE_AON_CM_IPU_UART6_CLKCTRL_REG_IDLEST));

boardPadDelayInit.c:

/* UART5 - uart5_rxd on AC7 - X_UART5 */
     {0x1784, 0x50002, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}},

/* UART5 - uart5_txd on AC6 - X_UART5 */
     {0x1788, 0x10002, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}},

/* UART6 - uart6_txd on F12 - X_UART6 */
     {0x16B8, 0x10003, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}},

/* UART6 - uart6_rxd on G12 - X_UART6 */
     {0x16B4, 0x50003, {0x0, 0, 0}, {0x0, 0, 0}, {0x0, 0, 0}},

UART5 initialization:

    Board_initCfg boardCfg;
    boardCfg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_MODULE_CLOCK;
    Board_init(boardCfg);    

    UART_Params params = {
        UART_MODE_CALLBACK,     /* readMode */
        UART_MODE_CALLBACK,     /* writeMode */
        SemaphoreP_WAIT_FOREVER,/* readTimeout */
        SemaphoreP_WAIT_FOREVER,/* writeTimeout */
        uartRxCb,               /* readCallback */
        uartTxCb,               /* writeCallback */
        UART_RETURN_FULL,       /* readReturnMode */
        UART_DATA_BINARY,         /* readDataMode */
        UART_DATA_BINARY,         /* writeDataMode */
        UART_ECHO_OFF,           /* readEcho */
        115200,                 /* baudRate */
        UART_LEN_8,             /* dataLength */
        UART_STOP_ONE,          /* stopBits */
        UART_PAR_NONE           /* parityType */
    };

    /* Get the default UART init configurations */
    UART_socGetInitCfg(UART_INSTANCE, &uart5_cfg);

    /* Set the default UART init configurations */
    UART_socSetInitCfg(UART_INSTANCE, &uart5_cfg);

    UART_init();
    uart5_handle = UART_open(UART_INSTANCE, &params);

I've tested and received the same results on 3 carrier boards with 2 different SOM's. This is leading me to think I've got a conflict on the AC7 pin somewhere I'm not seeing or something else is not set correctly in my software configuration.

Edit: I forgot to mention that one of my testing carrier boards supports UART5 on pins F11 and G10 as well. When I set my pinmux for these two pins, it works perfectly. It's only when I try to mux to pins AC6 and AC7 that the RX doesn't work on pin AC7.


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>