cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H725 internal tamper detection

Simon
Associate II

Hello,

I am trying to figure out how to configure internal voltage monitoring use the internal tamper detection to clear the RTC when an undervoltage condition occurs. My understanding is that you have to enable the backup regulator and enable monitoring like this.

SET_BIT (PWR->CR1, PWR_CR1_DBP);
HAL_PWREx_EnableBkUpReg();
HAL_PWREx_EnableMonitoring();

But how do I set up the tamper detection. There appears to be an inconsistency between the RM and the SFR view of the RTC registers in CubeIDE. The register at offset 0x40 in the RM is called RTC_TAFCR (pg. 1980) while in CubeIDE it is called RTC_TAMPCR and they have differnt bit definitions. Which of these is correct (thye can't both be)? I believe the internal detection is included in Tamper 3, but how do I configure that.
Without working tamper detection the data is preserved in the RTC at least down to 0.4V but it stops getting updated at a much higher voltage, resulting in losing time when the device is powered on again, but no way to detect that this has happened.

2 REPLIES 2
KDJEM.1
ST Employee

Hello @Simon  ;

 

Thank you for bringing the issue about the register name to our attention.

I reported internally for checking and fixing. 

I recommend you to look at RTC_Tamper example that may help you. This example explains how to configure RTC to write/read data to/from RTC Backup registers and to demonstrate the tamper detection feature.

 

Internal ticket number: 225333 (This is an internal tracking number and is not accessible or usable by customers).

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Simon
Associate II

Hi @KDJEM.1,

Thank you for the response, I had already looked at the example, but I don't think it is relevant to what I am trying to achieve. I am trying  to detect an undervoltage condition on the VBAT pin to trigger the tamper. Various bits of documentation suggest this is a feature, but there don't appear to be any examples on how to configure it. Note that when this occurs the main M7 isn't running, just the RTC being powered by a couple of capacitors to maintin the RTC though power cycles and I need the RTC to be cleared if the VBAT voltage gets to low to run the RTC.

 

Regards
Simon