2023-05-10 07:03 PM
I'm working on a project with an STM32L4 microcontroller and I need to implement an anti-tampering function to detect if the case has been opened using a switch. I know that the STM32L4 has an anti-tampering function on pin PA0, but I'm already using this pin as an input for the clock of a radio (SX1250). What are my options for implementing this type of anti-tampering function in my device without interfering with the radio clock input? Is it possible to use a switch to detect tampering, and if so, how could I do it? I appreciate any suggestions or advice you can offer.
2023-05-11 01:35 AM
I think ... yes.
You have
RTC_TAMP1 on pin PC13
RTC_TAMP2 on PA0
RTC_TAMP3 on pin PE6
2023-05-11 01:39 AM - edited 2023-11-20 05:46 AM
It is the STM32L412KB, I think I only have the PA0 available
2023-05-11 02:02 AM
Ah... ok. So I have no idea.
2023-05-11 02:05 AM
Set two pins close to each other, one as input, the other as output. there will be something holding them together. If someone opens the case then the pin will reset :D
2023-05-11 02:35 AM
> anti-tampering function on pin PA0, but I'm already using this pin as an input for the clock of a radio
What does that mean? Is it necessarily connected to PA0, cannot be it connected elsewhere?
> anti-tampering function to detect if the case has been opened using a switch
The TAMPER input provides a particular functionality: timestamping and backup registers reset, even in VBAT mode (i.e. when there's no power on VDD only on VBAT). However, on the 32-pin package, you don't even have VBAT pin.
So, define, what exactly do you mean by "anti-tampering function". Maybe you just need to wake up from some of the low-power modes - for that, decide, which low-power mode do you intend to use, and read the PWR chapter in RM to see your options.
JW
2023-05-11 06:50 PM
> What does that mean? Is it necessarily connected to PA0, cannot be it connected elsewhere?
That is something I was wondering too. I am following a reference design and it uses the PA0 as an input pin which is connected to the output clock of the radio module. I assumed that it might be utilizing the PA0 as RCC_CK_IN to synchronize clocks? so I guess that it has to be that pin and not a normal GPIO but I am not sure.
>what exactly do you mean by "anti-tampering function"
I am looking for a way to alert the user if the device's case has been opened, even when it's not connected to power. I don't want to use any irreversible because the device should continue functioning normally. The goal is simply to inform the user that the device may have been tampered with.