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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,951 次查看
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 解答
1,941 次查看
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

在原帖中查看解决方案

3 回复数
1,912 次查看
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 项奖励
回复
1,907 次查看
wdong
Contributor III

sorry, it is "volatile"

0 项奖励
回复
1,942 次查看
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