Hi,
there is a strange implementation in uart_v0.c in the pdk.
In case of error, the interrupt callback calls a function to manage the error:
static void UART_v0_hwiIntFxn(uintptr_t arg)
{
UART_Handle handle = (UART_Handle)arg;
UART_V0_Object *object = (UART_V0_Object*)handle->object;
UART_HwAttrs const *hwAttrs = (UART_HwAttrs const *)handle->hwAttrs;
uint32_t intType;
while (TRUE)
{
intType = UART_intIdentityGet_v0(hwAttrs->baseAddr);
if (intType & UART_INTID_RX_THRES_REACH)
{
/* RX FIFO trigger or char timeout interrupt */
if ((intType & UART_INTID_RX_LINE_STAT_ERROR) ==
UART_INTID_RX_LINE_STAT_ERROR)
{
/* RX line status error */
UART_procLineStatusErr(handle);
}
but the implementation of this function is:
static inline void UART_procLineStatusErr(UART_Handle handle)
{
UART_V0_Object *object = (UART_V0_Object*)handle->object;
UART_HwAttrs const *hwAttrs = (UART_HwAttrs const *)handle->hwAttrs;
uint32_t lineStatus;
if (object->readSize)
{
lineStatus = UART_readLineStatus_v0(hwAttrs->baseAddr);
..... (error callback & interrupt disable)
if object->readSize is 0 with interrupt enabled the firmware will hangs with continuous interrupt with no callback.
I don't know when it happen (interrupt enabled with readsize=0) but it happens.
Regards.