2025-10-31 5:12 AM
Hello,
In a project with STM32 using SBSFU in a U575 microcontroller, why can a local variable of type structure within a function cause failures or unexpected behaviour in the secure zone, while a global variable of the same type works correctly?
2025-10-31 5:49 AM
What failures are you experiencing?
What makes you think that it is the local structure which causes them?
2025-10-31 5:57 AM
When I declare a structure as a local variable within a secure function, the program generates a HardFault. The same structure declared as a global variable works reliably.
I suspect the issue is related to memory allocation on the stack in the secure zone, but if I declare it globally, the problem disappears. Why does this happen?