Boot Configuration; Table 2. Boot Modes - ST STM32C0 Series Getting Started

Hardware development
Hide thumbs Also See for STM32C0 Series:
Table of Contents

Advertisement

3

Boot configuration

Three different boot modes can be selected through the BOOT0 pin, the BOOT_LOCK bit in the FLASH_SECR
register, and the boot configuration bits nBOOT1, BOOT_SEL, and nBOOT0 in the user option byte, as shown in
the following table.
BOOT_LOCK
0
0
0
0
0
0
1
The boot mode configuration is latched on the fourth rising edge of SYSCLK after a reset. It is up to the user to
set the boot mode configuration related to the required boot mode.
The boot mode configuration is 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 it is still accessible from its original memory space (0x0800 0000). In other words, the flash memory
content 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 0x1FFF0000.
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).
Forcing boot from the user flash memory
The BOOT_LOCK bit enables forcing a unique entry point in the main flash memory for boot, regardless of the
other boot mode configuration bits.
Empty check
Internal empty check flag (the EMPTY bit of the flash access control register (FLASH_ACR)) is implemented to
allow easy programming of virgin devices by the bootloader. This flag is used when BOOT0 pin is defining Main
flash memory as the target boot area. When the flag is set, the device is considered as empty. System memory
(bootloader) is selected, instead of the Main Flash, as a boot area to allow the user to program the flash memory.
This flag is updated only during Option bytes loading: it is set when the content of the address 0x08000 0000 is
read as 0xFFFF FFFF, otherwise it is cleared. It means a power reset or setting of the OBL_LAUNCH bit in the
FLASH_CR register is needed to clear this flag after programming of a virgin device to execute the user code
after the system reset. The software can also directly write the EMPTY bit.
Note:
If the device is programmed for a first time but the option bytes are not reloaded, the device still selects the
system memory as a boot area after a system reset.
AN5673 - Rev 2
Table 2.
Boot mode configuration
nBOOT1 bit
BOOT0 pin
X
0
1
1
0
1
X
X
1
X
0
X
X
X
Boot modes
nBOOT_SEL bit
nBOOT0 bit
0
X
0
X
0
X
1
1
1
0
1
0
X
X
AN5673
Boot configuration
Selected boot area
Main flash memory
System memory
Embedded SRAM
Main flash memory
System memory
Embedded SRAM
Main flash memory
page 17/32

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32C0 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents