UDS Over LIN sample

This example demonstrates DFU over LIN together with the Lin2Can Gateway Sample.

Note that this sample is configured as a LIN responder.

Hardware setup

You will need 2 ARDEP Boards as well as 1 CAN to USB interface

+---------+  +---------+ +---------+
| CAN2USB |  | ARDEP 1 | | ARDEP 2 |
|         |  |         | |         |
| USB CAN |  | CAN LIN | | CAN LIN |
+--+---+--+  +--+---+--+ +------+--+
   |   |        |   |           |
   |   +--------+   +-----------+
   |
   |        +---------+
   |        | U  HOST |
   +--------+ S       |
            | B       |
            +---------+

Build and flash

Build and flash the UDS application to the ARDEP 2 board in the diagram:

west build --board ardep samples/lin2can/uds
west ardep dfu

Build and flash the Gateway application to the ARDEP 1 board in the diagram:

west build --board ardep samples/lin2can/gateway
west ardep dfu

Usage

  1. Setup the can interface

sudo ip link set can0 type can bitrate 500000
sudo ip link set up can0
  1. Build a new application to flash via uds (note that the new application must also support UDS over LIN if you need to update the application again, in this case we just use the led sample which does not support UDS over LIN).

west build --board ardep samples/led --build-dir build-led
  1. Flash the new application using UDS:

west ardep uds-dfu --build-dir build-led --interface can0