To improve the accessibility of our content, please find the audio version of this blog post.
OpenSTLinux is an open-source Linux distribution for ￼STM32 microprocessors. The OS helps engineering teams prototype faster and reduce their time to market. It thus serves as a unique support tool while also contributing to the open-source community. Too often, teams treat Tux as a magic bullet that will solve all their software needs. However, going from concept to mass market requires a lot more than a kernel, especially on embedded systems. Hence, choosing the right distribution and platform is critical. To assist professionals facing this challenge, we list seven fundamental questions to answer before starting a project. These interrogations will also help decision-makers evaluate their needs and decide what embedded Linux distribution is right for them. Indeed, they represent guidelines for developers aiming to reduce significant frictions during the development process.
As we saw in the ten commandments of working with an MPU that we published earlier this year, working with microprocessors and embedded Linux can get uniquely complex. To help deal with this complexity, we came up with OpenSTLinux, a mainlined open-source distribution. It comprises a board support package (BSP), a kernel, drivers, a secure boot chain, a secure OS, and application frameworks. The challenge for developers, whether they come from the MCU world, or are familiar with MPUs, is to figure out what solution will work best for their projects. Hence, the following questions serve as a preparatory survey for teams evaluating their needs.
OpenSTLinux and Its Contributions
1. What Does the Embedded Linux Distribution Bring to the Developers?
As is customary, OpenSTLinux offers a board support package and an application framework for STM32MP1 microprocessors. The BSP includes the kernel space with low-level drivers. It also holds a TF-A and U-Boot boot chain, the OP-TEE secure OS for secure systems, and the Linux kernel for non-secure environments. Traditionally, many in the industry just stop at the BSP. When that happens, developers must spend considerable time hunting for the proper middleware. ST adopted a different philosophy. To help engineers write applications faster, OpenSTLinux also offers software packages in the user space. Sitting on top of the kernel space, it provides middleware for power management or specific network protocol, among many others. We decided to go beyond the kernel space to ensure developers could choose drivers more rapidly and benefit from software optimizations.
2. What Does the Embedded Linux Distribution Bring to Projects?
Embedded Linux is unique in many ways, one of which is the need to create a custom distribution. Unlike Linux on PC, slapping a general-purpose distribution is out of the question. The mainlined OpenSTLinux distribution serves as the foundation for the embedded system’s custom distribution. However, obtaining a dedicated distribution is one of the most complex phases of development. To ensure developers can do their best work as fast as possible, we worked with the Yocto Project. Yocto is the de facto creation tool for custom embedded Linux distribution in industrial settings. Working closely with the Yocto project can thus ensure that teams get the support and resources they need for their project.
Members of the ST Partner Program also provide invaluable assistance. For instance, Bootlin can offer training services to teams working on Yocto Project or Buildroot. Many developers often prefer the latter when project requirements aren’t as stringent as industrial applications. Either way, Bootlin can help engineers get started rapidly. Similarly, Pengutronix, , and Witekio take care of the bootloader, kernel, user space, and more, so teams can focus on their features. Hence, OpenSTLinux is more than a simple operating system. It’s one piece of a vast ecosystem that carries a project to the finish line.
3. What Does the Embedded Linux Distribution Bring to the Open-Source Community?
Out of all the companies that released an embedded Linux package, many hesitate to extensively work with the open-source community, which can lead to various problems. For example, it can restrict support for a piece of hardware, or it can mean that a security exploit remains unnoticed. As a result, it increases maintenance costs and lowers code quality. A genuinely essential contribution that hardware vendors can make is upstreaming their drivers. It’s a process where manufacturers upload their open-source drivers to make them part of the main Linux codebase. However, it can take months, if not more than a year, for the community to approve some of them. Companies may also have to revise significant portions of their submission or work on optimizations.
Upstreaming is so essential, and too often so unpopular, that the Linux foundation tried to address the issue. A blog post on Linux.com showed how to convince managers that upstreaming was in their “best interest”. ST committed to working with the open-source community closely, and for the past three years, we’ve upstreamed as much of our drivers as possible. We also created one of the largest internal Linux development teams in our industry. Today, about 95% of the drivers for the STM32MP1 are in the main Linux codebase. Working with the community also ensures that we continue to improve our solutions. Applications will receive greater support over a longer period than traditional drivers. Similarly, developers can take advantage of standardized APIs while users receive security patches faster. Hence, ST can guarantee a greater level of quality thanks to our commitment to the Linux community.
OpenSTLinux and Its Support
4. Does the Embedded Linux Distribution Have a Strong Support System From Its Vendor and a Dedicated Community?
Companies choosing an embedded Linux distribution must take support operations into account. Traditionally, vendors maintain the current LTS kernel, meaning that they add features and release bug fixes. Hence, when a new kernel comes out, manufacturers may not support the latest drivers on a previous release. Engineers must, therefore, use a third party to continue supporting an older kernel in use in their application.
If this is pretty standard practice, it can get cumbersome. Embedded developers often start a project on a previous LTS kernel version, unlike PC developers that tend to favor the latest releases. It might even be advantageous for an embedded system to use a prior kernel if it means engineers can reuse past work. Unfortunately, if a vendor no longer supports the previous LTS kernel version, teams may have to begin a project on the latest release. Programmers must, as a result, write more code, thus further delaying their release to market.
ST solves this issue by systematically supporting the current and the previous LTS kernel. As a result, teams have much greater flexibility. Developers may be more confident to start a project on an earlier kernel to hasten developments. Additionally, the STM32 MPU Community is a great place to ask questions about OpenSTLinux. Take, for instance, this ST community member that had an issue with building its Linux kernel. In a matter of hours, an ST employee replied with a few tips, and another community member chimed in with additional recommendations. We also offer an extensive Wiki that will help developers get started. And we provide workshops as well as other webinars to assist engineers.
5. Does the Vendor of the Embedded Linux Distribution Offer Security Features?
Securing an embedded system is as complicated as it is critical. Engineers know that hackers can damage their brand, hurt users, and potentially steal essential intellectual properties. However, without the support of the manufacturer responsible for the embedded Linux distribution, developers must do everything themselves. It can, thus, lead to delays and massive investments.
To ensure teams don’t have to go through that, we offer a series of security solutions. For instance, STM32Trust provides tools that help developers implement secure firmware updates or secure boot. We also have packages to take advantage of secure firmware and secure module installations. Both can protect companies from IP theft during production. Finally, OpenSTLinux relies on hardware units in the STM32MP1, such as those accelerating AES 256 encryption and decryption operations.
OpenSTLinux and an STM32MP1 also means developers can rapidly use a secure boot chain based on Arm Trusted Firmware (TF-A). They can then launch an Open portable Trusted Execution Environment (OP-TEE). OP-TEE is special for ST because we originally wrote the Secure OS and backported it to Arm v7 before handing it to Linaro, a member of the ST Partner Program. Ultimately, our focus was to protect all levels of an embedded system.
6. Does the Vendor of the Embedded Linux Distribution Offer Software to Extend Features?
Engineers that are new to Embedded Linux may underestimate the work that goes into writing an application. Regardless of the distribution, it is just that, and there’s a long road ahead before developers ship a working program. Hence, we offer expansion packages to help teams get their proof-of-concepts working faster. For instance, X-LINUX-AI contains a framework and application examples for computer vision demos. Similarly, X-LINUX-PREDMNT will jumpstart predictive maintenance and condition monitoring applications. The latter package includes the AWS IoT Greengrass Edge Computing service and uses the STM32MP1 to set up a gateway. The software also works with WireST-SDK and EdgeST-SDK to facilitate the creation of edge computing systems.
ST will enable its partners and customers to offer their expansion packages. Similar to Yocto recipes, these software tools will assist developers looking to quickly release an application.
- To see how developers use our STM32MP1 as a gateway for AWS cloud services, check out Condition Monitoring and Predictive Maintenance: Solutions to Send Your First Sensor Data Faster.￼
- We showed a demo from X-LINUX-AI during the XR Day Conference. To learn more about the hardware we used check out: XR Day Live! Follow the Event That’s Shaping What We’ll Wear on Our Heads.￼
7. Does the Vendor of the Embedded Linux Distribution Offer Packages for Rapid Prototyping?
OpenSTLinux offers three packages. STM32MP1Starter is the quickest way to launch demos and try our development boards. It includes multiple firmware examples and tools to install our Linux image. Once developers wish to start writing a proof-of-concept or prototyping, they can move onto STM32MP1Dev, which includes a software development kit. Finally, STM32MP1Distrib offers OpenSTLinux Board Support Package (BSP). It enables teams to create a custom distribution that resembles the Starter or Developers Package.
- Check out the training sessions we put online: VIDEO: STM32MP1 Workshop or How to Appreciate the Complexities of MPU Design.
The next step for many engineers is often the hardest: starting the actual project. Once teams evaluate their needs and answer these seven questions, planning a roadmap can be daunting. It’s the reason why we made sure that OpenSTLinux would be an integral part of the ST ecosystem. We strived to make the OS a great contributor to engineers as well as the open-source community. It is also rich in features that simplify developments, secure products, and reduce the time to market. However, because it lives within the ST portfolio, OpenSTLinux is more than the sum of its parts.
Developers familiar with STM32 MCUs can port MCU code and use an RTOS on the Cortex-M4 of the STM32MP1. Teams looking to build an interface can rely on the fact that Qt and are members of the ST Partner Program. Engineers can add shields to experiment with sensors, try out a sub-gigahertz protocol, or simply add new features that will differentiate them from the competition. And we offer software tools to facilitate the creation of custom PCBs. Ultimately OpenSTLinux, and the rest of the ST ecosystem, offer a holistic approach that strives to demystify developments so engineers don’t ask how they can come up with a design, but what they can do for their customers.