STM32WB55RB can't allocate memory after GPIO Interrupt
The problem can be simplyfied to this code:
int startFlag = 0;
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin){
startFlag = 1;
}
int main(){
if(startFlag== 1){
//crashes at first iteration (Hard_Fault_Handler)
int *test = malloc(sizeof(int));
}
}
But this works like a intened:
int main(){
int *test = malloc(sizeof(int));
}
I really dont see the obvious issue here. I made sure that the Callback function is completly finished and also tried it with " volatile int startFlag = 0;" but it didn't help.
Can someone help me?