Skip to main content

Eclipse OpenBSW ECU

Illustration of Eclipse OpenBSW ECUIllustration of Eclipse OpenBSW ECU

Integrate · RemotiveCar v0.10.0

  • CAN
  • Lighting
What you need
  • Linux with RemotiveBus

Run it​

git clone https://github.com/remotivelabs/remotivelabs-remotive-car.git
cd remotivelabs-remotive-car

remotive topology build -f instances/openbsw/main.instance.yaml build

docker compose -f build/remotive_car_openbsw/docker-compose.yml --profile 3dcar up --build

Open http://localhost:3000 for the 3D car. The first build compiles OpenBSW from source, which takes a few minutes.

Running the embedded software of an ECU in the topology lets you develop and test it against the rest of the car long before, and long after, there is hardware on your desk. Here the Body Control Module (BCM) is an Eclipse OpenBSW application, a port of the python BCM's behaviour: turn signals, beams, brake lights and gear. The same sources run in two ways:

  • As a virtual ECU: the POSIX build of OpenBSW in a container, attached directly to the DriverCan and BodyCan networks. OpenBSW opens the SocketCAN interfaces that RemotiveBus gives the container, just as it would open a vcan on a Linux host.

  • On hardware: the firmware flashed to an NXP S32K148EVB board. RemotiveBus bridges the two topology networks to two host CAN channels, and the board sits on those physical buses. The rest of the topology is unchanged.

  • Part of the RemotiveCar example

  • The BCM application, its Dockerfile and how it is built: models/bcm/openbsw

  • Virtual ECU instance: openbsw, with the instance file BCM/openbsw.instance.yaml

  • Board instance: openbsw_board, with the BCM marked as external in BCM/external.instance.yaml

  • The board's parts, wiring, build and flashing: HARDWARE.md

As a virtual ECU​

remotive topology build -f instances/openbsw/main.instance.yaml build
docker compose -f build/remotive_car_openbsw/docker-compose.yml --profile jupyter --profile 3dcar up -d --build

The first build compiles OpenBSW from source, which takes a few minutes. Drive the inputs from the Jupyter notebook at http://localhost:8888/lab?token=remotivelabs and watch the lights in the 3D car at http://localhost:3000.

Run the pytest suite against it:

docker compose -f build/remotive_car_openbsw/docker-compose.yml --profile tester run --rm --no-deps --build tester

These are the same tests as for the python BCM, since they only use the BCM's CAN interface. An OpenBSW ECU has no RemotiveBroker control plane, so the tests reset it the way a real ECU is reset: with a UDS ECU Reset over ISO-TP on DriverCan. They also read its software version over UDS.

On an S32K148EVB board​

With the board flashed and wired to a two-channel CAN interface on the host, see HARDWARE.md:

remotive topology build -f instances/openbsw_board/main.instance.yaml build
# This command will start the topology make the 3D car available
docker compose -f build/remotive_car_openbsw_board/docker-compose.yml --profile jupyter --profile 3dcar up -d --build
# This optional step will run test pytest cases on the topology we just started
docker compose -f build/remotive_car_openbsw_board/docker-compose.yml --profile tester run --rm --no-deps --build tester

The same notebook, 3D car and tests now work with the board. The UDS reset restarts its MCU, and the software version test reads the version the board was built with.

Notice:

  • OpenBSW speaks SocketCAN, so both ways need Linux with RemotiveBus vcan networks. The can_over_udp settings don't work here.
  • The board needs a two-channel SocketCAN interface on the host and an external CAN transceiver for the second bus.
  • Ping and emergency mode need the control plane, so they aren't available for this BCM. See the instance README for all the differences.