A bug caused by wrong LIN time base setting

Env:

S32K144 acts as LIN master and communicated with 3 slaves (receives signals from 1 slave only). Time base is set to 10ms accodring to LDF file.

Summary:

1. LIN RX function works properly in the old SW, the timer source is FTM3 of S32K144, timer interrupt is triggered every 500us.

2. Change the timer source to LPIT channel 1, interrupt is set to 500us also.

3. S32K144 LIN RX function does not work correctly.

Root cause:

FTM working mode is not right, it should be up timer mode instead of output  compare mode.

The interrupt is generated every 65535/48000 =  1.365ms thus the LIN time base is actually 13.65ms (although does not meet LIN spec), so the LIN RX function did not show any issue.

After SW switched to LTIP timer source, the time base is precise 5ms, but the frame slot is 20ms for all uncondictional frames, so some frames will not be transferred on the bus by the LIN stack. (it takes more than 10ms for one frame as the bitrate is 10417, the slot time in INTEGER for one frame is 2 accordinig to the LIN stack generated code)

猜你喜欢

转载自blog.csdn.net/jackjones_008/article/details/84971892