Update on OpenBLT development efforts

After the OpenBLT version 1.5.0 release last month, development efforts for the next version were started right away. With the goal of having a transparent development process, this article provides an update on the ongoing development tasks. For those new to the OpenBLT project have a look at the recently published OpenBLT introduction video:

STM32 Hardware Abstraction Layer support

In the early days of the STM32 microcontroller, the only way to access peripherals was by directly accessing the registers or via the Standard Peripheral Library (SPL). A few years ago ST refocused their software library efforts from the SPL to the new Hardware Abstraction Layer (HAL). A nice feature of the HAL is that it comes with the CubeMX PC tool. CubeMX allows you to quickly configure the microcontroller peripherals through an intuitive user interface. It can generate initialization and example code for using the HAL. You can run the generated code directly or copy just the parts you need to your own project. It is great for both rapid firmware prototyping and for developing production-ready firmware.

With the growing popularity of the HAL and CubeMX, OpenBLT users requested its support in the bootloader. My initial response was: why fix something that isn’t broken? However, I did find out that ST no longer makes the SPL available for new microcontroller families, such as the STM32L4, STM32F7 and STM32H7. This made me decide to go through the efforts of upgrading the SPL support to HAL for all STM32 ports and demo programs in the OpenBLT bootloader.

I started out with the STM32F3 port and demo programs. After removing the SPL and integrating the HAL, I got a bit of a shock. The bootloader’s ROM size grew from 6184 bytes to 10812 bytes. That is a whopping 75% increase. Not really what you want for a bootloader, where ROM size should ideally be as small as possible.

Luckily, I found out that ST recently added the so-called Lower Layer (LL) drivers to the HAL. The LL is actually quite similar to the original SPL. After reconfiguring the bootloader for using the LL as much as possible, the ROM size shrunk to 7680 bytes. In my opinion that is acceptable; You get all the benefits of CubeMX and HAL/LL, with only a 25% increase in ROM size. Note though that it was not possible to only use the LL, because certain drivers (Flash and CAN for example) are only available as HAL drivers.

The other STM32 ports and demo programs supported by OpenBLT will be upgraded to HAL in the near future. Probably in the following order: STM32F0, STM32F2, STM32F1, and then STM32F4.

Portation to the STM32L4 family

Looking at the statistics of the most popular microcontroller families of OpenBLT users, there is a clear winner: STM32. This year the focus will therefore be on adding support for more STM32 microcontroller families, such as the STM32L0, STM32L4, STM32F7 and STM32H7. ST was kind enough to sponsor the OpenBLT project with a bunch of Nucleo boards, which can be used for realizing this.

A few weeks ago I got started on the STM32L4 port. This one is now completed, including demo programs for the Nucleo-L476RG board. The STM32L4 port supports firmware updates via RS232 and CAN. While developing the port, I made sure to make use of the HAL right away.

STM32L4 port specific information can be found on this Wiki page:

https://www.feaser.com/openblt/doku.php?id=manual:ports:armcm4_stm32l4

Getting started instructions for the Nucleo-L476RG demo programs are on the Wiki as well:

https://www.feaser.com/openblt/doku.php?id=manual:demos:nucleo_l476rg_truestudio

Python bindings for LibOpenBLT

Development of the Python bindings for the OpenBLT host library (LibOpenBLT) has started. Soon you can develop your own firmware update tool in Python. Python is rapidly growing in popularity. It has a clean and easy to learn syntax and comes with an expansive package library that is easy to install.

I have not yet programmed a lot in Python, so I had to figure out a couple of things. For example, how to create a package that can be easily installed by other users and how to access LibOpenBLT’s shared library. It is going quite well so far and I noticed that I really enjoy working with Python. For those that would like to follow this development effort more closely, have a look at the code in the trunk.

OpenBLT listed as STM32 third party supplier

ST publishes a periodically updated presentation which lists the third party software suppliers for their STM32 microcontrollers. The latest version includes a section about bootloader offerings, and they were kind enough to list the OpenBLT project there.

This doesn’t have anything to do with the development of OpenBLT, but I feel this is a major step forward towards increased recognition of the OpenBLT project, worth mentioning in this article.

That’s it for this month’s update. I hope you found the contents informative and feel free to provide feedback in the comments section.

 

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