S32K144 Uart Async Receive message fail

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

S32K144 Uart Async Receive message fail

3,196件の閲覧回数
KILLERzheng
Contributor IV

I create a S32K144 project with MCAL based on SDK(PlatformSDK_S32K1_2021_08_S32K144_M4F), and I want to receive and send message via Uart. It could send message out, but when I try to receive uart message via the function Std_ReturnType Uart_AsyncReceive(uint8 Channel, uint8* Buffer, uint32 BufferSize), it could not work well, especially when the BufferSize is not equal to the number of byte that the slave answers. In this case, the Uart_AsyncReceive return the uart receive is ongoing and I have to abort receive otherwise it could not send any message out again.

I want to know is there any better way to deal with the case that we don't know the answer length before we send the ask command?

KILLERzheng_0-1641885123233.png

 

タグ(1)
0 件の賞賛
返信
1 返信

3,167件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

try to use continuous reception, having some longer or circular receive buffer, doing single byte reception and within each rx callback check receive byte if the current receive should be finished or not.
Refer to attached example, based on previous SDK. But functions should be similar .

BR, Petr

0 件の賞賛
返信