cancel
Showing results for 
Search instead for 
Did you mean: 

How to switch from one STM32 to another using STM32CubeMX

ST AME Support NF
ST Employee

Introduction

In the field of embedded systems, it is very common to migrate an existing design from one STM32 microcontroller to another in response to changing application requirements. These changes can be dependent on, for example, flash memory, SRAM, GPIO count, or peripheral features. Fortunately, this transition can be performed easily and efficiently using the STM32CubeMX tool. In this article, we guide you step by step on how to migrate from one STM32 microcontroller to another using STM32CubeMX.

1. Prerequisite

Software: STM32CubeMX version 6.14.1

2. Understanding the theory behind the switch

The STM32CubeMX tool permits opening a project from another STM32 part number in the same family. For example, you can open a project created for an STM32F407 with an STM32F429 part number. This allows for easy migration from one part number to another within the same STM32 family. In this article, we guide you step by step on how to perform this migration.

3. Steps

To begin, we create a project with the STM32F407VGTx:

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

ELABI1_0-1749745179161.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 STM32F407VGTx. Select it, and then click on [Start Project].

ELABI1_1-1749745179167.png

A window opens as shown in the screenshot below:

ELABI1_2-1749745179177.png

Add some peripherals and their associated configurations to our project. For example, we can add two ADC channels:

  • Step 3: Click on the [Analog] button, select ADC1, and select “IN0” and “IN1”.

ELABI1_3-1749745179187.png

We also add a timer with a PWM output channel:

  • Step 4: Click on the Timers button, select TIM2, choose “PWR Generation CH1” for the Channel1 field.

ELABI1_4-1749745179196.png

Let us also add I2C communication:

  • Step 5: Click on the [Connectivitybutton, select I2C1, choose “I2C" for I2C field.

ELABI1_5-1749745179207.png

 

  • Step 6: Add a few GPIOs.

GPIO output: Click on PD4 and choose “GPIO_Output

ELABI1_6-1749745179211.png

GPIO input: Click on PD15 and choose “GPIO_Input

ELABI1_7-1749745179214.png

EXTI (external interrupt): Click on PA7 and choose “GPIO_EXTI7

ELABI1_8-1749745179219.png

Now, let us save this example configuration:

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

ELABI1_9-1749745179230.png

We switch and load the project configuration onto another STM32 of the same series:

  • Step 8: Create a new project by clicking on the [File] button located at the top and select [New Project].

 

ELABI1_10-1749745179232.png

We select an STM32 belonging to the same series (STM32F4). As an example, you can select the STM32F429ZITx:

  • Step 9: Enter the part number that you want to work on in the Commercial Part Number field. In this example we work on the STM32F429ZITx, select it, and then click on [Start Project].

ELABI1_11-1749745179238.png

A window opens as shown in the screenshot below:

ELABI1_12-1749745179246.png

Now, we import our previous project:

  • Step 10: Click on the [File] button located at the top and select [Import Project]:

ELABI1_13-1749745179255.png

A window opens as shown in the screenshot below:

ELABI1_14-1749745179260.png

  • Step 11: Locate the project we previously created for the STM32F407 by clicking on the three dots located at the top, selecting the project, and click [Open].

ELABI1_15-1749745179268.png

A window opens as shown in the screenshot below which contains an important remark:

ELABI1_16-1749745179272.png

This message indicates that the MCU (STM32F407VGTx) found in the project being imported is not the same as the MCU (STM32F429ZITx) currently edited.

  • Step 12: Click on the [Try Import] button and see the status of the import operation.

ELABI1_17-1749745179275.png

The tool returns that the importing project is completed as shown in the screenshot:

ELABI1_18-1749745179278.png

  • Step 13: Now, click on [OK] to import the project.

ELABI1_19-1749745179281.png

A pop-up is displayed indicating that the project has been successfully imported:

ELABI1_20-1749745179282.png

We have now completed the import of the configuration for the STM32F407 to the STM32F429:

ELABI1_21-1749745179287.png

Conclusion

Migrate from one STM32 to another using STM32CubeMX is simple and fast. By following these steps, you can easily transfer your configurations without starting from scratch, saving both time and effort.

Comments
Tajwar.Chandel
Associate III

Hi,

I am also working on the STM32H743ZI2 board. Can you please help to provide the IOC file of ethernet default code for the same.

This will very beneficial to us to move ahead.

Regards,

Tajwar

ACaru.1
Associate II

Project Import failed: Import 'STM32H747AIIx' not supported (multiple context)

Version history
Last update:
‎2025-08-06 4:42 AM
Updated by: