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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值