AN4088
AN4088
Application note
Migrating between STM32F1 and STM32F0 series microcontrollers
            Introduction
            For designers of STM32 microcontroller applications, it is important to be able to easily
            replace one microcontroller type by another within the same product family. One key
            advantage of STM32 microcontrollers is their simplified porting thanks to a strong focus on
            compatibility across the portfolio. Migrating an application to a different microcontroller is
            often needed to fulfill higher product requirements more demanding on memory size or with
            increased number of I/Os. Cost reduction is another reason for change to smaller
            components and shrunk PCB area.
            This application note is written to help users with the analysis of the steps required to
            migrate from an existing STM32F1 series device to an STM32F0 series device. It gathers
            the most important information and lists the mandatory aspects that users need to address.
            To migrate an application from STM32F1 series to STM32F0 series, users have to analyze
            the hardware migration, the peripheral migration and the firmware migration.
            To benefit fully from the information included in this application note, users should be
            familiar with the STM32 microcontroller family. Refer to the following documents available
            from www.st.com.
                STM32F1xx family reference manuals (RM0008 and RM0041), STM32F1xx product
                 datasheets, and STM32F1xx Flash programming manuals (PM0075, PM0063 and
                 PM0068).
                STM32F0xx family reference manuals (RM0091 and RM0360) and STM32F0xx
                 product datasheets.
            For an overview of the whole STM32 series and a comparison of the different features of
            each STM32 product series, please refer to AN3364 Migration and compatibility guidelines
            for STM32 microcontroller applications.
            Table 1 lists the microcontrollers and development tools addressed by this application note.
                                    STM32F0 series,
                Microcontroller
                                    STM32F1 series.
Note:       The following notational convention is used in the rest of the document:
            STM32F0xx is used instead of STM32F0xxxx when referring to products of STM32F0
            series, and STM32F1xx is used instead of STM32F1xxxx when referring to products of
            STM32F1 series.
Contents
3          Peripheral migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
           3.1      STM32 product cross-compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
           3.2      System architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
           3.3      Memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
           3.4      Reset and clock controller (RCC) interface . . . . . . . . . . . . . . . . . . . . . . . 14
           3.5      DMA interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
           3.6      Interrupt vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
           3.7      GPIO interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
           3.8      EXTI source selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
           3.9      Flash interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
           3.10     ADC interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
           3.11     PWR interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
           3.12     Real-time clock (RTC) interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
           3.13     SPI interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
           3.14     I2C interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
           3.15     USART interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
           3.16     CEC interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
           3.17     USB interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
List of tables
List of figures
           The way to select the boot mode on the STM32F0xx products differs from STM32F1xx
           product family. Instead of using two pins for the boot mode setting, STM32F0xx products
           use BOOT0 pin and retrieve the nBOOT1 value from an option bit located in the User option
           bytes at 0x1FFFF800 memory address.
           On the STM32F04x and STM32F09x devices the BOOT0 pin can be replaced by nBOOT0
           bit using the BOOT_SEL bit in the User option bytes. This provides the ability to use PF11
           GPIO on the device.
           Table 6 summarizes the different configurations available for the Boot mode selection.
Note: The BOOTx value is the opposite of the nBOOTx option bit, where x stands for 1 and 2.
3 Peripheral migration
             As shown in Table 7, there are three categories of peripherals. The common peripherals are
             supported with the dedicated firmware library without any modification, except if the
             peripheral instance is no longer present. You can change the instance and, of course, all the
             related features (clock configuration, pin configuration, interrupt/DMA request).
             The modified peripherals such as ADC, RCC and RTC are different from the STM32F1
             series ones and should be updated to take advantage of the enhancements and the new
             features in STM32F0 series.
             All these modified peripherals in the STM32F0 series are enhanced to obtain smaller silicon
             print with features designed to offer advanced high-end capabilities in economical end
             products and to fix some limitations present in the STM32F1 series.
Table 7. STM32 peripheral compatibility analysis, STM32F1 versus STM32F0 series(1) (continued)
                                                                 Compatibility
Peripheral   STM32F1 STM32F0
                                          Features                      Pinout          Firmware driver
Table 7. STM32 peripheral compatibility analysis, STM32F1 versus STM32F0 series(1) (continued)
                                                                     Compatibility
Peripheral      STM32F1 STM32F0
                                                   Features                 Pinout       Firmware driver
              Important modifications have been performed on the MCU organization too, starting by
              switching from a Harvard to Von Neumann architecture, decreasing the system complexity,
              or focusing on SW Debug in order to simplify this precise feature.
TSC                                           0x40024000            NA                    NA
CRC                                           0x40023000                            0x40023000
FLITF                       AHB1              0x40022000                            0x40022000
                                                                   AHB
RCC                                           0x40021000                            0x40021000
DMA1/DMA                                      0x40020000                            0x40020000
GPIOG                        NA                     NA                              0x40012000
GPIOF                                         0x48001400                            0x40011C00
GPIOE                                        0x4800 1000                            0x40011800
GPIOD                                        0x48000C00           APB2              0x40011400
                            AHB2
GPIOC                                         0x48000800                            0x40011000
GPIOB                                         0x48000400                           0x40010C00
GPIOA                                         0x48000000                            0x40010800
DBGMCU                                        0x40015800            NA                    NA
TIM17                                         0x40014800            NA                    NA
TIM16                                         0x40014400            NA                    NA
TIM15                                         0x40014000            NA                    NA
                            APB2
USART1                                        0x40013800                            0x40013800
SPI1 / I2S1                                   0x40013000                            0x40013000
TIM1                                         0x40012C00                            0x40012C00
                                                                  APB2
ADC / ADC1                                    0x40012400                            0x40012400
                        APB2 (through
EXTI                                          0x40010400                            0x40010400
                          SYSCFG)
SYSCFG + COMP               APB2              0x40010000            NA                    NA
   Table 8. IP bus mapping differences between STM32F0 and STM32F1 series(1) (continued)
                               STM32F0 series                        STM32F1 series
       Peripheral
                        Bus              Base address         Bus              Base address
      Table 8. IP bus mapping differences between STM32F0 and STM32F1 series(1) (continued)
                                       STM32F0 series                                      STM32F1 series
        Peripheral
                                 Bus                Base address                    Bus              Base address
CAN2                              NA                      NA                                          0x40006800
CAN1                              NA                      NA                                          0x40006400
UART5                             NA                      NA                                          0x40005000
SPI3/I2S3                         NA                      NA                                          0x40003C00
                                                                                    APB1
TIM13                             NA                      NA                                          0x40001C00
TIM12                             NA                      NA                                          0x40001800
TIM5                              NA                      NA                                          0x40000C00
BKP registers                     NA                      NA                                          0x40006C00
AFIO                              NA                      NA                        APB2              0x40010000
1. NA in table cells with gray shading = feature not available.
   STM32F0 series devices have only one APB bus, APB1 and APB2 indicate on which APB register the clock configuration
   bits of those peripherals are defined.
               In addition to the differences described in the table above, the following additional
               adaptation steps may be needed for the migration.
               1. System clock configuration: when moving from STM32F1 series to STM32F0 series,
                    only a few settings need to be updated in the system clock configuration code; mainly
                    the Flash settings (configure the right wait states for the system frequency, prefetch
                    enable/disable) or/and the PLL parameters configuration:
                    a) In case HSE or HSI is used directly as the system clock source, only the Flash
                         parameters should be modified.
                    b) In case PLL (clocked by HSE or HSI) is used as the system clock source, the
                         Flash parameters and PLL configuration need to be updated.
               Table 10 below provides an example of porting a system clock configuration from STM32F1
               to STM32F0 series:
                    –   STM32F100x value line running at maximum performance: system clock at
                        24 MHz (PLL, clocked by the HSE (8 MHz), used as the system clock source),
                        Flash with 0 wait states and Flash prefetch queue enabled.
                    –   STM32F0 series running at maximum performance: system clock at 48 MHz (PLL,
                        clocked by the HSE (8 MHz), used as the system clock source), Flash with 1 wait
                        state and Flash prefetch enabled.
               As shown in Table 10, only the Flash settings and PLL parameters (code in Bold Italic)
               need to be rewritten to run on STM32F0 series. However, HSE, AHB prescaler and the
               system clock source configuration are left unchanged, and APB prescalers are adapted to
               the maximum APB frequency in the STM32F0 series.
Note:    1     The source code presented in Table 10 is intentionally simplified (timeout in wait loop
               removed) and is based on the assumption that the RCC and Flash registers are at their
               reset values.
         2     For STM32F0xx, you can use the clock configuration tool,
               STM32F0xx_Clock_Configuration.xls, to generate a customized system_stm32f0xx.c file
  Table 10. Example of migrating system clock configuration code from STM32F1 to STM32F0
 STM32F100x Value Line running at 24 MHz (PLL as   STM32F0xx running at 48 MHz (PLL as clock source)
        clock source) with 0 wait states                           with 1 wait state
         2.   Peripheral access configuration: since the address mapping of some peripherals has
              been changed in STM32F0 series versus STM32F1 series, you need to use different
              registers to [enable/disable] or [enter/exit] the peripheral [clock] or [from reset mode].
         To configure the access to a given peripheral, you have first to know to which bus this
         peripheral is connected; refer to Table 8 then, depending on the action needed, program
         the right register as described in Table 11 above. For example, if USART1 is connected to
         the APB2 bus, to enable the USART1 clock you have to configure APB2ENR register as
         follows:
         RCC->APB2ENR |= RCC_APB2ENR_USART1EN;
        Table 12. DMA request differences between STM32F1 series and STM32F09x family(1)
      Peripheral       DMA request             STM32F1 series                STM32 F09x family
                                                                       DMA1_Channel1 /
ADC1 / ADC          ADC1 / ADC          DMA1_Channel1                  DMA1_Channel2 /
                                                                       DMA2_Channel5
ADC3                ADC3                DMA2_Channel5                  NA
                    DAC_Channel1 /      DMA2_Channel3 /                DMA1_Channel3 /
DAC
                    DAC                 DMA1_Channel3(*)               DMA2_Channel3
                                                                       DMA1_Channel2 /
                    SPI1_Rx             DMA1_Channel2                  DMA2_Channel3
SPI1
                    SPI1_Tx             DMA1_Channel3                  DMA1_Channel3 /
                                                                       DMA2_Channel4
                                                                       DMA1_Channel4 /
                    SPI2_Rx             DMA1_Channel4                  DMA1_Channel6
SPI2
                    SPI2_Tx             DMA1_Channel5                  DMA1_Channel5 /
                                                                       DMA1_Channel7
                    SPI3_Rx             DMA2_Channel1
SPI3                                                                   NA
                    SPI3_Tx             DMA2_Channel2
                    USART1_Rx           DMA1_Channel5                  DMA1_Channel1 /
USART1
                    USART1_Tx           DMA1_Channel4                  DMA1_Channel3 /
                                                                       DMA1_Channel1 /
                                                                       DMA1_Channel3 /
                                                                       DMA1_Channel5 /
                                                                       DMA1_Channel6 /
                                                                       DMA2_Channel2 /
                    USART2_Rx           DMA1_Channe6                   DMA2_Channel3
USART2
                    USART2_Tx           DMA1_Channel7                  DMA1_Channel2 /
                                                                       DMA1_Channel4 /
                                                                       DMA1_Channel7 /
                                                                       DMA2_Channel1 /
                                                                       DMA2_Channel4 /
                                                                       DMA2_Channel5
Table 12. DMA request differences between STM32F1 series and STM32F09x family(1) (continued)
    Peripheral      DMA request           STM32F1 series             STM32 F09x family
                                                                DMA1_Channel1 /
                                                                DMA1_Channel3 /
                                                                DMA1_Channel5 /
                                                                DMA1_Channel6 /
                                                                DMA2_Channel2 /
                  USART4_Rx        DMA2_Channel3                DMA2_Channel3
USART4
                  USART4_Tx        DMA2_Channel5                DMA1_Channel2 /
                                                                DMA1_Channel4 /
                                                                DMA1_Channel7 /
                                                                DMA2_Channel1 /
                                                                DMA2_Channel4 /
                                                                DMA2_Channel5
                                                                DMA1_Channel1 /
                                                                DMA1_Channel3 /
                                                                DMA1_Channel5 /
                                                                DMA1_Channel6 /
                                                                DMA2_Channel2 /
                  USART5_Rx        DMA2_Channe4                 DMA2_Channel3
USART5
                  USART5_Tx        DMA2_Channel1                DMA1_Channel2 /
                                                                DMA1_Channel4 /
                                                                DMA1_Channel7 /
                                                                DMA2_Channel1 /
                                                                DMA2_Channel4 /
                                                                DMA2_Channel5
                                                                DMA1_Channel1 /
                                                                DMA1_Channel3 /
                                                                DMA1_Channel5 /
                                                                DMA1_Channel6 /
                                                                DMA2_Channel2 /
                  USART6_Rx                                     DMA2_Channel3
USART6                             NA
                  USART6_Tx                                     DMA1_Channel2 /
                                                                DMA1_Channel4 /
                                                                DMA1_Channel7 /
                                                                DMA2_Channel1 /
                                                                DMA2_Channel4 /
                                                                DMA2_Channel5
                                                                DMA1_Channel1 /
                                                                DMA1_Channel3 /
                                                                DMA1_Channel5 /
                                                                DMA1_Channel6 /
                                                                DMA2_Channel2 /
                  USART7_Rx                                     DMA2_Channel3
USART7                             NA
                  USART7_Tx                                     DMA1_Channel2 /
                                                                DMA1_Channel4 /
                                                                DMA1_Channel7 /
                                                                DMA2_Channel1 /
                                                                DMA2_Channel4 /
                                                                DMA2_Channel5
Table 12. DMA request differences between STM32F1 series and STM32F09x family(1) (continued)
       Peripheral      DMA request         STM32F1 series            STM32 F09x family
                                                                DMA1_Channel1 /
                                                                DMA1_Channel3 /
                                                                DMA1_Channel5 /
                                                                DMA1_Channel6 /
                                                                DMA2_Channel2 /
                    USART8_Rx                                   DMA2_Channel3
USART8                               NA
                    USART8_Tx                                   DMA1_Channel2 /
                                                                DMA1_Channel4 /
                                                                DMA1_Channel7 /
                                                                DMA2_Channel1 /
                                                                DMA2_Channel4 /
                                                                DMA2_Channel5
                                                                DMA1_Channel3 /
                    I2C1_Rx          DMA1_Channe7               DMA1_Channel6
I2C1
                    I2C1_Tx          DMA1_Channel6              DMA1_Channel2 /
                                                                DMA1_Channel7
                    I2C2_Rx          DMA1_Channel5
I2C2                                                            NA
                    I2C2_Tx          DMA1_Channel4
SDIO                SDIO             DMA2_Channel4              NA
                                                                DMA1_Channel2
                    TIM2_UP          DMA1_Channel2              DMA1_Channel5
                    TIM2_CH1         DMA1_Channel5              DMA1_Channel3 /
TIM2                TIM2_CH2         DMA1_Channel7              DMA1_Channel7
                    TIM2_CH3         DMA1_Channel1              DMA1_Channel1
                    TIM2_CH4         DMA1_Channel7              DMA1_Channel4 /
                                                                DMA1_Channel7
Table 12. DMA request differences between STM32F1 series and STM32F09x family(1) (continued)
      Peripheral            DMA request                   STM32F1 series        STM32 F09x family
                         TIM4_UP                 DMA1_Channel7
                         TIM4_CH1                DMA1_Channel1
TIM4                                                                       NA
                         TIM4_CH2                DMA1_Channel4
                         TIM4_CH3                DMA1_Channel5
                         TIM5_UP                 DMA2_Channel2
                         TIM5_CH1                DMA2_Channel5
                         TIM5_CH2                DMA2_Channel4
TIM5                                                                       NA
                         TIM5_CH3                DMA2_Channel2
                         TIM5_CH4                DMA2_Channel1
                         TIM5_TRIG               DMA2_Channel1
                                                 DMA2_Channel3 /           DMA1_Channel3 /
TIM6                     TIM6_UP
                                                 DMA1_Channel3(*)          DMA2_Channel3
                                                 DMA2_Channe4 /            DMA1_Channel4 /
TIM7                     TIM7_UP
                                                 DMA1_Channel4 (*)         DMA2_Channel4
                         TIM15_UP                DMA1_Channel5             DMA1_Channel5
                         TIM15_CH1               DMA1_Channel5             DMA1_Channel5
TIM15
                         TIM15_TRIG              DMA1_Channel5             DMA1_Channel5
                         TIM15_COM               DMA1_Channel5             DMA1_Channel5
                                                                           DMA1_Channel3 /
                                                                           DMA1_Channel4 /
                         TIM16_UP                DMA1_Channel6             DMA1_Channel6
TIM16
                         TIM16_CH1               DMA1_Channel6             DMA1_Channel3 /
                                                                           DMA1_Channel4 /
                                                                           DMA1_Channel6
                                                                           DMA1_Channel1 /
                                                                           DMA1_Channel2 /
                         TIM17_UP                DMA1_Channel7             DMA1_Channel7
TIM17
                         TIM17_CH1               DMA1_Channel7             DMA1_Channel1 /
                                                                           DMA1_Channel2 /
                                                                           DMA1_Channel7
1. NA in table cells with gray shading means Not Applicable.
       Table 13. DMA request differences between STM32F1 series and STM32F07x family(1)
      Peripheral            DMA request                   STM32F1 series        STM32 F07x family
Table 13. DMA request differences between STM32F1 series and STM32F07x family(1) (continued)
       Peripheral      DMA request         STM32F1 series            STM32 F07x family
                    TIM8_UP          DMA2_Channel1
                    TIM8_CH1         DMA2_Channel3
                    TIM8_CH2         DMA2_Channel5
TIM8                TIM8_CH3         DMA2_Channel1              NA
                    TIM8_CH4         DMA2_Channel2
                    TIM8_TRIG        DMA2_Channel2
                    TIM8_COM         DMA2_Channel2
                    TIM2_UP          DMA1_Channel2              DMA_Channel2
                    TIM2_CH1         DMA1_Channel5              DMA_Channel5
TIM2                TIM2_CH2         DMA1_Channel7              DMA_Channel3 / DMA_Channel7
                    TIM2_CH3         DMA1_Channel1              DMA_Channel1
                    TIM2_CH4         DMA1_Channel7              DMA_Channel4 / DMA_Channel7
                    TIM3_UP          DMA1_Channel3              DMA_Channel3
                    TIM3_CH1         DMA1_Channel6              DMA_Channel4 / DMA_Channel6
TIM3                TIM3_TRIG        DMA1_Channel6              DMA_Channel4 / DMA_Channel6
                    TIM3_CH3         DMA1_Channel2              DMA_Channel2
                    TIM3_CH4         DMA1_Channel3              DMA_Channel3
Table 13. DMA request differences between STM32F1 series and STM32F07x family(1) (continued)
      Peripheral            DMA request                   STM32F1 series          STM32 F07x family
                         TIM4_UP                 DMA1_Channel7
                         TIM4_CH1                DMA1_Channel1
TIM4                                                                       NA
                         TIM4_CH2                DMA1_Channel4
                         TIM4_CH3                DMA1_Channel5
                         TIM5_UP                 DMA2_Channel2
                         TIM5_CH1                DMA2_Channel5
                         TIM5_CH2                DMA2_Channel4
TIM5                                                                       NA
                         TIM5_CH3                DMA2_Channel2
                         TIM5_CH4                DMA2_Channel1
                         TIM5_TRIG               DMA2_Channel1
                                                 DMA2_Channel3 /
TIM6                     TIM6_UP                                           DMA_Channel3
                                                 DMA1_Channel3(*)
                                                 DMA2_Channe4 /
TIM7                     TIM7_UP                                           DMA_Channel4
                                                 DMA1_Channel4 (*)
                         TIM15_UP                DMA1_Channel5             DMA_Channel5
                         TIM15_CH1               DMA1_Channel5             DMA_Channel5
TIM15
                         TIM15_TRIG              DMA1_Channel5             DMA_Channel5
                         TIM15_COM               DMA1_Channel5             DMA_Channel5
                                                                           DMA_Channel3 / DMA_Channel4
                         TIM16_UP                DMA1_Channel6             / DMA_Channel6
TIM16
                         TIM16_CH1               DMA1_Channel6             DMA_Channel3 / DMA_Channel4
                                                                           / DMA_Channel6
                                                                           DMA_Channel1 / DMA_Channel2
                         TIM17_UP                DMA1_Channel7             / DMA_Channel7
TIM17
                         TIM17_CH1               DMA1_Channel7             DMA_Channel1 / DMA_Channel2
                                                                           / DMA_Channel7
1. NA in table cells with gray shading means Not Applicable.
     Table 14. DMA request differences between STM32F1 series and STM32F05x/STM32F03x
                                           families(1)
                                                                                STM32 F05x/STM32F03x
      Peripheral            DMA request                   STM32F1 series
                                                                                       families
                                                                           DMA_Channel1
ADC1 / ADC               ADC1 / ADC              DMA1_Channel1
                                                                           DMA_Channel2
ADC3                     ADC3                    DMA2_Channel5             NA
                                                 DMA2_Channel3 /
                         DAC_Channel1 /
                                                 DMA1_Channel3(*)
DAC                      DAC                                               DMA_Channel3
                                                 DMA2_Channel4 /
                         DAC_Channel2
                                                 DMA1_Channel4(*)
                         SPI1_Rx                 DMA1_Channel2             DMA_Channel2
SPI1
                         SPI1_Tx                 DMA1_Channel3             DMA_Channel3
                         SPI2_Rx                 DMA1_Channel4             DMA_Channel4
SPI2
                         SPI2_Tx                 DMA1_Channel5             DMA_Channel5
                         SPI3_Rx                 DMA2_Channel1
SPI3                                                                       NA
                         SPI3_Tx                 DMA2_Channel2
    Table 14. DMA request differences between STM32F1 series and STM32F05x/STM32F03x
                                    families(1) (continued)
                                                                  STM32 F05x/STM32F03x
       Peripheral      DMA request         STM32F1 series
                                                                         families
                    TIM8_UP          DMA2_Channel1
                    TIM8_CH1         DMA2_Channel3
                    TIM8_CH2         DMA2_Channel5
TIM8                TIM8_CH3         DMA2_Channel1           NA
                    TIM8_CH4         DMA2_Channel2
                    TIM8_TRIG        DMA2_Channel2
                    TIM8_COM         DMA2_Channel2
                    TIM2_UP          DMA1_Channel2           DMA_Channel2
                    TIM2_CH1         DMA1_Channel5           DMA_Channel5
TIM2                TIM2_CH2         DMA1_Channel7           DMA_Channel3
                    TIM2_CH3         DMA1_Channel1           DMA_Channel1
                    TIM2_CH4         DMA1_Channel7           DMA_Channel4
                    TIM3_UP          DMA1_Channel3           DMA_Channel3
                    TIM3_CH1         DMA1_Channel6           DMA_Channel4
TIM3                TIM3_TRIG        DMA1_Channel6           DMA_Channel4
                    TIM3_CH3         DMA1_Channel2           DMA_Channel2
                    TIM3_CH4         DMA1_Channel3           DMA_Channel3
                    TIM4_UP          DMA1_Channel7
                    TIM4_CH1         DMA1_Channel1
TIM4                                                         NA
                    TIM4_CH2         DMA1_Channel4
                    TIM4_CH3         DMA1_Channel5
     Table 14. DMA request differences between STM32F1 series and STM32F05x/STM32F03x
                                     families(1) (continued)
                                                                                STM32 F05x/STM32F03x
      Peripheral            DMA request                   STM32F1 series
                                                                                       families
                         TIM5_UP                 DMA2_Channel2
                         TIM5_CH1                DMA2_Channel5
                         TIM5_CH2                DMA2_Channel4
TIM5                                                                       NA
                         TIM5_CH3                DMA2_Channel2
                         TIM5_CH4                DMA2_Channel1
                         TIM5_TRIG               DMA2_Channel1
                                                 DMA2_Channel3 /
TIM6                     TIM6_UP                                           DMA_Channel3
                                                 DMA1_Channel3(*)
                                                 DMA2_Channe4 /
TIM7                     TIM7_UP                                           NA
                                                 DMA1_Channel4 (*)
                         TIM15_UP                DMA1_Channel5             DMA_Channel5
                         TIM15_CH1               DMA1_Channel5             DMA_Channel5
TIM15
                         TIM15_TRIG              DMA1_Channel5             DMA_Channel5
                         TIM15_COM               DMA1_Channel5             DMA_Channel5
                         TIM16_UP                DMA1_Channel6             DMA_Channel3 / DMA_Channel4
TIM16
                         TIM16_CH1               DMA1_Channel6             DMA_Channel3 / DMA_Channel4
                         TIM17_UP                DMA1_Channel7             DMA_Channel1 / DMA_Channel2
TIM17
                         TIM17_CH1               DMA1_Channel7             DMA_Channel1 / DMA_Channel2
1. NA in table cells with gray shading means Not Applicable.
               Table 15. Interrupt vector differences between STM32F1 series and STM32F0
                                                  series(1)
             Position              STM32F1 series                       STM32F0 series
                0       WWDG                                 WWDG
                1       PVD                                  PVD_VDDIO2
                2       TAMPER                               RTC
                3       RTC                                  FLASH
                4       FLASH                                RCC_CRS
                5       RCC                                  EXTI0_1
                6       EXTI0                                EXTI2_3
                7       EXTI1                                EXTI4_15
                8       EXTI2                                TSC
                9       EXTI3                                DMA_CH1
                                                             DMA_CH2_3
                10      EXTI4
                                                             DMA2_CH1_2
                                                             DMA_CH4_5_6_7
                11      DMA1_Channel1
                                                             DMA2_CH3_4_5
                12      DMA1_Channel2                        ADC_COMP
                13      DMA1_Channel3                        TIM1_BRK_UP_TRG_COM
                14      DMA1_Channel4                        TIM1_CC
                15      DMA1_Channel5                        TIM2
                16      DMA1_Channel6                        TIM3
                17      DMA1_Channel7                        TIM6_DAC
                18      ADC1_2                               TIM7
                        CAN1_TX /
                19                                           TIM14
                        USB_HP_CAN_TX
                        CAN1_RX0 /
                20                                           TIM15
                        USB_LP_CAN_RX0
                21      CAN1_RX1                             TIM16
                22      CAN1_SCE                             TIM17
                23      EXTI9_5                              I2C1
                        TIM1_BRK /
                24                                           I2C2
                        TIM1_BRK _TIM9
           Table 15. Interrupt vector differences between STM32F1 series and STM32F0
                                         series(1) (continued)
         Position               STM32F1 series                    STM32F0 series
                    TIM1_UP /
           25                                           SPI1
                    TIM1_UP_TIM10
                    TIM1_TRG_COM /
           26                                           SPI2
                    TIM1_TRG_COM_TIM11
           27       TIM1_CC                             USART1
           28       TIM2                                USART2
           29       TIM3                                USART3_4_5_6_7_8
           30       TIM4                                CEC_CAN
           31       I2C1_EV                             USB
           32       I2C1_ER                             NA
           33       I2C2_EV                             NA
           34       I2C2_ER                             NA
           35       SPI1                                NA
           36       SPI2                                NA
           37       USART1                              NA
           38       USART2                              NA
           39       USART3                              NA
           40       EXTI15_10                           NA
           41       RTC_Alarm                           NA
           42       OTG_FS_WKUP / USBWakeUp             NA
           43       TIM8_BRK / TIM8_BRK_TIM12           NA
           44       TIM8_UP / TIM8_UP_TIM13             NA
                    TIM8_TRG_COM /
           45                                           NA
                    TIM8_TRG_COM_TIM14
           46       TIM8_CC                             NA
           47       ADC3                                NA
           48       FSMC                                NA
           49       SDIO                                NA
           50       TIM5                                NA
           51       SPI3                                NA
           52       UART4                               NA
           53       UART5                               NA
           54       TIM6                                NA
           55       TIM7                                NA
           56       DMA2_Channel1                       NA
                Table 15. Interrupt vector differences between STM32F1 series and STM32F0
                                              series(1) (continued)
             Position                    STM32F1 series                       STM32F0 series
                 57        DMA2_Channel2                           NA
                 58        DMA2_Channel3                           NA
                 59        DMA2_Channel4 / DMA2_Channel4_5         NA
                 60        DMA2_Channel5                           NA
                 61        ETH                                     NA
                 62        ETH_WKUP                                NA
                 63        CAN2_TX                                 NA
                 64        CAN2_RX0                                NA
                 65        CAN2_RX1                                NA
                 66        CAN2_SCE                                NA
                 67        OTG_FS                                  NA
           1. NA in gray table cells means Not Applicable.
             Table 16. GPIO differences between STM32F1 series and STM32F0 series
          GPIO                           STM32F1 series                                STM32F0 series
                            Floating                                      Floating
Input mode                  PU                                            PU
                            PD                                            PD
                                                                          PP
                                                                          PP + PU
                            PP                                            PP + PD
General purpose output
                            OD                                            OD
                                                                          OD + PU
                                                                          OD + PD
                                                                          PP
                                                                          PP + PU
                            PP                                            PP + PD
Alternate function output
                            OD                                            OD
                                                                          OD + PU
                                                                          OD + PD
Input / Output              Analog                                        Analog
                            2 MHz                                         2 MHz
Output speed                10 MHz                                        10 MHz
                            50 MHz                                        48 MHz
                I/O pin has a multiplexer with eight alternate function inputs (AF0 to AF7) that can be
                configured through the GPIOx_AFRL and GPIOx_AFRH registers:
                –    The peripheral alternate functions are mapped by configuring AF0 to AF7.
           3.   In addition to this flexible I/O multiplexing architecture, each peripheral has alternate
                functions mapped on different I/O pins to optimize the number of peripheral I/O
                functions for different device packages. For example, the USART2_RX pin can be
                mapped on PA3 or PA15 pin.
Note:      Please refer to the “Alternate function mapping” table in the STM32F0x datasheet for the
           detailed mapping of the system and the peripheral alternate function I/O pins.
           4. Configuration procedure
                –    Configure the desired I/O as an alternate function in the GPIOx_MODER register
                –    Select the type, pull-up/pull-down and output speed via the GPIOx_OTYPER,
                     GPIOx_PUPDR and GPIOx_OSPEEDER registers, respectively
                –    Connect the I/O to the desired AFx in the GPIOx_AFRL or GPIOx_AFRH register
           Table 17. Flash differences between STM32F1 series and STM32F0 series(1)
               FLASH                         STM32F1 series                      STM32F0 series
        Table 17. Flash differences between STM32F1 series and STM32F0 series(1) (continued)
               FLASH                              STM32F1 series                STM32F0 series
                                        STOP                          STOP
                                        STANDBY                       STANDBY
                                        WDG                           WDG
                                        NA                            RAM_PARITY_CHECK
 User Option bytes
                                        NA                            VDDA_MONITOR
                                        NA                            nBOOT1
                                        NA                            nBOOT0
                                        NA                            BOOT_SEL
 Erase granularity                      Page (1 or 2 Kbytes)          Page (1 Kbytes or 2Kbytes)
 Program mode                           Half word (16 bit)            Half word (16 bit)
 Same feature but spec change or enhancement
 New features
1. NA in gray table cells means Not Applicable.
2. New feature.
3. Same feature but with specification change or enhancement.
               Table 18. ADC differences between STM32F1 series and STM32F0 series
         ADC                                   STM32F1 series                                     STM32F0 series
              Table 19. PWR differences between STM32F1 series and STM32F0 series
   PWR                STM32F1 series                STM32F0x0/x1/x2 devices              STM32F0x8 devices
Power         Integrated POR / PDR circuitry Integrated POR / PDR circuitry Power ON reset must be
supply        Programmable Voltage Detector Programmable Voltage Detector controlled externally through the
supervisor    (PVD)                          (PVD)                          dedicated NPOR pin.
          Sleep mode                             Sleep mode
Low-power Stop mode                              Stop mode                          Sleep mode
modes     Standby mode (1.8 V domain             Standby mode (1.8 V domain         Stop mode
          powered-off)                           powered-off)
              Sleep mode                         Sleep mode
              – Any peripheral                   – Any peripheral
                interrupt/wakeup event             interrupt/wakeup event
                                                                                    Sleep mode
              Stop mode                          Stop mode
                                                                                    – Any peripheral
Wake-up       – Any EXTI line event/interrupt    – Any EXTI line event/interrupt
                                                                                      interrupt/wakeup event
sources       Standby mode                       Standby mode
                                                                                    Stop mode
              – WKUP pin rising edge             – WKUPx pins rising edge
                                                                                    – Any EXTI line event/interrupt
              – RTC alarm                        – RTC alarm / autowakeup
              – External reset in NRST pin       – External reset in NRST pin
              – IWDG reset                       – IWDG reset
1. Same feature but specification change or enhancement
                used to configure the microcontroller system at start-up and before branching to the
                main() program.
Note:    For STM32F0xx, you can use the clock configuration tool,
         STM32F0xx_Clock_Configuration.xls, to generate a customized SystemInit() function
         depending on your application requirements. For more information, refer to AN4055 “Clock
         configuration tool for STM32F0xx microcontrollers”.
         2. Peripheral access configuration: as presented in section 3.4: Reset and clock controller
              (RCC) interface, you need to call different functions to [enable/disable] or [enter/exit]
              the peripheral [clock] or [from reset mode]. For example, GPIOA is mapped on AHB
              bus on STM32F0 series (APB2 bus on STM32F1 series). To enable its clock, you have
              to use the RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
              function instead of:
              RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
              in the STM32F1 series.
              Refer to Table 8 for the peripheral bus mapping changes between STM32F0 and
              STM32F1 series.
         3. Peripheral clock configuration
         Some STM32F0xx peripherals support dual clock features. The table below summarizes the
         clock sources for those IPs in comparison with STM32F10xx peripherals.
                                                             – HSI14: by default
         ADC             APB2 clock with prescaler           – APB2 clock/2
                                                             – APB2 clock/4
                                                             HSI/244: by default
                                                             LSE
          CEC            APB1 clock with prescaler           APB clock: Clock for the digital interface
                                                             (used for register read/write access). This
                                                             clock is equal to the APB2 clock.
                                                             I2C1can be clocked with:
                                                             – System clock
          I2C            APB1 clock                          – HSI
                                                             I2C2 can be only clocked with:
                                                             – HSI
          SPI/I2S        System clock                        System clock
                                                             USART1, USART2 and USART3 can be
                                                             clocked with:
                         USART1 can be clocked with          – system clock
                         – PCLK2 (72 MHz Max)                – LSE clock
          USART
                         Other USARTs can be clocked with    – HSI clock
                         – PCLK1 (36 MHz Max)                – APB clock (PCLK)
                                                             For STM32F051 devices, USART2 can be
                                                             only clocked with system clock
                            void FLASH_SetLatency(uint32_t
                                                                       void FLASH_SetLatency(uint32_t FLASH_Latency);
                            FLASH_Latency);
                            void FLASH_PrefetchBufferCmd(uint32_t      void FLASH_PrefetchBufferCmd(FunctionalState
  Interface configuration
                            FLASH_PrefetchBuffer);                     NewState);
                            void FLASH_HalfCycleAccessCmd(uint32_t
                                                                       NA
                            FLASH_HalfCycleAccess);
                            Page_Address);                             Page_Address);
                            FLASH_Status FLASH_EraseAllPages(void); FLASH_Status FLASH_EraseAllPages(void);
                            FLASH_STATUS
                                                                       FLASH_STATUS FLASH_OB_ERASE(void);
                            FLASH_ERASEOPTIONBYTES(void);
                            FLASH_Status
                                                                       FLASH_Status FLASH_ProgramWord(uint32_t
                            FLASH_ProgramWord(uint32_t Address,
                                                                       Address, uint32_t Data);
                            uint32_t Data);
                            FLASH_Status
                                                                       FLASH_Status FLASH_ProgramHalfWord(uint32_t
                            FLASH_ProgramHalfWord(uint32_t Address,
                                                                       Address, uint16_t Data);
                            uint16_t Data);
                           Table 21. STM32F10x and STM32F0xx Flash driver API correspondence (continued)
                                   STM32F10x Flash driver API                       STM32F0xx Flash driver API
                            NA                                         void FLASH_OB_Unlock(void);
                            NA                                         void FLASH_OB_Lock(void);
                           FLASH_Status
                                                                       FLASH_Status FLASH_ProgramOptionByteData(uint32_t
                           FLASH_ProgramOptionByteData(uint32_t
                                                                       Address, uint8_t Data);
                           Address, uint8_t Data);
                            FLASH_Status
                                                                       FLASH_Status FLASH_OB_EnableWRP(uint32_t
                            FLASH_EnableWriteProtection(uint32_t
                                                                       OB_WRP);
                            FLASH_Pages);
                            FLASH_Status
                                                                       FLASH_Status FLASH_OB_RDPConfig(uint8_t
                            FLASH_ReadOutProtection(FunctionalState
                                                                       OB_RDP);
                            NewState);
                            FLASH_Status
 Option Byte Programming
                     Table 21. STM32F10x and STM32F0xx Flash driver API correspondence (continued)
                               STM32F10x Flash driver API                       STM32F0xx Flash driver API
                  Color key:
                         = New function
                   NA                                                 void CRC_DeInit(void);
                   void CRC_ResetDR(void);                            void CRC_ResetDR(void);
                                                                      void CRC_ReverseInputDataSelect(uint32_t
                   NA
                                                                      CRC_ReverseInputData);
 Configuration
                                                                      void CRC_ReverseOutputDataCmd(FunctionalState
                   NA
                                                                      NewState);
                   NA                                                 void CRC_SetInitRegister(uint32_t CRC_InitValue);
                                                                      void CRC_PolynomialSizeSelect(uint32_t
                   NA
                                                                      CRC_PolSize)(*)
                   NA                                                 void CRC_SetPolynomial(uint32_t CRC_Pol)(*)
                   uint32_t CRC_CalcCRC(uint32_t CRC_Data);           uint32_t CRC_CalcCRC(uint32_t CRC_Data);
 Computation
               Table 22. STM32F10xx and STM32F0xx CRC driver API correspondence (continued)
                       STM32F10xx CRC driver API                         STM32F0xx CRC driver API
Note:      (*) This function is only applicable for STM32F07x, STM32F04x and STM32F091 devices.
  Color key:
                 = New function
           GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
           GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; /* None, Pull-up or pull-
           down */
           GPIO_Init(GPIOy, &GPIO_InitStructure);
                functions for different device packages; for example, the USART2_RX pin can be
                mapped on PA3 or PA15 pin.
         4.     Configuration procedure:
                –    Connect the pin to the desired peripherals' Alternate Function (AF) using
                     GPIO_PinAFConfig() function
                –    Use GPIO_Init() function to configure the I/O pin:
                     - Configure the desired pin in alternate function mode using
                     GPIO_InitStructure->GPIO_Mode = GPIO_Mode_AF;
                     - Select the type, pull-up/pull-down and output speed via
                     GPIO_PuPd, GPIO_OType and GPIO_Speed members
         The example below shows how to remap USART2 Tx/Rx I/Os on PD5/PD6 pins in
         STM32F1 series:
              /* Enable APB2 interface clock for GPIOD and AFIO (AFIO peripheral is used
                 to configure the I/Os software remapping) */
           RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_AFIO,
         ENABLE);
              GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
              GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
              GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
              GPIO_Init(GPIOA, &GPIO_InitStructure);
           In STM32F0 series, the configuration of the EXTI line source pin is performed in the
           SYSCFG peripheral (instead of AFIO in STM32F1 series). As a result, the source code
           should be updated as follows:
              /* Enable GPIOA's AHB interface clock */
              RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
              /* Enable SYSCFG's APB interface clock */
              RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
           The table below presents the MISC driver API correspondence between STM32F10x and
           STM32F0xx Libraries.
            void NVIC_Init(NVIC_InitTypeDef*
                                                      void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
            NVIC_InitStruct);
            void NVIC_SystemLPConfig(uint8_t         void NVIC_SystemLPConfig(uint8_t
            LowPowerMode, FunctionalState NewState); LowPowerMode, FunctionalState NewState);
            void SysTick_CLKSourceConfig(uint32_t     void SysTick_CLKSourceConfig(uint32_t
            SysTick_CLKSource);                       SysTick_CLKSource);
            NVIC_PriorityGroupConfig(uint32_t
                                                      NA
            NVIC_PriorityGroup);
            void NVIC_SetVectorTable(uint32_t
                                                      NA
            NVIC_VectTab, uint32_t Offset);
              /* ADCCLK = PCLK2/4 */
              RCC_ADCCLKConfig(RCC_PCLK2_Div4);
/* Enable ADC1 */
ADC_Cmd(ADC1, ENABLE);
           /* ADC1 configuration */
           ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b;
           ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
           ADC_InitStructure.ADC_ExternalTrigConvEdge =
         ADC_ExternalTrigConvEdge_None;
         ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T1_TRGO;;
           ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
           ADC_InitStructure.ADC_ScanDirection = ADC_ScanDirection_Backward;
           ADC_Init(ADC1, &ADC_InitStructure);
         /* ADC Calibration */
           ADC_GetCalibrationFactor(ADC1);
         /* Enable ADC_DMA */
           ADC_DMACmd(ADC1, ENABLE);
                         /* Enable ADC1 */
                         ADC_Cmd(ADC1, ENABLE);
                                                    Table 24. STM32F10x and STM32F0xx DAC driver API correspondence (continued)
                                                                 STM32F10x DAC driver API                         STM32F0xx DAC driver API
   Interrupts and flags management DMA management
                                                                                         void PWR_EnterSleepMode(uint8_t
                                         NA
                                                                                         PWR_SLEEPEntry);
                                         void PWR_EnterSTOPMode(uint32_t                 void PWR_EnterSTOPMode(uint32_t
                                         PWR_Regulator, uint8_t PWR_STOPEntry);          PWR_Regulator, uint8_t PWR_STOPEntry);
                                         PWR_FLAG);                                      PWR_FLAG);
FLAG
                    Color key:
                                           = New function
uint16_t BKPdata = 0;
           ...
           /* Enable APB2 interface clock for PWR and BKP */
           RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR | RCC_APB1Periph_BKP, ENABLE);
uint16_t BKPdata = 0;
           ...
           /* PWR Clock Enable */
           RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
                                               Color key:
                                                    = New function
         The main changes in the source code/procedure in STM32F0 series versus STM32F1 are
         described below:
            Dual Clock Source (Refer to RCC section for more details).
            No Prescaler feature configuration.
            It supports more than one address (multiple addressing).
            Each event flag has an associate enable control bit to generate the adequate interrupt.
            In the CEC structure definition, seven fields should be initialized.
             The example below shows how to configure the CEC STM32F1 series:
         /* Configure the CEC peripheral */
           CEC_InitStructure.CEC_BitTimingMode = CEC_BitTimingStdMode;
           CEC_InitStructure.CEC_BitPeriodMode = CEC_BitPeriodStdMode;
           CEC_Init(&CEC_InitStructure);
                           Table 27. STM32F10xx and STM32F0xx I2C driver API correspondence (continued)
                                    STM32F10xx I2C Driver API                         STM32F0xx I2C Driver API
                     Table 27. STM32F10xx and STM32F0xx I2C driver API correspondence (continued)
                              STM32F10xx I2C Driver API                         STM32F0xx I2C Driver API
                     void I2C_DMALastTransferCmd(I2C_TypeDef*
                                                                    NA
                     I2Cx, FunctionalState NewState);
                                   Table 27. STM32F10xx and STM32F0xx I2C driver API correspondence (continued)
                                            STM32F10xx I2C Driver API                           STM32F0xx I2C Driver API
                      Color key:
                                     = New function
                                        Though some API functions are identical in STM32F1 and STM32F0, in most cases the
                                        application code needs to be rewritten when moving from STM32F1 to STM32F0. However,
                                        STMicroelectronics provides an “I2C Communication peripheral application library (CPAL)”,
                                        which allows to move seamlessly from STM32F1 to STM32F0: user needs to modify only
                                        few settings without any changes on the application code. For more details about STM32F1
                                        I2C CPAL, please refer to UM1029. For STM32F0, the I2C CPAL is provided within the
                                        Standard Peripherals Library package.”
                                                                                            FunctionalState NewState);
                                                                                            void SPI_NSSPulseModeCmd(SPI_TypeDef* SPIx,
                                    NA
                                                                                            FunctionalState NewState);
                                    void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState         void SPI_Cmd(SPI_TypeDef* SPIx, FunctionalState
                                    NewState);                                              NewState);
                                    void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState         void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState
                                    NewState);                                              NewState);
                                    void SPI_DataSizeConfig(SPI_TypeDef* SPIx,              void SPI_DataSizeConfig(SPI_TypeDef* SPIx,
                                    uint16_t SPI_DataSize);                                 uint16_t SPI_DataSize);
                                                                                            void SPI_RxFIFOThresholdConfig(SPI_TypeDef*
                                    NA
                                                                                            SPIx, uint16_t SPI_RxFIFOThreshold);
                                                                                            void SPI_BiDirectionalLineConfig(SPI_TypeDef*
                                    NA
                                                                                            SPIx, uint16_t SPI_Direction);
                                    void SPI_NSSInternalSoftwareConfig(SPI_TypeDef*         void SPI_NSSInternalSoftwareConfig(SPI_TypeDef*
                                    SPIx, uint16_t SPI_NSSInternalSoft);                    SPIx, uint16_t SPI_NSSInternalSoft);
                                    void SPI_SSOutputCmd(SPI_TypeDef* SPIx,                 void SPI_SSOutputCmd(SPI_TypeDef* SPIx,
                                    FunctionalState NewState);                              FunctionalState NewState);
                                                                                            void SPI_SendData8(SPI_TypeDef* SPIx, uint8_t
                                    void SPI_I2S_SendData(SPI_TypeDef* SPIx,                Data);
 Data Transfers
                                       Table 28. STM32F10xx and STM32F0xx SPI driver API correspondence (continued)
                                                  STM32F10xx SPI driver API                         STM32F0xx SPI driver API
                                      NA
                                                                                         uint16_t SPI_CRCLength);
                                      void SPI_TransmitCRC(SPI_TypeDef* SPIx);           void SPI_TransmitCRC(SPI_TypeDef* SPIx);
                                      void SPI_CalculateCRC(SPI_TypeDef* SPIx,           void SPI_CalculateCRC(SPI_TypeDef* SPIx,
                                      FunctionalState NewState);                         FunctionalState NewState);
                                      uint16_t SPI_GetCRC(SPI_TypeDef* SPIx, uint8_t     uint16_t SPI_GetCRC(SPI_TypeDef* SPIx, uint8_t
                                      SPI_CRC);                                          SPI_CRC);
                                                                                         uint16_t
                                      NA                                                 SPI_GetTransmissionFIFOStatus(SPI_TypeDef*
                                                                                         SPIx);
                                                                                         uint16_t
                                      NA
                                                                                         SPI_GetReceptionFIFOStatus(SPI_TypeDef* SPIx);
                                      FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef*      FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef*
                                      SPIx, uint16_t SPI_I2S_FLAG);                      SPIx, uint16_t SPI_I2S_FLAG);(*)
                                      void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx,
                                      uint16_t SPI_I2S_FLAG);                            void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx,
                                      void SPI_I2S_ClearITPendingBit(SPI_TypeDef*        uint16_t SPI_I2S_FLAG);(*)
                                      SPIx, uint8_t SPI_I2S_IT);
                                      ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx,    ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx,
                                      uint8_t SPI_I2S_IT);                               uint8_t SPI_I2S_IT);(*)
                                  Color key:
                                           = New function
(*) One more flag in STM32F0xx (TI frame format error) can generate an event in comparison with STM32F10xx driver API.
                                                                                      FunctionalState NewState);
                                    void USART_SetPrescaler(USART_TypeDef*            void USART_SetPrescaler(USART_TypeDef*
                                    USARTx, uint8_t USART_Prescaler);                 USARTx, uint8_t USART_Prescaler);
                                                                               void
                                    void USART_OverSampling8Cmd(USART_TypeDef*
                                                                               USART_OverSampling8Cmd(USART_TypeDef*
                                    USARTx, FunctionalState NewState);
                                                                               USARTx, FunctionalState NewState);
                                                                                      void
                                    void USART_OneBitMethodCmd(USART_TypeDef*
                                                                                      USART_OneBitMethodCmd(USART_TypeDef*
                                    USARTx, FunctionalState NewState);
                                                                                      USARTx, FunctionalState NewState);
                                                                                      void USART_MSBFirstCmd(USART_TypeDef*
                                    NA
                                                                                      USARTx, FunctionalState NewState);
                                                                                      void USART_DataInvCmd(USART_TypeDef*
                                    NA
                                                                                      USARTx, FunctionalState NewState);
                                                                                      void USART_InvPinCmd(USART_TypeDef*
                                    NA                                                USARTx, uint32_t USART_InvPin, FunctionalState
                                                                                      NewState);
                                                                                      void USART_SWAPPinCmd(USART_TypeDef*
                                    NA
                                                                                      USARTx, FunctionalState NewState);
                                                                                      void
                                    NA                                                USART_ReceiverTimeOutCmd(USART_TypeDef*
                                                                                      USARTx, FunctionalState NewState);
                                                                                      void
                                    NA                                                USART_SetReceiverTimeOut(USART_TypeDef*
                                                                                      USARTx, uint32_t USART_ReceiverTimeOut);
                     Table 29. STM32F10x and STM32F0xx USART driver API correspondence (continued)
                              STM32F10xx USART driver API                  STM32F0xx USART driver API
                                                                    void USART_STOPModeCmd(USART_TypeDef*
                      NA
                                                                    USARTx, FunctionalState NewState);
    STOP Mode
                                                                    void
                                                                    USART_StopModeWakeUpSourceConfig(USART_
                      NA
                                                                    TypeDef* USARTx, uint32_t
                                                                    USART_WakeUpSource);
                                                                    void
                      NA                                            USART_AutoBaudRateCmd(USART_TypeDef*
      AutoBaudRate
                      NA                                            USART_MuteModeWakeUpConfig(USART_TypeD
                                                                    ef* USARTx, uint32_t USART_WakeUp);
                                                                    void USART_MuteModeCmd(USART_TypeDef*
                      NA
                                                                    USARTx, FunctionalState NewState);
                                                                    void
                      NA                                            USART_AddressDetectionConfig(USART_TypeDe
                                                                    f* USARTx, uint32_t USART_AddressLength);
                      void                                          void
                      USART_LINBreakDetectLengthConfig(USART_Type   USART_LINBreakDetectLengthConfig(USART_Ty
    LIN mode
                   Table 29. STM32F10x and STM32F0xx USART driver API correspondence (continued)
                            STM32F10xx USART driver API                  STM32F0xx USART driver API
                                    Table 29. STM32F10x and STM32F0xx USART driver API correspondence (continued)
                                              STM32F10xx USART driver API                    STM32F0xx USART driver API
                                                                                     FunctionalState NewState);
                                                                                     void
                                     NA                                              USART_OverrunDetectionConfig(USART_TypeDe
                                                                                     f* USARTx, uint32_t USART_OVRDetection);
                                                                                   FlagStatus
                                     FlagStatus USART_GetFlagStatus(USART_TypeDef*
                                                                                   USART_GetFlagStatus(USART_TypeDef*
                                     USARTx, uint16_t USART_FLAG);
                                                                                   USARTx, uint32_t USART_FLAG);
                                     void USART_ClearFlag(USART_TypeDef* USARTx,     void USART_ClearFlag(USART_TypeDef*
                                     uint16_t USART_FLAG);                           USARTx, uint32_t USART_FLAG);
                                     ITStatus USART_GetITStatus(USART_TypeDef*       ITStatus USART_GetITStatus(USART_TypeDef*
                                     USARTx, uint32_t USART_IT);                     USARTx, uint32_t USART_IT);
                                     void USART_ClearITPendingBit(USART_TypeDef*     void USART_ClearITPendingBit(USART_TypeDef*
                                     USARTx, uint32_t USART_IT);                     USARTx, uint32_t USART_IT);
                   Color key:
                                       = New function
                                                                          void IWDG_SetPrescaler(uint8_t
    configuration
IWDG_FLAG); IWDG_FLAG);
           Color key:
                          = New function
5 Revision history
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and
improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on
ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order
acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or
the design of Purchasers’ products.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.