S32K144 LPUART IDLE Line Interrupt Configuration

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

S32K144 LPUART IDLE Line Interrupt Configuration

10,199 次查看
dony
Contributor II

   I try to add the LPUART idle line interrupt - LPUART_INT_IDLE_LINE based on S32SDK_S32K1xx_RTM_3.0.0.

  • Firstly, set the CTRL[ILT] and CTRL[IDLECFG] in LPUART_DRV_Init( ):

pastedImage_2.png

 

  • Secondly, enable the CTRL[IDLE] in the function LPUART_DRV_StartReceiveDataUsingInt() or LPUART_DRV_StartReceiveDataUsingDma():

pastedImage_4.png

pastedImage_5.png

 

  • Lastly, add  handler for the LPUART_INT_IDLE_LINE interruption to the LPUART_DRV_IRQHandler():

pastedImage_7.png

   But it still can not trigger the LPUART_INT_IDLE_LINE interruption after I send a string to the LPUART.

Is it configured correctly? Is there anything I haven't done?

 

Have a great day,

Cyril

标记 (4)
8 回复数

9,526 次查看
wjandsq
Contributor IV

UART_IDLE.jpg

9,531 次查看
wjandsq
Contributor IV

S32K serial communication has the following two practical working modes:
1. Interrupt the receiving and sending mode, the library file is relatively complete and there is no problem.
2. In DMA receiving and idle interrupt receiving mode, you need to set the receiving error event and idle interrupt event,
and make changes to the SDK. DMA receiving mode is very useful for high baud rate above 921600 and dense data
communication. In the DMA receiving mode, the NXP SDK library did not do the corresponding processing,
but NXP does not admit that their SDK has problems in this mode.
That's because they have not done specific tests in this application scenario at all,
so there is no corresponding DEMO in this scenario.
NXP believes that serial port reception is a problem at the application layer.
There is no problem in sending and receiving AUTOSAR packets directly.
But this package can only be used for regular serial communication.
For the scene of high baud rate communication, it is very bad, and RTOS must be used.
So NXP wants to promote this AUTOSAR package, it is still very unrealistic,
especially the S32K144 with 64KB of memory.

S32K串口通讯,有以下两个比较实用的工作模式:
1. 中断接收和发送模式,库文件比较完善,没有问题。
2. DMA接收及空闲中断接收模式,需要设置接收错误事件,和空闲中断事件,对SDK进行改动。

DMA接收模式对于921600以上高波特率及密集数据通信时非常有用。

在DMA接收模式下,NXP SDK库并没有做好相应的处理,但NXP不承认他们的SDK在这个模式下有问题,
那是因为他们根本没有在这种应用场景做具体的测试,所以没有这这种场景下对应的DEMO。

NXP认为串口接收是应用层的问题,他们AUTOSAR包直接收发没有问题的,
但这个包只能做常规的串口通信,对于高波特率通信这种场景而言,非常烂,还必须得用FreeRTOS。
所以NXP想推销这个AUTOSAR包,还是非常不现实,尤其是使用较少64KB内存的S32K144,加上FreeRTOS内存很紧张。

0 项奖励
回复

9,774 次查看
NXF55009
NXP Employee
NXP Employee

Hi there , I using LPUART with IDLE interrupt and DMA recv&send recently ,  here is my solution .

If you using the SDK LPUART driver , when enter the LPUART_DRV_IRQHandler() , all ERROR status are clear by LPUART_DRV_ErrIrqHandler() .

 1.png

In the LPUART_DRV_ErrIrqHandler() , the IDLE status is also clear in the end .

 2.png

      So modify the FEATURE_LPUART_STAT_REG_FLAGS_MASK ( in file S32K144_features.h )  , from ( 0xC01FC000U ) to ( 0xC00FC000U ) , to avoid the idle flag being clear in LPUART_DRV_ErrIrqHandler() .

3.png

7,929 次查看
xxw1
Contributor I

It's no use

0 项奖励
回复

9,502 次查看
wjandsq
Contributor IV

IdleEvent.jpg

0 项奖励
回复

9,504 次查看
wjandsq
Contributor IV

IdleCallback.jpg

0 项奖励
回复

9,597 次查看
leonchan
Contributor I

Hi ,The s32K144 LPUART with IDLE interrupt and DMA code demo,wherre can dowload?

0 项奖励
回复

9,774 次查看
wjandsq
Contributor IV

LPUART_IdleLineIrqHandler(instance)   must  be  first  lines  in LPUART_DRV_IRQHandler()   !