I find this trouble really hard to fix.
Some info before describing the problem : - I got a Nucleo L4r5zi and I'm using stm32duino to control it. - I'm using PlatformIO in visual studio code to debug the code. - This problem occur randomly, which means that I can run the same code twice and in the first run the code will crash and in the second one it won't.
The Problem :
I have a really big code that I'm working on and there fore can't send all the code. It seems that my Nucleo is crashing in the middle of malloc (sometimes free) function as can be seeing here :
Jumps to here - Default handler
It is very randomly. If a will add a single line to the code - I will get the malloc crashing somewhere else ...
How can I fix that ? I want the Nucleo to stop crashing. What causing the crash and how can I stop it ?