User Activity

I am working with stm32H743 MCU, sometimes when I add a function, its calling caused a hard fault, when I move the function to another place in the code, the fault is resolved.What can be the reason?