User Tools

Site Tools


manual:canfd_demo

Firmware updates using the CAN FD communication interface

Bootloader configuration

Functionality for firmware updates via CAN FD is built on top of the CAN classic functionality. Refer to the firmware updates using CAN page for details on how to perform the basic configuration for firmware updates via CAN.

If you want to perform firmware updates via CAN FD and the bootloader is currently already configured for firmware updates via CAN classic, add the following macro to “blt_conf.h” (if not already present), and set it to a value of 1. Next, rebuild the bootloader after making the change:

#define BOOT_COM_CAN_FD_ENABLE          (1)

The bootloader is now configured for firmware updates via CAN FD and the full 64 bytes payload will be used during firmware updates, instead of the 8 bytes of CAN classic. This significantly increases the data throughput during the firmware update.

Optionally, you can configure an increased communication speed for the up to 64 bytes of payload in the CAN message. The so-called bitrate switch feature (BRS). To enable this feature and at the same time configure its communication speed, at the following macro to “blt_conf.h” and set it to the desired communication speed in bits/second:

#define BOOT_COM_CAN_FD_BRS_BAUDRATE    (2000000)

Using MicroBoot

To configure the CAN communication settings in MicroBoot to use CAN FD, open MicroBoot and click the “Settings”-button to configure the “XCP on CAN” interface.

Select a CAN device that supports CAN FD. For example one of the Vector CAN devices such as a VN1610 (“Vector XL Driver”). If you selected a CAN device that supports CAN FD, you'll notice that more CAN FD related entries show up in the “Baudrate” drop-down box. Select the entry that represents the communicate speeds that you configured for the bootloader:

The image above shows how to configure the nominal baudrate to 500 kbits/second and the data baudrate to 2 Mbits/second. This should be the same as the values configured using the macros BOOT_COM_CAN_BAUDRATE and BOOT_COM_CAN_FD_BRS_BAUDRATE in “blt_conf.h”, respectively.

Using BootCommander

The BootCommander command line interface (CLI) program allows you to configure all communication settings via options on the command line. The only new command line parameter for CAN FD is the “-bd” option. Also make sure that you selected a CAN device that supports CAN FD. You could use the “Baudrate” drop-down box in MicroBoot, as described above, to verify if you CAN device supports CAN FD.

The following example demonstrates how to call BootCommander for making a firmware update with one of the demo programs. Just correct the “-d” option to select the CAN communication device that your PC uses to connect to the CAN bus.

Example to perform a firmware update via CAN FD using a nominal baudrate of 500 kbits/second and a data baudrate of 2 Mbits/second:

BootCommander -s=xcp -t=xcp_can -d=vector_xldriver -b=500000 -bd=2000000 -c=0 -tid=667 -rid=7e1 -xid=0 demoprog_stm32g431.srec

CAN FD transceiver

Keep in mind that to use CAN FD, your microcontroller needs to support CAN FD and your microcontroller system needs to have a CAN FD capable CAN transceiver. Feaser offers a freely available design of a CAN FD shield that can be used as a reference and example. This shield can be used with ST Nucleo-64 and ST Nucleo-144 boards:

manual/canfd_demo.txt · Last modified: by voorburg

GNU Free Documentation License 1.3 Powered by PHP Driven by DokuWiki