Hi All,
I noticed a bug in the current UART driver. If a Framing Error occur the driver stuck in UART_TransferHandleIRQ(). The issue comes with the SDK update from 2.8.1 to 2.11 therefore I tried to find the relevant lines by a step by step process of elimination and I was able to find the place:
Line 1717 in fsl_uart.c driver version 2.5.1/ SDK 2.11.0:
/* If framing error or parity error happened, stop the RX interrupt when use no ring buffer */
if (((handle->rxState == (uint8_t)kUART_RxFramingError) || (handle->rxState == (uint8_t)kUART_RxParityError)) &&
(NULL == handle->rxRingBuffer))
{
/* Disable and re-enable the global interrupt to protect the interrupt enable register during read-modify-wrte.
*/
irqMask = DisableGlobalIRQ();
/* Enable RX/Rx overrun/framing error/idle line interrupt. */
base->C2 |= ((uint8_t)UART_C2_RIE_MASK | (uint8_t)UART_C2_ILIE_MASK);
base->C3 |= ((uint8_t)UART_C3_ORIE_MASK | (uint8_t)UART_C3_FEIE_MASK);
/* Enable parity error interrupt when parity mode is enable*/
if (((uint8_t)UART_C1_PE_MASK & base->C1) != 0U)
{
base->C3 |= (uint8_t)UART_C3_PEIE_MASK;
}
EnableGlobalIRQ(irqMask);
}
Compared with Line 1635 in fsl_uart.c driver version 2.3.0/ SDK 2.11.0:
/* If framing error or parity error happened, stop the RX interrupt when use no ring buffer */
if (((handle->rxState == (uint8_t)kUART_RxFramingError) || (handle->rxState == (uint8_t)kUART_RxParityError)) &&
(NULL == handle->rxRingBuffer))
{
UART_DisableInterrupts(
base, (uint32_t)kUART_RxDataRegFullInterruptEnable | (uint32_t)kUART_RxOverrunInterruptEnable |
(uint32_t)kUART_FramingErrorInterruptEnable | (uint32_t)kUART_IdleLineInterruptEnable);
/* Disable parity error interrupt when parity mode is enable*/
if ((UART_C1_PE_MASK & base->C1) != 0U)
{
UART_DisableInterrupts(base, (uint32_t)kUART_ParityErrorInterruptEnable);
}
}
Instead of disabling the interrupts in case of a framing/parity error, now all interrupts will be enabled.
Hi, as says Petr_H
on the link (https://community.nxp.com/t5/MCUXpresso-Config-Tools/MK50-UART-updated-driver-breaks-build-quot-idle...The Peripherals tool now incorrectly migrates to the configuration component that is intended for the UART driver 2.1.5 on this processor. We have reproduced the problem and our developers are preparing the fix.
For now, as a workaround, to generate code matching the driver 2.1.4 it's necessary to revert to an older version of the component in your configuration by either using the archived .mex file if you have it, or I have fixed the .mex file to use the 2.1.4 component and attach it to this post, so you can use it.
Then, to avoid the incorrect migration next time, check the 'ignore' checkbox in the Migration dialog when you are asked for this component:
We apologize for the inconvenience. The issue will be fixed, however, only in the latest config tools version which is in MCUXPresso IDE 11.7.0 and standalone MCUXPresso Config Tools V13. I recommend upgrading to these versions.
Best regards
Config Tools Team
Hi,
your link does not work, but I think you are talking about something different.
This issue is about the SDK generated by https://mcuxpresso.nxp.com. The latest version available for the MK64 is Version 2.11.0 which includes UART driver Version 2.5.1. I do not use MCUXpresso IDE at all.
Could you please inform the SDK Team to fix the bug and release a bug fix version of the SDK e.g. 2.11.1.
Thanks
I'm using the SDK for the MK64FN1M0xxx12.
Thanks