This example demonstrates signal-based LIN 2.1 communication between two NXP FRDM-S32K118 boards using the AUTOSAR LIN stack and NXP RTD drivers. One board is configured as the LIN Master and periodically transmits an ASCII character through a LIN signal contained in a standard communication frame, while the second board acts as the LIN Slave and publishes the subsequent ASCII character in a separate LIN frame. The exchanged values are displayed on the UART console, providing a simple demonstration of LIN signal transmission, frame scheduling, and Master-Slave communication.
This example was developed using the S32K1 Real-Time Drivers (RTD) package for S32 Design Studio. To download and install the complete software and tools ecosystem use the link below:
- S32K1 RTD Software Package
- Serial terminal program (for example: PuTTy, Tera Term, RealTerm etc.)
- Personal Computer
- 2x FRDM-A-S32K118
- 2x Type-C USB cable
- Connect the Type-C USB cable to PC and on both FRDM-A-S32K118 boards for power supply and debugging.
-
Open S32 Design Studio IDE, in the Dashboard Panel, choose Import project from Application Code Hub.
-
You can find the demo you need by searching for the name directly
-
Open the project, click the GitHub link, S32 Design Studio IDE will automatically retrieve project attributes, then click Next>.
-
Select main branch and then click Next>.
-
Select your local path for the repo in Destination->Directory: window. The S32 Design Studio IDE will clone the repo into this path, click Next>.
-
Select Import existing Eclipse projects then click Next>.
-
Select the 2 projects in the repository then click Finish.
- In Project Explorer, right-click on each project and select Update Code and Build Project. This will generate the configuration (Pins, Clocks, Peripherals), update the source code and build the project using the active configuration (e.g. Debug_FLASH).
Make sure the build completes successfully and the *.elf file is generated without errors.

- If during this process a pop-up appears asking whether or not to replace or keep the existing LIN configuration files, it's very important to select Replace, otherwise build issues may occur.

Note: With the HSE firmware package installed (e.g.
HSE_FW_S32K344_0_2_55_0_D2502), Replace can cause build errors. In that case select Keep existing and rebuild.
Go to Debug and select Debug Configurations. Select GDB PEMicro Interface Debugging:
Use the controls to control the program flow.
Note: The GDB PEMicro Interface Debugging configuration uses a default ports 6224 and 7224. In example are provided 2 debug configurations, one with default ports and another one with custom ports to support debugging of 2 boards simultaneously on the same PC. In one launch configuration, select one board (for example USB1) and in the second launch configuration, select the other board (for example USB2).
Open a serial terminal on the enumerated COM port (typical settings: 115200 baud, 8 data bits, no parity, 1 stop bit, no flow control).
The LIN Sender begins cycling through the printable ASCII range and the LIN Receiver echoes back the next character. Each node prints the character it sent or received together with the transport-layer transfer status.
On the Sender FRDM-A-S32K118 terminal you should see:
Sender sent [A] to receiver
Sender received [B] from receiver
Sender sent [B] to receiver
Sender received [C] from receiver
Sender sent [C] to receiver
Sender received [D] from receiver
...On the Receiving FRDM-A-S32K118 terminal you should see:
Receiver received [A] from sender
Receiver sent [B] to sender
Receiver received [B] from sender
Receiver sent [C] to sender
Receiver received [C] from sender
Receiver sent [D] to sender
...The first FRDM-A-S32K118 transmits one character per LIN schedule cycle over the transport layer (MasterReq frame 0x3C, SID 0x23). The 2nd FRDM-A-S32K118 receives it, increments the value by one, and returns it in the response frame (SlaveResp 0x3D, RSID 0x63). The transmitted character advances through the printable ASCII range (0x20..0x7F) and wraps back to 0x20 (space) after 0x7F, so the two terminals stay one character apart and loop continuously.
For general technical questions related to NXP microcontrollers, please use the NXP Community Forum.
Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository.
Note: For more general technical questions regarding NXP Microcontrollers and the difference in expected functionality, enter your questions on the NXP Community Forum
| Version | Description / Update | Date |
|---|---|---|
| 1.0 | Initial release on Application Code Hub | October 1st 2026 |






