STM32Cube Software Libraries: New Features for MEMS Thanks to Major Upgrades

Internet of Things, Our products Leave a Comment

The software expansions X-CUBE-MEMS1 and X-CUBE-MEMSMIC1 have recently been updated to offer new features like real-time acoustic beamforming, or to improve how data from the motion sensors is processed. ST’s obsession with software could surprise those unfamiliar with the company’s history, but offering the industry’s leading MicroElectroMechanical Systems (MEMS), the most flexible power components, or some of the best Wi-Fi modules, like the SPWF04, is not enough when you strive to augment life. Hence, ST continuously releases new and improved software so engineers can efficiently take advantage of hardware features, powerful technologies, and the latest standards, to ensure they design better products faster.

The union of hardware and software is actually such an important part of ST’s DNA that it will hold its next Developers Conference on September 6 in Santa Clara, California. To prepare for this annual event, the Life.Augmented blog has reviewed some of the recent updates to STM32Cube software libraries. These are packages that contain Hardware Abstraction Layers (HAL), APIs, Real-Time Operating Systems, drivers, and even application examples with their source code, among many other things. This mix of low and high-level tools make a big difference in a developers’ experience. For instance, the three major ODE Function Packs we reviewed greatly optimize application creation, and X-CUBE for Bluetooth or sub-gigahertz networks facilitate the design of feature-rich devices for consumer and industrial markets. Today, we’ll look at libraries that make ST’s MEMS special.


The X-NUCLEO-IKS01A1 board (click to enlarge)

X-CUBE-MEMS1 is the ultimate package when it comes to developing an application revolving around ST’s sensors. It contains drivers and sample implementations for its thermometer-hygrometer (HTS221), barometer (LPS25HB, or LPS22HB), magnetometer (LIS3MDL, or LSM303AGR), or its system-in-package solutions combining a gyroscope, and an accelerometer (LSM6DS0, or LSM6DSL). There’s also a Unicleo application, which takes in data from the sensors and outputs it to a Graphical User Interface (GUI) that helps visualize results, to more effectively program applications. To quickly take advantage of the pre-built binaries, one can use the following stack (the first board on top):

New Motion Libraries

This software expansion pack received a huge upgrade as a lot of ODE libraries have now become available as middleware in the X-CUBE-MEMS1 project. One of the most popular examples is MotionFX, which we first saw in the FP-SNS-ALLMEMS1 STM32 ODE Function Pack. The library uses the data from multiple sensors and advanced algorithms to increase accuracy and performance, a process known as “sensor fusion.”

To help engineers master the library quicker, X-CUBE-MEMS1 also includes the application example entitled DataLogFusion (path ./Projects/Multi/Applications/), which shows how the software can estimate the device’s position by using its accelerometer, gyroscope, and magnetometer. As with all the other ST packs, source codes are freely available, and all the necessary files are already organized by toolchain, so importing them to an Integrated Development Environment (IDE) is stunningly simple. A single blog post can’t possibly delve into all the Motion libraries available in X-CUBE-MEMS1, but we strongly recommend you just download them and check them out for yourselves.


The X-NUCLEO-CCA02M1 board (click to enlarge)

As smart speakers and speech recognition are on everyone’s mind, X-CUBE-MEMSMIC1 becomes the one-stop solution to tackle complex audio problems. The expansion software package has the necessary tools to quickly work with the MP34DT01-M, an omnidirectional digital microphone that uses a capacitive sensing element. It also includes special drivers so the device can automatically function as an USB microphone, to immediately start audio streaming. Engineers can finally put together the stack listed below to work with the precompiled binaries (the first board listed is at the top):

Beamforming and Source Localization

X-CUBE-MEMSMIC1 just received two new libraries: Acoustic beamforming (AcousticBF), and Acoustic source localization (AcousticSL). The first one uses the sound recorded by two digital MEMS microphones and processes the signal using an algorithm, which can determine the particular direction in space of a source while rejecting the ambient noise. Such technology can ensure that the user’s voice is easily recognizable, even in a noisy environment. The library is also quite powerful because it allows engineers to tune the system to find the right balance between output quality and resource consumption. There are also numerous customizations options to adjust the output resolution to the noise level and other environmental factors.

AcousticSL works well with the two digital MEMS microphone soldered on the X-NUCLEO-CCA02M1, but users can also add two more, such as the STEVAL-MKI129V1, to increase accuracy. The library combines three Direction of Arrival (DOA) algorithms to estimate the angle at which the audio source is coming from. Depending on the number of microphones, the application will work on an 180º or 360º plane, and a series of parameters will help designers fine tune the resolution in accordance with the needs of their application.

To know more about STM32 Cube Expansion Software, please visit ST’s website.
We also encourage you to register for the ST Developers Conference 2017 while there are still spots available.