8. Resource isolation framework security controller (RIFSC)

8.1 Introduction

Resource isolation framework (RIF) is a comprehensive set of hardware blocks designed to enforce and manage isolation of STM32 hardware resources, like memory and peripherals.

The RIFSC (RIF security controller) is composed of three sets of registers, each managing a specific set of hardware resources:

8.2 RIFSC main features

8.3 RIFSC implementation

RIMU

Master port RIF protections in this device (using RIMU) are defined in Table 37. Possible inheritance from RISUP of RIF configuration is also defined.

Table 37. RIMU resource assignment

Index(1)Master nameCID at resetRISUP(2) inheritance
-CPU1 (Cortex-A35)0x1No
-CPU2 (Cortex-M33)0x2
0Trace (ETR)0x0
1SDMMC1RISUP76CID, secure guard(3)
2SDMMC2RISUP77
3SDMMC3RISUP78
4OTG_HSRISUP66
5USBHRISUP63
6ETH1RISUP60
7ETH2RISUP61
10DCMIPP (camera)RISUP87
11LTDC L1 or L20x0No
12LTDC L3
  1. 1. When no index is written, the CID values are hardcoded, and the master manages security.
  2. 2. When applicable, the corresponding CIDSEL bit is available in RIFSC_RIMC_ATTRx.
  3. 3. The master is forced by hardware to non-secure when its associated RISUP is programmed non-secure.

Note: All DMA instances (HPDMA, LPDMA) are not mentioned, as they automatically manage the CID to use on their master ports (0 to 2, or 0 to 3 only), inheriting the value from the CPU that controls a given channel.

RISUP

Table 38 defines the index of the non-RIF-aware peripherals managed by the RIFSC (RISUP blocks) and the IAC. Few RIF-aware peripherals are also listed.

When a peripheral is used by multiple security domains (like multiple CPU codes), the RCC implements specific clock and reset access control registers, using a dedicated rcc index, also shown in this table.

Table 38. Indexes for non-RIF-aware peripherals (RISUP)

Peripherals 31 to 0
rcc31USART1
30SPDIFRX
rcc29-
28-
rcc27SPI6
26SPI5
rcc25SPI4
24SPI3
rcc23SPI2
22SPI1
rcc21LPTIM5
20LPTIM4
rcc19LPTIM3
18LPTIM2
rcc17LPTIM1
16-
rcc15TIM17
14TIM16
rcc13TIM15
12TIM14
rcc11TIM13
10TIM12
rcc9TIM11
8TIM10
rcc7TIM8
6TIM7
rcc5TIM6
4TIM5
rcc3TIM4
2TIM3
rcc1TIM2
0TIM1
Peripherals 63 to 32
rcc63USBH
62-
rcc61ETH2
60ETH1
rcc59ADC2
58ADC1
rcc57HDP
56FDCAN
rcc55-
54MDF1
rcc53-
52SAI4
rcc51SAI3
50SAI2
rcc49SAI1
48-
rcc47-
46-
rcc45-
44-
rcc43I2C3
42I2C2
rcc41I2C1
40LPUART1
rcc39-
38-
rcc37UART7
36USART6
rcc35UART5
34UART4
rcc33USART3
32USART2
Peripherals 95 to 64
rcc95SAES
94PKA
rcc93RNG2
92RNG1
rcc91-
90-
rcc89-
88DCMI_PSSI
rcc87DCMIIPP
86CSI
rcc85-
84-
rcc83-
82-
rcc81-
80105 LTDC common(1)
rcc79-
78- SDMMC3
rcc77- SDMMC2
76- SDMMC1
rcc75-
74110 OCTOSPI1
rcc73- STGEN(2)
72-
rcc71-
70-
rcc69-
68-
rcc67- DDRPERFM
66- OTG_HS
rcc65-
64-
Peripherals 127 to 96
rcc127IAC(2)(3)
126-
rcc125OTFDEC1
124-
rcc123-
122-
rcc121-
120LTDC_L3(3)
rcc119LTDC_L1L2(3)
118ICACHE DCACHE(3)
rcc117-
116I3C3
rcc115I3C2
114I3C1
rcc113-
112-
rcc111-
110SERC
rcc109CRC
108RAMCFG
rcc107DTS
106VREFBUF
rcc105-
104WWDG1
rcc103IWDG4
102IWDG3
rcc101IWDG2
100IWDG1
rcc99CRYP2
98CRYP1
rcc97HASH2
96HASH1
  1. 1. Common configuration registers (refer to the corresponding peripheral section for details).
  2. 2. RIF-aware peripheral, without access control registers in the RIFSC.
  3. 3. No associated registers in the RCC.

IAC and RCC indexes for RIF-aware peripherals and RIF protected memories

Table 39 defines the index of the RIF firewall components and RIF-aware peripherals managed by IAC and RCC peripherals.

Note: All these peripherals are RIF-aware, not requiring RISUP, and usually belonging to multiple compartments.

Table 39. Indexes for RIF-aware peripherals (with RCC control index)

Peripherals 159 to 128
159158157156155154153152151150149148147146145144143142141140139138137136135134133132131130129128
--SYSCFGRIFSCCA35SSCRCCPWREXTI2EXTI1TAMPRTC-HPDMA3HPDMA2HPDMA1-IPCC1---STGEN--RISAF4 (DDR-SDRAM)-RISAF2 (OCTOSPI1)RISAF1 (BKPSRAM)-RISAB5 (RETRAM)-RISAB3 (SRAM1)RISAB2 (SYSRAM high)RISAB1 (SYSRAM low)
rcc---106----102102-858483-87------104-110/11177-76-787474
Peripherals 191 to 160
191190189188187186185184183182181180179178177176175174173172171170169168167166165164163162161160
---------------BSECFMCDDRPHYCDDRCTRL--GPIOZ--GPIOIGPIOHGPIOGGPIOFGPIOEGPIODGPIOCGPIOBGPIOA
rcc--------------103112104104--101--989796959493929190

RIFSC, RCC, and IAC common programming

To program the RISUP and the RCC, and to read back illegal access information in the IAC, refer to Section 5.4: Resource isolation framework (RIF).

8.4 RIFSC functional description

8.4.1 RIFSC block diagrams

The RIFSC is composed of two sets of registers, each managing a specific set of hardware resources: RIMU and RISUP

RIFSC and RIMU block diagram

The following figures show the RIMU block diagrams, associated with its master on the interconnect, and the RIFSC peripheral. RISUP inheritance is defined in Section 8.3.

Figure 18. RIMU block diagram (without inheritance)

Figure 18. RIMU block diagram (without inheritance)
Figure 18. RIMU block diagram (without inheritance)

MSv67854V1

Figure 19. RIMU block diagram (with inheritance from RISUP programming)

Figure 19. RIMU block diagram (with inheritance from RISUP programming)
Figure 19. RIMU block diagram (with inheritance from RISUP programming)

MSv67855V1

RIFSC and RISUP block diagram

Figure 20 shows the block diagram of the RISUP, associated with its slaves on the interconnect, the IAC, and the RIFSC peripherals.

The RISUP logic protecting a peripheral uses information from the RIFSC to determine which security, privilege, and compartment are allowed to go through. There is also inheritance between the access right to the peripheral and the access to the corresponding clocking and reset bits in the RCC peripheral.

Figure 20. RISUP block diagram

Figure 20. RISUP block diagram. This diagram illustrates the architecture of the RISUP (Resource Isolation Security Unit) and its interaction with other system components. At the top, the RIFSC (Resource Isolation Framework Security Controller) is shown with registers: RISC_SECCFG, RISC_PRIVCFG, RISC_CIDCFGx(*), and RISC_SEMCRx. The RIFSC is connected to the AHB bus. Below it, the RCC (Reset and Clock Control) block is connected to the RIFSC via signals: sec, priv, cid, and config. The RISUP block is the central component, containing two RIF gates. Each RIF gate is connected to a Slave peripheral (Slave periph 0 and Slave periph 1) and receives a clock signal (ck_per0 and ck_per1) from the RCC. The RIF gates also receive security (sec) and compartment (cid) signals from the AHB bus. The Slave peripherals are connected to the System bus, which is also connected to Master 1 and Master 2. The RISUP block outputs illegal access signals (per0_ilac and per1_ilac) to the IAC (Illegal Access Controller). The Slave peripherals also output interrupts (per0_irq[0 to 3] and per1_irq[0 to 3]) to the CPU cores (CPU0, CPU1, CPU2, CPU3). A note indicates that the RISC_CIDCFGx(*) register is for the trusted domain only. The diagram is labeled MSv67856V1.
Figure 20. RISUP block diagram. This diagram illustrates the architecture of the RISUP (Resource Isolation Security Unit) and its interaction with other system components. At the top, the RIFSC (Resource Isolation Framework Security Controller) is shown with registers: RISC_SECCFG, RISC_PRIVCFG, RISC_CIDCFGx(*), and RISC_SEMCRx. The RIFSC is connected to the AHB bus. Below it, the RCC (Reset and Clock Control) block is connected to the RIFSC via signals: sec, priv, cid, and config. The RISUP block is the central component, containing two RIF gates. Each RIF gate is connected to a Slave peripheral (Slave periph 0 and Slave periph 1) and receives a clock signal (ck_per0 and ck_per1) from the RCC. The RIF gates also receive security (sec) and compartment (cid) signals from the AHB bus. The Slave peripherals are connected to the System bus, which is also connected to Master 1 and Master 2. The RISUP block outputs illegal access signals (per0_ilac and per1_ilac) to the IAC (Illegal Access Controller). The Slave peripherals also output interrupts (per0_irq[0 to 3] and per1_irq[0 to 3]) to the CPU cores (CPU0, CPU1, CPU2, CPU3). A note indicates that the RISC_CIDCFGx(*) register is for the trusted domain only. The diagram is labeled MSv67856V1.

8.4.2 RIFSC internal signals

Table 40 and Table 41 describe some internal signals available at, respectively, RIMU and RISUP logic levels.

Table 40. RIMU internal input/output signal

NameTypeDescription
per_clkDigital inputPeripheral master port bus clock

Table 41. RISUP internal input/output signals

NameTypeDescription
ck_perXDigital inputPeripheral x kernel clock from RCC
ilacDigital outputIllegal access signal to IAC

8.4.3 RIFSC reset and clocks

RIMU and RISUP logics share the same clock and the same reset as the resource they are protecting.

The RIFSC has a single reset. After a SoC general reset (power-on reset), all non RIF-aware peripherals become non-secure and unprivileged, reachable by any CID.

8.4.4 RIFSC control of masters (RIMU)

RIMC registers in RIFSC, associated with the RIMU logic, assign bus master x to a security domain by setting secure, privileged, and compartment information on the system bus using RIMC_ATTRx registers. Alternatively, when clearing the corresponding SEL bit in RIMC_ATTRx, the bus attribute of the master port x is taken from the RISUP that controls the access to slave port of this peripheral x (supported attribute: CID).

RIMC registers must be initialized by a trusted domain application after the device reset. Optionally this application can set the GLOCK bit in RIMC_CR, preventing further writes to all RIMC registers. This bit can be cleared only by a power-on reset.

If a trusted domain application programs a compartment ID equals 4, 5, or 6 using the MCID[2:0] bitfield, these masters are usually sand boxed to dedicated chunk of memories, and have a reduced set of peripherals and GPIOs.

Note: In the STM32MP21xx device, CID 7 is reserved for multicore debugging (see Section 5.4.7: RIF special security domain: debug domain).

8.4.5 RIFSC control of debug access port (DAP)

For the protection of the DAP master port, a specific hardware has been implemented in the device. The table below summarizes how the DAP peripheral performs its accesses on the interconnect, based on the debug profile selected by the secure application in the device.

Table 42. DAP compartment ID allocation

Debug profileCPU debugMCUs debugDAP CID valueComment
Microcontroller debugNoYessame as Cortex-M33 (0x2)In this profile, both MCUs can be debugged. Only peripherals accessible to Cortex-M33 can be accessed by the DAP, if security and privilege allow it.
Application processor debugYesNosame as Cortex-A35 (0x1)Only peripherals accessible to Cortex-A35 can be accessed by the DAP, if security and privilege allow it.
Global debug (MCUs and CPU)YesYesAny CID (default: 0x7)DAP CID is defined by DAPCID bitfield in RIMC_CR. DAPCID is writable by secure, non-secure, privileged or unprivileged DAP.

Three important notes are linked to this table:

The way to set up these debug profiles in the device is explained in Section 6.3.11: BSEC debug and trace control.

Figure 21 illustrates how BSEC, DAP, RIMU, and RIMC are integrated. If a global debug profile is selected in BSEC (CPU + MCU debug activated), the DAPCID bitfield in RIMC_CR is writable by secure, non-secure, privileged, or unprivileged DAP. The GDPEN bit is also set in RIMC_SR. If any other debug profile is selected, RIMC_CR can be written only by a trusted domain application.

Note: When no debug profile is selected, the DAP CID is zero.

When DAPCID is left with its default value (0x7), the DAP is assigned to the RIF debug domain, when a global debug profile is selected.

DAP privileged level is not defined by RIMU. Hence, if debug tools define the DAP as unprivileged, its access can be rejected by the target even if DAPCID = 0x7.

Figure 21. DAP and its RIMU

Block diagram showing the integration of BSEC, RIMU, RIFSC, and DAP. BSEC provides cpudbg and mcudbg signals to a multiplexer in RIMU. The RIFSC provides RIMC_CR.DAPCID(*) to the multiplexer. The multiplexer output goes to the DAP Master port. RIMU also outputs bus_nsec_o, bus_priv_o, and bus_cid to the AHB or AXI interconnect. The AHB bus connects to the RIFSC and the interconnect. The DAP Master port connects to the interconnect via bus_nsec_i, bus_priv_i, and bus_clk. A note at the bottom states: (*) If glbdbg is set, DAPCID is writable by the DAP.

(*) If glbdbg is set, DAPCID is writable by the DAP.

MSv67858V1

Block diagram showing the integration of BSEC, RIMU, RIFSC, and DAP. BSEC provides cpudbg and mcudbg signals to a multiplexer in RIMU. The RIFSC provides RIMC_CR.DAPCID(*) to the multiplexer. The multiplexer output goes to the DAP Master port. RIMU also outputs bus_nsec_o, bus_priv_o, and bus_cid to the AHB or AXI interconnect. The AHB bus connects to the RIFSC and the interconnect. The DAP Master port connects to the interconnect via bus_nsec_i, bus_priv_i, and bus_clk. A note at the bottom states: (*) If glbdbg is set, DAPCID is writable by the DAP.

8.4.6 RIFSC control of peripherals (RISUP)

RISC registers in RIFSC, associated with the RISUP logic, assign non-RIF aware peripherals to none, one or any security domain (secure, privilege, compartment). The figure below illustrates the principle of this allocation.

Figure 22. Allocation of RISUP resources

Diagram showing the allocation of RISUP resources across 8 peripherals (Periph#0 to Periph#7). It details security access (s, ns, s or ns), privilege access (p, np, p or np), and CID access (CID1, CID2, CID3, All CIDs) for each peripheral. A legend explains the symbols for dynamic CID selection (semaphore) and static/static-locked CID selection. Static lock icon Static lock icon Static lock icon Dynamic CID selection icon Static lock icon Dynamic CID selection icon Static lock icon Static lock icon Dynamic CID selection icon Static lock icon
Periph#0Periph#1Periph#2Periph#3Periph#4Periph#5Periph#6Periph#7
snss or nsss or nsns
pnpp or nppp or npnp
CID1CID2C1 or C2 or noneCID2C2 or C3 or noneCID3All CIDs
All CIDs (ro)All CIDs (ro)

Legend

MSv67859V1

Diagram showing the allocation of RISUP resources across 8 peripherals (Periph#0 to Periph#7). It details security access (s, ns, s or ns), privilege access (p, np, p or np), and CID access (CID1, CID2, CID3, All CIDs) for each peripheral. A legend explains the symbols for dynamic CID selection (semaphore) and static/static-locked CID selection. Static lock icon Static lock icon Static lock icon Dynamic CID selection icon Static lock icon Dynamic CID selection icon Static lock icon Static lock icon Dynamic CID selection icon Static lock icon

For each peripheral, the RIF allows the following policies:

Note: For the first three cases, the filtering based on secure and privileged always applies. At any point in time, the trusted domain application can lock the RIF configuration of a peripheral until the next reset, by setting the RLOCK bit in RISC_RCFGLOCKR.

As defined in Section 5.4: Resource isolation framework (RIF), the debug domain (privileged) must be granted following accesses when activated:

RISUP application information

To assign statically the peripheral x to the compartment y, a trusted domain application must set SCID to CIDy and CFEN to 1 in RISC_PERx_CIDCFGR. An application in compartment y can then set or clear the SECx bit in RISC_SECCFG, and the PRIVx bit in RISC_PRIVCFGR, if the security and privilege of the access are sufficient.

To grant statically the peripheral x to any compartment, a trusted domain application must clear CFEN bit to 0 in RISC_PERx_CIDCFGR. An application in any compartment can then set or clear SECx in RISC_SECCFG, and PRIVx in RISC_PRIVCFGR, if the security and privilege of the access are sufficient.

Note: Only a secure privileged application can write to RISC_SECCFGR, while only a privileged application can write to RISC_PRIVCFGR.

The SECx bit in RISC_SECCFG controls the secure access to PRIVx in RISC_PRIVCFGR.

The dynamic assignment of peripheral x to compartment y1 or y2 is done as follows:

Note: At any time, a trusted domain application can reset the peripheral x semaphore by clearing then setting SEM_EN in RISC_PERx_CIDCFGR.

When the trusted domain needs to prevent any compartment to access a peripheral x, the recommended procedure is the following:

  1. 1. Mask illegal access interrupts from peripheral x in IAC_IER register.
  2. 2. Set RISC_CIDCFGRx to statically assign it to TDCID.
  3. 3. Set RCC_xCFGR with default values.
  4. 4. Reset all SEMWLCy bits, and set SEM_EN and CFEN bits in RISC_PERx_CIDCFGR.

From that point, no applications can take the semaphore, hence the access to the peripheral is prevented.

Note: Steps 2 to 3 are not needed if the RCC bits corresponding to this peripheral are at the default values.

The above methods are summarized in the figure below.

Figure 23. RISUP initialization principle

Flowchart showing RISUP initialization principle for a given peripheral resource. It branches based on CFEN and SEM_EN settings, leading to various privilege and security update steps for CIDs, eventually converging at 'Enable the resource'.
graph TD
    Start(( )) --> D1{ }
    D1 -- "[CFEN=0]" --> A1([Any secure privileged CID can update security])
    D1 -- "[CFEN=1]" --> D2{ }
    D2 -- "[SEM_EN=0]" --> A2([Grant peripheral usage to one CID])
    D2 -- "[SEM_EN=1]" --> A3([Grant peripheral usage to some CIDs])
    A3 --> B1([One CID takes ownership of the peripheral])
    B1 --> A4([Granted privileged secure CID updates peripheral security])
    A2 --> A4
    A1 --> D3{ }
    D3 -- "[non-secure]" --> A5([Any privileged CID can update privilege])
    D3 -- "[secure]" --> A6([Any secure privileged CID can update privilege])
    A4 --> D4{ }
    D4 -- "[non-secure]" --> A7([Granted privileged CID can update peripheral privilege])
    D4 -- "[secure]" --> A8([Granted secure privileged CID can update peripheral privilege])
    A5 --> End(( ))
    A6 --> End
    A7 --> End
    A8 --> End
    End --> C1([Enable the resource])
    

CFEN: Compartment filtering enable
SEM_EN: Semaphore enable
Blue: resource configuration delegation to one CPU (if resource not locked)
MSv67860V1

Flowchart showing RISUP initialization principle for a given peripheral resource. It branches based on CFEN and SEM_EN settings, leading to various privilege and security update steps for CIDs, eventually converging at 'Enable the resource'.

8.4.7 Managing illegal accesses

RIF component RISUP does not use the standard interrupt lines toward NVIC or GIC concentrators. The IAC captures all RIF interrupt events, called illegal access events.

Refer to Section 11: Illegal access controller (IAC) for more information on the way illegal accesses are managed.

8.5 RIFSC registers

These registers are accessible through the register interface of the RIFSC peripheral.

Registers Section 8.5.1 to Section 8.5.6 are slave control registers for peripherals.

Registers Section 8.5.7 and Section 8.5.9 are master configuration registers.

If security and privileged policy allows it, the debug domain traffic goes through, regardless of any CID filtering policy.

8.5.1 RIFSC RISC slave configuration register x (RIFSC_RISC_CR)

Address offset: 0x000

Reset value: 0x0000 0000

Secure privileged, trusted domain CID write access only. Any read access is allowed on this register. Writes are ignored if GLOCK is set.

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.GLOCK
rs

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

Bit 0 GLOCK: Global lock

This bit locks the configuration of RIFSC RISC registers until next reset. This bit is cleared by default and, once set, it cannot be reset until global RIFSC reset.

0: RIFSC RISC registers are writable.

1: All writes to RIFSC RISC registers are ignored, except RIFSC_RISC_PERy_SEMCR.

8.5.2 RIFSC RISC slave security configuration register x (RIFSC_RISC_SECCFGRx)

Address offset: 0x010 + 0x4 * x, (x = 0 to 5)

Reset value: 0x0000 0000

Non-secure or unprivileged writes to this register are ignored, while any read is allowed. Writes are ignored if GLOCK is set in RIFSC_RISC_CR.

31302928272625242322212019181716
SEC{i + 32 * x}
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SEC{i + 32 * x}
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 SEC{i + 32 * x}: Security configuration for peripheral {i + 32 * x} (i = 0 to 31)

0: Secure and non-secure data access are granted to the peripheral {i + 32 * x}.

1: Secure data access only are granted to the peripheral {i + 32 * x}.

Note: Regardless of SEC value, any execute access to peripheral {i + 32 * x} triggers a bus error.

If the compartment filtering for peripheral {i + 32 * x} is enabled (resp. disabled) using CFEN in RIFSC_RISC_PERy_CIDCFGR, only an authorized compartment (resp. any compartment) can write this bit, if privilege and security of the access is sufficient.

Authorized compartment is defined as SCID if SEM_EN = 0 in

RIFSC_RISC_PERy_CIDCFGR. If SEM_EN = 1, it is equal to SEMCID, if SEM_MUTEX = 1 in RIFSC_RISC_PERy_SEMCR. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.

8.5.3 RIFSC RISFC slave privileged register x
(RIFSC_RISC_PRIVCFGRx)

Address offset: 0x030 + 0x4 * x, (x = 0 to 5)

Reset value: 0x0000 0000

Unprivileged writes to this register are ignored, while any read is allowed. Writes are ignored if GLOCK is set in RIFSC_RISC_CR.

31302928272625242322212019181716
PRIV{i + 32 * x}
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
PRIV{i + 32 * x}
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 PRIV{i + 32 * x}: Privileged-only access permission for peripheral {i + 32 * x} (i = 0 to 31)

0: Privileged and unprivileged data access are granted to the peripheral {i + 32 * x}.

1: Privileged data access only are granted to the peripheral {i + 32 * x}.

Note: If corresponding SEC{i + 32 * x} bit is set in RIFSC_RISC_SECCFGRx, this bit can only be written by a secure privileged application.

If the compartment filtering for peripheral {i + 32 * x} is enabled (resp. disabled) using CFEN in RIFSC_RISC_PERy_CIDCFGR, only an authorized compartment (resp. any compartment) can write this bit, if privilege and security of the access is sufficient.

Authorized compartment is defined as SCID if SEM_EN = 0 in RIFSC_RISC_PERy_CIDCFGR. If SEM_EN = 1, it is equal to SEMCID, if SEM_MUTEX = 1 in RIFSC_RISC_PERy_SEMCR. There is no authorized compartment if SEM_EN = 1 and SEM_MUTEX = 0.

8.5.4 RIFSC RISC slave resource configuration lock register x
(RIFSC_RISC_RCFGLOCKRx)

Address offset: 0x050 + 0x4 * x, (x = 0 to 5)

Reset value: 0x0000 0000

Secure privileged, trusted domain CID write access only. Any read access is allowed on this register. Writes are ignored if GLOCK is set in RIFSC_RISC_CR.

31302928272625242322212019181716
RLOCK{i + 32 * x}
rsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrs
1514131211109876543210
RLOCK{i + 32 * x}
rsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrs

Bits 31:0 RLOCK{i + 32 * x}: rResource lock for peripheral {i + 32 * x} (i = 0 to 31)

This bit is set to lock the peripheral resource {i + 32 * x}. It is cleared by default and, once set, this bit cannot be cleared until the RIFSC RISC peripheral is reset.

0: SEC{i + 32 * x} in RIFSC_RISC_SECCFGRx and PRIV{i + 32 * x} in RIFSC_RISC_PRIVCFGRx are writable. RIFSC_RISC_PERy_CIDCFGR is writable.

1: Writes to SEC{i + 32 * x} and PRIV{i + 32 * x} are ignored. Writes to RIFSC_RISC_PERy_CIDCFGR register are ignored.

8.5.5 RIFSC RISC slave peripheral y CID configuration register (RIFSC_RISC_PERy_CIDCFGR)

Address offset: 0x100 + 0x8 * y, (y = 0 to 127)

Reset value: 0x0000 0000

Secure privileged, trusted domain CID write access only. Any read access is allowed on this register. Writes are ignored if GLOCK is set in RIFSC_RISC_CR, or if RLOCKy is set in RIFSC_RISC_RCFGLOCKRx.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.SEMw LC7SEMw LC6SEMw LC5SEMw LC4SEMw LC3SEMw LC2SEMw LC1SEMw LC0
rwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.SCID[2:0]Res.Res.SEM_E NCFEN
rwrwrwrwrw

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

Bits 23:16 SEMwLCi: Semaphore white list for compartment i (i = 7 to 0)

0: Application running in compartment i cannot get access to peripheral y through the semaphore SEM_MUTEX.

1: Application running in compartment i can get access to peripheral y through the semaphore SEM_MUTEX.

Note: This bit is not taken into account by RISC when the semaphore is disabled (SEM_EN = 0) or compartment filtering is off (CFEN = 0).

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

Bits 6:4 SCID[2:0]: Static CID

The trusted domain application uses this bitfield to statically define which compartment has access to the peripheral y when SEM_EN = 0.

Note: This CID is not taken into account by RISC when the semaphore is enabled (SEM_EN = 1) or compartment filtering is off (CFEN = 0).

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

Bit 1 SEM_EN: Semaphore enable

0: Access to peripheral y is granted only if CID of the access equals to SCID.

1: Access to peripheral y is granted only if SEM_MUTEX = 1 and CID of the access equals to SEMCID in RIFSC_RISC_PERy_SEMCR.

Note: This bit is not taken into account by RISC if the compartment filtering is off (CFEN = 0). When this bit is cleared from 1 by the trusted domain application, SEM_MUTEX is cleared to zero by RISC.

Bit 0 CFEN: CID filtering enable

0: Compartment-based filtering defined in RIFSC_RISC_PERy_CIDCFGR and optionally RIFSC_RISC_PERy_SEMCR is disabled for peripheral y.

1: Compartment-based filtering defined in RIFSC_RISC_PERy_CIDCFGR and optionally RIFSC_RISC_PERy_SEMCR is enabled for peripheral y.

For any CFEN value, access controls to peripheral y defined in RIFSC_RISC_PRIVCFGRx and RIFSC_RISC_SECCFGRx always apply.

Note: When this bit is cleared from 1 by the trusted domain application, SEM_MUTEX is cleared to zero by RISC.

8.5.6 RIFSC RISC slave peripheral y semaphore control register (RIFSC_RISC_PERy_SEMCR)

Address offset: 0x104+0x8*y, (y = 0 to 127)

Reset value: 0x0000 0000

If the compartment filtering is disabled (CFEN = 0) or the semaphore is disabled (SEM_EN = 0) in RIFSC_RISC_PERy_CIDCFGR, any write to this register is ignored.

Privileged-only write if PRIVy is set in RIFSC_RISC_PRIVCFGRx. Secure-only write if SECy bit is set in RIFSC_RISC_SECCFGRx.

If compartment filtering is enabled and semaphore is enabled (CFEN = SEM_EN = 1), only an authorized compartment can write to this register. For this register, the authorized compartment is equal to SEMCID if SEM_MUTEX = 1, else it is defined by the CID white list (SEMWLKy) in register RIFSC_RISC_PERy_CIDCFGR. There is no authorized compartment if the semaphore is disabled (SEM_EN = 0).

Any read access is allowed to this register. The debug domain is managed like any other masters, when activated.

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.SEMCID[2:0]Res.Res.Res.SEM_MUTEX
rrrrw

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

Bits 6:4 SEMCID[2:0]: Semaphore current CID

When SEM_EN and CFEN are set in RIFSC_RISC_PERy_CIDCFGR, this read-only bitfield is updated with the CID value of the latest successful acquisition of RIFSC_RISC_PERy_SEMCR semaphore (SEM_MUTEX = 1).

In all the other cases, this bitfield stays unchanged.

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

Bit 0 SEM_MUTEX: Semaphore mutex

A white-listed application can set this bit to get exclusive access to peripheral y when SEM_EN is set in RIFSC_RISC_PERy_CIDCFGR (writes are ignored otherwise).

Read 0: Semaphore is free to take.
Read 1: Semaphore is taken.
Write 0: Release semaphore.
Write 1: Acquire semaphore.

Note: When SEM_MUTEX = 0, only applications belonging to white-listed compartments (defined with SEMWLCi bits in RIFSC_RISC_PERy_CIDCFGR) can acquire this semaphore.

When SEM_MUTEX = 1, only applications belonging to compartment SEMCID can release this semaphore.

This bit is cleared when CFEN or SEM_EN are cleared from 1 by the trusted domain application in RIFSC_RISC_PERy_CIDCFGR.

8.5.7 RIFSC RIMC master configuration register (RIFSC_RIMC_CR)

Address offset: 0xC00

Reset value: 0x0000 8710

Any read access is allowed on this register. Writes are ignored if GLOCK is set in this register.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
DDENRes.Res.Res.Res.DAPCID[2:0]Res.TDCID[2:0]Res.Res.WUCD ONEGLOCK
rrwrwrwrworworworsrs

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

Bit 15 DDEN: Debug domain enable

This read-only bit gives the status on the debug domain feature availability on this device.

0: Debug domain not available
1: Debug domain available

Bits 14:11 Reserved, must be kept at reset value.

Bits 10:8 DAPCID[2:0]: Debug access port compartment ID

This bitfield defines the CID of the DAP when GDPEN is set in RIFSC_RIMC_SR.

When DAPCID[2:0] = 0x7, debugging tools have the highest level of debug access, if secure global debug profile is enabled in the BSEC peripheral.

When GDPEN = 0, DAPCID[2:0] can be written by trusted application (TDCID secure privileged). When GDPEN = 1, the DAP can also change this bitfield regardless of the access type (secure, non-secure, privileged, or unprivileged).

Bit 7 Reserved, must be kept at reset value.

ST logo
ST logo

Bits 6:4 TDCID[2:0]: Trusted domain compartment ID

Master with this compartment ID runs the application with the highest level of trust.
TDCID[2:0] value is distributed in all the device. This bitfield is write once (subsequent writes are ignored).

Note: Secure privileged write access only. Write only by debug domain and trusted domain CIDs, as defined in this register.

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

Bit 1 WUCDONE: Wake-up CPU done

Setting this bit deactivates the wake-up CPU mechanism described in Section 5.4: Resource isolation framework (RIF). Reading this bit always returns zero.

0: When WUCEN = 1 in RIFSC_RIMC_SR, the trusted domain CID information is fixed to 0x2 (wake-up CPU), else it is defined in this register.

1: Setting this bit clears WUCEN after few cycles. Once WUCEN =0, the trusted domain CID information is defined in this register.

Note: Secure privileged write access only. Write only by debug domain and trusted domain CIDs, as defined in this register (including this bit).

Bit 0 GLOCK: Global lock

This bit is used to lock the configuration of RIFSC RIMC registers until next reset. This bit is cleared by default and, once set, it cannot be reset until global RIFSC reset.

0: RIFSC RIMC registers are writable.

1: All writes to RIFSC RIMC registers are ignored.

Note: Secure privileged write access only. Write only by debug domain and trusted domain CIDs, as defined in this register.

8.5.8 RIFSC RIMC master status register (RIFSC_RIMC_SR)

Address offset: 0xC04

Reset value: 0x0000 0000

Any read access is allowed on this register.

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.WUCENGDPEN
rr

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

Bit 1 WUCEN: Wake-up CPU enable

This read-only bit is set when the application properly initializes the wake-up CPU mechanism described in Section 5.4: Resource isolation framework (RIF).

0: Wake-up CPU is disabled. The trusted domain CID value is driven by RIFSC_RIMC_CR.

1: Wake-up CPU is enabled. The trusted domain CID value is fixed to 0x2 until the application sets WUCDONE in RIFSC_RIMC_CR (in this case, WUCDONE is cleared after few cycles).

ST logo
ST logo

Bit 0 GDPEN: Global debug profile enable

This read-only bit is set when the global-debug profile is activated in the device (CPU and MCU debugging allowed).

0: Global-debug profile (CPU + MCU) is not activated.

1: Global-debug profile (CPU + MCU) is activated.

8.5.9 RIFSC RIMC master attribute register x (RIFSC_RIMC_ATTRx)

Address offset: 0xC10+x*0x4 (x = 0 to 15)

Reset value: 0x0000 0000

Secure privileged, trusted domain CID write access only. Any read access is allowed on this register. Writes are ignored if GLOCK is set in RIFSC_RIMC_CR register.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.MPRIVMSECRes.MCID[2:0]Res.CIDSELRes.Res.
rwrwrwrwrwrw

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

Bit 9 MPRIV: Master privileged

Value of the privileged flag on the interconnect for this master, programmed by the trusted domain.

0: This master is unprivileged.

1: This master is privileged.

Bit 8 MSEC: Master secure

Value of the secure flag on the interconnect for this master, programmed by the trusted domain.

0: This master is non-secure.

1: This master is secure.

Bit 7 Reserved, must be kept at reset value.

Bits 6:4 MCID[2:0]: Master CID

Value of the CID flag on the interconnect for this master, programmed by the trusted domain.

Valid only if indicated in RIF masters table in Section 8.3. This bitfield is not taken into account when CIDSEL = 0 in this register.

This bitfield cannot be written with a value of 0x7 (write to MCID[2:0] is ignored).

Bit 3 Reserved, must be kept at reset value.

Bit 2 CIDSEL: CID selection

0: Compartment ID of master x is driven by hardware value or by inheritance to associated RISUP. See master table in Section 8.3 for details.

1: Compartment ID of master x is defined by MCID[2:0] in this register.

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

8.5.10 RIFSC peripheral protection status register x (RIFSC_PPSRx)

Address offset: 0xFB0 + 0x4 * x, (x = 0 to 3)

Reset value: 0xCFFE FFFF, 0xBFDE 0F3F, 0xF9C3 740C, 0x21DC 7DFF

31302928272625242322212019181716
PPEN{i + 32 * x}
rrrrrrrrrrrrrrrr
1514131211109876543210
PPEN{i + 32 * x}
rrrrrrrrrrrrrrrr

Bits 31:0 PPEN{i + 32 * x}: Peripheral protection enable {i + 32 * x} (i = 0 to 31)

0: RISUP protection to peripheral {i + 32 * x} is not present. The corresponding RIFSC_RISC_PERy_CIDCFGR and RIFSC_RISC_PERy_SEMCR (where y = i + 32 * x) are reserved.

1: RISUP protection to peripheral {i + 32 * x} is present.

8.5.11 RIFSC hardware configuration register 3 (RIFSC_HWCFGR3)

Address offset: 0xFE8

Reset value: 0x0000 0000

31302928272625242322212019181716
CFG[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
CFG[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 CFG[31:0]: Hardware configuration

This bitfield returns the generic value RISAL_FIXED_LENGTH.

8.5.12 RIFSC hardware configuration register 2 (RIFSC_HWCFGR2)

Address offset: 0xFEC

Reset value: 0x0010 0080

31302928272625242322212019181716
CFG3[7:0]CFG2[7:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
CFG1[15:0]
rrrrrrrrrrrrrrrr

Bits 31:24 CFG3[7:0]: Hardware configuration 3

This bitfield returns the generic value NUM_RISAL.

Bits 23:16 CFG2[7:0]: Hardware configuration 2

This bitfield returns the generic value NUM_MP.

Bits 15:0 CFG1[15:0]: Hardware configuration 1

This bitfield returns the generic value NUM_SP.

8.5.13 RIFSC hardware configuration register 1 (RIFSC_HWCFGR1)

Address offset: 0xFF0

Reset value: 0x0071 3111

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.CFG6[3:0]CFG5[3:0]
rrrrrrrr
1514131211109876543210
CFG4[3:0]CFG3[3:0]CFG2[3:0]CFG1[3:0]
rrrrrrrrrrrrrrrr

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

Bits 23:20 CFG6[3:0]: Hardware configuration 6

This bitfield returns the generic value DEFAULT_DAPCID.

Bits 19:16 CFG5[3:0]: Hardware configuration 5

This bitfield returns the generic value DEFAULT_TDCID.

Bits 15:12 CFG4[3:0]: Hardware configuration 4

This bitfield returns the generic value CID_WIDTH.

Bits 11:8 CFG3[3:0]: Hardware configuration 3

This bitfield returns the generic value PRIV_ENABLED.

Bits 7:4 CFG2[3:0]: Hardware configuration 2

This bitfield returns the generic value SEC_ENABLED.

Bits 3:0 CFG1[3:0]: Hardware configuration 1

This bitfield returns the generic value RIF_ENABLED.

8.5.14 RIFSC version register (RIFSC_VERR)

Address offset: 0xFF4

Reset value: 0x0000 0010

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.MAJREV[3:0]MINREV[3:0]
rrrrrrrr

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

Bits 7:4 MAJREV[3:0]: RIFSC major revision

Bits 3:0 MINREV[3:0]: RIFSC minor revision

8.5.15 RIFSC identification register (RIFSC_IPIDR)

Address offset: 0xFF8

Reset value: 0x0010 0162

31302928272625242322212019181716
ID[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
ID[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 ID[31:0]: RIFSC identification code

8.5.16 RIFSC size identification register (RIFSC_SIDR)

Address offset: 0xFFC

Reset value: 0xA3C5 DD04

31302928272625242322212019181716
SID[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
SID[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 SID[31:0]: RIFSC size identification code

Bits[31:8] = 0xA3C5DD (fixed code)

Bits[7:0] = 0x04 (4-Kbyte address decoding)

8.5.17 RIFSC register map

Table 43. RIFSC register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x000RIFSC_RISC_CRRes.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.Res.0
Reset value0
0x010 + 0x004 * x (x = 0 to 5)
Last address: 0x024
RIFSC_RISC_SECCFGRxSEC{i + 32 * x}
Reset value00000000000000000000000000000000
0x028-0x02CReservedReserved

Table 43. RIFSC register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x030 + 0x004 * x
(x = 0 to 5)
Last address:
0x044
RIFSC_RISC_
PRIVCFGRx
PRIV{i + 32 * x}
Reset value00000000000000000000000000000000
0x048-
0x04C
ReservedReserved
0x050 + 0x004 * x
(x = 0 to 5)
Last address:
0x064
RIFSC_RISC_
RCFGLOCKRx
RLOCK{i + 32 * x}
Reset value00000000000000000000000000000000
0x068-
0x06C
ReservedReserved
0x100 + 0x008 * y
(y = 0 to 127) Last address:
0x4F8
RIFSC_RISC_
PERy_
CIDCFGR
Res.Res.Res.Res.Res.Res.Res.Res.SEMWLC7SEMWLC6SEMWLC5SEMWLC4SEMWLC3SEMWLC2SEMWLC1SEMWLC0Res.Res.Res.Res.Res.Res.Res.Res.Res.SCID[2:0]Res.Res.SEM_ENCFEN
Reset value0000000000000
0x104 + 0x008 * y
(y = 0 to 127) Last address:
0x4FC
RIFSC_RISC_
PERy_SEMCR
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.SEMID
[2:0]
Res.Res.Res.SEM_MUTEX
Reset value0000
0x500-
0xBFC
ReservedReserved
0xC00RIFSC_RIMC
_CR
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DDENRes.Res.Res.Res.DAPCID
[2:0]
Res.TDCID
[2:0]
Res.Res.WUCDONEGLOCK
Reset value111100100
0xC04RIFSC_RIMC
_SR
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.Res.WUCENGPDEN
Reset value00
0xC08-
0xC0C
ReservedReserved
0xC10 + 0x004 * x
(x = 1 to 15) Last address:
0xC4C
RIFSC_RIMC
_ATTRx
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MPRIVMSECRes.MCID[2:0]Res.CIDSELRes.Res.
Reset value000000
0xC50 to
0xFAC
ReservedReserved
0xFB0 + 0x004 * x
(x = 0 to 3)
Last address:
0xFBC
RIFSC_PPSRxPPEN{i + 32 * x}
Reset value(1)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0xFC0-
0xFE4
ReservedReserved
0xFE8RIFSC_
HWCFGR3
CFG[31:0]
Reset value00000000000000000000000000000000
0xFECRIFSC_
HWCFGR2
CFG3[7:0]CFG2[7:0]CFG1[15:0]
Reset value00000000000100000000000010000000

Table 43. RIFSC register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0xFF0RIFSC_HWCFGR1Res.Res.Res.Res.Res.Res.Res.Res.CFG6[3:0]CFG5[3:0]CFG4[3:0]CFG3[3:0]CFG2[3:0]CFG1[3:0]
Reset value011100010011000100010001
0xFF4RIFSC_VERRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.MAJREV[3:0]MINREV[3:0]
Reset value00010000
0xFF8RIFSC_IPIDRID[31:0]
Reset value00000000000100000000000101100010
0xFFCRIFSC_SIDRSID[31:0]
Reset value1010001111000101110111010000100

1. See RIFSC peripheral protection status register x (RIFSC_PPSRx) for the various reset values.

Refer to Section 2.4 for the register boundary addresses.