What is this?
This is project SuperCAN. An open source USB to CAN-FD protocol. SuperCAN works with the open source D5035-01 hardware to form an USB 2.0 to CAN-FD interface.
SuperCAN supports Windows 10 and Linux.
Build | Status |
---|---|
Firmware | |
Linux | |
Windows |
NOTE: Kindly ensure you have the device driver package installed on your system. Ensure you have copied the plugin from the Windows archive into the plugin folder of CANdevStudio.
- can-utils
- CANdevStudio
NOTE: Kindly ensure you have the device driver built and loaded into the kernel. See below.
This assumes you have a board with the SuperDFU bootloader already installed. If not, see below on how to build & flash the bootloader.
Ensure you have dfu-util
available on your system. Windows users can download dfu-util binaries here. On a Debian derived distro such as Ubuntu, apt install dfu-util
will get you set up.
sudo dfu-util -d 1d50:5035,:5036 -R -D supercan.dfu
Since version 0.3.3, the bootloader can be updated through DFU. Earlier versions require a debug probe (see below).
sudo dfu-util -d 1d50:5035,:5036 -R -D superdfu.dfu
NOTE: You likely need to re-flash the CAN application once the bootloader has been updated.
Please follow these steps.
This section describes the steps to build the software in a Linux-like environment. Windows users should read this.
Clone this repository and initialize the submodules.
$ git submodule update --init --recursive
SuperCAN uses a customized TinyUSB stack.
You will need the the ARM GNU toolchain.
On Debian derived Linux distributions apt-get install gcc-arm-none-eabi
will get you set up.
You can choose between these options
- Build and flash stand-alone SuperCAN
- Build and flash SuperCAN and SuperDFU (bootloader)
- Build and upload SuperCAN through SuperDFU
If you have a debugger probe such as SEGGER's J-Link you can choose any option. For option 3 you need a board with the SuperDFU bootloader already flashed onto it.
$ cd Boards/examples/device/supercan
$ make -j V=1 HWREV=3 flash-jlink
$ cd Boards/examples/device/supercan
$ make -j V=1 HWREV=3 flash-edbg
This creates and flashes the firmware file. Make sure to replace HWREV=3 with the version of the board you are using.
Ensure you have python3
installed.
This option installs the SuperDFU bootloader on the device. SuperDFU implements USB DFU 1.1.
$ cd Boards/examples/device/atsame51_dfu
$ make -j V=1 BOARD=d5035-01 HWREV=3 BOOTLOADER=1 VID=0x1d50 PID=0x5036 PRODUCT_NAME="D5035-01 SuperCAN DFU" INTERFACE_NAME="D5035-01 SuperCAN DFU" flash-jlink
$ cd Boards/examples/device/atsame51_dfu
$ make -j V=1 BOARD=d5035-01 HWREV=3 BOOTLOADER=1 VID=0x1d50 PID=0x5036 PRODUCT_NAME="D5035-01 SuperCAN DFU" INTERFACE_NAME="D5035-01 SuperCAN DFU" flash-edbg
This creates and flashes the bootloader. Make sure to replace HWREV=3 with the revision of the board you are using.
Next, flash SuperCAN using these steps
$ cd Boards/examples/device/supercan
$ make -j V=1 HWREV=3 APP=1 flash-dfu
$ cd Boards/examples/device/supercan
$ make -j V=1 HWREV=3 APP=1 OFFSET=0x4000 edbg-dfu
Ensure you have python3
and dfu-util
installed.
Build the SuperCAN DFU file
$ cd Boards/examples/device/supercan
$ make -j V=1 HWREV=3 APP=1 dfu
Ensure HWREV matches the board you are using.
Next, upload the DFU file to the board.
$ cd Boards/examples/device/supercan
$ sudo dfu-util -R -D _build/build-d5035-01/d5035-01-firmware.dfu
Build the Visual Studio solution in the Windows folder. I use Visual Studio Community 2019 which is available free of charge for non-commercial products (as of this writing).
The solution contains code for a demo application that sends and dumps CAN traffic.
To build the Linux kernel module, please follow these instructions.
SuperCAN is available under the MIT license. SuperCAN uses FreeRTOS and TinyUSB which are both available under the same license.
The Linux driver is available under GPLv2 or MIT.