LIN Slave Reports Incorrect Message ID - KBA228178
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Author: IhorS_86 Version: **
Translation - Japanese: LINスレーブが不正なメッセージIDを報告する - KBA228178 - Community Translated (JA)
Question:
When selecting the LIN2.0 specification compatibility, why does the LIN slave report an incorrect message ID, where the LSB and MSB are swapped in the slave response? How do I fix it?
Answer:
There is a defect in the generated LIN.c source code file. This error can be fixed as follows:
In the LIN.c file, find the following code:
/*D1= Message ID LSB */
LINS_srfBuffer[LINS_PDU_D1_IDX] =
HI8(messageIdTable[tempStatus]);
/* D2 = Message ID MSB */
LINS_srfBuffer[LINS_PDU_D2_IDX] =
LO8(messageIdTable[tempStatus]);
Swap the HI8() and LO8() functions, so that LSB is LO8 and MSB is HI8.
IMPORTANT: The LIN.c file is a generated file, and it is overwritten each time you build the application. Therefore, you must re-edit the LIN.c file every time you build or generate code.