AN4660
AN4660
Application note
Migration of microcontroller applications from
STM32F42xxx/F43xxx devices to STM32F7 Series devices
Introduction
The designers of STM32 microcontroller applications must have the possibility to easily
replace one microcontroller type with another one from the same product family. The
reasons for migrating an application to a different microcontroller can be for example:
• To fulfill higher product requirements, extra demands on the memory size, or an increased
number of I/Os.
• To meet cost reduction constraints that require to switch to smaller components and to
shrink the PCB area.
This application note analyzes the steps required to migrate from an existing
STM32F42xxx/F43xxx device to a STM32F7 Series device based design.
This application note provides a guideline on the hardware migration and the peripheral
migration. To fully benefit from this application note, the user should be familiar with the
STM32 microcontroller family.
For additional information, refer to the following documents available on www.st.com:
• STM32F405/415, STM32F407/417, STM32F427/437 and STM32F429/439 advanced
ARM®-based 32-bit MCUs reference manual (RM0090)
• STM32F72xxx and STM32F73xxx advanced ARM®-based 32-bit MCUs reference
manual (RM0431)
• STM32F75xxx and STM32F74xxx advanced ARM®-based 32-bit MCUs reference
manual (RM0385)
• STM32F76xxx and STM32F77xxx advanced ARM®-based 32-bit MCUs reference
manual (RM0410)
Contents
1 Hardware migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1 Pinout compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.1 LQFP100 package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.2 LQFP208 package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.3 LQFP176 package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1.4 TFBGA216 package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.1.5 LQFP64 package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.2 Boot mode compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.3 System bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2 Peripheral migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1 STM32 product cross-compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2 Memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.3 Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.4 Embedded Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.5 Flexible memory controller (FMC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.6 Interrupt vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.7 External interrupt lines (EXTI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.8 RCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.8.1 Maximum frequency according to power scale parameter . . . . . . . . . . 28
2.9 PWR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.10 RTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.11 U(S)ART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.12 I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.13 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.14 CRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.15 USB OTG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.16 ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.16.1 External trigger for regular channels . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.16.2 External trigger for injected channels . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
List of tables
List of figures
1 Hardware migration
9&$3
3(
3(
3%
3(
3(
9''
3%
966
9''
3$
3&
3&
3%
3%
3(
3$
3$
3%
3(
3$
3(
3$
3(
3& 670)[[[)[[[)[[[)[[[)[[[
966$
95()
9''$
3$:.83
3$
3$ 3LQVWRDUHQRWFRPSDWLEOH
3$
9&$3
3(
3(
3%
3(
3(
3%
3(
3(
9''
966
9''
3$
966
3&
3&
3%
3(
3(
3%
3(
3$
3%
3$
3$
06Y9
19 VDD VSSA
20 VSSA VREF+
21 VREF+ VDDA
22 VDDA PA0-WKUP
23 PA0-WKUP PA1
24 PA1 PA2
25 PA2 PA3
26 PA3 VSS
27 VSS VDD
28 VDD PA4
29 PA4 PA5
30 PA5 PA6
31 PA6 PA7
32 PA7 PC4
33 PC4 PC5
34 PC5 PB0
35 PB0 PB1
36 PB1 PB2
37 PB2 PE7
38 PE7 PE8
39 PE8 PE9
40 PE9 PE10
41 PE10 PE11
42 PE11 PE12
43 PE12 PE13
44 PE13 PE14
45 PE14 PE15
46 PE15 PB10
47 PB10 PB11
48 PB11 VCAP1
49 VCAP1 VSS
53 PB14 PB14
54 PB15 PB15
55 PD8 PD8
56 PD9 PD9
57 PD10 PD10
1RWFRPSDWLEOHSLQV
06Y9
For the highlighted (blue) terminals, the DSIHOST dedicated IOs on the
STM32F768Ax/STM32F769xx/STM32F779xx/STM32F469BxT/STM32F479BxT devices
substitute some of
STM32F74xxx/STM32F756xx/STM32F765xx/STM32F767xx/STM32F777xx/STM32F42xB
xT/STM32F43xBxT IO ports.
966
966
3,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3- 3) 3( 3( 3( 3% 3+ 3+ 3+
5 9''$ 3$ 3$ 3% 3% 3- 3- 3( 3( 3( 3( 3( 3% 3% 3%
7)%*$
670)[[[
670)[[
670)[[ 670)$[
670)[[ 670)[[
670)[[ 670)[[
670)[1[+ 670)1[+
670)[1[+ 670)1[+
'6, '6,
) 966 3. 3/ ) 966 +267B +267B
'3 '1
'6, '6,
9''
+ 9'' 3- 3- + +267B +267B
'6,
&.3 &.1
'6, '6,
- 9'' 3- 3- - 9'' +267B +267B
'3 '1
9&$3
. 9'' 3- 3' . 9'' 3'
'6,
1RWFRPSDWLEOHEDOOV
06Y9
For the highlighted (blue) terminals, the DSIHOST dedicated IOs on the
STM32F768Ax/STM32F769xx/STM32F779xx/STM32F469NxH/STM32F479NxH devices
substitute some of
STM32F74xxx/STM32F756xx/STM32F765xx/STM32F767xx/STM32F777xx/
STM32F42xNxH/STM32F43xNxH IO ports.
STM32F42xxx/F43xxx
Boot mode
selection Pins Boot Mode Aliasing
BOOT1 BOOT0
Main Flash
x 0 Main Flash memory is selected as the boot space at 0x0800 0000
memory
System
0 1 System memory is selected as the boot space at 0x1FFF 0000
memory
By default, in the STM32F7 Series devices, when the boot from system bootloader is
selected, the code is executed from the ITCM interface. It could be reprogrammed by option
byte executed from the AXIM interface. For more details on system bootloader refer to
AN2606.
2 Peripheral migration
- - - - SW Comments
Flash memory in
2048 1024 2048 512
Kbyte
256
320 512 256
System (115+16+64+ - -
(240+16+64) (386+16+128) (176+16+64)
SRAM 64)
(Kbyte)
Instruction NA 16 16 16
Backup 4 4 4 4
GP 10 10 10 10 Yes -
Advanced
2 2 2 Yes -
Timers control
Basic 2 2 2 Yes -
Low-power NA 1 1 NA -
Quad-SPI No Yes NA -
3/3 (simplex)
6/2 (full 4/3 (simplex) No/
SPI / I2S 4/3 (simplex) I2S compatible.
duplex) 6/3 (simplex)(1) Yes
5/3 (simplex)(2)
Programmable
I2C 3 4 3 No clock source for
STM32F7 Series
Additional features
USART/
4/4 4/4 4/4 No on STM32F7
UART
Series
Communication interfaces
Dedicated
USB OTG VDDUSB
Yes Yes Yes No
FS More endpoints on
STM32F7 Series
More endpoints
and host channels
USB OTG
Yes Yes Yes No with an embedded
HS
HS PHY in the
STM32F7x3 line
CAN 2 2 3 1 Yes -
SAI 1 2 Yes -
New clock source
for SDMMC1 on
SDIO/ STM32F7 Series
Yes Yes 2x 2x Yes
SDMMC1 with dedicated
supply for SDM-
MC2
SPDIFRX No 4 inputs NA NA -
RNG Yes Yes Yes Yes -
FMC memory con-
Yes Yes Yes Yes -
troller
Ethernet Yes Yes NA Yes -
MDIOS No No Yes NA NA -
HDMI-CEC No Yes NA NA -
DCMI Yes Yes NA Yes -
WWDG Yes Yes Yes Yes -
IWDG Yes Yes Yes Yes -
Additional features
CRC Yes Yes Yes Yes on STM32F7
Series
LCD-TFT No | Yes(3) Yes NA Yes -
New feature on
DSI-HOST No No Yes NA NA STM32F7x9xx/
Fx8xx
New feature on
JPEG No No Yes NA NA STM32F76xxx/
F77xxx
DMA DMA1-DMA2 (8 stream each) Yes -
Chrom-ART-Acc
Yes Yes NA Yes -
(DMA2D)
Crypto Yes Yes Yes (AES256) Yes -
Hash Yes Yes NA Yes -
140 in
STM32F7x2xx
GPIO Up to 168 Up to 168 Yes -
138 in
STM32F7x3xx
New feature on
DFSDM1 No No 4 filters NA NA STM32F76xxx/
F77xxx
12 bits 3 3 3
ADC Timer Trigger
ADC Number of Yes
16|24 16|24 16|24 not compatible
channels
Table 11. Flash module 1 Mbyte single bank organization (STM32F7 Series)
Bloc base addresses on Block base addresses
Block Name Sector size
AXIM interface on ITCM interface
Table 12. FMC differences between the STM32F42xxx/F43xxx and STM32F7 Series
devices
FMC STM32F42xxx/F43xxx STM32F7 Series
– SRAM
– NOR/NAND memories – SRAM
– PSRAM – NOR/NAND memories
External memory interfaces – Two banks of NAND Flash – PSRAM
memory with ECC hardware – NAND Flash memory with
– 16-bit PC Card compatible ECC hardware
devices
Data bus width 8-,16- or 32-bit
Bank1
NOR/PSRAM/SRAM NOR/PSRAM/SRAM
4×64 Mbytes
Bank2
Reserved
4×64 Mbytes
NAND Flash memory
Bank3
NAND Flash memory
FMC Bank 4×64 Mbytes
memory mapping Bank4
PC Card Reserved
4×64 Mbytes
SDRAM bank1
4×64 Mbytes
SDRAM SDRAM
SDRAM bank2
4×64 Mbytes
NOR/PSRAM/SRAM SDRAM bank1
256 Mbytes 256 Mbytes
NAND bank1 SDRAM bank2
256 Mbytes 256 Mbytes
SDRAM bank1 NAND bank3
Memory mapping swap: 256 Mbytes 256 Mbytes
(SYSCFG_MEMRMP) SDRAM bank2
Reserved
Bits 11:10 SWP_FMC[1:0] = 01b 256 Mbytes
Reserved Reserved
NAND bank2 NOR/PSRAM/SRAM
256 Mbytes 256 Mbytes
PC card
Reserved
256 Mbytes
91 NA SAI2
92 NA Quad-SPI
93 NA LPTIM1
94 NA HDMI-CEC NA
95 NA I2C4_EV NA
96 NA I2C4_ER NA
97 NA SPDIFRX NA
98 NA NA DSIHOST NA
99 NA NA DFSDM1_FLT0 NA
100 NA NA DFSDM1_FLT1 NA
101 NA NA DFSDM1_FLT2 NA
102 NA NA DFSDM1_FLT3 NA
103 NA NA SDMMC2 SDMMC2
104 NA NA CAN3_TX NA
105 NA NA CAN3_RX0 NA
106 NA NA CAN3_RX1 NA
107 NA NA CAN3_SCE NA
108 NA NA JPEG NA
109 NA NA MDIOS NA
2.8 RCC
Table 15 presents the main differences related to the RCC (Reset and Clock Controller)
between the STM32F42xxx/F43xxx and STM32F7 Series devices.
2.9 PWR
Table 17 presents the PWR controller differences between the STM32F42xxx/F43xxx and
STM32F7 Series devices.
Table 17. PWR differences between the STM32F42xxx/F43xxx and STM32F7 Series
devices
PWR STM32F42xxx/F43xxx STM32F7 Series
PWR_CR PWR_CR1
PWR_CSR PWR_CSR1
PWR_CR2
PWR_CSR2
Power control Comment :
registers – PWR_CR2:
NA Used to configure the wakeup pin polarity, or to
clear the wakeup pins flags.
– PWR_CSR2:
Used either to enable the wakeup pins or used to
detect an event on the wakeup pin
2.10 RTC
Table 18 shows the RTC comparison between the STM32F42xxx/F43xxx and STM32F7
Series devices.
Table 18. RTC comparison between the STM32F42xxx/F43xxx and STM32F7 Series
devices
RTC STM32F42xxx/F43xxx STM32F7 Series
2.11 U(S)ART
The U(S)ART is not SW compatible with the STM32F42xxx/F43xxx devices and includes
new additional features detailed in Table 19.
UART/USART 4/4
– Up to 27 Mbit/s
Baud rate – Up to 4x11.25 Mbit/s – (clock frequency is 100 MHz and
oversampling is by 8)
– Dual clock domain:
Convenient baud rate programming
Clock – Single clock domain
independent from the PCLK
reprogramming
– Word length: Programmable (7, 8 or 9
– Word length: Programmable (8 or 9 bits)
Data
bits) – Programmable data order with MSB-
first or LSB-first shifting
interrupt – 10 interrupt sources with flags – 14 interrupt sources with flags
– LIN mode
– SPI Master
– IrDA SIR ENDEC block
– Hardware flow control (CTS/RTS)
– Continuous communication using DMA
– Multiprocessor communication
– Single-wire half-duplex communication
Support the T=0 and T=1 asynchronous
Smartcard mode T = 0 and T= 1 has to
protocols.
Features be implemented by software.
Number of stop bits: 0.5, 1, 1.5, 2
Number of stop bits: 0.5, 1, 1.5, 2
smartcard operation.
– Support for ModBus communication
- Timeout feature
- CR/LF character recognition
NA – Receiver timeout interrupt
– Auto baud rate detection
– Driver Enable
– Swappable Tx/Rx pin configuration
U(S)ART
– Software not compatible
registers
2.12 I2C
The STM32F42xxx/F43xxx and STM32F7 Series devices share the same features on the
I2C, but the software and register configuration are not compatible.
Table 20 presents the I2C differences between the STM32F42xxx/F43xxx and STM32F7
Series devices.
Table 20. I2C differences between the STM32F42xxx/F43xxx and STM32F7 Series devices
STM32F74xxx/F75xxx/
I2C STM32F42xxx/F43xxx STM32F72xxx/F73xxx
F76xxx/F77xxx
Instances – x3 (I2C1, I2C2, I2C3) – x4 (I2C1, I2C2, I2C3, I2C4) – x3 (I2C1, I2C2, I2C3)
– 7-bit and 10-bit addressing mode
– SMBus
– Standard mode (up to 100 kbit/s)
Features – Fast-mode (up to 400 kbit/s)
- – Fast-mode plus (up to 1 Mbit/s)(1)
– Single clock source – Programmable clock source
I2C registers – Software not compatible.
1. On the STM32F77xxx/F76xxx/F72xxx/F73xxx devices, the I2C I/Os support the 20mA drive needed in Fast-mode Plus.
2.13 SPI
The STM32F42xxx/F43xxx and STM32F7 Series implement different features on the SPI.
Table 21 presents the SPI differences between the STM32F42xxx/F43xxx and STM32F7
Series devices.
Table 21. SPI differences between the STM32F42xxx/F43xxx and STM32F7 Series devices
STM32F74xxx/F75xxx/
SPI STM32F42xxx/F43xxx STM32F72xxx/F73xxx
F76xxx/F77xxx
Instances x6 x4 | x6 x3 | x5
Features SPI + I2S
Fixed, configurable to 8 or
Data size Programmable from 4 to 16-bit
16 bits
Tx & Rx 16-bit buffers Two 32-bit embedded Rx and Tx FIFOs
Data buffer
(single data frame) (up to 4 data frames)
No
Data packing Yes
(16-bit access only)
SPI TI
SPI TI mode
Mode SPI Motorola mode
SPI Motorola mode
NSSP mode
Speed Up to 45 Mbit/s Up to 54 Mbit/s
SPI registers Software not compatible
2.14 CRC
The STM32F7 Series devices implements a similar CRC (Cyclic redundancy check)
calculation unit as the STM32F42xxx/F43xxx devices.
Table 22 presents the CRC differences between the STM32F42xxx/F43xxx and STM32F7
Series devices.
Table 22. CRC differences between the STM32F42xxx/F43xxx and STM32F7 Series
devices
CRC STM32F42xxx/F43xxx STM32F7 Series
2.16 ADC
The STM32F7 Series devices embed the same ADC peripherals with the same features
except for external triggers in regular and injected channels.
Table 24 and Table 25 present the differences of external trigger for regular channels and
injected channels between the STM32F42xxx/F43xxx and STM32F7 Series devices.
Table 24. External trigger for regular channel differences between the
STM32F42xxx/F43xxx and STM32F7 Series devices
Source
Type EXTSEL[3:0]
STM32F42xxx/F43xxx STM32F7 Series
Table 25. External trigger for injected channel differences between the
STM32F42xxx/F43xxx and STM32F7 Series devices
Source
Type EXTSEL[3:0]
STM32F42xxx/F43xxx STM32F7 Series
3 Conclusion
This application note is a useful complement to the datasheets and reference manuals,
which gives a simple guideline to migrate from an existing STM32F42xxx/F43xxx device to
a STM32F7 Series device.
4 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.