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