For designers of STM32 microcontroller applications, it is important to be able to easily
replace one microcontroller type by another one in the same product family. Migrating an
application to a different microcontroller is often needed, when product requirements grow,
putting extra demands on memory size, or increasing the number of I/Os. On the other
hand, cost reduction objectives may force you to switch to smaller components and shrink
the PCB area.
This application note is written to help you and analyze the steps you need to migrate from
an existing STM32F1 devices based design to STM32L1 devices. It groups together all the
most important information and lists the vital aspects that you need to address.
To migrate your application from STM32F1 series to STM32L1 series, you have to analyze
the hardware migration, the peripheral migration and the firmware migration.
AN3422
Application note
Migration of microcontroller applications
from STM32F1 to STM32L1 series
To benefit fully from the information in this application note, the user should be familiar with
the STM32 microcontroller family. You can refer to the following documents that are available
from www.st.com.
●The STM32F1 family reference manuals (RM0008 and RM0041), the STM32F1
datasheets, and the STM32F1 Flash programming manuals (PM0075, PM0063 and
PM0068).
●The STM32L1 family reference manual (RM0038), the STM32L1 datasheets, and the
STM32F1 Flash and EEPROM programming manual (PM0062).
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.
The STM32L1 platform forms a strong foundation with a broad and growing portfolio. With
new products addressing new applications, the complete STM32L product series now
comprises three series, STM32L1 Medium-density, STM32L1 Medium-density+ and STM32L1 High-density, all dedicated to ultra low power and low voltage applications.
●STM32L1: Designed for ultra-low-power applications that are energy-aware and seek
to achieve the absolute lowest power consumption. The L1 series maintains
compatibility with the F1 series.
–Medium-density devices are STM32L151xx and STM32L152xx microcontrollers
where the Flash memory density ranges between 64 and 128 Kbyte
–Medium-density+ devices are STM32L151xx, STM32L152xx and STM32L162xx
microcontrollers where the Flash memory density is 256 Kbyte
–High-density devices are STM32L151xx, STM32L152xx and STM32L162xx
microcontrollers where the Flash memory density is 384 Kbyte
The ultralow power STM32L1 Medium-density, STM32L1 Medium-density+ and STM32L1
High-density are fully pin-to-pin, software and feature compatible.
The ultralow power STM32L and general-purpose STM32F1xxx families are pin-to-pin
compatible. All peripherals shares the same pins in the two families, but there are some
minor differences between packages.
In fact, the STM32L1 series maintains a close compatibility with the whole STM32F1 series.
All power and functional pins are pin-to-pin compatible. The transition from the STM32F1
series to the STM32L1 series is simple as only a few pins are impacted (impacted pins are
in bold in the table below).
Table 2.STM32F1 series and STM32L1 series pinout differences
As shown in Table 3 on page 13, 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: FLASH, ADC, RCC, PWR, GPIO and RTC are different
from the F1 series ones and should be updated to take advantage of the enhancements and
the new features in L1 series.
All these modified peripherals in the L1 series are enhanced to obtain lower power
consumption, with features designed to meet new market requirements and to fix some
limitations present in the F1 series.
4.1 STM32 product cross-compatibility
The STM32 series embeds a set of peripherals which can be classed in three categories:
●The first category is for the peripherals which are by definition common to all products.
Those peripherals are identical, so they have the same structure, registers and control
bits. There is no need to perform any firmware change to keep the same functionality at
the application level after migration. All the features and behavior remain the same.
●The second category is for the peripherals which are shared by all products but have
only minor differences (in general to support new features), so migration from one
product to another is very easy and does not need any significant new development
effort.
●The third category is for peripherals which have been considerably changed from one
product to another (new architecture, new features...). For this category of peripherals,
migration will require new development at application level.
Ta bl e 3 gives a general overview of this classification.
12/52Doc ID 018976 Rev 2
AN3422Peripheral migration
Table 3.STM32 peripheral compatibility analysis F1 versus L1 series
Compatibility
PeripheralF1 seriesL1 series
CommentsPinoutSW compatibility
No I2S in L1 Medium-density
SPIYe s
Ye s
series
IdenticalFull compatibility
L1 vs. F1: limitation fix
WWDG
IWDG
DBGMCU
CRC
EXTI
USB FS
Device
DMA
TIM
Ye sYesSame featuresNAFull compatibility
Ye sYesSame featuresNAFull compatibility
Ye sYesSame featuresNAFull compatibility
Ye sYesSame featuresNAFull compatibility
Ye sYesSame featuresIdenticalFull compatibility
Ye sYesSame featuresIdenticalFull compatibility
Ye sYesSame featuresNAFull compatibility
Ye sYesSame featuresIdenticalFull compatibility
Same features (No SDIO in
SDIO
Ye sYe s
L1 Medium-density and
IdenticalFull compatibility
Medium-density+ series)
Same features but only
SRAM/NOR memories are
FSMC
Ye sYe s
supported (No FSMC in L1
IdenticalFull compatibility
Medium-density and Mediumdensity+ series)
PWR
RCC
Ye sYe s +EnhancementNA
Ye sYe s +EnhancementNAPartial compatibility
Full compatibility for the
same feature
Limitation fix / One Sample
USART
I2C
DAC
ADC
RTC
Ye sYe s +
Bit method / Oversampling by 8IdenticalFull compatibility
Ye sYe s +Limitation fixIdenticalFull compatibility
Ye sYe s +DMA underrun interruptIdenticalFull compatibility
Ye sYes++New peripheralIdenticalPartial compatibility
Ye sYes++New peripheral
Identical for the
same feature
Not compatible
FLASHYe sYes++New peripheralNANot compatible
GPIO
CAN
Ye sYes++New peripheralIdenticalNot compatible
Ye sNANANANA
Doc ID 018976 Rev 213/52
Peripheral migrationAN3422
Color key:
= New feature or new architecture (Yes++)
= Same feature, but specification change or enhancement (Yes+)
= Feature not available (NA)
Table 3.STM32 peripheral compatibility analysis F1 versus L1 series (continued)
Compatibility
PeripheralF1 seriesL1 series
CommentsPinoutSW compatibility
CECYe sNANANANA
Ethernet
LCD glass
COMP
SYSCFG
AES
OPAMP
Ye sNANANANA
NAYesNANANA
NAYesNANANA
NAYesNANANA
NAYesNANANA
NAYesNANANA
4.2 System architecture
The STM32L MCU family, based on the Cortex-M3 core, extends ST’s ultra-low-power
portfolio in performance, features, memory size and package pin count. It combines very
high performance and ultra-low power consumption, through the use of an optimized
architecture and ST’s proprietary ultra-low leakage process, that is also used in the STM8L
family. The STM32L family offers three different product lines (STM32L Medium-density,
STM32L Medium-density+ and STM32L High-density).
4.3 Memory mapping
The peripheral address mapping has been changed in the L1 series vs. F1 series, the main
change concerns the GPIOs which have been moved from the APB bus to the AHB bus to
allow them to operate at maximum speed.
The tables below provide the peripheral address mapping correspondence between L1 and
F1 series.
14/52Doc ID 018976 Rev 2
AN3422Peripheral migration
Table 4.IP bus mapping differences between STM32F1 and STM32L1 series
STM32L1 series STM32F1 series
Peripheral
BusBase addressBusBase address
FSMC
AES0x50060000
DMA20x40026400
0xA0000000AHB0xA0000000
NANA
0x40020400
DMA10x400260000x40020000
Flash Interface0x40023C000x40022000
AHB
RCC0x400238000x40021000
CRC0x40023000
GPIOG0x40021C00
AHB
0x40023000
0x40012000
APB2
GPIOF0x400218000x40011C00
GPIOH0x40021400
GPIOE0x40021000
NANA
0x40011800
GPIOD0x40020C000x40011400
GPIOC0x400208000x40011000
APB2
GPIOB0x400204000x40010C00
GPIOA0x400200000x40010800
USART1
0x40013800
0x40013800
APB2
SP10x400130000x40013000
SDIO0x40012C00AHB0x40018000
ADC10x40012400
TIM110x400110000x40015400
TIM100x40010C000x40015000
APB2
APB2
0x40012400
TIM90x400108000x40014C00
EXTI0x400104000x40010400
SYSCFG0x40010000NANA
Doc ID 018976 Rev 215/52
Peripheral migrationAN3422
Table 4.IP bus mapping differences between STM32F1 and STM32L1 series
STM32L1 series STM32F1 series
Peripheral
BusBase addressBusBase address
OPAMP
COMP+RI0x40007C00
DAC0x40007400
PWR0x400070000x40007000
USB device FS SRAM0x400060000x40006000
USB device FS0x40005C000x40005C00
I2C20x400058000x40005800
I2C10x400054000x40005400
UART50x400050000x40005000
UART40x40004C000x40004C00
USART30x400048000x40004800
USART20x400044000x40004400
SPI30x40003C000x40003C00
SPI20x40003800
IWDG0x400030000x40003000
WWDG0x40002C000x40002C00
RTC
APB1
0x40007C5CNANA
NANA
APB1
0x40002800
(inc. BKP registers)
0x40007400
0x40003800
0x40002800
LCD0x40002400NANA
TIM70x40001400
TIM60x400010000x40001000
TIM50x40000C000x40000C00
TIM40x400008000x40000800
TIM30x400004000x40000400
TIM20x400000000x40000000
USB OTG FS
ETHERNET MAC
ADC2
ADC3
TIM8
TIM1
16/52Doc ID 018976 Rev 2
NANA
NANA0x40028000
NANA
NANA0x40013C00
NANA0x40013400
NANA0x40012C00
0x40001400
APB1
0x50000000
AHB
0x40012800
APB2
Loading...
+ 36 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.