English
Language : 

AN4088 Datasheet, PDF (40/71 Pages) STMicroelectronics – Migrating between STM32F1 and STM32F0 series microcontrollers
Firmware migration using the library
4
Firmware migration using the library
AN4088
Note:
This section describes how to migrate an application based on STM32F1xx Standard
Peripherals Library in order to use the STM32F0xx Standard Peripherals Library.
The STM32F1xx and STM32F0xx libraries have the same architecture and are CMSIS
compliant; they use the same driver naming and the same APIs for all compatible
peripherals.
Only a few peripheral drivers need to be updated to migrate the application from an
STM32F1 series to an STM32F0 series product.
In the rest of this chapter (unless otherwise specified), the term “STM32F0xx Library” is
used to refer to the STM32F0xx Standard Peripherals Library, and the term “STM32F10x
Library” is used to refer to the STM32F10x Standard Peripherals Library.
4.1
Note:
Migration steps
To update your application code to run on STM32F0xx Library, you have to follow the steps
listed below:
1. Update the toolchain startup files
a) Project files: device connections and Flash memory loader. These files are
provided with the latest version of your toolchain that supports STM32F0xxx
devices. For more information, please refer to your toolchain documentation.
b) Linker configuration and vector table location files: these files are developed
following the CMSIS standard and are included in the STM32F0xx Library install
package under the following directory: Libraries\CMSIS\Device\ST\STM32F0xx.
2. Add STM32F0xx Library source files to the application sources
a) Replace the stm32f10x_conf.h file of your application with stm32f0xx_conf.h
provided in STM32F0xx Library.
b) Replace the existing stm32f10x_it.c/stm32f10x_it.h files in your application with
stm32f0xx_it.c/Stm32f0xx_it.h provided in STM32F0xx Library.
3. Update the part of your application code that uses the RCC, PWR, GPIO, FLASH, ADC
and RTC drivers. Further details are provided in the next section.
The STM32F0xx Library comes with a rich set of examples (67 in total) demonstrating how
to use the different peripherals (under Project\STM32F0xx_StdPeriph_Examples\).
4.2
RCC driver
1. System clock configuration: as presented in section 3.4: Reset and clock controller
(RCC) interface, the STM32F0 and STM32F1 series have the same clock sources and
configuration procedures. However, there are some differences related to the product
voltage range, PLL configuration, maximum frequency and Flash wait state
configuration. Thanks to the CMSIS layer, these differences are hidden from the
application code; you only have to replace the system_stm32f10x.c file by
system_stm32f0xx.c file. This file provides an implementation of SystemInit() function
40/71
DocID023072 Rev 3