Improved USB support in OpenBLT 1.4.2

OpenBLT version 1.4.2 was released last week. The majority of the changes in this patch release, were focused on the USB support on the host side. The OpenBLT bootloader already supported firmware updates using USB as the transport layer. There was one limitation though: On the PC side it was only possible to use the MicroBoot tool and not yet the new BootCommander program, which is based on the OpenBLT Host Library (LibOpenBLT). With the new OpenBLT version 1.4.2 patch release, USB support was implemented in both LibOpenBLT and BootCommander. This article provides details regarding how this USB support was realized.

USB support in LibOpenBLT

LibOpenBLT is a cross-platform host library that handles the communication between a PC program and a microcontroller, running the OpenBLT bootloader. Prior to version 1.4.2 it only supported RS232 and CAN as the communication medium. This patch introduces support for USB. TCP/IP is planned to be added in the near future.

When designing and implementing USB support in LibOpenBLT, the goal was to use as much as possible from the underlying operating system. As can be seen in the following illustration, this resulted in building the USB support on top of the WinUSB user space functionality in Windows, and the LibUSB user space functionality in Linux.

Under Windows, LibOpenBLT’s USB support works with Windows Vista or newer. It is necessary to install a USB driver though. Detailed instructions on how to achieve this can be found on the OpenBLT Wiki.

Under Linux, LibOpenBLT’s USB support should work with any distribution as long as the LibUSB-1.0 package is installed. It was successfully tested on Ubuntu, Fedora, Arch, Debian, and even on a Raspberry PI. These distributions all have the LibUSB-1.0 package installed by default. It is advised to add a UDEV rule for the OpenBLT USB device, allowing firmware updates to be made without requiring super user privileges. Additional details on how to add such a UDEV rule can be found on the OpenBLT Wiki.

USB support in BootCommander

You can now perform firmware updates via USB with BootCommander. Since BootCommander is built on top of LibOpenBLT, all that had to be done was to implement the command line option for specifying USB as the transport layer:

Here is a full command line example of performing a firmware update via USB:

BootCommander -s=xcp -t=xcp_usb demoprog_olimex_stm32h103.srec

Let me know how the new USB support is working out for you. As always, feedback is welcome.

This entry was posted in OpenBLT and tagged , , . Bookmark the permalink.