cancel
Showing results for 
Search instead for 
Did you mean: 

Tamper: not able to update into the seed registers

meghasb
Senior

Hi all,

I'm trying to implement Active Tamper in STM32U585 controller, im trying to generate the SEED, the Seed is getting generated, but the SEED is not getting updated in the SEED reg of tamper, i'm attaching the code and seed values generated for reference. can anyone help me whats wrong here, 

meghasb_0-1700136839457.pngmeghasb_1-1700136874433.png

meghasb_2-1700137019153.png

reference image for Seed reg not updated.

1 ACCEPTED SOLUTION

Accepted Solutions
Ced
ST Employee

Hello @meghasb ,

Once programming the SEED value with four write access, you should wait until SEEDF = 0 in TAMP_ATOR.

if the function HAL_RTCEx_SetActiveSeed() return HAL_OK, it means that the SEED programming is OK.

To use the HAL_RTCEx_SetActiveSeed() function,  the Active tamper need to be already enabled with HAL_RTCEx_SetActiveTampers().

 

You can see section "Active tamper initialization" into the RM0456:

"

Here is the software procedure to initialize the active tampers after system reset:
Read INITS in TAMP_ATOR register.
• If INITS = 0x0 (initialization was not done):
a) Write TAMP_ATCR to configure Active tamper clock, filter and output sharing if
any, and active mode.
b) Write TAMP_CR1 to enable tampers (all the needed tampers must be enabled in
the same write access).
c) Write SEED by writing four times in the TAMP_ATSEEDR.
d) Wait until SEEDF = 0 in TAMP_ATOR. Backup registers are then protected by
active tamper.


• If INITS = 0x1 (initialization already done):
No initialization. To increase randomness a new SEED should be provided regularly.
When a new SEED is provided, wait until SEEDF = 0 before entering a low-power
mode which switches off the TAMP APB clock.
• In case the tampers are disabled by software, and re-enabled afterwards, the SEED
must be written after enabling tampers:
a) Write TAMP_CR1 to enable tampers (all the needed tampers must be enabled in
the same write access).
b) Write SEED by writing four times in the TAMP_ATSEEDR.
c) Wait until SEEDF = 0 in TAMP_ATOR. Backup registers are then protected by
active tamper.

"

You can also check this example:

https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/NUCLEO-U545RE-Q/Examples/RTC/RTC_ActiveTamper

 

Best Regards,

Ced

 

View solution in original post

3 REPLIES 3
Ced
ST Employee

Hello meghasb,

TAMP_ATSEEDR register is write only, you cannot read back the programmed value.

Best Regards,

Ced

 

 

Hello @Ced 

Thanks for the reply, yes SEED is only write, but the (TAMP_ATOR) is read, once the SEED is generated this should be high, its as per my understanding, correct me if im wrong here.

Ced
ST Employee

Hello @meghasb ,

Once programming the SEED value with four write access, you should wait until SEEDF = 0 in TAMP_ATOR.

if the function HAL_RTCEx_SetActiveSeed() return HAL_OK, it means that the SEED programming is OK.

To use the HAL_RTCEx_SetActiveSeed() function,  the Active tamper need to be already enabled with HAL_RTCEx_SetActiveTampers().

 

You can see section "Active tamper initialization" into the RM0456:

"

Here is the software procedure to initialize the active tampers after system reset:
Read INITS in TAMP_ATOR register.
• If INITS = 0x0 (initialization was not done):
a) Write TAMP_ATCR to configure Active tamper clock, filter and output sharing if
any, and active mode.
b) Write TAMP_CR1 to enable tampers (all the needed tampers must be enabled in
the same write access).
c) Write SEED by writing four times in the TAMP_ATSEEDR.
d) Wait until SEEDF = 0 in TAMP_ATOR. Backup registers are then protected by
active tamper.


• If INITS = 0x1 (initialization already done):
No initialization. To increase randomness a new SEED should be provided regularly.
When a new SEED is provided, wait until SEEDF = 0 before entering a low-power
mode which switches off the TAMP APB clock.
• In case the tampers are disabled by software, and re-enabled afterwards, the SEED
must be written after enabling tampers:
a) Write TAMP_CR1 to enable tampers (all the needed tampers must be enabled in
the same write access).
b) Write SEED by writing four times in the TAMP_ATSEEDR.
c) Wait until SEEDF = 0 in TAMP_ATOR. Backup registers are then protected by
active tamper.

"

You can also check this example:

https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/NUCLEO-U545RE-Q/Examples/RTC/RTC_ActiveTamper

 

Best Regards,

Ced