To improve the accessibility of our content, please find the audio version of this blog post.
ST is announcing today new versions of STM32CubeProgrammer, STM32CubeMonitor, STM32CubeMonitor-RF, and STM32CubeMonitor-UCPD. The tools often appear in our columns because many STM32 developers use them to release their products to market faster. Indeed, the challenge for any embedded system engineer is to find a comprehensive platform for their microcontroller or microprocessor. A device may have many features, but none of them are helpful if designers can’t implement them efficiently. As a result, it is critical to offer a wide range of software tools that facilitate the development of applications on STM32 devices. Let us, therefore, explore some of these tools and their new functionalities.
Table of Contents
What is STM32CubeProgrammer?
A Unifying Experience
STM32CubeProgrammer aims to unify the user experience. ST brought all the features of utilities like the ST-LINK Utility, DFUs, and others to STM32CubeProgrammer, which became a one-stop-shop for developers working on embedded systems. We also designed it to work on all major operating systems and even embedded OpenJDK8-Liberica to facilitate its installation. Users do not need to install Java themselves and struggle with compatibility issues before experiencing STM32CubeProgrammer. Finally, the utility has two critical components: a graphical user interface and a command-line interface. Users can thus optimize their workflow by either taking advantage of its visual cues or its scripting capabilities.
An STM32 Flasher and Debugger
At its core, STM32CubeProgrammer helps debug and flash STM32 microcontrollers. As a result, it includes features that optimize these two processes. For instance, version 2.6 introduced the ability to dump the entire register map and edit any register on the fly. Previously, changing a register’s value meant changing the source code, recompiling it, and flashing the firmware. Today, testing new parameters or determining if a value is causing a bug is a lot simpler. Similarly, engineers can now use STM32CubeProgrammer to flash all external memories at once. Traditionally, flashing the external embedded storage and an SD card demanded developers launch each process separately. STM32CubeProgrammer can do it in one step.
Another challenge for developers is parsing the massive amount of information passing through STM32CubeProgrammer. Anyone who flashed firmware knows how difficult it is to track all logs. Hence, we brought custom traces that allow developers to assign a color to a particular printf function. It ensures developers can distinguish a specific output from the rest of the log rapidly. Debugging thus becomes a lot more straightforward and intuitive. Additionally, it can help developers coordinate their color scheme with STM32CubeIDE, another member of our unique ecosystem designed to empower creators.
A Portal to Security on STM32
Readers of the ST Blog know STM32CubeProgrammer as a central piece of the security solutions present in the STM32Cube Ecosystem. The utility comes with Trusted Package Creator, which enables developers to upload an OEM key to a hardware secure module and to encrypt their firmware using this same key. OEMs then use STM32CubeProgrammer to securely install the firmware onto the STM32 SFI microcontroller. Developers can even use an I2C and SPI interface, which gives them more flexibility. Additionally, the STM32L5 also supports external secure firmware install (SFIx), meaning that OEMs can flash the encrypted binary on memory modules outside the microcontroller.
A Sigfox Provisioner
When using an STM32WL microcontroller, developers can use STM32CubeProgrammer to extract the Sigfox certificate embedded into the MCU. Firstly, developers copy this 136-byte string to their clipboard or save it in a binary file. Secondly, they visit my.st.com/sfxp, where they can paste the certificate and immediately download Sigfox credentials in the form of a ZIP file. Thirdly, they load the content of that downloaded package to the MCU through STM32CubeProgrammer and get the MCU’s Sigfox ID and PAC using an AT command. Finally, developers go to https://buy.sigfox.com/activate/ to register. The activation will last two years, and developers can send 140 messages per day for free for a year.
What’s New in STM32CubeProgrammer?
STM32CubeProgrammer 2.9, the software’s latest version, now supports a double authentication system when provisioning encryption keys via JTAG or a Boot Loader for the Bluetooth stack on the STM32WB. Put simply, the feature enables makers to protect their Bluetooth stack against updates from end-users. Indeed, developers can update the Bluetooth stack with ST’s secure firmware, in most cases, if they know what they are doing. However, a manufacturer may offer a particular environment and, therefore, wish to protect it. As a result, the double authentication system prevents access to the update mechanism by the end-user. ST published the application AN5185 to offer more details.
The new software brings an update to its command-line interface (CLI) to enable the creation of scripts. Since the script manager is part of the application, it doesn’t depend on the operating system or its shell environment. As a result, scripts are highly sharable. Another advantage is that the script manager can maintain connections to the target. When using a traditional batch file, STM32CubeProgrammer CLI needs to reconnect at every step, which can be tedious. On the other hand, the new script manager can keep a connection live throughout a session. It can also handle local variables and even supports arithmetic or logic operations on these variables. Developers can thus create powerful macros to automate complex processes better.
STM32CubeProgrammer 2.9 now supports PKCS#11 when encrypting firmware for the STM32MP1. The Public-Key Cryptography Standards (PKCS) 11, also called Cryptoki, is a standard that governs cryptographic processes at a low level. It is gaining popularity as APIs help embedded system developers take advantage of its mechanisms. On an STM32MP1, PKCS#11 allows engineers to segregate the storage of the private key and the encryption process for the secure secret provisioning (SSP).
SSP is the equivalent of a Secure Firmware Install for MPUs. Developers encrypt their firmware with a private-public key system with STM32CubeProgrammer before sending their code to OEMs. The IP is thus unreadable by third parties. During assembly, OEMs use the provided hardware secure module (HSM) containing an encryption key that they can’t read to load the firmware that the MPU will decrypt internally. However, until now, developers encrypting the MPU’s code had access to the private key. The problem is that some organizations must limit access to such critical information. Thanks to the new STM32CubeProgrammer and PKCS#11, the private key remains hidden in an HSM, even during the encryption process by the developers.
What Is STM32CubeMonitor?
The Netflix of MCUs
STM32CubeMonitor is a runtime variable monitoring and visualization tool with a web interface for remote connections and a graphical interface to create custom dashboards. It ensures developers can efficiently monitor their applications through a graphical interface that relies on Node-RED. This flow-based programming tool enables users to create complex data representations with no coding at all. It will allow them to easily debug their software and analyze behaviors without disrupting an existing codebase. Additionally, users can share their dashboards on the Node-RED and ST communities to build on one another.
To make the first experience with STM32CubeMonitor more intuitive, the ST Wiki explains in detail how developers can monitor a variable within an application in just two straightforward steps. Users select the start address of the data they are tracking in memory and its type. To assist in this task, we have a guide showing how to get addresses from ELF files. The interface then asks the user to select an STLINK probe.
A Runtime Monitoring Utility Based on Node-RED
Keeping track of registers, variables in memory interrupts, and the myriad of events that take place at any given moment is daunting. Hence, manually monitoring them is so demanding that teams often do not have the resources for this endeavor. STM32CubeMonitor offers a solution to this problem and relies on Node-RED to keep things as simple as possible. Users drag and drop graphical representations of a program’s element onto a canvas to create a flow, meaning a sequence of events. For instance, conditions can trigger modules that send alerts by email or push data to a cloud platform using MQTT.
Without entering a single line of code, users can create graphs, chart plots, or generate gauges that will help them visualize values in a counter, data from a sensor, and many other aspects of an application. Additionally, the presence of a web server means that it’s possible to use these visualizations on any PC or mobile browser, whether on the local network or remotely. Moreover, thanks to the Node-RED and ST community, users can start by simply looking at dashboards from other users and organically learn by studying other people’s examples.
A Support Tool Throughout the Life Cycle of a Product
During the prototyping phase, engineers will likely use an STLINK probe, such as one of the STLINK-V3 modules currently available. It connects the MCU board to the PC, which will help set up the STM32CubeMonitor Dashboard and act as a gateway for the web interface. When designers are ready to ship their final product, they can also create a software routine that will send data to a USB port using UART. Developers can thus still monitor their application securely by using a computer with STM32CubeMonitor connected to that USB port. As a result, the tool provides a long-term analysis that will help plan upgrades or upcoming features.
What’s New in STM32CubeMonitor?
Node-RED 1.3.7 Support
STM32CubeMonitor 1.3.0 uses the NodeRED 1.3.7 framework, currently the latest 1.3 version. Released last April, the 1.3 version brought a new plugin framework and the ability to execute function nodes automatically. The updates to the Change/Switch nodes also improved their readability. The OpenJS Foundation will launch a new version of Node-RED in 2022. ST will continue to keep updating STM32CubeMonitor and will report significant changes in our integration of the programming tool in this blog post.
New Format and Symbol Change Notification
The latest version of STM32CubeMonitor brings the ability to export data in CSV instead of simply using a proprietary format. As a result, users will be able to import the information into Excel, MATLAB, and others, opening the door to more data optimization and manipulation. The new software will also throw a notification if symbols change. Put simply, the utility tracks variables by defining them in a file and associating them with a symbol. However, recompiling code may render the symbols’ file obsolete, creating a discrepancy with the Node-RED dashboard. The new STM32CubeMonitor will alert users if they forget to update the symbols’ file.
What Is STM32CubeMonitor-RF?
STM32CubeMonitor-RF is a tool that tests the Bluetooth and 802.15.4 radio performance of STM32WB microcontrollers. The graphical user interface helps visualize signal strength and packet errors over time, while a command-line interface opens the door to macros, batch files, and other types of automation. Put simply, it draws from the same philosophy as the traditional STM32CubeMonitor but specializes in radio performance. Hence, developers can rapidly test their design and potentially spot issues. The utility can also sniff 802.15.4 communications between devices. The easiest way to try the utility is to connect an STM32WB development board to a computer and use its USB or UART interface.
What’s New in STM32CubeMonitor-RF?
STM32CubeMonitor-RF 2.8.0 is a significant update that more than doubles over-the-air performances thanks to larger data packets. When users select the “Optimize MTU size” option in the “OTA Updater”, the software tool increases OTA transfers from 16 kbit/s to 41 kbit/s. It is, therefore, an essential quality of life improvement for developers. Sending files or updating a device’s firmware are everyday operations during development. The faster speeds will ensure developers work faster and more efficiently.
What Is STM32CubeMonitor-UCPD?
STM32CubeMonitor-UCPD monitors and helps set up USB-C and Power Delivery systems on STM32 microcontrollers running the ST USB PD stack. Developers can use the tool to monitor interactions on the USB-C interface, use sink or source power profiles, and use vendor-defined messages (VDM). The tool even has predefined settings to facilitate and hasten developments by handling many of the complexities inherent to these new technologies. STM32CubeMonitor-UCPD was integral to the launch of ST’s USB-C Power Delivery ecosystem in 2019. Since then, we’ve continued to improve the software to help developers gauge performance and obtain certifications faster.
What’s New in STM32CubeMonitor-UCPD?
One of the most significant additions to STM32CubeMonitor-UCPD 1.2.0 is the integration of the Java machine. Like the other tools in this blog post, the utility has everything needed in the installer. Users no longer need to install Java themselves before running the application. Additionally, users can now display traces for the voltage and current bus, VDM, UCSI, and more. The new STM32CubeMonitor-UCPD also monitors electrical values from the battery. Hence, developers can track more processes and understand what is happening when connecting two USB-C devices or using Power Delivery.