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:
...
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.
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
I have changed the pin_mux.c as shown below:
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