I am using MKL82Z MCU, and kinetis sdk 2.3 libraries.
I initialized LPUART2 interface:
CLOCK_SetLpuartClock(1);
lpuart_config_t config;
LPUART_GetDefaultConfig(&config);
config.baudRate_Bps = 115200;
config.enableTx = true;
config.enableRx = true;
LPUART_Init(LPUART2, &config, CLOCK_GetFreq(kCLOCK_PllFllSelClk));
LPUART_EnableInterrupts(LPUART2, kLPUART_RxDataRegFullInterruptEnable);
EnableIRQ(LPUART2_IRQn);
My lpuart2 irq handel function:
void LPUART2_IRQHandler(void)
{
uint32_t Status_Flag = LPUART_GetStatusFlags(LPUART2);
for(size_t i = 0; i < 5; i++)
{
ToggleLed(1);
delayMs(30);
}
}
I Never falls into the LPUART2_IRQHandler function.
why this is happening?
Have you try to configure PTD2 and PTD3 as LPUART2 function and enable the clock gate of Port D?
If you are using TWR-KL82Z72M or FRDM-KL82Z, the PTD2 is used for other function by default. You should notice the hardware circuit.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------