on
2021-11-30
01:34 AM
- edited on
2024-06-04
06:18 AM
by
Laurids_PETERSE
It is very common to need to port an existing embedded design from one STM32 microcontroller part number to another when application requirements change (for example, Flash, SRAM, GPIO, or peripherals). This is something that can be done easily using the STM32CubeMX tool. In this article we will see how we can switch from one STM32 to another using STM32CubeMX.
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. To do this, we will first create a project (ioc file) for an STM32F407 and then open it with STM32CubeMX to do the conversion. As you will see the steps are easy to follow making the switch an easy task for engineers. Let’s look at how to do the switch using our STM32CubeMX.
First, create a Project for a STM32F407VGTx
Open STM32CubeMX
Build the Configuration for the STM32F407:
Now let’s create our project by adding some peripherals and associated configuration.
For example, add 2 ADC channels:
We will also add a Timer PWM output channel:
Let’s also add I2C communication:
Add a few GPIOs:
One GPIO output: PD4
One GPIO input: PD15
One EXTI (external interrupt) on PA7:
Let’s save this example configuration and name it STM32F407_Project_V1.
Now we will load a project configuration on an STM32 of the same series.
Switch to another STM32
We will create a New Project: File -> New project
Now we will select an STM32 belonging to the same Series (STM32F4). As an example, you can select the STM32F429ZITx.
Now we will import our previous Project: Project - > Import
Browse the project we previously created for the STM32F407:
A window like this will be displayed:
A message indicates that the MCU (STM32F407VGTx) found in the Project being imported is not the same as the MCU (STM32F429ZITx) currently edited. First, we will click on Try Import button and see the status of the import operation.
The tool returns that the importing project is completed.
Now click on OK to import the project.
You will see some pop-up windows indicating if the Project has been successfully imported and that is the case in our example:
We have now completed the import of the configuration for the STM32F407 to the STM32F429:
STM32CubeMX - STM32Cube initialization code generator - STMicroelectronics
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
Project Import failed: Import 'STM32H747AIIx' not supported (multiple context)