README.rst
1SocketCAN Bridge demo based on Nucleo H743ZI platform
2=====================================================
3
4This demo showcases host integration for CAN.
5
6Host requirements
7-----------------
8
9On the host side you'll need to create a virtual CAN interface.
10
11For this, ensure that the ``vcan`` module is loaded::
12
13 # modprobe vcan
14
15To setup a virtual bus, named ``vcan0``, run the following commands::
16
17 # ip link add dev vcan0 type vcan
18 # ip link set up vcan0
19
20Running the demo
21----------------
22
23With the host prepared, running the script will generate some traffic on the ``vcan0`` interface::
24
25 (monitor) start @scripts/complex/socketcan_bridge/nucleo_h743zi-socketcanbridge.resc
26
27All packets from ``vcan0`` will be routed to the ``canHub`` object inside Renode,
28which is a simulated CAN bus with the Nucleo's CAN controller, ``fdcan1``, connected to it.
29
30You can see the packets using Wireshark or the ``candump`` tool.
31
32To send a test packet from host to Renode you can use the ``cansend`` tool, e.g.::
33
34 $ cansend vcan0 "123#00FFAA5501020304" # classic CAN frame
35 $ cansend vcan0 "213##F444546474849505152535455" # FD CAN frame
36
37Note that FD and XL CAN frame routing depends on the host supporting it.
38