Table of Contents

BootCommander Utility

BootCommander is a command line interface (CLI) program for performing firmware updates on a microcontroller that runs the OpenBLT bootloader. It provides a firmware update tool for those that prefer a command line interface program over one with a graphical user interface, such as MicroBoot.

BootCommander was written in the C programming language (C99) and developed with cross-platform support in mind. It has been successfully tested on a Windows PC, Linux PC and even on embedded Linux systems such as a Raspberry Pi and a Beagle Board.

Under the hood, BootCommander relies on the OpenBLT host library (LibOpenBLT) for handling the actual communication with the bootloader.

Thanks to the open source nature of the OpenBLT project, full source code is available for the BootCommander program. This makes it a great reference and starting point for those that would like to develop their own firmware update tool. For details on its implementation, refer to the reference manual that is located at: .\Doc\RM_BootCommander.pdf.

Program usage

When calling the BootCommander program from the terminal, it expects a few options followed by a firmware file: BootCommander [options] [firmware file].

The currently supported firmware file format is S-records and the location of the firmware file can be specified as either an absolute or relative path. The options the make it possible to select and configure the communication protocol and transport layer to use:

Additional XCP version 1.0 communication protocol settings (xcp):

Additional XCP on RS232 settings (xcp_rs232):

Additional XCP on Modbus RTU settings (xcp_mbrtu):

Additional XCP on CAN settings (xcp_can):

Additional XCP on TCP/IP settings (xcp_net):

Program settings:

Note that is it not necessary to specify an option if its default value is already the desired value. This means that the following two examples behave exactly the same:

BootCommander -d=COM4 demoprog.srec

and

BootCommander -s=xcp -t=xcp_rs232 -d=COM4 -b=57600 -t1=1000 -t3=2000 -t4=10000 -t5=1000 -t7=2000 demoprog.srec

Building BootCommander from sources

BootCommander relies on CMake to automatically detect the build tools on your system and to generate the build environment for it. The following instructions assume that CMake is installed on your system and is available on the path. Windows users can download the installer from http://www.cmake.org/. Mainstream Linux distributions have CMake in their software repository and it can be installed from there. Example for Ubuntu based distributions:

sudo apt-get install cmake

Note that BootCommander relies on the OpenBLT Host Library (LibOpenBLT) and some of the files that were generated when building LibOpenBLT. Therefore, make sure you already built LibOpenBLT, before you attempt to build BootCommander.

Building on Linux with GCC

This method assumes that the basic tools needed for building software are installed. At least the GCC compiler and Make are needed. On Ubuntu based distributions, these tools can be installed via command:

sudo apt-get install build-essential

Using the terminal, set the working directory to ./Host/Source/BootCommander/build. Next, type the following two commands to detect and generate the Unix Makefiles based build environment and then build the BootCommander executable:

cmake ..
make

After a successful build, the BootCommander executable is located in the ./Host directory.

Building on Windows with Microsoft Visual C++

This method assumes that Microsoft Visual C++ is installed. During the BootCommander development, Microsoft Visual Studio 2019 was used. The method outlined here should work just fine with both older and newer versions of Microsoft Visual Studio.

Using the Command Prompt in Windows, set the working directory to .\Host\Source\BootCommander\build and type the command:

cmake ..

A solution file for Microsoft Visual C++ is then automatically generated, called BootCommander.sln. Open the solution in Microsoft Visual C++ and build the program from there, by selecting Build→Rebuild Solution from the menu.

After a successful build, the BootCommander.exe executable is located in the ./Host directory.

Note that this builds a 64-bit version of BootCommander.exe, which then also requires a 64-bit version of the LibOpenBLT shared library (libopenblt.dll). Starting with OpenBLT version 1.14, LibOpenBLT is built and distributed as a 64-bit library, so that works well together.

If you use the 32-bit LibOpenBLT shared library from before OpenBLT version 1.14, or if you rebuilt it yourself as 32-bit, then you should build BootCommander as 32-bit as well. To build a 32-bit version of BootCommander, generate the build environment with command “cmake -A Win32..”.

Building on Windows with MinGW

This method assumes that the MinGW compiler toolchain is installed on your PC. A convenient way to install it, is by downloading the installer that bundles the Code::Blocks IDE together with MinGW. When using OpenBLT version 1.14 or newer, it is recommended to download the 64-bit installer version, because the included libopenblt.dll file is 64-bit as well. Otherwise you can download the 32-bit installer version.

Make sure the .\bin directory of the MinGW installation directory is added to your path in Windows. A quick way to verify that this is the case, run the following command from the Command Prompt in Windows and make sure the program could be found:

mingw32-make

Using the Command Prompt in Windows, set the working directory to .\Host\Source\BootCommander\build. Next, type the following two commands to detect and generate the MinGW Makefiles based build environment and then build the BootCommander executable:

cmake -G "CodeBlocks - MinGW Makefiles" ..
mingw32-make

After a successful build, the BootCommander.exe executable is located in the .\Host directory.