cancel
Showing results for 
Search instead for 
Did you mean: 

How to export a project configuration to a compatible STM32

ST AME Support NF
ST Employee

Introduction

When a specific STM32 part number selected for a project is not available in the desired time frame, it is essential to find a compatible alternative. This article guides you through the process of using STM32CubeMX to identify and configure a compatible STM32, ensuring the continuity and success of your project.

1. Prerequisite

Software:  STM32CubeMX version 6.14.1

2. Configuration and compatibility with STM32CubeMX

To begin, an STM32CubeMX project is created for a specific microcontroller, such as the STM32G031F4. Once the project is initialized, we add the necessary configurations to our application. Then, we explore the available options to identify which other STM32 part numbers are compatible with these configurations by following these steps:

  • Step 1: Open STM32CubeMX and click on the [ACCESS TO MCU SELECTOR] button.

ELABI1_0-1749744936704.png

  • Step 2: Enter the part number that you want to work on in the “Commercial Part Number” field (in this example we work on the STM32G031F4P3), select it, and then click on [Start Project].

ELABI1_1-1749744936710.png

A window opens as shown in the screenshot below:

ELABI1_2-1749744936718.jpeg

Let's add some peripherals and their associated configurations to our project. For example, we are going to add “SPI” to our project:

  • Step 3: Click on the [Connectivity] button, select SPI1, and then choose the mode: [Full-Duplex Master.]

ELABI1_3-1749744936726.png

We can also add “UART“ to our project:

  • Step 4: Click on the [Connectivity] button, select USART1, and then choose the mode: [Asynchronous].

ELABI1_4-1749744936733.png

Now, let us save this example configuration:

  • Step 5: Click on the [File] button located at the top and select [Save Project] with the name STM32G031F4_Project_V1.

ELABI1_5-1749744936746.png

Now, we will look for compatible STM32 for this project:

  • Step 6: Under the [Pinout] button select [List Pinout Compatible MCUs].

ELABI1_6-1749744936757.png

A window opens, displaying the list of STM32 part numbers that are fully compatible. They are shown in blue with the comment “Full Compatible”. Additionally, it displays others that are partially compatible and require certain hardware modifications, shown in yellow with the comment “Need HW change”. See the screenshot below for reference:

ELABI1_7-1749744936770.jpeg

For the “Need HW change” section, if you need to know what needs to be changed for a particular STM32 part number, place your mouse cursor over the desired part number. Check the popup message that explains the differences.

For example, for the STM31F038F6Px, here is the popup that appears:

ELABI1_8-1749744936775.png

You can adjust the search by enabling or disabling options regarding:

  • Pinning Status: x to ignore pin status (locked pins)
  • Power Pins: to consider or not the power pins
  • System Pins: to consider or not the system pins

ELABI1_9-1749744936782.png

Now, we continue our project:

  • Step 7: Select the STM32 part number that you wish to work on and click on the [Ok, Import] button. For example, we choose the STM32G051F8Px.

ELABI1_10-1749744936788.png

The configuration is imported automatically, and we now have our project configuration transferred to a fully compatible STM32 part number:

ELABI1_11-1749744936796.png

Note: We can also see the list of compatible STM32 MCUs by clicking on the Compatible MCUs' button located below.

If you want to load the current configuration again to another STM32, just double-click on one of the STM32 part numbers from the list.

ELABI1_12-1749744936802.png

Conclusion

This article demonstrates how STM32CubeMX simplifies the process of finding and configuring a compatible STM32 microcontroller, ensuring project continuity with minimal effort. By following the steps outlined, you can efficiently adapt your configuration to an alternative STM32 part number while maintaining project integrity.

Version history
Last update:
‎2025-07-14 7:23 AM
Updated by: