Bug 1736 - LIN protocol decoder interprets SYNC byte as PID
Summary: LIN protocol decoder interprets SYNC byte as PID
Status: RESOLVED WONTFIX
Alias: None
Product: PulseView
Classification: Unclassified
Component: Protocol decoding (show other bugs)
Version: 0.5.0
Hardware: x86 Windows
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-06 19:19 CEST by Eugene Muzychenko
Modified: 2021-09-06 21:41 CEST (History)
1 user (show)



Attachments
A session with LIN data (8.31 KB, application/zip)
2021-09-06 19:19 CEST, Eugene Muzychenko
Details
A screenshot (112.68 KB, image/png)
2021-09-06 19:20 CEST, Eugene Muzychenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Muzychenko 2021-09-06 19:19:24 CEST
Created attachment 749 [details]
A session with LIN data

LIN protocol uses byte 0x55 as a first frame byte to sync the receivers' clocks. PID byte (parity/identifier) is sent next to it. Protocol decoder interprets SYNC byte as PID, so number of data bytes is determined incorrectly, and the checksum is always invalid.



Steps to reproduce:

Load a LIN communication record and attach the decoder.



Actual results:

SYNC byte 0x55 is always interpreted as PID, with ID 15 and parity 1. The real PID byte is interpreted as a first data byte.



Expected results:

SYNC byte must be shown as is. The next byte should be interpreted as a PID.



Versions affected:

0.4.2 release, 0.5.0-git-3ce5dd9 nighty build.
Comment 1 Eugene Muzychenko 2021-09-06 19:20:55 CEST
Created attachment 750 [details]
A screenshot
Comment 2 Gerhard Sittig 2021-09-06 20:21:27 CEST
Seems like you connected both TX and RX, while both carry the same data.
Thus the LIN PD is fed with every byte two times in a row, thus takes 
the 0x55 as the SYNC and the PID byte. Can you check that configuration?
Comment 3 Eugene Muzychenko 2021-09-06 21:41:57 CEST
Gerhard, you're right, Since LIN is a single-line bus, and I found no information about configuring the decoder, I connected both TX and RX. I thought the decoder somehow distinguishes between sent and received bytes.

With TX/RX only, the decoder works correctly.

Seems like it's because LIN decoder is stacked on top of standard UART that always has separate RX and TX lines.

It would be great to at least mention this peculiarity in the short note displayed in the decoder selection window.