LIN S32K

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
963件の閲覧回数
dongxun
Contributor II

Hi,

I hope this message finds you well. I am currently working on LIN communication testing using the S32K312NHT0MPAST demo board (with EB28) and have encountered a few challenges that I would greatly appreciate your guidance on.

First, when configuring the MCU as a LIN Master, the measured bitrate on the oscilloscope does not match the configured baud rate. Second, in Slave mode (attempting to receive a 0x10 message from CANoe), I noticed the following issues:

  1. The MCU triggers interrupts upon detecting RXD signals, but no explicit Slave-mode APIs are available in Lin.c or Lin_ipw.c. Could you confirm if this is an expected implementation?
  2. After enabling the BRK13 register (to detect the 13-bit Break field sent by CANoe), the MCU enters the LPUART_LIN_IP_NODE_STATE_RECV_SYNC state but fails to read the sync byte 0x55 from the DATA register, causing the program to halt.
  3. Enabling the RX FIFO and setting the WATER register to 1 allowed data retrieval from the DATA register, but the received value is incorrect. Manual register adjustments based on the chip manual have not resolved this.

Given the transceiver’s 220pF capacitor (resembling a Slave configuration), I suspect a potential hardware/software mismatch. Could you advise on the root cause of the sync byte misalignment, missing Slave APIs, or any critical register settings I may have overlooked?

Thank you sincerely for your time and expertise. Any insights or documentation references would be invaluable.

Best regards,

タグ(1)
0 件の賞賛
返信
1 解決策
933件の閲覧回数
dongxun
Contributor II

Hello Daniel,

I hope this message finds you well.

I wanted to share that I have successfully resolved all the issues we discussed. Based on your valuable feedback, I have ceased all attempts to write to the registers and have focused on processing the received PID in the Linif.c file. Now, the system correctly handles whether to send or receive a response.

Additionally, I integrated the message simulation from CANoe, which allowed me to successfully read the LIN messages sent by CANoe and the data transmitted by the MCU as a slave on the debugger.

Thank you very much for your support and guidance throughout this process. I truly appreciate it.

Best wishes,

Dongxun

元の投稿で解決策を見る

2 返答(返信)
949件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @dongxun,

What NXP drivers / LIN stack version do you use?

  • The LIN Baudrate is configurable in the configurator of the LIN Driver, but it is limited by the clock selected for the LPUART module. How is the LPUART module clocked? And what is the value of LPURT_BAUD after LIN_Init()?
  • LIN Stack APIS: Please refer to LIN_UserManual.pdf that can be found in the LIN Stack Installation directory. Refer to the Lin Stack Slave example that uses the APIs.

danielmartynek_0-1743601916323.png

danielmartynek_1-1743601959990.png

 

  • BRK13: Do not modify the UART registers. This is done by the LIN Driver.
  • The UART driver does not use the FIFO.
  • I don't think the bus capacitance is the issue here, the baudrate must be fixed first.

 

Regards,

Daniel

 

 

 

934件の閲覧回数
dongxun
Contributor II

Hello Daniel,

I hope this message finds you well.

I wanted to share that I have successfully resolved all the issues we discussed. Based on your valuable feedback, I have ceased all attempts to write to the registers and have focused on processing the received PID in the Linif.c file. Now, the system correctly handles whether to send or receive a response.

Additionally, I integrated the message simulation from CANoe, which allowed me to successfully read the LIN messages sent by CANoe and the data transmitted by the MCU as a slave on the debugger.

Thank you very much for your support and guidance throughout this process. I truly appreciate it.

Best wishes,

Dongxun