RM0046 LIN Controller (LINFlex)
Doc ID 16912 Rev 5 523/936
Typically, the application has to copy the data from the BDR to SRAM locations. To copy the
data to the right location, the application has to identify the data by means of the identifier.
To avoid this and to ease the access to the SRAM locations, the LINFlex controller provides
a Filter Match Index. This index value is the number of the filter that matched the received
identifier.
The software can use the index in the IFMI register to directly access the pointer that points
to the right data array in the SRAM area and copy this data from the BDR to the SRAM (see
Figure 259).
Using a filter avoids the software reading the ID value in the BIDR, and configuring the
direction, the data field length and the checksum type in the BIDR.
If LINFlex cannot provide enough RX identifier filters to handle all identifiers the software
has to receive the data for, then a filter can be configured in mask mode (see Section , Slave
mode with identifier filtering) in order to manage several identifiers with one filter only.
Data discard
When LINFlex receives the identifier, the LINSR[HRF] bit is set and, if LINIER[HRIE] = 1, an
RX interrupt is generated. If the received identifier does not concern the node, you must
program LINCR2[DDRQ] = 1. LINFlex returns to idle state after bit DDRQ is set.
Error detection
In Slave mode, the following errors are detected:
● Header error: An error occurred during header reception (Break Delimiter error,
Inconsistent Synch Field, Header Timeout).
● Bit error: During transmission, the value read back from the bus differs from the
transmitted value.
● Framing error: A dominant state has been sampled on the stop bit of the currently
received character (synch field, identifier field or data field).
● Checksum error: The computed checksum does not match the received one.
Error handling
In case of Bit Error detection during transmission, LINFlex stops the transmission of the
frame after the corrupted bit. LINFlex returns to idle state and an interrupt is generated if the
BEIE bit in the LINIER is set.
During reception, a Framing Error leads LINFlex to discard the current frame. LINFlex
returns immediately to idle state. An interrupt is generated if LINIER[FEIE] = 1.
During reception, a Checksum Error leads LINFlex to discard the received frame. LINFlex
returns to idle state. An interrupt is generated if LINIER[CEIE] = 1.
During header reception, a Break Delimiter error, an Inconsistent Synch Field or a Timeout
error leads LINFlex to discard the header. An interrupt is generated if LINIER[HEIE] = 1.
LINFlex returns to idle state.
Valid header
A received header is considered as valid when it has been received correctly according to
the LIN protocol.