S32K144 UART Callback

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

S32K144 UART Callback

2,658件の閲覧回数
jay_zhang
Contributor II

I met a problem when I need to use a uart interface peripheral.

pastedImage_1.png

While using UART0 to receive the uart data, I don't know how to clear the flag in RX Callback function, the code will not exit in RX_callback function, anyone can help?

0 件の賞賛
返信
6 返答(返信)

1,603件の閲覧回数
547416104
Contributor III

The uart rx ISR flag is auto cleared after read the rx data register, so need you to read the data register.

0 件の賞賛
返信

2,381件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I have tested the lpuart_echo_s32k144 demo from SDK RTM 2.0.0 and see no issue, rx callback is called only once when byte is received.

Generally, you need not to clear any flags in callback functions. This callback is called from the interrupt handler which contains code for flags clearing already. Moreover RDRF flag is cleared by reading data register, so flag should be cleared before callback is called.

BR, Petr 

0 件の賞賛
返信

2,381件の閲覧回数
jay_zhang
Contributor II

Have you tried to use the callback install, in my code, after some buffer coming, the callback function is called, and always called, cannot go to main code section.

0 件の賞賛
返信

2,381件の閲覧回数
B46399
NXP Employee
NXP Employee

Hi,

Which version of SDK are you using?

Thanks,

Vlad

0 件の賞賛
返信

2,381件の閲覧回数
jay_zhang
Contributor II

0.8.6

0 件の賞賛
返信

2,381件の閲覧回数
B46399
NXP Employee
NXP Employee

Hi,

Indeed there was a problem with callbacks in that release, but that's very old. The latest drop is RTM 3.0.0, I suggest updating to the latest version.

Vlad

0 件の賞賛
返信