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

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

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

跳至解决方案
362 次查看
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:

破坏者
 
&uart3 {
        ...
        status = "disabled"; // or status = "enabled"
};

 

0 项奖励
1 解答
301 次查看
kerazus
Contributor II

Hi AldoG,

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

Thank you for answer.

Best Regards.

在原帖中查看解决方案

2 回复数
334 次查看
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 项奖励
302 次查看
kerazus
Contributor II

Hi AldoG,

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

Thank you for answer.

Best Regards.