Linflexd UART mpc5748g.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linflexd UART mpc5748g.

778 Views
Krishnaja
Contributor II

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.

0 Kudos
Reply
1 Reply

763 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

do you use DMA mode? There's one known limitation:

https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/S32-Design-Studio-for-Power-Architectu...

lukaszadrapa_0-1637774545098.png

Regards,

Lukas

0 Kudos
Reply