Overview
This document helps you update the firmware of your RAK modules based on STM32 microcontrollers using STM32CubeProgrammer. Download the STM32CubeProgrammer software and install the appropriate installer based on your Operating System.
By default, RAK modules have RAK Bootloader. To update your device, you will only need the .bin
file to be uploaded via RAK DFU Tool or WisToolBox. However, aside from the .bin
firmware file, RAK also provides the .hex
file, which contains both the RAK bootloader and the application code. This STM32CubeProgrammer guide will use that hex file provided on the modules.
Contents
These are the two ways to use the STM32CubeProgammer:
đź“ť NOTE: If you have no ST-LINK hardware tool, you can only use the STM32's built-in UART bootloader since you will only need a UART connection (no external tool required). |
Using the STM32 UART Bootloader
Your RAK module must be connected to the PC via a USB-UART converter (VCC, GND, TX, and RX). It must be in STM32 UART Bootloader mode as well. To do this, you have to connect the BOOT pin of the module to VCC (3.3 V) then reset (momentary pull down of reset pin) the module. You can also power up the module while BOOT pin already connected to VCC so you will not need to reset. Take note that after a successful upload, you have to remove the BOOT pin connection to VCC.
⚠️ WARNING: RAKDAP1 hardware debugger DOES NOT work with STM32CubeProgrammer. It is advisable to use alternative USB-UART converter when using the UART bootloader of STM32WL to upload a .bin nor .hex file. |
Open the STM32CubeProgrammer software, and select UART on the tool selection.
With the RAK module connected to the PC, select the correct assigned port (COM19 in this guide), then click Connect. If a wrong port is selected, the connection will fail.
You should see that the device and its memory are read by STM32CubeProgrammer.
đź“ť NOTE:
|
After a successful connection, you have to open the firmware file you need to upload. This is usually a .hex
file that contains both the RAK Bootloader and the latest application code. You have to check the specific RAK module documentation for the correct hex file.
Click Download to start uploading the firmware file. If all is successful, you should see 100%. At this point, you can now remove the connection of BOOT pin to VCC and restart the module to run the updated application code.
Using ST-LINK Debugger/Programmer Tool
You need to connect the ST-LINK tool to your RAK module. The RAK module must have external power, and SWD pins (VDD, GND, SWDIO, and SWCLK) must be connected to the ST-LINK. The ST-LINK will detect the voltage level of the supplied power to the RAK module. It must be connected to a PC via USB.
Open the STM32CubeProgrammer software, and select ST-LINK on the tool selection.
If the ST-LINK is not detected by the PC, you need to click refresh. Then you can now click Connect button.
With a successful connection, you should see that the device and its memory content are read by STM32CubeProgrammer.
đź“ť NOTE:
|
You also have the option to perform a full chip erase using ST-LINK if you need your RAK module to be as fresh as a newly purchased module.
After successful mass erase, you have to open the firmware file you need to upload. This is usually a .hex
file that contains both the RAK Bootloader and the latest application code. You have to check the specific RAK module documentation for the correct hex file.
Click Download to start uploading the firmware file.
If all is successful, you should see 100%. At this point, you can now remove the connection of the module to the ST-LINK and run your device normally.
Updated