Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

They will create a virtual (emulated) CAN interface in the guest and connect it to the CAN interface can0 of the host. The controller emulated in the Guest is the Kvaser PCI CAN-S (single SJA1000 channel) board, which is supported by the mainline kernel. It’s important to point out that the CAN interface of the host has to be proper set up and powered up. The configuration from emulated devices is not propagated to the physical host interface[14].

The emulated CAN interface can be used inside the Guest just as a physical one:

...

Table 2: General requirements for CAN support on EVE

Requirement

Description

R.1

CAN bus should be supported by EVE’s kernel

R.2

EVE should support CAN controllers present in the hardware

R.3

EVE should support Virtual CAN interfaces

R.4

EVE should be able to configure CAN interfaces (physical or virtual) and set all parameters supported by iproute2


R.5

EVE should be able to passthrough one or more CAN interfaces (physical or virtual) to one or more Edge Applications, i.e., containers and/or VMs

R.6

EVE should get the configuration for CAN interfaces (physical or virtual) from the device model

R.7

EVE should not allow dynamic adding/removal of virtual CAN interfaces

Table 3 presents the specification of each requirement from Table 2.

Table 3: Requirements for CAN support on EVE

Requirement

Description

RS.1

CAN bus should be supported by EVE’s kernel

The SocketCAN Framework must be built/enabled in the kernel.

RS.2

EVE should support CAN controllers present in the hardware

All the devices officially supported by EVE and equipped with CAN controllers must have the corresponding device drivers built/enabled in the kernel (when available). Device drivers for USB CAN adapters can also be provided as modules.

RS.3

EVE should support Virtual CAN interfaces

The Virtual CAN interface device driver should be built/enabled in the kernel (CONFIG_CAN_VCAN), as well as the drivers for QEMU’s CAN virtio devices:

  • CONFIG_CAN_SJA1000

  • CONFIG_CAN_KVASER_PCI

  • CONFIG_CAN_SJA1000_PLATFORM

RS.4

EVE should be able to configure CAN interfaces (physical or virtual) and set all parameters supported by iproute2

EVE should be able to understand and setup the parameters described on Table 4. Notice that some CAN controllers, including the Virtual CAN, don’t support all the parameters, so only those specified in the configuration for a specific interface must be set by EVE.

RS.5

EVE should be able to passthrough one or more CAN interfaces (physical or virtual) to one or more Edge Applications, i.e., containers and/or VMs

Pillar + Domain manager should generate the corresponding QEMU configuration for a VM/Container with all CAN interfaces with passing-through required. There will be no distinction between a Virtual and Physical CAN interface

Info

Notice that in opposite to other devices, like Serial Ports, the same CAN interface can be passed-through to more than one VM/Container. EVE must support such configuration.


RS.6

EVE should get the configuration for CAN interfaces (physical or virtual) from the device model

The parameters of Table 4 should be specified for each CAN interface (to be used by EVE) in the device model (JSON format). Only the parameters that are supported by the CAN controller should be provided. EVE should not change/set any parameter that is not specified in the device model

RS.7

EVE should not allow dynamic adding/removal of virtual CAN interfaces

The configuration for CAN interfaces (Virtual CAN, etc) are fixed in the device model, EVE should not change it, unless the device model is updated. EVE should proceed the following steps:

  1. Read the device configuration at initialization

  2. Create any described Virtual CAN interface

  3. Setup the parameters for the CAN interfaces described in the configuration

  4. Bring up all configured CAN interfaces

Any CAN interface that is not described in the configuration should be left untouched by EVE.

EVE should not add/remove any Virtual CAN during runtime, unless the device model is updated.

Table 4: Parameters of a CAN interface. Not all parameters should be supported by all controllers, including Virtual CAN

Parameter

Allowed values

bitrate

NUMBER in bps

sample-point

0.000..0.999

tq

NUMBER in ns

prop-seg

NUMBER in tq

phase-seg1

NUMBER in tq

phase-seg2

NUMBER in tq

sjw

NUMBER in tq

dbitrate

NUMBER in bps

dsample-point

0.000..0.999

dtq

NUMBER in ns

dprop-seg

NUMBER in tq

dphase-seg1

NUMBER in tq

dphase-seg2

NUMBER in tq

dsjw

NUMBER in tq

tdcv

NUMBER in tc

tdco

NUMBER in tc

tdcf

NUMBER in tc

loopback

on | off

listen-only

on | off

triple-sampling

on | off

one-shot

on | off

berr-reporting

on | off

fd

on | off

fd-non-iso

on | off

presume-ack

on | off

cc-len8-dlc

on | off

tdc-mode

auto | manual | off

restart-ms

0 | NUMBER in ms

restart

True | False

termination

0..65535

Use cases

This section describes the main use cases with different configurations and/or uses of CAN bus by Edge Applications and EVE-OS. In all examples it will be considered a hypothetical device running EVE-OS with three Edge Applications deployed (no matter their type, i.e., if they are Containers and/or VMs). However, all these examples can be expanded to different combinations and setups.

...

Roadmap Planner
maplinks
timelinetrue
pagelinks
source%7B%22title%22%3A%22Roadmap%20Planner%22%2C%22timeline%22%3A%7B%22startDate%22%3A%222024-01-31%2000%3A00%3A00%22%2C%22endDate%22%3A%222024-04-01%2000%3A00%3A00%22%2C%22displayOption%22%3A%22MONTH%22%7D%2C%22lanes%22%3A%5B%7B%22title%22%3A%22Phase%201%22%2C%22color%22%3A%7B%22lane%22%3A%22%23f6c342%22%2C%22bar%22%3A%22%23fadb8e%22%2C%22text%22%3A%22%23594300%22%2C%22count%22%3A1%7D%2C%22bars%22%3A%5B%7B%22rowIndex%22%3A0%2C%22startDate%22%3A%222024-01-15%2017%3A35%3A02%22%2C%22id%22%3A%2232fbfb23-d4e3-4432-bde3-822bff0b3987%22%2C%22title%22%3A%22R.1%22%2C%22description%22%3A%22%22%2C%22duration%22%3A0.4158415841584158%2C%22pageLink%22%3A%7B%7D%7D%2C%7B%22rowIndex%22%3A1%2C%22startDate%22%3A%222024-01-15%2010%3A13%3A04%22%2C%22id%22%3A%2287a7c171-81f8-421b-88b3-016a47a9544b%22%2C%22title%22%3A%22R.2%22%2C%22description%22%3A%22%22%2C%22duration%22%3A0.44554455445544555%2C%22pageLink%22%3A%7B%7D%7D%2C%7B%22rowIndex%22%3A2%2C%22startDate%22%3A%222024-01-15%2010%3A13%3A04%22%2C%22id%22%3A%2238102cd9-a3b6-4384-b6d4-76d403b66be0%22%2C%22title%22%3A%22R.3%22%2C%22description%22%3A%22%22%2C%22duration%22%3A0.4752475247524752%2C%22pageLink%22%3A%7B%7D%7D%5D%7D%2C%7B%22title%22%3A%22Phase%202%22%2C%22color%22%3A%7B%22lane%22%3A%22%233b7fc4%22%2C%22bar%22%3A%22%236c9fd3%22%2C%22text%22%3A%22%23ffffff%22%2C%22count%22%3A1%7D%2C%22bars%22%3A%5B%7B%22title%22%3A%22R.4%22%2C%22description%22%3A%22This%20is%20the%20third%20bar.%22%2C%22startDate%22%3A%222024-01-28%2000%3A14%3A15%22%2C%22duration%22%3A0.7920792079207921%2C%22rowIndex%22%3A0%2C%22id%22%3A%22a3daf2c8-bc88-4fb4-9a43-b8dc25455ba5%22%2C%22pageLink%22%3A%7B%7D%7D%2C%7B%22rowIndex%22%3A1%2C%22startDate%22%3A%222024-01-28%2007%3A36%3A14%22%2C%22id%22%3A%22e765e69e-7d5e-428d-9906-56ee4cecd08c%22%2C%22title%22%3A%22R.6%22%2C%22description%22%3A%22%22%2C%22duration%22%3A0.7920792079207921%2C%22pageLink%22%3A%7B%7D%7D%5D%7D%2C%7B%22title%22%3A%22Phase%203%22%2C%22color%22%3A%7B%22lane%22%3A%22%23d04437%22%2C%22bar%22%3A%22%23dc7369%22%2C%22text%22%3A%22%23ffffff%22%2C%22count%22%3A1%7D%2C%22bars%22%3A%5B%7B%22rowIndex%22%3A0%2C%22startDate%22%3A%222024-02-21%2009%3A16%3A02%22%2C%22id%22%3A%22583f977a-17c1-4c90-8a1f-d5ec91fcaf8c%22%2C%22title%22%3A%22R.5%22%2C%22description%22%3A%22%22%2C%22duration%22%3A1.2772277227722773%2C%22pageLink%22%3A%7B%7D%7D%2C%7B%22rowIndex%22%3A1%2C%22startDate%22%3A%222024-02-21%2016%3A09%3A30%22%2C%22id%22%3A%224a64d947-93ed-4e6c-a3f0-b99f004a413e%22%2C%22title%22%3A%22R.7%22%2C%22description%22%3A%22%22%2C%22duration%22%3A1.2772277227722773%2C%22pageLink%22%3A%7B%7D%7D%2C%7B%22rowIndex%22%3A2%2C%22startDate%22%3A%222024-01-15%2017%3A35%3A02%22%2C%22id%22%3A%2248e387eb-9db5-44aa-917e-974880d7a17d%22%2C%22title%22%3A%22Testing%22%2C%22description%22%3A%22%22%2C%22duration%22%3A2.108910891089109%2C%22pageLink%22%3A%7B%7D%7D%2C%7B%22rowIndex%22%3A3%2C%22startDate%22%3A%222024-03-18%2011%3A52%3A52%22%2C%22id%22%3A%22d625f2ca-ddfc-4926-a8a8-0fa4caad895a%22%2C%22title%22%3A%22PRs%22%2C%22description%22%3A%22%22%2C%22duration%22%3A0.5544554455445545%2C%22pageLink%22%3A%7B%7D%7D%5D%7D%5D%2C%22markers%22%3A%5B%7B%22title%22%3A%22Marker%201%22%2C%22markerDate%22%3A%2220245544554455445545%2C%22pageLink%22%3A%7B%7D%7D%5D%7D%5D%2C%22markers%22%3A%5B%7B%22title%22%3A%22Start%20of%20development%22%2C%22markerDate%22%3A%222024-01-15%2000%3A00%3A00%22%7D%5D%7D
titleRoadmap%20Planner
hash5920d78dbb91f2bad7e3b1e9e3d8abb75178671b4533293b2c12400faf430e90

References

  1. https://www.ti.com/lit/an/sloa101b/sloa101b.pdf?ts=1699421104828

  2. https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial

  3. https://www.can-cia.org/can-knowledge/can/can-fd/

  4. https://www.kernel.org/doc/html/latest/networking/can.html

  5. https://gitlab.com/hjoertel/can4linux

  6. https://www.kampis-elektroecke.de/can-hausbus/can-bus-bit-timing/

  7. https://www.ti.com/lit/an/sprac35/sprac35.pdf?ts=1702295040569

  8. http://www.oertel-halle.de/files/cia99paper.pdf

  9. https://www.can-cia.org/fileadmin/resources/documents/proceedings/2013_hartwich_v2.pdf

  10. https://www.ni.com/docs/de-DE/bundle/ni-xnet/page/can-fd-iso-versus-non-iso.html

  11. https://www.nxp.com/docs/en/application-note/AN12728.pdf

  12. https://docs.espressif.com/projects/esp-idf/en/v4.1.1/api-reference/peripherals/can.html

  13. https://python-can.readthedocs.io/en/2.2.1/interfaces/socketcan.html

  14. https://www.qemu.org/docs/master/system/devices/can.html

  15. Presentation of this proposal at the EVE’s Community call: https://zoom.us/rec/share/G7GXmXKTWZP3p5wu-O0zPIPK8AmuCE3FssvdZDmbJAkKAb24miZbs8Sn8GXr6DcC.fireCQoUTKwI-Id_

...