MKL15Z32VFM4 :uart1

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

MKL15Z32VFM4 :uart1

733 次查看
chenxikean
Contributor I

Hello, when I use the MKL15Z32VFM4 chip, uart1 cannot output normally. Below is my initialization code. The initialization process is the same as the routine, but the data cannot be output normally.

 

code: 

    

uart_config_t config;

BOARD_InitPins();
BOARD_BootClockRUN();

/*
* config.baudRate_Bps = 115200U;
* config.parityMode = kUART_ParityDisabled;
* config.stopBitCount = kUART_OneStopBit;
* config.txFifoWatermark = 0;
* config.rxFifoWatermark = 1;
* config.enableTx = false;
* config.enableRx = false;
*/
UART_GetDefaultConfig(&config);
config.baudRate_Bps = BOARD_DEBUG_UART_BAUDRATE;
config.enableTx = true;
config.enableRx = true;

UART_Init(DEMO_UART, &config, DEMO_UART_CLK_FREQ);

标签 (1)
0 项奖励
回复
1 回复

719 次查看
diego_charles
NXP TechSupport
NXP TechSupport

Hi @chenxikean 

 

By “uart1 cannot output normally” , do you mean that the TX pin it is not encoding the transfer as expected, or simply does not have any output?

The routine that you shared seems ok to initialize UART in polling mode. However, your code does not show how the initialization of the TX and RX pins is done (probably you are doing this inside BOARD_InitPins ()  ). It could be the case that you will need to review that also.

Diego.

0 项奖励
回复