Bootloader - solution for remote firmware update

10 minutes

What is the bootloader? - significant remote update simplification.

Advantages and an example from practice. 

Do you need to place your solution on the market as soon as possible, but you know that you will want to improve the firmware in future with new functions at the same time, like companies such as Tesla does for their cars? 

It is not necessary to recall the device from the market, because there is a solution for firmware remote update! The solution is to use the bootloader, firmware update will be fast, secure and user friendly. We have such a know-how in ASN Plus!

Remote update brings costs reduction

Electronic devices remote firmware update possibility is increasingly in demand among our customers. It brings significant cost reduction to the producers and vendors at the same time. They do not need to recall the devices from the market just to update the firmware.

Remote firmware update.

You can avoid the risk of damaging your good reputation, and in addition, you might gain an edge over the competition thanks to the remote update. You can simply add new functions and improvements by remote firmware update, so you will be able to flexibly respond  to your customer’s requirements and comments. We are well aware of the remote update feature importance in ASN Plus and we have rich experiences with its implementation.

Bootloader = programme for firmware update

There are several ways to approach electronic device firmware update. One option is that hardware is controlled by the main programme and its update is processed by the bootloader.

The main programme can be simply updated by bootloader from both flash memory and from cloud. Possible mass update of higher volume of devices is smooth as well. It is up to the user whether he allows the update or not. The principle is similar to the mobile phones system, where it is up to the user whether he wants to update the device or he wants to keep the old version. There is also an option that the update is made by device producer. Bootloader is changeless and it does not update itself. It is just a middle point of the main programme upgrade.

Remote update and its advantages

Are you asking a question if it is a good idea to invest time and finances to bootloader for remote update implementation? We are convinced that definitely yes. This feature can bring to you as an electronic devices producer many advantages:

  • Easy update of high volume devices – implementation of the bootloader with option of remote update has a big importance for devices which are on the market in a high volume.

  • User friendly solution – remote update can be done by layman. The interface is intuitive. Both the producer and user have an option to decide whether they want to process the upgrade or they will carry on using the old version.

  • Bug fixes without recalling from the market – if some firmware critical error appears on the device after placing it on the market, you can fix it easily without needing to recall the devices from the market.

  • An edge over the competition – the electronic device can be continuously improved and new functions can be added thanks to bootloader. You will gain an edge over the competition easily without needing to place the brand new product on the market.

Remote firmware update

Bootloader in Leviathan device

To make the importance and advantages of the bootloader even more obvious in practice, we will describe the way of its implementation in the Leviathan device. We have developed it for Jefftron corporation, which is an airsoft guns electronics specialized reseller.

Leviathan mediates the connection between airsoft gun and mobile app and brings the option of monitoring the shooting statistics. It also enables various parameters settings, such as shooting cadency, virtual magazine, gun preloading or optical sensor calibration. The airsoft gun control unit is produced in a big series and it is used by a big volume of users, so the option of an easy and fast firmware upgrade was one of the crucial development requirements.

Firmware upgrade is done via the mobile app

The part of the Leviathan device’s firmware is the main program and bootloader. If our developers team prepares a new version of the main programme, which brings the new functions, it uploads it on the server. After the mobile app turns on and is paired with a control unit, it checks the current firmware version and compares it with the one on the server.  If the app finds a new version, it reminds the user or producer. They can then accept the upgrade and process it or refuse it.

Leviathan Jefftron

If a user confirms the upgrade, the app downloads a data file with a new version of the main program to a phone memory. App then sends the information about upcoming upgrade to the main program via Bluetooth. The main program reacts on this action - it shuts down and starts a bootloader (if it is not turned on already). App then manages the data transfer via Bluetooth. Bootloader gradually receives the data and writes it down instead of previous main program. Once the process is finished, the bootloader checks its function. If the data is not damaged, it turns off and the main program in a new version starts.

We did not forget about the risk of update failure

Not every time everything goes according to plan(Shit happens). Of course, the update process can fail due to the signal loss, current decrease in the gun, or data damage. If the main program was rewritten by a corrupted version, the airsoft gun would be nonfunctional. We have taken this risk into account and we have several solutions, which eliminate risks like these.

One solution is based on the principle, where a boot program reveals a main program malfunction after the upgrade, the bootloader prevents the main program from starting to run and enables repetitive update processing. The mobile phone app processes the check of the main program version and when in case of data corruption bootloader answers that the main program is nonfunctional. User is then offered by all versions available on the server. Users then can choose whether he wants to upgrade to the newest firmware version or to stay with the current version. Both producer and user don’t have to be afraid that in case of upgrade failure the electronic device would stop working.

Various firmware types for different variants of hardware

Leviathan device exist in different variants. Some of them are dedicated for models with optical switch, others for models with mechanical switch. Each hardware type cannot work without dedicated individually setted firmware. There is for each hardware variant a different firmware file on the server. The mobile app detects the type of hardware when pairing with Leviathan. Based on this it downloads relevant updates. Firmware is so possible to be edited and improved for various device types at the same time or separately.

Firmware features limitations via bootloader

As we mentioned above, the main task of the bootloader is turning on and updating the main program. Yet the boot program is able to affect device functions directly. We have used this feature in ASN Plus during firmware for Leviathan development. We have solved this way the requirement for limitation of units functions, which are dedicated to be sold in selected countries. There are states which legislation bans the option of automatic or burst shooting.  

From the firmware and hardware point of view, all units are identical. Some units have restricted (,,semi only”) bootloader. After the update is finished, the bootloader writes down the information to memory that automatic shooting is banned. The main program reads this information after turning on and then it does not enable automatic shooting.

If you are a developer or electronics producer, the option of remote firmware update via bootloader is worth considering. We will be happy to help you with implementation. In our company, ASN Plus, we have overcome a series of barriers and specific requirements. We will be glad to help you with complex firmware development and with electronics development as well.