cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with local structure variables in STM32 with SBSFU

Istillaga
Senior

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?

2 REPLIES 2
Andrew Neil
Super User

What failures are you experiencing?

What makes you think that it is the local structure which causes them? 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
Istillaga
Senior

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?