2023-09-19 02:43 AM
Ask this at arm.com, but maybe it is STM32U5 specific:
I try run an unprivileged application in secure mode and get a strange behavior:
STM32U5 has TZ enabled, all application runs in secure mode.
1) LR = 0xffff_fff9, CONTROL = 1 => BX LR increments the SP, but all registers become 0 (including PC and XPSR!)
2) When setting CONTROL = 1 and executing SVC, SP is decremented correctly, but nothing is stored on the stack?
I check all errata I could find, but no hint.
If TZ is disabled, the system behaves normal.
42Bastian
2023-09-21 02:37 AM
are you using main stack or process stack? Do you end up in some fault handler?
How exactly do you set the CONTROL, do you use CMSIS function or some tool-defined function or macro?
Be sure to check PM0264, for any tips.
Right now I don't know what could be the problem.
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.
2023-09-21 03:27 AM
Kicked the discussion in another thread:
https://community.st.com/t5/stm32-mcus-products/cortex-m33-stm32u5-unprivileged-mode-in-secure-not-working/m-p/592061
No matter which stack is used-