S32K144_LIN_MASTER_CONFIG

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

S32K144_LIN_MASTER_CONFIG

1,573件の閲覧回数
Yu_Conlinage
Contributor I

当 S32K144 开发板使用配置了 EB29 的 LIN 模块时,STAT 寄存器的初始化状态与示例例程状态不同。主要原因是在界面Lpuart_Lin_Ip_HwSetTransmitterCmd中,其中Base->CTRL = (Base->CTRL & ~LPUART_CTRL_TE_MASK) |((启用 ?1UL : 0UL) << LPUART_CTRL_TE_SHIFT);这将导致 STAT 寄存器中的 TC 状态被清除,从而导致传输异常。是否有任何可能导致此情况或任何相关支持的配置错误?谢谢。

我正在使用 EB29Lin_Lpuart_MasterFrameTransfer_S32K144 示例例程。

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

1,526件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

抱歉我可能没理解你的提问,如果我理解错误请纠正我。

Lin_Lpuart_MasterFrameTransfer_S32K144 看起来是S32K1 RTD里的示例。请问是否测试过最新的S32K1 RTD 3.0.0?

新建的工程复制了Lin_Lpuart_MasterFrameTransfer_S32K144 的Lin_43_LPUART_FLEXIO里的配置?

但是在运行完main函数里的

/* Initialize LIN module */

Lin_43_LPUART_FLEXIO_Init(NULL_PTR);

后,观察到CTRL[TE]值和例程不一样?

 

以下是S32K-RM (Rev.14.1, 01 2024).pdf里关于STAT[TC]的介绍:

LPUART Status Register (STAT)

bit 22 TC Transmission Complete Flag
TC is cleared when there is a transmission in progress or when a preamble or break character is loaded.
TC is set when the transmit buffer is empty and no data, preamble, or break character is being
transmitted. When TC is set, the transmit data output signal becomes idle (logic 1). TC is cleared by
writing to the DATA register to transmit new data, queuing a preamble by clearing and then setting
CTRL[TE], queuing a break character by writing 1 to CTRL[SBK].
0b - Transmitter active (sending data, a preamble, or a break).
1b - Transmitter idle (transmission activity complete).

发送完成之后这个STAT[TC]=1

 

如果是你新建的工程,请问是否检查过其他配置。比如Platform里的IntCtrlConfig是否使能了UART中断以及定义Hanlder?

 

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信

1,562件の閲覧回数
dora88flora
Contributor I

When the S32K144 development board uses the LIN module configured with EB29, the initialization state of the STAT register is different from the sample routine state. The main reason is that in the interface Lpuart_Lin_Ip_HwSetTransmitterCmd, Base->CTRL = (Base->CTRL & ~LPUART_CTRL_TE_MASK) | ((enabled? 1UL: 0UL) << LPUART_CTRL_TE_SHIFT); this will cause the TC status in the STAT register to be cleared, resulting in transmission abnormality. Is there any configuration error that may cause this or any related support? Thank you.

I am using the EB29Lin_Lpuart_MasterFrameTransfer_S32K144 example routine.

 

When you use the S32K144 development board and the EB29 LIN module, you find that the Lpuart_Lin_Ip_HwSetTransmitterCmd function clears the TC (transmission complete) status in the STAT register, causing transmission anomalies. This is not a simple configuration error, but a design behavior of the LPUART LIN driver or the hardware abstraction layer (HAL), which may intentionally reset the status bit when enabling/disabling the transmitter. It is recommended that you consult the S32K144 manual and driver documentation to understand the interaction between the TE and TC bits, and observe the register status through debugging. If TC clearing is the expected behavior, you need to adjust the code logic to adapt to this state. If the problem persists, please contact NXP technical support.

0 件の賞賛
返信