LIN component bug:when I transmate 256 Byte data by Transport Layer,the component recognize it as invalid length

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ChFu_2665236
Level 1
Level 1

LIN component version:5.0

line 4411 at LINS.c(LINS is component name)

20191207161831.png

While length is 256,the first frame is:

0x3C : 0x21 0x11 0x00 xx xx xx xx xx

so frame[LINS_PDU_LEN_IDX] is equel to 0.

then it while jump to else which means invalid length

0 Likes
5 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

ChFu,

How many bytes is frame[]?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

ChFu,

True.  A LIN frame has 8 bytes of data.

I guess I'm confused about the 256 bytes of data.  Is this using 0x3C/0x3D UDP protocols?

Is you LIN device a LIN Master or Slave?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Len,

I'm using LIN TRANSPORT LAYER,not UDP. Maybe you can call it PDU (Packet Data Unit).

Here is the document about it.(at Page 59)

https://www.cs-group.de/wp-content/uploads/2016/11/LIN_Specification_Package_2.2A.pdf

And my LIN device is LIN Slave.

Chengbo Fu

0 Likes

Chengo Fu,

I'm not sure I can be of a lot of help (I usually work on the LIN HW side of the project).  Are you referring to page 76 "4.2.5.3 Data dump"?

0x3C : 0x21 0x11 0x00 xx xx xx xx xx

pastedImage_4.png

I assume from above, you're trying to issue a 0x3C command from the master to 0x21 as the NAD.

PCI = 0x11 => lower nibble = 0x1xx bytes for length of message.

pastedImage_2.png

3.2.1.4 LEN

A LEN byte is only used in FF; it contains the eight least significant bits of the message length. Thus, the maximum length of a message is 4095 (0xFFF) bytes.

LEN = 0x00 least significant byte.   Total Length of message is 0x100 = 256 bytes.

I assume from your initial post you might have spotted a "bug" in the SW?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes