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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
1,957件の閲覧回数
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,947件の閲覧回数
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,918件の閲覧回数
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,913件の閲覧回数
wdong
Contributor III

sorry, it is "volatile"

0 件の賞賛
返信
1,948件の閲覧回数
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