1. Home
  2. Docs
  3. How-To
  4. Update Module Firmware

Update Module Firmware

There are currently two ways to load and update firmware on Hexabitz modules. Both methods work with individual modules only. You cannot presently perform a mass update for the entire array at once. However, if you want to update a module remotely (i.e., via another module), check out this article.

1. Using ST Factory Bootloader and Array Ports

The MCU used in Hexabitz mainstream implementation comes from its manufacturer (STMicro) pre-loaded with a small application called factory bootloader. This application allows loading a new firmware to the MCU via one of the UART interfaces connected to array ports. The module port that enables bootloader-based update is marked with (*) . For this process, all you need is a UART-USB converter cable and a special application from ST called STM32CubeProgrammer software. But first, you need to boot up the module into its factory bootloader mode.

Booting into ST Factory Bootloader

In general, when the STM32F0-based module is virgin (i.e., it has no firmware at all) it boots automatically in a mode called “factory bootloader mode”, where you can upload the firmware right away. However, when the module is already running a firmware, you will need to force it to boot into the factory bootloader. You can do that with either one of these two methods:

  • Using the update CLI Command. Once you execute this command, the MCU will leave the running application and jump to the factory bootloader. If you are already connected to the programming port, you will need to close this port in RealTerm (or any other terminal emulator) before using it to connect to the factory bootloader.
  • Applying 3.3V on module B (Boot0) pad while power cycling. The Easiest way to achieve this is to connect a female-to-male jumper wire to one of the power ports (edge ports) top connectors, and then touch the B pad while power cycling the MCU.

Once the MCU is in factory bootloader mode, connect the USB-UART TXD/RXD (yellow/orange) wires to the appropriate port and run the STM32CubeProgrammer.

If you’re using the programmer H40R00 module, you will have before to solder the appropriate VTX VRX pins existed in the programmer module.

Example:  if the programmer is connected to the target module by P1, then solder VTX1, VRX1 pins and connect Bitz Clamp to pin P2* of the module for programming.

In other words, the VTX, VRX pins should follow the connected programmers’ pin label with the target module, taking into consideration removing solder from all other VTX, RTX pins.


Then follow the steps below:

  • Use any serial terminal emulator tool (e.g., RealTerm).
  • Type “update” CLI or apply 3.3V on module B (Boot0) pad while power cycling.
  • Close the port from the serial terminal emulator.
  • Open STM32CubeProgrammer software and apply the following steps:
    • Choose UART >> connect.
    • Port: select the appropriate COM port.
    • Click full chip erase.
    • Go to open file taskbar then choose .hex file for the firmware.

Note: If you are not powering the module from the same USB-UART cable (or another cable connected to your PC), then you need to connect module GND and the PC GND together. Just connect the GND wire on the USB-UART cable to a module GND pad.


2. Using the Serial Wire Debug Interface

The Serial Wire Debug (SWD) interface enables fast firmware update as well as real-time debugging. You will need an STM32-compatible programmer/debugger (e.g., ST-LINK V2 or ST-LINK V3 or the Nucleo board or H40R00 module) and a programming software tool (e.g., ST-LINK Utility or STM32CubeProg or via STM32CubeIDE). Three module pads are needed for connection between the programmer and the target module (plus GND): C (SWD Clock), D (SWD Data) and R (MCU Reset).

You will need to make the following connections between the programmer and the module (example provided for the programmer H40R00 module):

  • For PC connection, connect USB Micro-B cable to your PC directly.
  • For the host board (H40R00 module) three module pads are needed for connection (plus GND): C (SWD Clock), D (SWD Data) and R (MCU Reset):

         Pin R (H40R00) >> Pin R (target module).

         Pin C (H40R00) >> Pin C (target module).

         Pin D (H40R00) >> Pin D (target module).

  • You need to connect GND between ST-LINK and the module. If your module is powered from a USB-UART cable connected to the same laptop that you connect the ST-LINK to, then, they both have a common ground, and you might not need a separate GND connection.


  • Open STM32CubeProgrammer software and follow the steps:
    • Choose ST-Link >> connect.
    • Port: SWD.
    • Click full chip erase.
    • Go to open file taskbar then choose .hex file for the firmware.

Note: Some ST-LINK programmers require target VCC to be connected as well. In this case, you need to connect one of the module power (top) pads as well.


Watch this video for more details.


Q: Where do I find module firmware?

A: There are three easy methods to get pre-compiled firmware HEX files for the release you want without cloning and compiling the firmware:

  • Navigate to module website page, Resources tab and download HEX files for latest firmware release.
  • Visit module firmware repository on GitHub and click on Releases, recent releases should show up with their associated HEX files.
  • Visit module firmware repository on GitHub and navigate to the Compiled folder within the code. The folder contains HEX files for current and previous releases. Simply copy the release you want if you have a local copy. If you are browsing the repository online, click on the HEX file then, click on Raw to display and download the file. You can also download a zip folder of the entire repository using the Clone or download button.


How can we help?