2023-11-16 04:18 AM
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,
reference image for Seed reg not updated.
Solved! Go to Solution.
2023-11-17 12:34 AM - edited 2023-11-17 12:34 AM
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:
Best Regards,
Ced
2023-11-16 07:45 AM
Hello meghasb,
TAMP_ATSEEDR register is write only, you cannot read back the programmed value.
Best Regards,
Ced
2023-11-16 09:10 PM
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.
2023-11-17 12:34 AM - edited 2023-11-17 12:34 AM
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:
Best Regards,
Ced