S32K144 UART can not receive data

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

S32K144 UART can not receive data

5,471 次查看
547416104
Contributor III

Hello EveriOne,

I  config the lpuart module to receive data, but I find I can not receive all the IC response data, now  the 0xE7 and 0x83 can be received, but 0x75 is not received, the config  and code as below, thanks

uart rx -01.png

547416104_0-1667982267512.png

547416104_0-1667982438996.png

 

 



 

0 项奖励
回复
3 回复数

5,454 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

most probably the issue is due to you enable/disable receiver and RX interrupt in the code at some time handling registers directly. If this is needed in application be sure it is done in time so receive byte cannot be lost. You can toggle gpio pin when you are doing this and measure it with respect of UART signals.
Try to keep receiver and interrupts enabled still and call LPUART_DRV_ReceiveData/LPUART_DRV_SetRxBuffer in time so each bytes will be received.

BR, Petr

0 项奖励
回复

5,451 次查看
547416104
Contributor III

Hi,

At first, I is keep uart RX and TX function, but no response data is received, so add the rx control, 

remove the rx control function, the RX is  enable, but after code running and debug, find the RX is disable. I do not known where disable the uart rx function in SDK, could you help me?

547416104_0-1667995572705.png

547416104_1-1667995578207.png

 

 

0 项奖励
回复

5,427 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

LPUART_DRV_ReceiveData enables receiver, after specified number of bytes is received then within LPUART_DRV_RxIrqHandler teh receiver will be disabled again, using LPUART_DRV_CompleteReceiveDataUsingInt. In order to keep receiver enabled you should update buffer within calback function in UART_EVENT_RX_FULL event using LPUART_DRV_SetRxBuffer. You can refer to lpuart_echo example.

BR, Petr

0 项奖励
回复