Introduction to STM32Cube Expansion Packages

Revision as of 08:11, 7 February 2024 by Registered User

Are you interested in contributing to the STM32Cube ecosystem by introducing your own embedded software solution to help STM32 developers? If so, we have an informative article that will guide you through the process of preparing a STM32Cube Expansion Package and becoming a ST Partner.

1. What is an STM32Cube Expansion ?

STM32Cube Expansion Packages are embedded software packages that complement the STM32Cube MCU Packages with additional software bricks, including specific drivers for external companion chips or application-specific middleware. They offer developers simplified implementations of real-world use cases in many application areas, such as sensing, power management, connectivity, and audio. They also contain preconfigured project examples for ST boards and supported IDEs to get started easily.
In addition to the packages provided and supported by ST, many partners contribute to enrich the STM32Cube ecosystem with their innovative solutions. They provide software based on STM32Cube HAL or LL drivers, leveraging STM32 hardware resources.
STM32 developers can evaluate ST partners solutions by accessing:

  • STM32Cube Demo: demo binaries to load and run them on their board,
  • STM32Cube Example Package: ready-to-use project example to load in their IDE,
  • STM32Cube Pack: software components to add (and possibly configure) in their STM32CubeMX tool project.
Figure 1: STM32Cube Expansion types


As an ST Partner, you will have the opportunity to expose one or several of your deliverables to STM32 developers for evaluation. This could include STM32Cube Demos and Example Packages, which are showcased on the www.st.com, or STM32Cube Packs, which are featured in the STM32CubeMX tool.

This article provides guidelines to ST partners or anyone aiming to prepare an STM32Cube Expansion.

Here is some general recommendations, considering developers needs:

  • To quickly identify which STM32 series is supported by Partners solutions.
  • To access clear and easy guidelines for getting started on STM32 board.
  • To get State of the Art implementation of STM32 hardware resources
  • To get Resources information (contact, support model, web site…).
  • To get a clear license model and an understandable path to production.
Figure 2 Common ground

2. How to prepare a STM32Cube Demo?

The objective is to provide an overview of partner solutions in terms of performance and functionality through a demo. This package provides a binary file format that developers can upload and run on a specific STM32 board thanks to STM32CubeProgrammer.

Figure 3: STM32Cube Demo


A Getting started document is recommended to describe all the steps to upload and run the demo.

3. How to prepare a STM32Cube Example Package?

The objective is to enable developers to evaluate your software in an STM32Cube environment through a project example. This package provides an example project in one IDE with your software components and an applicative code running on an STM32 board. Examples of IDE tools: STM32CubeIDE, IAR Embedded Workbench, Arm KEIL MDK, Microsoft Visual Studio Code...

A Getting started document is recommended to describe all the steps to upload and run the example project. Possible limitations should also be described.


3.1. Example from an IDE, without STM32CubeMX support

To create an example from and IDE (STM32CubeIDE, IAR Embedded Workbench, Arm KEIL MDK, Microsoft Visual Studio Code...) ,you shall :

  • Create a project in the selected IDE,
  • Add your software components and an applicative code running on an STM32 board.
Info white.png Information
The makefile and CMake are now supported in STM32CubeIDE.

You can then publish/share this project example in a zip file or in a GitHub repository.

3.2. Example with a configuration from STM32CubeMX

If you want to leverage STM32CubeMX tool to configure the STM32 pinout, clock and/or peripherals, you can:

  • Create a project in STM32CubeMX first,
  • Select a STM32 device according to your application,
  • Add your software component,
  • Generate a project including STM32 initialization code for your IDE,
  • Open the project in your IDE and add your applicative code running on an STM32 board.

You can then publish/share this project example in a zip file or in a GitHub repository. The .ioc file added by STM32CubeMX tool in your project files might be helpful for developers aiming to modify or customize the STM32CubeMX configuration of your project example.

3.3. Example if you have packaged your component as a CMSIS pack (following guidelines of section 5 below)

If you have packaged your software components in a STM32Cube Pack, you might load them in your STM32CubeMX project after having possibly configured the STM32 pinout, clock and/or peripherals (See 3.2)

4. How to prepare a STM32Cube pack?

Creating a STM32Cube pack enables STM32CubeMX users to configure your software components in the tool graphical user interface and automatically import them in their own newly-generated project. Your solution becomes available to any STM32 boards or STM32 devices (if compatible) for users starting a project from STM32CubeMX tool. Any software component is not adapted to the development of an STM32Cube Pack. Please refer to the Auto-assessment to prepare a STM32Cube pack paragraph.

4.1. A Standard CMSIS pack

Packaging your software components in a CMSIS pack allows developers to accelerate the integration while using development environments such as STM32CubeMX. You might refer to Open Cmsis Pack github to learn more about CMSIS standard.

ST provides a utility, STM32packCreator, to generate the .pdsc file, which contains meta data.

This utility is present in your STM32CubeMX install: YourLocation$\STMicroelectronics\STM32Cube\STM32CubeMX\utilities\STM32PackCreator directory. The methods to develop a CMSIS pack are explained in sections 4, 5.1 to 5.4 and 5.9 to 5.10 of the UM2739 user manual, accessible from the help menu of the STM32PackCreator or from st.com

4.2. A CMSIS pack with a configuration panel for STM32CubeMX

STM32CubeMX tool can optionally expose some configuration parameters for your software components. These parameters will appear in the configuration window of STM32CubeMX tool.

You can leverage this feature, by using the STM32packCreator utility, moving from CMSIS-Pack view to STM32CubeMX view. Refer to sections 5.5 and 5.6 of the UM2739 user manual.

4.3. A CMSIS pack with a configuration panel for STM32CubeMX, and source code generation

STM32CubeMX tool can optionally generate some customized source code as well, depending on some user parameters. Refer to section 5.7 of the UM2739 user manual.

4.4. STM32Cube Pack structure

The STM32Cube Expansion structure top level is the following:

Figure 4: STM32Cube Expansion folder structure


  • STM32CubeMX': generated by STM32PackCreator (available in STM32CubeMX panel Tools). It contains the files required by STM32CubeMX configure the software component.
  • Middlewares': contains your software component itself. Under ST subdirectories when coming from ST, under “Third_Party” when coming from your side or from a community.
  • Utilities: contains any PC software useful for your pack.
  • Documentation: contains the getting started and or any other documentation related to the package except the release note.

Other documents at the root of the package:

  • License.txt.contains the license terms. It is displayed during the installation process in STM32CubeMX tool
  • Release_Notes.html: contains information on the release such as goals, modified files, corrected bugs and limitation if any.

VendorName.CubeExpansionName.pdsc: the pdsc contains the description of the file included in the packages.


5. Going further

The following documents can be used as reference:

  • UM2739 STM32PackCreator user manual - Creating software packs and STM32Cube Expansion Packages enhanced for STM32CubeMX, rev1
  • UM2285 Development guidelines for STM32Cube Expansion Packages, rev2
  • UM2388 STM32Cube Firmware Packs Specification, rev1
  • UM2298 STM32Cube BSP drivers development guidelines, rev2
  • UM2312 Development checklist for STM32Cube Expansion Packages, rev5

6. Auto-assessment to prepare a STM32Cube pack

Any software component is not adapted to the development of an STM32Cube pack. Indeed, the possibility of configurations is huge and not covered completely by the tools. Some other methods may be feasible but are not considered in the normal flow. We refer to this list of questions to identify the right candidates. The questions must be taken in the generic understanding of the industry.

  • Is <My SW component> well structured?
  • If yes, move to the next question

My software is structured in functional units/components self-content from an architecture point of view.

  • Does <My SW component> have a standard build system?
  •  If yes, move to the next question

We exclude cases such as complex cases with different linker scripts, generating more than one binary file, if your software needs to dynamically adapt the run-time configuration. STM32CubeMX generates simple project structure (refer to the basic or advanced structure).

  • Am I ready to adapt my architecture to STM32Cube rules when interacting with STM32Cube components?
  •  If yes, move to the next question

STMicroelectronics has defined some rules to interact between STM32Cube components to guarantee coherency between software components. There is no impact on your own software component architecture but on the structure of the project (such as the location of your software component into the project itself, the location of the HAL drivers, the usage of STM32Cube API, and others).

  • Am I ready to add this delivery method on the long run?
  • If yes, move to the next question

We value working with partners and customers on the long run. The work related to the STM32Cube Expansion Package is valuable if you intend to upgrade it regularly with new versions of your software component. Therefore, the method could be done one time but needs to be thought on the long run.

  • <My SW component> is hardware agnostic.
  • Check the DSPDEMO STM32Cube Expansion sample training

Your software component has no relation with any hardware components (no peripherals of STM32Cube ecosystem offer). This video training and the associated I-Cube describe the creation of STM32Cube Expansion in a simple software component.

  • <My SW component> has some hardware relation with UART, I2C, SPI, GPIO
  • Check the Sequencer STM32Cube Expansion sample training

This video training and the associated I-Cube describe the creation of STM32Cube Expansion in a simple software component with the usage of GPIO.

  • <My SW component> has some hardware relation with timers
  • Take care: refer to STM32PackCreator limitation

Basic usage of timers is supported. Complex and advanced features are too complex to be implemented in our tools.

  • <My SW component> has some hardware relation with other peripherals than the ones mentioned above
  • Be cautious - check the STDIO STM32Cube Expansion sample training.