What steps are required to change M4 console from UART4 to UART3?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

What steps are required to change M4 console from UART4 to UART3?

1,315 次查看
mwilliams
Contributor III

I have the imx8M mini  lpddr EVK and I am trying to move the M4 console from UART4 to UART3 on the J1003 header.  I made changes to the "hello_world" demo application in board.h as follows:

...

/* The UART to use for debug messages. */
#define BOARD_DEBUG_UART_TYPE kSerialPort_Uart
#define BOARD_DEBUG_UART_BAUDRATE 115200u
//#define BOARD_DEBUG_UART_BASEADDR UART4_BASE
#define BOARD_DEBUG_UART_BASEADDR UART3_BASE
//#define BOARD_DEBUG_UART_INSTANCE 4U
#define BOARD_DEBUG_UART_INSTANCE 3U
//#define BOARD_DEBUG_UART_CLK_FREQ \
// CLOCK_GetPllFreq(kCLOCK_SystemPll1Ctrl) / (CLOCK_GetRootPreDivider(kCLOCK_RootUart4)) / \
// (CLOCK_GetRootPostDivider(kCLOCK_RootUart4)) / 10
#define BOARD_DEBUG_UART_CLK_FREQ \
CLOCK_GetPllFreq(kCLOCK_SystemPll1Ctrl) / (CLOCK_GetRootPreDivider(kCLOCK_RootUart3)) / \
(CLOCK_GetRootPostDivider(kCLOCK_RootUart3)) / 10
//#define BOARD_UART_IRQ UART4_IRQn
//#define BOARD_UART_IRQ_HANDLER UART4_IRQHandler
#define BOARD_UART_IRQ UART3_IRQn
#define BOARD_UART_IRQ_HANDLER UART3_IRQHandler

...

I have also edited the imx8mm-evk.dtsi file as below to disable uart3:

...

&uart3 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_uart3>;
    assigned-clocks = <&clk IMX8MM_CLK_UART3>;
    assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
    fsl,uart-has-rtscts;
/*  status = "okay"; */
    status = "disabled";
};
...

 

After building a new image, when I fatload the resulting hello_world.bin, I don't see any activity on the pins of the J1003 connector pins 8 and 10.  What am I doing wrong?

The regular hello_world.bin functions correctly on UART4, so I think I am missing some steps, please help.

Thanks in advance.

0 项奖励
回复
3 回复数

1,279 次查看
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @mwilliams 

I hope you are doing well

To change the console from UART4 to UART3 one can check if uart3 clocks are properly configured.
Please verify the pin configuration in pin_mux.c.

Thanks & Regards

Sanket Parekh

0 项奖励
回复

1,267 次查看
mwilliams
Contributor III

I have changed the pin_mux.c as shown below:

void BOARD_InitPins(void) {                                /*!< Function assigned for the core: Cortex-M4[m4] */
/*
    IOMUXC_SetPinMux(IOMUXC_UART4_RXD_UART4_RX, 0U);
    IOMUXC_SetPinConfig(IOMUXC_UART4_RXD_UART4_RX,
                        IOMUXC_SW_PAD_CTL_PAD_DSE(6U) |
                        IOMUXC_SW_PAD_CTL_PAD_FSEL(2U));
    IOMUXC_SetPinMux(IOMUXC_UART4_TXD_UART4_TX, 0U);
    IOMUXC_SetPinConfig(IOMUXC_UART4_TXD_UART4_TX,
                        IOMUXC_SW_PAD_CTL_PAD_DSE(6U) |
                        IOMUXC_SW_PAD_CTL_PAD_FSEL(2U));
*/

    IOMUXC_SetPinMux(IOMUXC_UART3_RXD_UART3_RX, 0U);
    IOMUXC_SetPinConfig(IOMUXC_UART3_RXD_UART3_RX,
                        IOMUXC_SW_PAD_CTL_PAD_DSE(6U) |
                        IOMUXC_SW_PAD_CTL_PAD_FSEL(2U));

    IOMUXC_SetPinMux(IOMUXC_UART3_TXD_UART3_TX, 0U);
    IOMUXC_SetPinConfig(IOMUXC_UART3_TXD_UART3_TX,
                        IOMUXC_SW_PAD_CTL_PAD_DSE(6U) |
                        IOMUXC_SW_PAD_CTL_PAD_FSEL(2U));

}
 
After rebuilding I still see no activity on the J1003 connector pins 8 & 10.  I do notice that when booting linux there are only the device nodes created for UART1 & 2 (/dev/ttymxc0 and /dev/ttymxc1) so UART3 has apparently been disabled.
 
Any further assistance would be appreciated.
 
Thanks in advance.
 
    

 

0 项奖励
回复

1,268 次查看
mwilliams
Contributor III

Hi Sanket,

I am most grateful for your reply.  I found reference to UART4 remains in ...\boards\evkmimx8mm\demo_apps\hello_world\pin_mux.c as shown below:

/* FUNCTION ************************************************************************************************************
*
* Function Name : BOARD_InitPins
* Description : Configures pin routing and optionally pin electrical features.
*
* END ****************************************************************************************************************/
void BOARD_InitPins(void) { /*!< Function assigned for the core: Cortex-M4[m4] */
IOMUXC_SetPinMux(IOMUXC_UART4_RXD_UART4_RX, 0U);
IOMUXC_SetPinConfig(IOMUXC_UART4_RXD_UART4_RX,
IOMUXC_SW_PAD_CTL_PAD_DSE(6U) |
IOMUXC_SW_PAD_CTL_PAD_FSEL(2U));
IOMUXC_SetPinMux(IOMUXC_UART4_TXD_UART4_TX, 0U);
IOMUXC_SetPinConfig(IOMUXC_UART4_TXD_UART4_TX,
IOMUXC_SW_PAD_CTL_PAD_DSE(6U) |
IOMUXC_SW_PAD_CTL_PAD_FSEL(2U));
}

I don't know how to change this so that UART 3 will be configured for the M4 console.  I would appreciate any elaboration that you might provide.

Thanks in advance.

Mike

 

0 项奖励
回复