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:5037,:5038 -R -D sllin.dfu
sudo dfu-util -d 1d50:5037,:5038 -R -D superdfu.dfu
NOTE: You likely need to re-flash the LIN application once the bootloader has been updated.
Ensure you have dfu-util available.
Perform the steps for Linux but omit the sudo
command.
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
slLIN 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 slLIN
- Build and flash slLIN and SuperDFU (bootloader)
- Build and upload slLIN 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.
NOTE: this documentation uses D5035-50 as reference, replace with the ID and name of the board you are using.
$ cd Boards/examples/device/sllin
$ make -j V=1 BOARD=d5035_50 HWREV=1 flash-jlink
$ cd Boards/examples/device/sllin
$ make -j V=1 BOARD=d5035_50 HWREV=1 flash-edbg
This creates and flashes the firmware file. Make sure to replace HWREV=1 with the version of the board you are using.
NOTE: this documentation uses D5035-50 as reference, replace with the ID and name 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_50 HWREV=1 BOOTLOADER=1 VID=0x1d50 PID=0x5038 PRODUCT_NAME="D5035-50 slLIN DFU" INTERFACE_NAME="D5035-50 slLIN DFU" flash-jlink
$ cd Boards/examples/device/atsame51_dfu
$ make -j V=1 BOARD=d5035_50 HWREV=1 BOOTLOADER=1 VID=0x1d50 PID=0x5038 PRODUCT_NAME="D5035-50 slLIN DFU" INTERFACE_NAME="D5035-50 slLIN DFU" flash-edbg
This creates and flashes the bootloader. Make sure to replace HWREV=1 with the revision of the board you are using.
Next, flash slLIN using these steps
$ cd Boards/examples/device/sllin
$ make -j V=1 BOARD=d5035_50 HWREV=1 APP=1 flash-dfu
$ cd Boards/examples/device/sllin
$ make -j V=1 BOARD=d5035_50 HWREV=1 APP=1 OFFSET=0x4000 edbg-dfu
Ensure you have python3
and dfu-util
installed.
Build the slLIN DFU file
$ cd Boards/examples/device/sllin
$ make -j V=1 BOARD=d5035_50 HWREV=1 APP=1 dfu
Ensure HWREV matches the board you are using.
Next, upload the DFU file to the board.
$ cd Boards/examples/device/sllin
$ make -j V=1 BOARD=d5035_50 HWREV=1 APP=1 dfu-upload