40. Tamper and backup registers (TAMP)

40.1 TAMP introduction

The anti-tamper detection circuit is used to protect sensitive data from external attacks. 32 32-bit backup registers are retained in all low-power modes. The backup registers, as well as other secrets in the device, are protected by this anti-tamper detection circuit with 3 tamper pins and 6 internal tampers. The external tamper pins can be configured for edge detection, or level detection with or without filtering.

40.2 TAMP main features

40.3 TAMP functional description

40.3.1 TAMP block diagram

Figure 562. TAMP block diagram

Figure 562. TAMP block diagram showing the interaction between external inputs (TAMP_IN1 to TAMP_INx), internal tamper inputs (tamp_itamp1 to tamp_itampy), tamper detection blocks with edge/level detection, masking/logic across tamp_ker_ck and tamp_pclk clock domains, and connections to backup registers and IRQ/registers interfaces.
Figure 562. TAMP block diagram showing the interaction between external inputs (TAMP_IN1 to TAMP_INx), internal tamper inputs (tamp_itamp1 to tamp_itampy), tamper detection blocks with edge/level detection, masking/logic across tamp_ker_ck and tamp_pclk clock domains, and connections to backup registers and IRQ/registers interfaces.

1. The number of external and internal tampers depends on products.

40.3.2 TAMP pins and internal signals

Table 399. TAMP input/output pins

Pin nameSignal typeDescription
TAMP_INx (x = pin index)InputTamper input pin

Table 400. TAMP internal input/output signals

Internal signal nameSignal typeDescription
tamp_ker_ckInputTAMP kernel clock, connected to rtc_ker_ck and also named RTCCLK in this document
tamp_pclkInputTAMP APB clock, connected to rtc_pclk
tamp_itamp[y]
(y = signal index)
InputsInternal tamper event sources
tamp_evtOutputTamper event detection flag (internal or external tamper), whatever confirmed or potential mode configuration.
tamp_potentialOutputPotential tamper detection signal, used for device secrets(1) protection.
This signal is active when:
– a tamper event detection flag (internal or external tamper), is generated in potential mode.
– or a software request is done by writing BKBLOCK to 1
tamp_confirmedOutputConfirmed tamper detection signal, used for device secrets(1) protection.
This signal is active when:
– a tamper event detection flag (internal or external tamper), is generated in confirmed mode.
– or a software request is done by writing BKERASE to 1
tamp_itOutputTAMP interrupt (refer to Section 40.5: TAMP interrupts for details)
tamp_trg[x]
(x = signal index)
OutputTamper detection trigger

1. Refer to Table 401: TAMP interconnection.

The TAMP kernel clock is usually the LSE at 32.768 kHz although it is possible to select other clock sources in the RCC (refer to RCC for more details). The TAMP kernel clock is required only for external tamper inputs level with filtering, and for external active tamper detection modes. Internal tampers detection and external tampers inputs edge detection are functional without requiring any kernel clock.

Read and write access to backup registers and all other TAMP registers are also functional without any kernel clock (only APB clock is needed).

Some detections modes are not available in some low-power modes depending on the selected clock (refer to for more details).

Table 401. TAMP interconnection
Signal nameSource/Destination
tamp_evtrtc_tamp_evt used to generate a timestamp event
tamp_potential

The tamp_potential signal is used to block the read and write accesses to the device secrets listed hereafter:

  • • Backup registers
  • • SRAM2

The RHUK (root hardware unique key) in system flash memory hardware bus to SAES is blocked.

The tamp_potential signal is used to erase the device secrets listed hereafter:

  • • ICACHE content
  • • SAES, AES, HASH, CCB peripherals
  • • PKA including PKA SRAM

The device secrets access is blocked when erase is ongoing.

tamp_confirmed

The tamp_confirmed signal is used to erase the device secrets listed hereafter:

  • • Backup registers
  • • SRAM2
  • • ICACHE content
  • • SAES, AES, HASH, CCB peripherals
  • • PKA including PKA SRAM

The device secrets access is blocked when erase is ongoing.

The RHUK (root hardware unique key) in system flash memory hardware bus to SAES is blocked.

tamp_itamp3LSE monitoring (LSECSS)(1)
tamp_itamp4HSE monitoring (CSS)(2)
tamp_itamp5RTC calendar overflow (rtc_calovf)
tamp_itamp6Unexpected debug activation
tamp_itamp9Cryptographic peripherals fault (AES or SAES or PKA or TRNG)(3)
tamp_itamp11IWDG reset when tamper flag is set (potential tamper timeout)
  1. 1. This monitoring must be enabled by setting LSECSSON in RTC domain control register (RCC_RTCCR).
  2. 2. This monitoring must be enabled by setting HSECSSON in RCC control register (RCC_CR).
  3. 3. Only TRNG on STM32C53x/C54x/C55x/C56x.

40.3.3 GPIOs controlled by the RTC and TAMP

Refer to Section 39.3.3: GPIOs controlled by the RTC and TAMP.

40.3.4 TAMP register write protection

After system reset, the TAMP registers (including backup registers) are protected against parasitic write access by the DRTCP bit in the power control peripheral (refer to the PWR

power control section). DRTCP bit must be set in order to enable TAMP registers write access.

40.3.5 Backup registers protection zones

The backup registers protection is configured thanks to BKPRW[7:0] and BKPW[7:0] (refer to the figure below):

Figure 563. Backup registers protection zones

Diagram showing the mapping of protection zones to TAMP registers. Protection Zone 3 is associated with TAMP_BKPI(1)R. Protection Zone 2 is associated with TAMP_BKPtR (t = BKPW) and TAMP_BKPzR (z = BKPW-1). Protection Zone 1 is associated with TAMP_BKPyR (y = BKPRW) and TAMP_BKPxR (x = BKPRW-1). TAMP_BKP0R is also shown as a separate register.
Protection Zone 3TAMP_BKPI(1)R
Protection Zone 2TAMP_BKPtR (t = BKPW)
TAMP_BKPzR (z = BKPW-1)
Protection Zone 1TAMP_BKPyR (y = BKPRW)
TAMP_BKPxR (x = BKPRW-1)
TAMP_BKP0R

MSv67557V1

Diagram showing the mapping of protection zones to TAMP registers. Protection Zone 3 is associated with TAMP_BKPI(1)R. Protection Zone 2 is associated with TAMP_BKPtR (t = BKPW) and TAMP_BKPzR (z = BKPW-1). Protection Zone 1 is associated with TAMP_BKPyR (y = BKPRW) and TAMP_BKPxR (x = BKPRW-1). TAMP_BKP0R is also shown as a separate register.

1. I = last backup register index

40.3.6 TAMP privilege protection modes

By default after a backup domain power-on reset, all TAMP registers can be read or written in both privileged and unprivileged modes, except for the TAMP privilege configuration register (TAMP_PRIVCFGR) which can be written in privilege mode only. The TAMP protection configuration is not affected by a system reset.

The backup registers protection is configured thanks to BKPRW[7:0] and BKPRWPRIV for the protection zone 1, and thanks to BKPRW[7:0], BKPW[7:0] and BKPWPRIV for the protection zone 2 (refer to Figure 563).

A unprivileged access to a privileged-protected register is denied:

40.3.7 Tamper detection

The tamper detection main purpose is to protect the device secrets from device external attacks. The detection is made on events on TAMP_INx (x = pin index) I/Os, or on internal monitors detecting out-of-range device conditions.

The tamper detection can be configured for the following purposes:

The external I/Os tamper detection supports passive mode: TAMP_INx I/Os are monitored and a tamper is detected either on edge or level.

A digital filter can be applied on external tamper detection to avoid false detection. In addition, it is possible to configure each tamper source in potential mode, so that the secrets erase is not launched by hardware on tamper detection. The secrets erase can then be launched by software after software checks.

40.3.8 TAMP backup registers and other device secrets erase

The backup registers (TAMP_BKPxR) are not reset by system reset or when the device wakes up from Standby mode.

The backup registers and the other device secrets are not reset when the corresponding mask is set (TAMPxMSK=1 in the TAMP_CR2 register).

Note: The backup registers are also erased when the readout protection of the flash is changed from level 1 to level 0.

Tamper detection – confirmed mode

The confirmed mode is selected for TAMPx (external tamper x) when TAMPxPOM = 0 in the TAMP_CR2 register. The confirmed mode is selected for ITAMPx (internal tamper x) when ITAMPxPOM = 0 in the TAMP_CR3 register. The effects of a tamper detection in confirmed mode are described with tamp_confirmed signal in the Table 401: TAMP interconnection.

This mode is selected to erase automatically the device secrets when the tamper is detected.

Tamper detection – potential mode

The potential mode is selected for TAMPx (external tamper x) when TAMPxPOM = 1 in the TAMP_CR2 register. The potential tamper mode is selected for ITAMPx (internal tamper x) when ITAMPxPOM = 1 in the TAMP_CR3 register. The effects of a tamper detection in potential mode are described with tamp_potential signal in the Table 401: TAMP interconnection.

This mode is selected to avoid irreversible erasure of some device secrets when the tamper is detected. In this mode, some device secrets are not erased when the corresponding tamper event is detected. In addition, the read and write accesses to these device secrets are blocked as soon as the tamper detection flag is set in potential mode, until this flag is cleared by setting the corresponding clear flag in the TAMP_SCR register. Therefore the software can perform some checks to discriminate false from true tampers, and decide to launch secrets erase only in case of the potential tamper is confirmed to be a true tamper. The device secrets are erased by software by setting the BKERASE bit in the TAMP_CR2 register.

Potential tamper to confirmed tamper timeout

Some internal tampers generate a tamper event if the independent watchdog reset occurs when another tamper flag is set (refer to Table 401: TAMP interconnection). The IWDG tamper must be configured with ITAMPxPOM = 0. This permits the erasure of device secrets to be forced by hardware after a timeout, in case the previous tamper event was in potential mode. This is equivalent to change the “potential tamper” into “confirmed tamper” if a watchdog reset occurs before any software decision following the potential tamper event.

Device secrets access blocked by software

By default, the device secrets can be accessed by the application, except if a tamper event flag is detected: the device secrets access is not possible as long as a tamper flag is set.

It is possible to block the access to the device secrets by software, by setting the BKBLOCK bit of the TAMP_CR2 register. The device secrets access is possible only when BKBLOCK = 0 and no tamper flag is set.

40.3.9 Tamper detection configuration and initialization

Each input can be enabled by setting the corresponding TAMPxE bits to 1 in the TAMP_CR register.

Each TAMP_INx tamper detection input is associated with a flag TAMPxF in the TAMP_SR register.

By setting the TAMPxIE bit in the TAMP_IER register, an interrupt is generated when a tamper detection event occurs (when TAMPxF is set). Setting TAMPxIE is not allowed when the corresponding TAMPxMSK is set.

Trigger output generation on tamper event

The tamper event detection can be used as trigger input by the low-power timers.

When TAMPxMSK bit is cleared in TAMP_CR register, the TAMPxF flag must be cleared by software in order to allow a new tamper detection on the same pin.

When TAMPxMSK bit is set, the TAMPxF flag is masked, and kept cleared in TAMP_SR register. This configuration permits the low-power timers to be triggered automatically in Stop mode, without requiring the system wake-up to perform the TAMPxF clearing. In this case, the backup registers are not cleared.

This feature is available only when the tamper is configured in level detection with filtering mode (TAMPFLT ≠ 00). Refer to Section : Level detection with filtering on tamper inputs (passive mode).

Timestamp on tamper event

With TAMPTS set to 1 in the RTC_CR, any internal or external tamper event causes a timestamp to occur. In case a timestamp occurs due to tamper event, either the TSF bit or the TSOVF bit is set in RTC_SR, in the same manner as if a normal timestamp event occurs.

Note: TSF is set up to 3 ck_apre cycles after TAMPxF flags. TSF is not set if RTCCLK is stopped (it is set when RTCCLK restarts).

Note: If TAMPxF is cleared before the expected rise of TSF, TSF is not set. Consequently, in case TAMPTS = 1, the software should either wait for timestamp flag before clearing the tamper flag, or should read the RTC counters values in the TAMP interrupt routine.

Edge detection on tamper inputs (passive mode)

If the TAMPFLT bits are 00, the TAMP_INx pins generate tamper detection events when either a rising edge or a falling edge is observed depending on the corresponding TAMPxTRG bit. The internal pull-up resistors on the TAMP_INx inputs are deactivated when edge detection is selected.

Caution: When TAMPFLT = 00 and TAMPxTRG = 0 (rising edge detection), a tamper event may be detected by hardware if the tamper input is already at high level before enabling the tamper detection.

After a tamper event has been detected and cleared, the TAMP_INx should be disabled and then re-enabled (TAMPxE set to 1) before re-programming the backup registers (TAMP_BKPxR). This prevents the application from writing to the backup registers while the TAMP_INx input value still indicates a tamper detection. This is equivalent to a level detection on the TAMP_INx input.

Level detection with filtering on tamper inputs (passive mode)

Level detection with filtering is performed by setting TAMPFLT to a non-zero value. A tamper detection event is generated when either 2, 4, or 8 (depending on TAMPFLT) consecutive samples are observed at the level designated by the TAMPxTRG bits.

The TAMP_INx inputs are precharged through the I/O internal pull-up resistance before its state is sampled, unless disabled by setting TAMPPUDIS to 1. The duration of the precharge is determined by the TAMPPRCH bits, allowing for larger capacitances on the TAMP_INx inputs.

The trade-off between tamper detection latency and power consumption through the pull-up can be optimized by using TAMPFREQ to determine the frequency of the sampling for level detection. The TAMP_IN I/O schmitt trigger is enabled only during the precharge duration to avoid any extra consumption if the tamper switch is open (floating state).

Figure 564. Tamper sampling with precharge pulse

Timing diagram for tamper sampling with precharge pulse. It shows the RTC clock, Floating input, and Switch opened signals. The Switch opened signal shows precharge pulses of 1, 2, 4, and 8 RTCCLK cycles before sampling. The Floating input is sampled at the end of each precharge period.

MSv30115V2

Timing diagram for tamper sampling with precharge pulse. It shows the RTC clock, Floating input, and Switch opened signals. The Switch opened signal shows precharge pulses of 1, 2, 4, and 8 RTCCLK cycles before sampling. The Floating input is sampled at the end of each precharge period.

Figure 565. Low level detection with precharge and filtering

Timing diagram for low level detection with precharge and filtering. It shows RTCCLK, Internal pull-up enable (TAMPPUDIS=0), TAMP_INx (TAMPPUDIS=0), and Schmitt trigger enable signals. It illustrates four sampling periods with different TAMP_INx states (floating or tied to 0) and precharge durations (TAMPPRCH).

Configuration:
TAMPxTRG=0: Low level detection
TAMPPRCH=1: 1 RTCCLK cycle pre-charge duration (internal pull-up is applied)
TAMPFLT=1: Tamper event is activated after 2 consecutive samples at active level

MSv74148V1

Timing diagram for low level detection with precharge and filtering. It shows RTCCLK, Internal pull-up enable (TAMPPUDIS=0), TAMP_INx (TAMPPUDIS=0), and Schmitt trigger enable signals. It illustrates four sampling periods with different TAMP_INx states (floating or tied to 0) and precharge durations (TAMPPRCH).

Note: Refer to the microcontroller datasheet for the electrical characteristics of the pull-up resistors.

40.4 TAMP low-power modes

Table 402. Effect of low-power modes on TAMP

ModeDescription
SleepNo effect.
TAMP interrupts cause the device to exit the Sleep mode.
StopNo effect on all features, except for level detection with filtering mode which remain active only when the clock source is LSE or LSI.
TAMP interrupts cause the device to exit the Stop mode.
StandbyNo effect on all features, except for level detection with filtering mode which remain active only when the clock source is LSE or LSI.
TAMP interrupts cause the device to exit the Standby mode.

Table 403. TAMP pins functionality over modes

Pin nameFunctional in all low-power modes
TAMP_IN[3:1]Yes

40.5 TAMP interrupts

Table 404. Interrupt requests

Interrupt acronymInterrupt eventEvent flag(1)Enable control bitInterrupt clear methodExit from low-power modes
TAMPTamper x(2)TAMPxFTAMPxIEWrite 1 in CTAMPxFYes(3)
Internal tamper y(2)ITAMPyFITAMPyIEWrite 1 in CITAMPyFYes(3)
  1. 1. The event flags are in the TAMP_SR register.
  2. 2. The number of tampers and internal tampers events depend on products.
  3. 3. Refer to Table 402: Effect of low-power modes on TAMP for more details about available features in the low-power modes.

40.6 TAMP registers

Refer to Section 1.2 of the reference manual for a list of abbreviations used in register descriptions. The peripheral registers can be accessed by words (32-bit).

40.6.1 TAMP control register 1 (TAMP_CR1)

This register can be protected against unprivileged access. Refer to Section 40.3.6: TAMP

privilege protection modes.

Address offset: 0x00

RTC domain reset value: 0x0000 0000

System reset: not affected

31302928272625242322212019181716
Res.Res.Res.Res.Res.ITAMP11ERes.ITA-
MP9E
Res.Res.ITAMP6EITAMP5EITAMP4EITAMP3ERes.Res.
rwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMP3ETAMP2ETAMP1E
rwrwrw

Bit 31 Reserved, must be kept at reset value.

Bit 30 Reserved, must be kept at reset value.

Bit 29 Reserved, must be kept at reset value.

Bit 28 Reserved, must be kept at reset value.

Bit 27 Reserved, must be kept at reset value.

Bit 26 ITAMP11E: Internal tamper 11 enable

0: Internal tamper 11 disabled.
1: Internal tamper 11 enabled.

Bit 25 Reserved, must be kept at reset value.

Bit 24 ITAMP9E: Internal tamper 9 enable

0: Internal tamper 9 disabled.
1: Internal tamper 9 enabled.

Bit 23 Reserved, must be kept at reset value.

Bit 22 Reserved, must be kept at reset value.

Bit 21 ITAMP6E: Internal tamper 6 enable

0: Internal tamper 6 disabled.
1: Internal tamper 6 enabled.

Bit 20 ITAMP5E: Internal tamper 5 enable

0: Internal tamper 5 disabled.
1: Internal tamper 5 enabled.

Bit 19 ITAMP4E: Internal tamper 4 enable

0: Internal tamper 4 disabled.
1: Internal tamper 4 enabled.

Bit 18 ITAMP3E: Internal tamper 3 enable

0: Internal tamper 3 disabled.
1: Internal tamper 3 enabled.

Bit 17 Reserved, must be kept at reset value.

Bit 16 Reserved, must be kept at reset value.

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

Bit 7 Reserved, must be kept at reset value.

Bit 6 Reserved, must be kept at reset value.

Bit 5 Reserved, must be kept at reset value.

Bit 4 Reserved, must be kept at reset value.

Bit 3 Reserved, must be kept at reset value.

Bit 2 TAMP3E: Tamper detection on TAMP_IN3 enable(1)

0: Tamper detection on TAMP_IN3 is disabled.

1: Tamper detection on TAMP_IN3 is enabled.

Bit 1 TAMP2E: Tamper detection on TAMP_IN2 enable(1)

0: Tamper detection on TAMP_IN2 is disabled.

1: Tamper detection on TAMP_IN2 is enabled.

Bit 0 TAMP1E: Tamper detection on TAMP_IN1 enable(1)

0: Tamper detection on TAMP_IN1 is disabled.

1: Tamper detection on TAMP_IN1 is enabled.

  1. 1. Tamper detection mode (selected with TAMP_FLTCR register and TAMPxTRG bits in TAMP_CR2), must be configured before enabling the tamper detection.

40.6.2 TAMP control register 2 (TAMP_CR2)

This register can be protected against unprivileged access. Refer to Section 40.3.6: TAMP privilege protection modes.

Address offset: 0x04

RTC domain reset value: 0x0000 0000

System reset: not affected

31302928272625242322212019181716
Res.Res.Res.Res.Res.TAMP3 TRGTAMP2 TRGTAMP1 TRGBK ERASEBK BLOCKRes.Res.Res.TAMP3 MSKTAMP2 MSKTAMP1 MSK
rwrwrwwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMP3 POMTAMP2 POMTAMP1 POM
rwrwrw

Bit 31 Reserved, must be kept at reset value.

Bit 30 Reserved, must be kept at reset value.

Bit 29 Reserved, must be kept at reset value.

Bit 28 Reserved, must be kept at reset value.

Bit 27 Reserved, must be kept at reset value.

Bit 26 TAMP3TRG: Active level for tamper 3 input

0: If TAMPFLT ≠ 00 tamper 3 input staying low triggers a tamper detection event.

If TAMPFLT = 00 tamper 3 input rising edge triggers a tamper detection event.

1: If TAMPFLT ≠ 00 tamper 3 input staying high triggers a tamper detection event.

If TAMPFLT = 00 tamper 3 input falling edge triggers a tamper detection event.

  1. 1. The effects of tamper detection in confirmed mode is described with tamp_confirmed signal in Table 401: TAMP interconnection.
  2. 2. The effects of tamper detection in potential mode is described with tamp_potential signal in Table 401: TAMP interconnection.

40.6.3 TAMP control register 3 (TAMP_CR3)

This register can be protected against unprivileged access. Refer to Section 40.3.6: TAMP privilege protection modes.

Address offset: 0x08

RTC domain reset value: 0x0000 0000

System reset: not affected

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.ITAMP11POMRes.ITAMP9POMRes.Res.ITAMP6POMITAMP5POMITAMP4POMITAMP3POMRes.Res.
rwrwrwrwrwrw

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

Bit 15 Reserved, must be kept at reset value.

Bit 14 Reserved, must be kept at reset value.

Bit 13 Reserved, must be kept at reset value.

Bit 12 Reserved, must be kept at reset value.

Bit 11 Reserved, must be kept at reset value.

Bit 10 ITAMP11POM: Internal tamper 11 potential mode

Bit 9 Reserved, must be kept at reset value.

Bit 8 ITAMP9POM: Internal tamper 9 potential mode

Bit 7 Reserved, must be kept at reset value.

Bit 6 Reserved, must be kept at reset value.

Bit 5 ITAMP6POM: Internal tamper 6 potential mode

Bit 4 ITAMP5POM: Internal tamper 5 potential mode

Bit 3 ITAMP4POM: Internal tamper 4 potential mode

Bit 2 ITAMP3POM: Internal tamper 3 potential mode

Bit 1 Reserved, must be kept at reset value.

Bit 0 Reserved, must be kept at reset value.

  1. 1. The effects of internal tamper detection in confirmed mode is described with tamp_confirmed signal in Table 401: TAMP interconnection
  2. 2. The effects of internal tamper detection in potential mode is described with tamp_potential signal in Table 401: TAMP interconnection.

40.6.4 TAMP filter control register (TAMP_FLTCR)

This register can be protected against unprivileged access. Refer to Section 40.3.6: TAMP privilege protection modes.

Address offset: 0x0C

RTC domain reset value: 0x0000 0000

System reset: not affected

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.TAMP
PUDIS
TAMPPRCH
[1:0]
TAMPFLT
[1:0]
TAMPFREQ
[2:0]
rwrwrwrwrwrwrwrw

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

Bit 7 TAMPPUDIS: TAMP_INx pull-up disable

This bit determines if each of the TAMPx pins are precharged before each sample.

Bits 6:5 TAMPPRCH[1:0]: TAMP_INx precharge duration

These bit determines the duration of time during which the pull-up/is activated before each sample. TAMPPRCH is valid for each of the TAMP_INx inputs.

Bits 4:3 TAMPFLT[1:0]: TAMP_INx filter count

These bits determines the number of consecutive samples at the specified level (TAMP*TRG) needed to activate a tamper event. TAMPFLT is valid for each of the TAMP_INx inputs.

Bits 2:0 TAMPFREQ[2:0]: Tamper sampling frequency

Determines the frequency at which each of the TAMP_INx inputs are sampled.

Note: This register concerns only the tamper inputs in passive mode.

40.6.5 TAMP configuration register (TAMP_CFGR)

This register can be globally write-protected, or each bit of this register can be individually write-protected against unprivileged access depending on the TAMP_PRIVCFGR configuration (refer to Section 40.3.6: TAMP privilege protection modes).

Address offset: 0x20

RTC domain reset value: 0x0000 0000

System reset: not affected

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.BKPW[7:0]
rwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.BKPRW[7:0]
rwrwrwrwrwrwrwrw

Bit 31 Reserved, must be kept at reset value.

Bit 30 Reserved, must be kept at reset value.

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

Bits 23:16 BKPW[7:0]: Backup registers write protection offset

BKPW value must be from 0 to 32.

Protection zone 2 is defined for backup registers from TAMP_BKPyR (y = BKPRW) to TAMP_BKPzR (z = BKPW-1, with BKPW > BKPRW):

If BKPW = 0 or if BKPW ≤ BKPRW: there is no protection zone 2.

Protection zone 3 is defined for backup registers from TAMP_BKPtR (t = BKPW if BKPW ≥ BKPRW, else t = BKPRW).

If BKPW = 32: there is no protection zone 3.

Refer to Figure 563: Backup registers protection zones.

Note: If BKPWPRIV is set, BKPW[7:0] can be written only in privileged mode.

Bit 15 Reserved, must be kept at reset value.

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

Bits 7:0 BKPRW[7:0]: Backup registers read/write protection offset

BKPRW value must be from 0 to 32.

Protection zone 1 is defined for backup registers from TAMP_BKP0R to TAMP_BKPxR (x = BKPRW-1, with BKPRW ≥ 1).

If BKPRW = 0: there is no protection zone 1.

Refer to Figure 563: Backup registers protection zones.

Note: If BKPRWPRIV or BKPWPRIV is set, BKPRW[7:0] can be written only in privileged mode.

40.6.6 TAMP privilege configuration register (TAMP_PRIVCFGR)

This register can be written only when the APB access is privileged.

Address offset: 0x24

RTC domain reset value: 0x0000 0000

System reset: not affected

31302928272625242322212019181716
TAMP
PRIV
BKP
WPRIV
BKPR
WPRIV
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
rwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Bit 31 TAMPPRIV : Tamper privilege protection (excluding monotonic counters and backup registers)Note: Refer to Section 40.3.6: TAMP privilege protection modes for details on the read protection.Bit 30 BKPWPRIV : Backup registers zone 2 privilege protectionBit 29 BKPRWPRIV : Backup registers zone 1 privilege protection

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

Bit 15 Reserved, must be kept at reset value.

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

40.6.7 TAMP interrupt enable register (TAMP_IER)

This register can be protected against unprivileged access. Refer to Section 40.3.6: TAMP privilege protection modes .

Address offset: 0x2C

RTC domain reset value: 0x0000 0000

System reset: not affected

31302928272625242322212019181716
Res.Res.Res.Res.Res.ITAMP1
1IE
Res.ITAMP9
IE
Res.Res.ITAMP6
IE
ITAMP5
IE
ITAMP4
IE
ITAMP3
IE
Res.Res.
rwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMP
3IE
TAMP
2IE
TAMP
1IE
rwrwrw

40.6.8 TAMP status register (TAMP_SR)

This register can be protected against unprivileged access. Refer to Section 40.3.6: TAMP privilege protection modes.

Address offset: 0x30

RTC domain reset value: 0x0000 0000

System reset: not affected

31302928272625242322212019181716
Res.Res.Res.Res.Res.ITAMP11FRes.ITAMP9FRes.Res.ITAMP6FITAMP5FITAMP4FITAMP3FRes.Res.
rrrrrr
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMP3FTAMP2FTAMP1F
rrr
ST logo
ST logo

40.6.9 TAMP masked interrupt status register (TAMP_MISR)

This register can be protected against unprivileged access. Refer to Section 40.3.6: TAMP privilege protection modes.

Address offset: 0x34

RTC domain reset value: 0x0000 0000

System reset: not affected

RM0522 40.6.9column_2Bit 20 Bit 19 Bit 18 Bit 2 Bit 1 Bit 0ITAMP5F ITAMP4F ITAMP3F TAMP3F TAMP2F TAMP1Ftamper 5. tamper 4. tamper 3.column_6.column_8column_9column_10column_11column_12column_13column_14column_15column_16
31302928272625242322212019181716
Res.Res.Res.Res.Res.ITAMP1ITAMP5ITAMP4ITAMP3
1MFRes.ITAMP9
MFRes.Res.ITAMP6
MFMFMFMFRes.Res.
rrrrrr
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMPTAMPTAMP
3MF2MF1MF
rrr

40.6.10 TAMP status clear register (TAMP_SCR)

This register can be protected against unprivileged access. Refer to Section 40.3.6: TAMP privilege protection modes.

Address offset: 0x3C

System reset value: 0x0000 0000

RM0522column_2column_3column_4column_5column_6.column_8column_9column_10column_11column_12column_13column_14column_15column_16
31302928272625242322212019181716
Res.CCCCCC
Res.Res.Res.Res.ITAMPRes.ITAMPRes.Res.ITAMPITAMPITAMPITAMPRes.Res.
11F9F6F5F4F3F
wwwwww
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CTAMPCTAMPCTAMP
3F2F1F
www
Bit 26CITAMP11F: Clear ITAMP11 detection flag
Bit 24CITAMP9F: Clear ITAMP9 detection flag
Bit 21CITAMP6F: Clear ITAMP6 detection flag
Bit 20CITAMP5F: Clear ITAMP5 detection flag
Bit 19CITAMP4F: Clear ITAMP4 detection flag
Bit 18CITAMP3F: Clear ITAMP3 detection flag

40.6.11 TAMP option register (TAMP_OR)

This register can be protected against unprivileged access. Refer to Section 40.3.6: TAMP privilege protection modes.

Address offset: 0x50

RTC domain reset value: 0x0000 0000

System reset: not affected

column_1column_2Bit 2 Bit 1 Bit 0CTAMP3F CTAMP2F CTAMP1Fcolumn_5column_6.column_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.Res.Res.Res.Res.Res.IN3_R
MP rwRes.IN2_ RMP rw
Bit 2IN3_RMP: TAMP_IN3 pin select
Bit 0IN2_RMP: TAMP_IN2 pin select

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

40.6.12 TAMP backup x register (TAMP_BKPxR)

This register can be protected against unprivileged access. Refer to Section 40.3.6: TAMP privilege protection modes.

Address offset: 0x100+0x04*x, (x = 0 to 31)

RTC domain reset value: 0x0000 0000

System reset: not affected

31302928272625242322212019181716
BKP[31:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
BKP[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwwrwrw

Bits 31:0 BKP[31:0]:

The application can write or read data to and from these registers.

In the default (ERASE) configuration this register is reset on a tamper detection event. It is forced to reset value as long as there is at least one internal or external tamper flag being set. This register is also reset when the readout protection (RDP) is disabled.

40.6.13 TAMP register map

Table 405. TAMP register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x00TAMP_CR1Res.Res.Res.Res.Res.ITAMP11ERes.ITAMP9ERes.Res.ITAMP6EITAMP5EITAMP4EITAMP3ERes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMP3ETAMP2ETAMP1E
Reset value000000000
0x04TAMP_CR2Res.Res.Res.Res.Res.TAMP3TRGTAMP2TRGTAMP1TRGBKERASEBKBLOCKRes.Res.Res.Res.TAMP3MSKTAMP2MSKTAMP1MSKRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMP3POMTAMP2POMTAMP1POM
Reset value00000000000
0x08TAMP_CR3Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ITAMP11POMRes.ITAMP9POMRes.Res.Res.Res.ITAMP6POMITAMP5POMITAMP4POM
Reset value000000
0x0CTAMP_FLTCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMPPUDISTAMPPRCH[1:0]TAMPFLT[1:0]TAMPFREQ[2:0]
Reset value0000000
0x20TAMP_CFGRRes.Res.Res.Res.Res.Res.Res.Res.BKPW[7:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.BKPRW[7:0]
Reset value000000000000000
0x24TAMP_PRIVCFGRTAMPPRIVBKPWPRIVBKPRWPRIVRes.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.
Reset value000
0x2CTAMP_IERRes.Res.Res.Res.Res.ITAMP11IERes.ITAMP9IERes.Res.ITAMP6IEITAMP5IEITAMP4IEITAMP3IERes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMP3IETAMP2IETAMP1IE
Reset value000000000
0x30TAMP_SRRes.Res.Res.Res.Res.ITAMP11FRes.ITAMP9FRes.Res.ITAMP6FITAMP5FITAMP4FITAMP3FRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMP3FTAMP2FTAMP1F
Reset value000000000
0x34TAMP_MISRRes.Res.Res.Res.Res.ITAMP11MFRes.ITAMP9MFRes.Res.ITAMP6MFITAMP5MFITAMP4MFITAMP3MFRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TAMP3MFTAMP2MFTAMP1MF
Reset value000000000
0x3CTAMP_SCRRes.Res.Res.Res.Res.CITAMP11FRes.CITAMP9FRes.Res.CITAMP6FCITAMP5FCITAMP4FCITAMP3FRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CTAMP3FCTAMP2FCTAMP1F
Reset value000000000

Table 405. TAMP register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x50TAMP_ORRes.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.IN3_RMPRes.IN2_RMP
Reset value00
0x100 +
0x04*x,
(x= 0 to 31)
TAMP_BKPxRBKP[31:0]
Reset value00000000000000000000000000000000

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