HAL LIN loopback polling

This example demonstrates how to use the LIN HAL module with polling 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 polling to handle the communication events.

Example Usage

  1. Build and load the example to your device

  2. Make the external connections described below

  3. Run the application and observe the output in the terminal

  4. The application will initialize the LIN HAL with polling mode

  5. The controller will send an 8-byte frame to the target (frame ID 0x12)

  6. The target will respond with an 8-byte frame to the controller (frame ID 0x13)

  7. The application will verify successful data transmission and reception

This example demonstrates:

  • LIN HAL initialization for both controller and target modes

  • Configuring LIN polling

  • Handling HAL based LIN communication with polling-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.