AN6274 · Application noteGetting started with STM32C5 MCU hardware development
Download .pdfOpen in the full document

Boot configuration

Boot mode selection

At startup, the BOOT0 pin or option bit (based on the value of the BOOT_SEL option bit) and BOOTADD[31:8] option bytes are used to select the boot memory address that includes:

  • Boot from any address in user flash memory
  • Boot from system memory

    → Bootloader

When boot from user flash is selected, the boot address is defined by BOOTADD. This address can be locked thanks to BOOT_LOCK.

Embedded bootloader

The embedded bootloader is located in the system memory and is programmed by ST during production. It is used to reprogram the flash memory using USART, SPI, FDCAN, or USB in device mode through the DFU (device firmware upgrade).

Refer to the application note STM32 microcontroller system memory boot mode (AN2606).

STM32C5 boot modes

The following table provides the details of the boot modes for the STM32C5 devices.
Table 3. STM32C5 boot modes
RPD_STATEBOOT_SEL option bitBOOT0 option bit

BOOT0

pin

EMPTY flag value(1)Boot area
Level 01X0XBoot address defined by user option byte BOOTADD[31:8]
1Bootloader
00X0Boot address defined by user option byte BOOTADD[31:8]
1Bootloader
1XBootloader
Level 2 with boundary scan and level 2XXXXBoot address defined by user option byte BOOTADD[31:8]

Empty check

During the option byte loading phase, after loading all options, the flash memory interface checks whether the boot location in the main memory, indicated by BOOTADD[31:8], is programmed. The result of this check, with the boot0 information, is used to determine where the system should boot from. It prevents the system from booting from the main flash memory area when, for instance, no user code has been programmed.

The main flash memory empty check status can be read from the EMPTY bit in the FLASH access control register (FLASH_ACR). Software can modify it by writing an appropriate value to the EMPTY bit.

The BOOT_LOCK, which locks modifications of option bytes involved in BOOT selection, has no impact on this empty check mechanism.

Embedded bootloader

The embedded bootloader is located in the system memory, programmed by ST during production. It is used to reprogram the flash memory by using USART, SPI, FDCAN, or USB in device mode through the DFU (device firmware upgrade).

For further information, refer to the application note STM32 microcontroller system memory boot mode (AN2606).

1 The boot address, defined by BOOTADD option byte, is considered empty only if the FLASH word is equal to 0xFFFF FFFF. In this case, at option byte loading, the EMPTY bit is set in FLASH_CR.

System bootloader

The system bootloader is located in the system memory, programmed by ST during the production. It is used to reprogram the flash memory using one of the following serial interfaces.

Table 4. Bootloader summary
Interface namePackage options
UFQFPN20TSSOP20UFQFPN24UFQFPN32LQFP32UFQFPN48LQFP48LQFP64LQFP80LQFP100 LQFP144
USART1-----PA9/PA10PA9/PA10PA9/PA10PA9/PA10PA9/PA10PA9/PA10
USART2PA2/PA3PA2/PA3PA2/PA3PA2/PA3PA2/PA3PA2/PA3PA2/PA3PA2/PA3PA2/PA3PA2/PA3PA2/PA3
USART3---------PD8/PD9PD8/PD9
UART4PA0/PA1PA0/PA1PA0/PA1PA0/PA1PA0/PA1PA0/PA1PA0/PA1PA0/PA1PA0/PA1PA0/PA1PA0/PA1
SPI1PA4/PA5/PA6/PA7PA4/PA5/PA6/PA7PA4/PA5/PA6/PA7PA4/PA5/PA6/PA7PA4/PA5/PA6/PA7PA4/PA5/PA6/PA7PA4/PA5/PA6/PA7PA4/PA5/PA6/PA7PA4/PA5/PA6/PA7PA4/PA5/PA6/PA7PA4/PA5/PA6/PA7
SPI2-----PB12/PB13/PB14/PB15PB12/PB13/PB14/PB15PB12/PB13/PB14/PB15PB12/PB13/PB14/PB15PB12/PB13/PB14/PB15PB12/PB13/PB14/PB15
SPI3(1)-----PB0/PB1/PB2/PB8PB0/PB1/PB2/PB8PB0/PB1/PB2/PB8PB0/PB1/PB2/PB8PB0/PB1/PB2/PB8PB0/PB1/PB2/PB8
FDCAN(2)---PB5/PB6PB5/PB6PB5/PB6PB5/PB6PB5/PB6PB5/PB6PB5/PB6PB5/PB6
USB DFUPA11/PA12PA11/PA12PA11/PA12PA11/PA12PA11/PA12PA11/PA12PA11/PA12PA11/PA12PA11/PA12PA11/PA12PA11/PA12

For more details refer to the application note STM32 microcontroller system memory boot mode (AN2606).

1 Not supported on STM32C53x/C54x.
2 FDCAN1 on STM32C55x/C56x and FDCAN2 on STM32C53x/C54x/C59x/C5Ax.