Hi,
I am using Linflexd UART in interrupt method.
Always "bytesRemaining" is 1. And it is not entering "LINFLEXD_UART_DRV_InstallRxCallback(INST_LINFLEXD_UART4,callback,);" callback function.
Can someone tell me the reason why "bytesRemaining" is not becoming 0?
status_t LINFLEXD_UART_DRV_GetReceiveStatus(uint32_t instance, uint32_t * bytesRemaining)
{
DEV_ASSERT(instance < LINFlexD_INSTANCE_COUNT);
const linflexd_uart_state_t * uartState;
uartState = (linflexd_uart_state_t *)s_uartLINFlexDStatePtr[instance];
if (bytesRemaining != NULL)
{
if (uartState->isRxBusy)
{
/* Fill in the number of bytes yet to be received and update the return value if needed */
if (uartState->transferType == LINFLEXD_UART_USING_INTERRUPTS)
{
/* In interrupt-based communication, the remaining bytes are retrieved
* from the state structure
*/
*bytesRemaining = uartState->rxSize;
}
#if defined(FEATURE_LINFLEXD_HAS_DMA_ENABLED)
else
{
/* In DMA-based communication, the remaining bytes are retrieved
* from the current DMA major loop count
*/
*bytesRemaining = EDMA_DRV_GetRemainingMajorIterationsCount(uartState->rxDMAChannel);
}
#endif
}
else
{
*bytesRemaining = 0;
}
}
return uartState->receiveStatus;
}
Regards,
Krishnaja.
Hi,
do you use DMA mode? There's one known limitation:
Regards,
Lukas