X-CUBE-MCSDK is our new STM32 Motor Control SDK with firmware (FW) libraries and a Graphical User Interface (GUI) for configuration. Designed for Permanent Magnet Synchronous Motors (PMSM) using FOC (Field-Oriented Control), it represents a radical shift from previous versions.
Our solutions for motor control are very diverse, and if we tend to write more about monolithic solutions, it’d be a mistake to forget our products for PMSM motors. However, in all cases, ST provides more than just components, but a complete ecosystem (hardware, software libraries with a graphical user interface for configuration, documentation, etc.) to help engineers bring their solution to market faster. One essential element of this ecosystem is our STM32 Motor Control SDK, now known as X-CUBE-MCSDK.
With roots going back all the way to 2002, the SDK offers libraries to help developers use our components better and design applications faster. For instance, the algorithms from ST will maximize efficiency and facilitate the implementation of critical features like on-the-fly startup for air conditioning fans, a single shunt for cost-effective solutions, flux weakening for washing machines, and a rotor’s angular position detection for sensorless applications. However, feedback from developers and our vision for motor control led us to take a different approach with the new X-CUBE-MCSDK.
Feature 1: A New FW Architecture
A significant advantage of the new SDK resides in the use of a different programming paradigm to ensure developers get a code that is a lot easier to customize and debug. Previously certain aspects of the SDK’s libraries used object-oriented concepts inherited from C++. We decided to rewrite them to something more approachable in C to simplify application development operations. For example, the new X-CUBE-MCSDK no longer casts some expressions to void, a popular method in C++ to suppress compiler warning, but that tends to drastically complicate debugging operations. Porting libraries to C also helps optimize application as teams can more easily improve performance and efficiency. In addition, the FW architecture has been completely reshuffled and source files are drastically smaller, making FW solutions more readable and understandable by developers for smoother customization.
This major internal overhaul is accompanied by massive updates to the SDK’s libraries. Indeed, the previous version of the SDK was using older libraries that were no longer standard on STM32 MCUs. For a few years now, STM32Cube is the de facto solution for all developments on our microcontrollers. It offers Hardware Abstraction Layers (HAL), increases portability between STM32 MCUs, offers low-level APIs, drivers, and other Middleware components to make the ST ecosystem a lot more accessible and efficient. X-CUBE-MCSDK now relies on the same standard libraries so developers familiar with STM32Cube will have a much easier time with the code and could potentially reuse a more significant chunk of their application from one project to the next.
Feature 2: A More Flexible GUI
Aside from internal modifications that may not always be obvious at first glance, the new SDK now works in conjunction with STM32CubeMX. Indeed, X-CUBE-MCSDK still uses MC-Workbench, a graphical tool where engineers can enter their motor and sensors’ parameters to generate custom code for their setup. However, today’s version of the SDK enjoys a direct link with STM32CubeMX, something that was lacking in previous versions. Ultimately, this means that developers will first configure their application by selecting a pre-defined project in MC-Workbench (as they did on the previous version), but what’s new is that the system calls STM32CubeMX in the background to generate the code.
When developers want to change the preselected configuration, such as the STM32 part number, the pinout configuration, the clock configuration, or add peripherals for new communication interfaces, they can now use STM32CubeMX through MC-Workbench and generate a new code for their application. They also have the freedom to customize projects, add custom code (extra PID control loop, for instance) within tags put by STM32CubeMX, thus making it their own solution.
The ST Community is fond of the STM32CubeMX configuration tool because it uses STM32Cube libraries and an intuitive interface to quickly generate header files that complex design operations out of developers’ hands. Using a step-by-step process, it’s easy to configure pinouts, clock trees, and peripherals, as well as resolve conflicts, among other things. If designers working on a motor control application decide to use another MCU in the middle of their prototyping phase, they will merely need to open STM32CubeMX, and will much more quickly port the work that was done on the previous MCU. X-CUBE-MCSDK thus brings a new level of flexibility that wasn’t possible before.
A New Beginning for Our Motor Control SDK
This cursory review of X-CUBE-MCSDK’s new features shows how much work and efforts went into this massive upgrade that modernizes and optimizes our motor control libraries, while also making them more accessible and flexible. Motor control is dear to our hearts, and as we continue to build on the shoulders of our previous innovations, the journey of our new SDK is just beginning. Indeed, our teams are already working on the next updates. For instance, the workflow from MC-Workbench to STM32CubeMX is too unidirectional. Once STM32CubeMX changes the predefined configuration, it is not easy to go back to MC-Workbench to modify motor application parameters. Hence, we are looking into how we can make both tools collaborate better, so engineers can go back and forth. Ultimately, MC-Workbench will be integrated into STM32CubeMX.
Similarly, we will increase the number MCUs and products compatible with the new SDK to quickly match and even surpass the previous version. Although we know that we are not there yet, the fact that we now use more modern and more standard libraries is a guarantee that we can bring the SDK to more parts at a much faster pace than before. Finally, we are also working on Motor Control Suite, a tool that will centralize all documentation, firmware, application examples, and forum threads, etc. Hence, when teams select a particular motor type, they will immediately have access to everything they need to start their project, without having to hunt down multiple resources across different sites and domains.
Let us know what feature of the new version impresses you the most and stay tuned for the latest developments in our motor control ecosystem.