Migration tips and tricks from one family of STM32 to another family of STM32

If you like it, share it

Thanks to Cube Library (HAL/LL) and the STM32 ecosystem is easy transfer a project from an STM32 family to another one.
STM has released some Application Note that help us to do this.
To find this AN, search on STM website the sentence:
Migrating from <STM32 family name>

Below there are some links, is not an exhaustive list, please search directly on STM website.

  • AN4228 – Migrating from STM32F1 Series to STM32F3 Series
  • AN3427 – Migrating from STM32F1 Series to STM32F2 Series
  • AN4904 – Migrating from STM32F1 Series to STM32F4 Series
  • AN4649 – Migrating from STM32F1 Series to STM32L4 Series
  • AN5145 – Migration of applications from STM32F0 Series to STM32G0 Series
  • AN4617 – Migrating between STM32F0 and STM32L0 Series
  • AN4660 – Migrating from STM32F4 to STM32F7 Series
  • AN4936 – Migrating from STM32F7 to STM32H743/753 Series
  • AN5293 – Migrating from STM32F7 and STM32H743/753 to STM32H7A3/7B3 and STM32H7B0 Series
  • AN4612 – Migrating from STM32L1 Series to STM32L4 and STM32L4+ Series

Apart the differences from one STM32 family and other, please take care at the IDE (compiler) that you use.
Normally in some compiler is easy because is necessary select the new STM32 that you need to traslate your SW and next chage the StartUp file and Interupt file.
In STM32CubeIDE is not possible change the name of STM32 in a project already developed. In this case is is necessary generate a new project where you select the same peripherals, next generate a project and transfert your routine from a previus project to this new one.
Below there is some quick explanation.

For KEIL see this video tutorial.
See also below where to change the STM32 name in your project.

For IAR the procedure is similar to KEIL.
See also below where to change the STM32 name in your project.

Standard Peripheral Libraries to STM32Cube Low-Layer APIs migration tool

If your old project use the: Standard Peripheral Libraries
to convert it in STM32Cube LL (Low-Layer APIs) try to use this STM tool (SPL2LL-Converter).