HAL LIN loopback interrupt
This example demonstrates how to use the LIN HAL module with interrupt mode to perform a loopback test. The application configures one LIN instance as a controller and another as a target device, then performs a data transfer between them using interrupts to handle the communication events.
Example Usage
Build and load the example to your device
Make the external connections described below
Run the application and observe the output in the terminal
The application will initialize the LIN HAL with interrupt mode
The controller will send an 8-byte frame to the target (frame ID 0x12)
The target will respond with an 8-byte frame to the controller (frame ID 0x13)
The application will verify successful data transmission and reception
This example demonstrates:
LIN HAL initialization for both controller and target modes
Configuring LIN interrupts
Handling HAL based LIN communication with interrupt-driven transfers
External Connections
This example requires external wiring between UC2 (controller) and UC5 (target) since they belong to different SPGSS islands. Connect the TX and RX signals of both instances to a single shared logic-level node:
UC2 TX (PA22) → shared node
UC2 RX (PA23) → shared node
UC5 TX (PA11) → shared node
UC5 RX (PB11) → shared node
Refer to the board schematic to locate these signals on the LP or SOM header.