DocID025202 Rev 7
56/1080
RM0365
56
3.5 Boot
configuration
In the STM32F302xx, three different boot modes can be selected through the BOOT0 pin
and nBOOT1 bit in the User option byte, as shown in the following table:
The values on both BOOT0 pin and nBOOT1 bit are latched on the 4th rising edge of
SYSCLK after a reset.
It is up to the user to set the nBOOT1 and BOOT0 to select the required boot mode. The
BOOT0 pin and nBOOT1 bit are also resampled when exiting from Standby mode.
Consequently they must be kept in the required Boot mode configuration in Standby mode.
After this startup delay has elapsed, the CPU fetches the top-of-stack value from address
0x0000 0000, then starts code execution from the boot memory at 0x0000 0004. Depending
on the selected boot mode, main Flash memory, system memory or SRAM is accessible as
follows:
•
Boot from main Flash memory: the main Flash memory is aliased in the boot memory
space (0x0000 0000), but still accessible from its original memory space (0x0800
0000). In other words, the Flash memory contents can be accessed starting from
address 0x0000 0000 or 0x0800 0000.
•
Boot from system memory: the system memory is aliased in the boot memory space
(0x0000 0000), but still accessible from its original memory space (0x1FFF D800).
•
Boot from the embedded SRAM: the SRAM is aliased in the boot memory space
(0x0000 0000), but it is still accessible from its original memory space (0x2000 0000).
3.5.1 Embedded
boot
loader
The embedded boot loader is located in the System memory, programmed by ST during
production. It is used to reprogram the Flash memory through
•
USART1(PA9/PA10), USART2(PD5/PD6) or USB(PA11/PA12) on STM32F302xB/C
devices,
•
USART1(PA9/PA10), USART2(PA2/PA3) or USB(PA11/PA12) on STM32F302x6/8 and
STM32F302xD/E devices.
Table 5. Boot modes
Boot mode selection
Boot mode
Aliasing
nBOOT1
BOOT0
-
-
x
0
Main Flash memory
Main flash memory is selected as boot
area
1
1
System memory
System memory is selected as boot area
0
1
Embedded SRAM
Embedded SRAM (on the DCode bus) is
selected as boot area