12. System configuration, boot, and security (SBS)

12.1 SBS introduction

The STM32C5 devices feature a set of configuration registers located in the SBS. On top of various device configurations, this SBS peripheral controls key boot and security features, including debug control.

12.2 SBS main features

12.3 SBS functional description

12.3.1 SBS block diagram

The figure below shows the SBS block diagram, including the following main functions:

Figure 36. SBS block diagram

SBS block diagram showing inputs, internal blocks, and outputs.

The diagram illustrates the SBS (System configuration, boot, and security) block structure. It is a gray rectangular block containing three internal white boxes: 'System configuration', 'Boot control', and 'HPDL counter'.
Inputs to the SBS block from the left are:

Internal connections:The identifier 'MSv76002V1' is located in the bottom right corner of the diagram area.

SBS block diagram showing inputs, internal blocks, and outputs.

12.3.2 SBS signals

The following table details the user-relevant internal signals that interface the SBS.

Table 80. SBS internal input/output signals

Signal nameTypeDescription
SBS_BOOT_PINInputSelect booting on user flash memory or bootloader
sbs_boot_addressesList of addresses defined by the flash memory:
– BOOT_ADDR: boot address
sbs_rdp_levelSignal based on the RDP_LEVEL option byte to activate the different security mechanisms depending on the product use. Expected values are described in Section 6: Embedded flash memory (FLASH).
sbs_init_vtorOutputVector address for Cortex-M33
sbs_hdplHDPL (temporal isolation level, ID of the boot level, used to isolate boot levels)
This signal reflects a monotonic counter that can be incremented from 0 to 3, and that is reset to zero only on software reset or POR.
sbs_ap_unlockedControl the Cortex-M33 access port.

12.3.3 SBS reset and clocks

The SBS configuration port is clocked by the AHB bus clock. There is a general reset and a debug configuration reset controlled in DBGMCU.

12.3.4 SBS I/O compensation cell management

The I/O compensation cell generates an 8-bit value for the I/O buffer: 4 bits for N-MOS and 4 bits for P-MOS. This value depends on the process, voltage, temperature (PVT) operating conditions. These bits are used to control the output impedance in the I/O buffer, and the slew rate of the I/O commutation (the \(t_{fall}\) and \(t_{rise}\) time), in order to reduce the I/O noise on the power supply.

As shown in Figure 37, the compensation cell is split in two blocks:

Figure 37. Compensation cell management

Block diagram of Compensation cell management. The SBS_CCCSR register controls the system. It has an 'enable' output to the Compensation cell and a 'ready' feedback input. It also provides 'code selection' to a multiplexer. The multiplexer has two inputs: '0' from SBS_CCVALR and '1' from SBS_CCSWCR. The output of the multiplexer goes to the Compensation cell. The Compensation cell outputs a 'value' back to the SBS_CCCSR register. Reference ID: MSv69110V1.
Block diagram of Compensation cell management. The SBS_CCCSR register controls the system. It has an 'enable' output to the Compensation cell and a 'ready' feedback input. It also provides 'code selection' to a multiplexer. The multiplexer has two inputs: '0' from SBS_CCVALR and '1' from SBS_CCSWCR. The output of the multiplexer goes to the Compensation cell. The Compensation cell outputs a 'value' back to the SBS_CCCSR register. Reference ID: MSv69110V1.

The compensation cell value can be read when the READY flag is set in SBS_CCCSR. With CODESEL in SBS_CCCSR, the application can select the value to apply between two options: the code from the cell, or the code from SBS_CCSWCR.

By default, the compensation cells are disabled, and a fixed code is applied to all I/Os.

The compensation cell can be used only when the HSI oscillator is enabled, see Section 9: Reset and clock control (RCC) for more details on the HSI oscillator.

Figure 38. Compensation cell use

Graph showing Compensation code vs Voltage. The y-axis has two levels: 'Slow' and 'Fast'. The x-axis shows voltage levels: 1.71, 2.0, 2.2, 2.7, and 3.3. The compensation code is 'Fast' for voltages below 2.0V and above 2.7V. It transitions to 'Slow' at 2.0V and remains 'Slow' until 2.2V. Between 2.0V and 2.2V, the code is in a transition state (shaded gray). It transitions back to 'Fast' at 2.7V and remains 'Fast' until 3.3V. Reference ID: MSv69111V2.
Graph showing Compensation code vs Voltage. The y-axis has two levels: 'Slow' and 'Fast'. The x-axis shows voltage levels: 1.71, 2.0, 2.2, 2.7, and 3.3. The compensation code is 'Fast' for voltages below 2.0V and above 2.7V. It transitions to 'Slow' at 2.0V and remains 'Slow' until 2.2V. Between 2.0V and 2.2V, the code is in a transition state (shaded gray). It transitions back to 'Fast' at 2.7V and remains 'Fast' until 3.3V. Reference ID: MSv69111V2.

12.3.5 SBS boot control

The SBS can be used to control the boot entry points considering the product settings. The main boot control actions are listed below:

Note: For more details on STM32C5xx BOOT control, refer to Section 4: Boot modes.

SBS HDPL (temporal isolation level) management

The HDPL is a monotonic counter incremented during the boot stages. The HDPL is reset to its default value only after a power-on or a system reset. This default value is 1.

The devices use HDPL information to automatically isolate code and its associated secrets (like keys) during the boot process. Incrementing HPDL ensures that private code and data for one boot stage cannot be directly accessible from later boot stages.

The HDPL is used by the user flash memory. See Section 6: Embedded flash memory (FLASH) for more details.

The HDPL can take the value from 1 to 3. When reaching the value 3, HDPL keeps this value until reset. The current HDPL value is readable in HDPL bitfield of SBS_HDPLSR.

To increment the HDPL by one, the application must write 0x6A to INCR_HDPL in SBS_HDPLCR. After such increment, and before doing any subsequent action, the user must check that the HDPL has effectively been incremented reading SBS_HDPLSR.

Table 81. HDPL encoded values

HDPLCode
10x51
20x8A
30x6F
All other values

12.3.6 SBS hardware secure storage control

This feature ensures the isolation of keys including the key derivation (DHUK) mechanism protecting data using a hardware key different for the identified domains.

Figure 39. SBS hardware secure storage control

Block diagram of SBS hardware secure storage control. The SBS block contains an HDPL counter, a Hardware secure storage control block, and a NEXT-HDPL block. The HDPL counter feeds into the Hardware secure storage control block. The Hardware secure storage control block feeds into the NEXT-HDPL block. The NEXT-HDPL block outputs the sbs_next_hdpl signal to the SAES block. The SAES block contains the DHUK block. The DHUK block feeds into the RHUK block. The RHUK block feeds into the Flash memory block.

The diagram illustrates the SBS hardware secure storage control architecture. Within the SBS block, an HDPL counter provides input to the Hardware secure storage control block. This block then provides input to the NEXT-HDPL block. The output of the NEXT-HDPL block is the sbs_next_hdpl signal, which is sent to the SAES block. Inside the SAES block, the DHUK block receives input from the sbs_next_hdpl signal and provides output to the RHUK block. The RHUK block then provides input to the Flash memory block.

Block diagram of SBS hardware secure storage control. The SBS block contains an HDPL counter, a Hardware secure storage control block, and a NEXT-HDPL block. The HDPL counter feeds into the Hardware secure storage control block. The Hardware secure storage control block feeds into the NEXT-HDPL block. The NEXT-HDPL block outputs the sbs_next_hdpl signal to the SAES block. The SAES block contains the DHUK block. The DHUK block feeds into the RHUK block. The RHUK block feeds into the Flash memory block.

All keys encrypted using the SAES/DHUK inherit of the RHUK property: unique per device.

The table below gives the value of HDPL function of NEXTHDPL value.

Table 82. NEXT-HDPL logic

HDPL[7:0] in
SBS_HDPLSR
NEXTHDPL[1:0]
0123
1 (0x51)0x510x8A0x6F
2 (0x8A)0x8A0x6F
3 (0x6F)0x6F0x6F
Others0x6F

12.4 SBS interrupts

SBS does not support interrupts.

12.5 SBS registers

For the actual availability of some peripherals/features and their related bits, check the datasheet or Table 3: Memory map and peripheral register boundary addresses. If not present, consider them as reserved, and keep them at reset value.

12.5.1 SBS temporal isolation control register (SBS_HDPLCR)

Address offset: 0x010

Reset value: 0x0000 00B4

Reset: system reset

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.INCR_HDPL[7:0]
rwrwrwrwrwrwrwrw

Bits 31:8 Reserved, must be kept at reset value.

Bits 7:0 INCR_HDPL[7:0]: HDPL value increment

0xB4: No increment

0x6A: Recommended value to increment HDPL level by one

Other: All other values allow an HDPL level increment.

12.5.2 SBS temporal isolation status register (SBS_HDPLSR)

Address offset: 0x014

Reset value: 0x0000 0051

Reset: system reset

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.HDPL[7:0]
rrrrrrrr

Bits 31:8 Reserved, must be kept at reset value.

Bits 7:0 HDPL[7:0]: Temporal isolation level

This bitfield returns the current temporal isolation level.

0x51: HDPL1, hide protection level to be used to execute and protect an immutable root of trust (IROT) stage. First code to be executed at each reset of the platform. To ensure secure boot, this code must be immutable)

0x8A: HDPL2, hide protection level to be used to execute and protect an updatable Root of Trust (UROT) stage. UROT is executed from IROT to complete the immutable root of trust execution during boot stages

0x6F: HDPL3, hide protection level to be used to execute the application. It is a temporal isolation level that can be used to run the application when it has to be isolated from IROT and UROT)

12.5.3 SBS next HDPL control register (SBS_NEXTHDPLCR)

Note: This section applies only to STM32C59xx/C5Axx devices.

Address offset: 0x018

Reset value: 0x0000 0000

Reset: system reset

Register security: no restriction

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.NEXTHDPL[1:0]
rwrw

Bits 31:2 Reserved, must be kept at reset value.

Bits 1:0 NEXTHDPL[1:0]: Index to point to a higher HDPL than the current one

This bitfield is used to add the increment to HDPL to access to the next secure storage areas through NEXT-HDPL.

00: NEXT-HDPL = HDPL

01: NEXT-HDPL = HDPL + 1

10: NEXT-HDPL = HDPL + 2

11: NEXT-HDPL = HDPL + 3

12.5.4 SBS product mode and configuration register (SBS_PMCR)

Address offset: 0x100

Reset value: 0x8000 0000

Reset: system reset

Register security: there is no access restriction.

31302928272625242322212019181716
Res.ETH1T
XLPI
ETH1P
DACK
ETH1I
NTPOL
ETH1_SEL_PHY[3:0]Res.Res.Res.Res.Res.Res.Res.Res.
rrrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ADC1_I
N7_RE
MAP
ADC1_I
N6_RE
MAP
ADC1_I
N5_RE
MAP
ADC1_I
N2_RE
MAP
rwrwrwrw

Bit 31 Reserved, must be kept at reset value.

Bit 30 ETH1TXLPI: Ethernet TxLPI status

This bit is set and reset by hardware.

When set, this bit indicates that the MAC has entered Tx LPI mode.

Bit 29 ETH1PDACK: Ethernet power-down acknowledge

This bit is set and reset by hardware.

When set, this bit indicates that the Ethernet controller has complete its power-down sequence and its clock can be stopped.

0: Ethernet functional / power-down sequence not yet completed

1: Ethernet power-down sequence completed

Bit 28 ETH1INTPOL: Ethernet external PHY interrupt polarity configuration

0: active high

1: active low

Bits 27:24 ETH1_SEL_PHY[3:0]: Ethernet PHY interface selection

0000: GMII or MII

0100: RMII

Other: reserved

Bits 23:4 Reserved, must be kept at reset value.

Bit 3 ADC1_IN7_REMAP: ADC1 channel IN7 remap

0: ADC1_IN7 is mapped on PA7

1: ADC1_IN7 is mapped on PB1

Note: This bit is only available for STM32C53x/542 device.

12.5.5 SBS FPU interrupt mask register (SBS_FPUIMR)

Address offset: 0x104
Reset value: 0x0000 001F
Reset: system reset
This register is only accessible through a privilege transaction.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FPU_IE[5:0]
rwrwrwrwrwrw

12.5.6 SBS memory erase status register (SBS_MESR)

Address offset: 0x108

Reset value: 0x000X 000X

Note: Bits 0 and 16 are not affected by system reset.

Register security: always accessible

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.IPMEE
rc_w1
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MCLR
rc_w1

Bits 31:17 Reserved, must be kept at reset value.

Bit 16 IPMEE: ICACHE erase status

This bit is set by hardware when an ICACHE erase is completed after potential tamper detection, or a product state regression (refer to Section 40: Tamper and backup registers (TAMP) for more details). This bit is cleared by software by writing 1 to it.

0: ICACHE erase ongoing

1: ICACHE erase ended

Bits 15:1 Reserved, must be kept at reset value.

Bit 0 MCLR: Device memories erase status

This bit is set by hardware when a SRAM2 and ICACHE erase is completed after power-on reset or tamper detection, or product state regression (refer to Section 40: Tamper and backup registers (TAMP) for more details).

This bit is not reset by system reset and is cleared by software by writing 1 to it.

0: Memory erase ongoing if not yet cleared by software

1: Memory erase done

12.5.7 SBS compensation cell for I/Os control and status register (SBS_CCCSR)

Address offset: 0x110

Reset value: 0x0000 0002

Reset: system reset

Register security: always accessible

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.RDY1Res.Res.Res.Res.Res.Res.CS1EN1
rrwrw

Bits 31:9 Reserved, must be kept at reset value.

12.5.8 SBS compensation cell for I/Os value register (SBS_CCVALR)

Address offset: 0x114

Reset value: 0x0000 00XX

Reset: system reset

Register security: always accessible

12.5.8column_2Bit 8 Bit 1 Bit 0RDY1 CS1 ENcolumn_5column_6column_7column_8column_9column_10column_11column_12column_13column_14column_15RM0522
31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.APSRC1[3:0]ANSRC1[3:0]
rrrrrrrr
Bits 7:4APSRC1[3:0]: Compensation value for the PMOS transistor
Bits 3:0ANSRC1[3:0]: Compensation value for the NMOS transistor
ST logo
ST logo

12.5.9 SBS compensation cell for I/Os software code register (SBS_CCSWCR)

Address offset: 0x118

Reset value: 0x0000 0078

Reset: system reset

Register security: always accessible

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.SW_APSRC1[3:0]SW_ANSRC1[3:0]
rwrwrwrwrwrwrwrw

Bits 31:8 Reserved, must be kept at reset value.

Bits 7:4 SW_APSRC1[3:0]: PMOS compensation code for the VDD power rails

This bitfield is written by software to define an I/O compensation cell code for PMOS transistors of the VDDIO power rail. This code is applied to the I/O when CS1 is set in SBS_CCSR.

Bits 3:0 SW_ANSRC1[3:0]: NMOS compensation code for VDD power rails

This bitfield is written by software to define an I/O compensation cell code for NMOS transistors of the VDD power rail. This code is applied to the I/O when CS1 is set in SBS_CCSR.

12.5.10 SBS Class B register (SBS_CFGR2)

Address offset: 0x120

Reset value: 0x0000 0000

Reset: system reset

Register security: always accessible

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ECCLPVDLSELCLL
rwrsrsrs

Bits 31:4 Reserved, must be kept at reset value.

Bit 3 ECCL: ECC lock

This bit is set and cleared by software. It can be used to enable and lock the flash memory double ECC error with break input of TIM1/8/15/16/17.

0: Double ECC error flag disconnected to timer break inputs

1: Double ECC error flag connected to timer break inputs

Bit 2 PVDL: PVD lock

This bit is set by software and cleared only by a system reset. It can be used to enable and lock the PVD connection with TIM1/8/15/16/17 break inputs.

0: PVD interrupt disconnected from timer break inputs. PVD_EN and PVD_SEL[2:0] in PWR registers are read/write.

1: PVD interrupt is connected to timer break inputs. PVD_EN and PVD_SEL[2:0] in PWR registers are read only

Bit 1 SEL: SRAM ECC error lock

This bit is set by software and cleared only by a system reset. It can be used to enable and lock the SRAM double ECC error signal with break input of TIM1/8/15/16/17.

0: SRAM double ECC error flag disconnected from timer break inputs

1: SRAM double ECC error flag connected to timer break inputs

Bit 0 CLL: Core lockup lock

This bit is set by software and cleared only by a system reset. It can be used to enable and lock the lockup (HardFault) output of the Cortex-M33 with TIM1/8/15/16/17 break inputs.

0: Lockup output disconnected from timer break inputs

1: Lockup output connected to timer break inputs

12.5.11 SBS CPU lock register (SBS_CLCKR)

Address offset: 0x144

Reset value: 0x0000 0000

Reset: system reset

Register security: This register can be read and written by privileged access only.
Unprivileged access is RAZ/WI.

This register is used to lock the configuration of the MPU and VTOR registers of the Cortex-M33.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LOCK
MPU
LOCKV
TOR
rsrs

Bits 31:2 Reserved, must be kept at reset value.

Bit 1 LOCKMPU: MPU register lock

This bit is set by software and cleared only by a system reset. When set, this bit disables write access to MPU_CTRL, MPU_RNR, and MPU_RBAR registers.

0: MPU registers write enabled

1: MPU registers write disabled

Bit 0 LOCKVTOR: VTOR register lock

This bit is set by software and cleared only by a system reset.

0: VTOR register write enabled

1: VTOR register write disabled

12.5.12 SBS ECC NMI mask register (SBS_ECCNMIR)

Address offset: 0x14C

Reset value: 0x0000 0000

Reset: system reset

Register security: This register is only accessible through a privilege transaction.

This register sets up the expected behavior on NMI regarding double ECC errors from the flash memory.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ECCN
MI_MA
SK_EN
rw

Bits 31:1 Reserved, must be kept at reset value.

Bit 0 ECCNMI_MASK_EN: NMI behavior setup when a double ECC error occurs on FLASH data part

0: NMI generated if a double ECC error in the FLASH data part

1: NMI not generated if a double ECC error in the FLASH data part

12.5.13 SBS register map

Table 83. SBS register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x010SBS_HDPLCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.INCR_HDPL[7:0]
Reset value10110100
0x014SBS_HDPLSRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.HDPL[7:0]
Reset value01010001
0x018SBS_NEXTHDPLCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.NEXTHDPL[1:0]
Reset value00
0x01C-0x0FCReserved
0x100SBS_PMCRRes.Res.ETHTXLPIETHPDACKETHINTPOLETH_SEL_PHY[3:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ADC1_IN7_REMAP
Reset value000000ADC1_IN6_REMAP
0x104SBS_FPUIMRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FPU_IE[5:0]
Reset value01111

Table 83. SBS register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x108SBS_MESRResResResResResResResResResResResResResResResIPMEEResResResResResResResResResResResResResResResMCLR
Reset value000
0x110SBS_CCCSRResResResResResResResResResResResResResResResResResResResResResResRDY10ResResResResResResCS1EN1
Reset value010
0x114SBS_CCVALRResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
Reset valueXXXXXXXX
0x118SBS_CCWCRResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
Reset value011110000
0x120SBS_CFGR2ResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
Reset value00000
0x124-0x140Reserved
0x144SBS_CLCKRResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
Reset value00
0x14CSBS_ECCNMIRResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
Reset value0

Refer to Section 2.2: Memory organization for the register boundary addresses.