IMXRT1024 UART Interrupt Transfer Example

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

IMXRT1024 UART Interrupt Transfer Example

Jump to solution
843 Views
Lukas_Frank
Senior Contributor I

Hi all, 

 

I wonder what happens if we don’t wait for send finished after LPUART_TransferSendNonBlocking in lpuart_interrupt_transfer example in SDK.

 

Exactly code line between 102-104. What happens if we delete these lines. Will data transmission fail for &xfer? Or exist any overflow with &sendXFer?

 

Thanks and Regards.

0 Kudos
1 Solution
822 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @Lukas_Frank,

The API check if the busy flag to check if there an ongoing operation. So the best option would be to check the status that return the API to ensure the message was sent or not.

/* Return error if current TX busy. */
    if ((uint8_t)kLPUART_TxBusy == handle->txState)
    {
        status = kStatus_LPUART_TxBusy;
    }

Best Regard,

Alexis Andalon

View solution in original post

0 Kudos
3 Replies
833 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @Lukas_Frank,

The transmission will not fail, one of the reasons to use the NonBlocking functions is to continue the normal application flow until a transmission is received and the callback is triggered, in which case, the application will handle the oncoming packet.

Only you would need to be careful to not try to send a transmission until the callback notify that the current send operation is done.

Best Regards,
Alexis Andalon

0 Kudos
827 Views
Lukas_Frank
Senior Contributor I

Hi @Alexis_A ,

 

Thanks for your feedback. I wonder exactly what happens if I start new data transmission before last one’s callback is triggered?

 

Thanks and Regards.

0 Kudos
823 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @Lukas_Frank,

The API check if the busy flag to check if there an ongoing operation. So the best option would be to check the status that return the API to ensure the message was sent or not.

/* Return error if current TX busy. */
    if ((uint8_t)kLPUART_TxBusy == handle->txState)
    {
        status = kStatus_LPUART_TxBusy;
    }

Best Regard,

Alexis Andalon

0 Kudos