TCP/IP support in LibOpenBLT and BootCommander

Goods news for all OpenBLT bootloader users that are interested in performing firmware updates on their microcontroller, via the Internet or from a local network. TCP/IP support was already available in the MicroBoot tool for Windows and is now also implemented in the cross-platform BootCommander command-line program.

The BootCommander program is based on the OpenBLT host library (LibOpenBLT), which means that TCP/IP is now also fully supported in LibOpenBLT. This completes the initial feature set envisioned for LibOpenBLT. It supports all the communication transport layers that are available in the OpenBLT bootloader itself: RS232, CAN, USB and TCP/IP.

This article provides instructions on how to obtain a copy of the OpenBLT bootloader that includes the new TCP/IP support, details regarding how the TCP/IP support was realized, and an example on performing a firmware update via TCP/IP and BootCommander.

How to get it

TCP/IP will be included in the next stable release. This will be version 1.5.0 and is planned to be released during the first part January 2018. For those eager to get their hands on it sooner, it is currently available in the trunk of OpenBLT’s SVN repository on SourceForge. Point your browser to https://sourceforge.net/p/openblt/code/HEAD/tree/trunk/ and click on “Download Snaphot”. Alternatively you can head over to GitHub at https://github.com/feaser/openblt, where you can find a mirror of the OpenBLT sources.

TCP/IP support in LibOpenBLT

When designing and implementing TCP/IP 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 TCP/IP support on top of Winsock in Windows, whereas a BSD socket forms the foundation in the Linux port.

For those not yet familiar with the LibOpenBLT library, it is definitely worth having a closer look. It enables you to quickly and easily develop your own firmware update PC tool, in the programming language of your liking. It is basically one simply shared library file, packed with all the functionality you would need to communicate with the OpenBLT bootloader.

TCP/IP support in BootCommander

You can now perform firmware updates via TCP/IP with BootCommander. This is great news for those using Linux and for those that prefer the BootCommander command-line program over the MicroBoot program that features a graphical user interface. Since BootCommander is built on top of LibOpenBLT, all that had to be done was to implement a few more command-line options, allowing the user to configure the TCP/IP based transport layer. To see these new options, simply run the BootCommander program without specifying any command-line options:

Note that the -a=[value] option supports not only an IP address, but also a hostname. So you could use something like “mytaget.mydomain.com”. The underlying functionality in LibOpenBLT will automatically resolve the IP address that belongs to the hostname.

Here is a full command line example of performing a firmware update via TCP/IP:

BootCommander -t=xcp_net -a=192.168.178.23 -p=1000 demoprog_ek_lm3s6965.srec

This assumes that the “demoprog_ek_lm3s6965.srec” firmware file is in the same directory as the BootCommander program. If not, then specify the full path to the firmware file.

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

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