cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use tamper detection mechanism with Trustzone activated in STM32U5 ?

ZKRAC.1
Associate II

I already used tamper detection mechanism, now I want to use it with Trustzone activated, I configured the tamper as non secure first and it works, but when I tried to configure it as secure, it didn't work, and I couldn't detect the tamper, we know from the documentation of trustzone that the system boots in the secure state and then switch to non secure state, and it stays in this state, access from secure to non-secure is always allowed, however from the non secure state we can access the secure state only through a non secure callable, my question is if the tamper is configured, can I detect tamper events and will the detection happened in the secure state or non-secure state........ I don't understand using tamper with trustzone!

Thank you.

4 REPLIES 4
Bubbles
ST Employee

Hi, I think it's described in chapter 3.5.5 of the RM0456. Tamper is a Trustzone-aware pripheral, it needs to be used as such. I think the problem you are experiencing stems from having a part of the tamper related code or configuration non-secure and pert secure. It has to be aligned.

BR,

J

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.

ZKRAC.1
Associate II

Hi Sir, thank you for your answer. As you mentioned above the tamper is a Trustzone-aware, peripheral, I'm trying to configure the tamper as secure so no configuration is done in non secure part, I have checked for available interrupts and I didn't find Tamper secure interrupt instead I have found Tamper non-secure interrupt. Would that mean there is no tamper interrupt in secure part!? If that's the case, so why we would configure it as secure if we can't use it !

Hint: everything works well in non-secure configuration.

Thank you.:)

Hi, trustzone-aware doesn't mean it needs two separate interrupts for S and NS. It means that it's aware of the current execution context, if the code executed is secure or not. And then it either works or not, if there is some discrepancy. Try using GTZC to monitor illegal access to tamper (TAMPIE). That may give you a clue on when there is the problem that breaks your functionality.

BR,

J

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.

Hi, I already tried using GTZC to monitor illegal access to tamper but it didn't work for me, I'm not sure about the configuration of GTZC but it seems correct, here what I did :

  1. Activate TAMP_IN1 in passive mode (I'm using pushbutton).
  2. Configure tamper as secure.
  3. Enable illegal access interrupts for TAMP.
  4. Using HAL_GTZC_TZIC_Callback to toggle an LED.

Thank you.