Skip to content

CAN signal visualizer for Fusion Domain Controller (FDC)

Notifications You must be signed in to change notification settings

foxtron-ev/canhut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

canhut

Overview

canhut is a composite of tools to provide GUI-enriched CAN signal visualizer for FDC, aims at supporting application-level verification and debugging in vehicle environment. It consists of a SocketCAN over Ethernet tunnel tool called cannelloni. The tool run on FDC and ubuntu PC to accomplish a CAN message mirroring from FDC's SocketCAN to ubuntu's SocketCAN. Besides, a CAN DBC and signal visualizer tool cabana runs on ubuntu PC to read frames from SocketCAN and plotting it on the Qt-based GUI. The signal can be decoded according to the DBC file.

┌─────────┐  eth   ┌───────┐
│ ubuntu  ├────────┤  FDC  ├────────────┐ ...... ───────┐
└─────────┘        └──┬──┬─┘            │               │
                      │  └──────────┐   └───────┐       └───────┐
                      │ GBDC CAN    │ CAN1      │ CAN2          │ CAN_n
                  ┌───┴───┐     ┌───┴───┐   ┌───┴───┐       ┌───┴───┐    
                  │ BMS   │     │ ECUs  │   │ ECUs  │       │ ECUs  │
                  └───────┘     └───────┘   └───────┘       └───────┘

Prerequisite

  • Ubuntu 22.04 (WSL2 is okay)
  • Support kernel module (or built-in) can can-raw vcan
  • If using WSL2, networkingMode=mirrored is required to be set in wsl2 config
[wsl2]
networkingMode=mirrored
  • S32G3 SDK 40 for cross-compile
  • Ethernet cable to connect FDC
  • DBC files (need sanitize, remove multiple-lines comment)

Clone

Clone the source code including submodules

git clone --recurse-submodules git@github.com:foxtron-ev/canhut.git

Build

cannelloni

The cannelloni uses cmake to generate a Makefile. Please build cannelloni using the following command.

For ubuntu

cmake -DCMAKE_BUILD_TYPE=Release -DSCTP_SUPPORT=false
make

In another shell environment, to build the executable runs on FDC

source /opt/fsl-auto/40.0/environment-setup-cortexa53-crypto-fsl-linux
cmake -DCMAKE_BUILD_TYPE=Release -DSCTP_SUPPORT=false
make

openpilot tools

Please follow the readme in openpilot tools to build.

Installation

cannelloni

On ubuntu, just instal it using make install

On FDC, copy the executable cannelloni to FDC file system.

Usage

On FDC, turn on CAN-to-ETH routing. For example, forward CAN2 to ubuntu port 20000, where the ubuntu IP address is 192.168.200.63.

cannelloni -I vcan2 -R 192.168.200.63 -l 20000 -r 20000

On ubuntu, turn on CAN-to-ETH routing, to listen port 20000 and mirror it to vcan2.

cannelloni -I vcan2 -R 192.168.200.1 -l 20000 -r 20000

And then launch cabana in openpilot project.

./tools/cabana/cabana

Then switch to "SocketCAN" tab to select vcan2 and corresponding DBC file. The alternative is to add options to the command line.

./tools/cabana/cabana --dbc ~/projects/cmm/FPD1_101.0_CAN2_FUSION_20240909_Fix.dbc --socketcan vcan2

Limitation

  • Support one channel at a time

About

CAN signal visualizer for Fusion Domain Controller (FDC)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published