RT1015 LPUART_TransferReceiveNonBlocking Driver

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

RT1015 LPUART_TransferReceiveNonBlocking Driver

2,522 Views
kensu
Contributor V

Hi,

I am study UART with "evkmimxrt1015_lpuart_interrupt_rb_transfer" SDK sample code.

The sample code is no problem.

After I modify some flow, it cannot receive any byte, 

pastedImage_1.png

My idea is using polling to call LPUART_TransferReceiveNonBlocking, if get any byte, use tx send a debug log.

I don't know why this modification cannot receive any RX byte.

Maybe there are some constrain to using LPUART_TransferReceiveNonBlocking?

I attached the source code. I only modify this file.

Can someone give me a hint?

Regards

Ken

Labels (1)
Tags (2)
0 Kudos
Reply
4 Replies

2,203 Views
snahmad
Contributor II

Any idea  to how to bytes actually read from LPUART_TransferReceiveNonBlocking

0 Kudos
Reply

2,451 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ken Su,

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
Firstly, you should move the function :
LPUART_TransferReceiveNonBlocking(DEMO_LPUART, &g_lpuartHandle, &receiveXfer, &receivedBytes);
out of the While(1) {} loop, then using the LPUART_UserCallback () fucntion to handle the signal value which will determinate whether call LPUART_TransferSendNonBlocking(DEMO_LPUART, &g_lpuartHandle, &sendXfer); or not.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

2,175 Views
snahmad
Contributor II

Hi all,

 

I manage it make it work using Rx Interrupt handler for every character which tell me count bytes received on LPUART Rx.

 

Solution 1-

For that I use LPUART2 for Tx using non-blocking LPUART_TransferSendNonBlocking which works anyway.

 

For Rx I am not using non-blocking LPUART_TransferReceiveNonBlocking 

For Rx I am using LPUART3 with my own interrupt handler for every char received. 

 

See my solution file : lpuart_rx_interrupt.c

 

Solution 2-

Solution # 1, but is not efficient as it is not using DMA.

Can some one elaborate why  LPUART_TransferReceiveNonBlocking  using with ring buffer does not give us bytes read.

Does using LPUART_TransferReceiveNonBlocking   with ringbuffer use DMA method.

See my example code attached: lpuart_ring_buffer.c, not tell me how many bytes it received.

however data do get received in buffer=g_rxBuffer not in g_rxRingBuffer

 

Thanks,

Syed

2,198 Views
snahmad
Contributor II

LPUART_TransferReceiveNonBlocking, I do get call back which rxcomplete, but I cannot how many bytes read.

0 Kudos
Reply