S32K144 SDKRTM3.0 FlexCAN Rx using FIFO callback and lpuart tx

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

S32K144 SDKRTM3.0 FlexCAN Rx using FIFO callback and lpuart tx

Jump to solution
1,951 Views
wdong
Contributor III

Dear, I am using S32K144 SDK RTM3.0,with FlexCAN and LPUART module,when I recieve can Msg, then tx using lpuart1, my problem:

1) I cant tx data twice using lpuart

2) I cant using the global varible in the while(1) loop

1.JPG2.JPGattachment is my project,thank you first

1 Solution
1,941 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello wdong

 

The function LPUART_DRV_SendData()  is a non-blocking function, this means that the when you execute another function the transmission will be still on course. To avoid this you may check if the bus is busy before calling the second TX or use the function LPUART_DRV_SendDataBlocking().

The LPUART_DRV_SendDataBlocking() does not return until the transmit is complete.

Could you explain in detail the point 2? ("I cant using the global variable in the while(1) loop")

 

Let me know if this is helpful, if you have more questions do not hesitate to ask me.

Best regards,

Omar

View solution in original post

3 Replies
1,912 Views
wdong
Contributor III

Thank you, your solution is helpful. As for the second problem, I already know how to do. One must use volatile before the global value, so it can be used in the while(1) loop.  

  
0 Kudos
Reply
1,907 Views
wdong
Contributor III

sorry, it is "volatile"

0 Kudos
Reply
1,942 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello wdong

 

The function LPUART_DRV_SendData()  is a non-blocking function, this means that the when you execute another function the transmission will be still on course. To avoid this you may check if the bus is busy before calling the second TX or use the function LPUART_DRV_SendDataBlocking().

The LPUART_DRV_SendDataBlocking() does not return until the transmit is complete.

Could you explain in detail the point 2? ("I cant using the global variable in the while(1) loop")

 

Let me know if this is helpful, if you have more questions do not hesitate to ask me.

Best regards,

Omar