How to use UART3 on Cortex-M4 processor in i.MX8MQ

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use UART3 on Cortex-M4 processor in i.MX8MQ

Jump to solution
332 Views
kerazus
Contributor II

Hi, I am using to i.MX8MQ and adjusting Cortex-M4 processor.  I ran application hello_world_app and then does settings according to UART3 but I couldn't run application. I showed settings below.

board.h 
#define BOARD_DEBUG_UART_BASEADDR UART3_BASE
#define BOARD_DEBUG_UART_INSTANCE 3U
#define BOARD_DEBUG_UART_CLK_FREQ \
CLOCK_GetPllFreq(kCLOCK_SystemPll1Ctrl) / (CLOCK_GetRootPreDivider(kCLOCK_RootUart3)) / \
(CLOCK_GetRootPostDivider(kCLOCK_RootUart3)) / 10
#define BOARD_UART_IRQ UART3_IRQn
#define BOARD_UART_IRQ_HANDLER UART3_IRQHandler
board.c 
CLOCK_EnableClock(kCLOCK_Uart3);

clock_config.c 

CLOCK_SetRootMux(kCLOCK_RootUart3, kCLOCK_UartRootmuxSysPll1Div10); 
CLOCK_SetRootDivider(kCLOCK_RootUart3, 1U, 1U); 

pin_mux.c 

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_SRE(1U) |
IOMUXC_SW_PAD_CTL_PAD_PUE_MASK);
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_SRE(1U) |
IOMUXC_SW_PAD_CTL_PAD_PUE_MASK);

I made the above settings on UART3 but I couldn't get UART3 to work. Do I need to make the necessary settings in the device tree files for UART3 enabled? Is the above settings enough? If enough Why I couldn't run UART3? For example device tree settings:

Spoiler
 
&uart3 {
        ...
        status = "disabled"; // or status = "enabled"
};

 

0 Kudos
1 Solution
271 Views
kerazus
Contributor II

Hi AldoG,

When I did settings in above, error fixed. I measured wrong.

Thank you for answer.

Best Regards.

View solution in original post

2 Replies
304 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Your configuration seems ok, I believe that you have disabled the UART3 from the device tree as well.

You do not mention if you’re testing this in one of our EVKs, but if yes how are you actually testing this?
Since UART3 is connected to the BT and it is not exposed.

Best regards,
Aldo.

0 Kudos
272 Views
kerazus
Contributor II

Hi AldoG,

When I did settings in above, error fixed. I measured wrong.

Thank you for answer.

Best Regards.