2015-03-14 12:36 PM
Hi,
I'm trying to implement a GOCR algorithm to 32F429IDISCOVERY board. The GOCR itself works very well on PC but on the discovery board I'm still having some issues that makes it unstable and unusable. Sometimes the algorithm works fine, everything goes well and the result is great but sometimes the processor gets stuck in hard fault/default handler. I cannot tell what is the reason of the crash and what am I supposed to do but I believe that stack/heap got overflowed. The crash always happens on normal instructions that were done few times before. Below I attached an image that shows the state of the processor before and after the crash:Thanks for your help of comments... #hard-fault #stm32 #discovery #ocr2015-03-14 02:26 PM
Most of the time it's regular instructions failing because of what the register point to.
You need to provide/examine the assembler instructions, the registers and the stack at the fault location to troubleshoot this.2015-03-14 03:10 PM
2015-03-14 06:38 PM
Ok, but it helps to understand what the processor sees.
Both these would seem to need a NULL check of the box2 pointer to eliminate that as a cause, ideally perhaps range/bounds checking that it's a RAM address. If you suspect stack issues, then make the stack bigger, fill it with a pattern you recognize and determine how deep it actually gets.2015-03-16 11:19 AM
Hi,
I am pretty sure that it is fault of a RAM sortage...This is good information that I know where the problem is but what to do now ? ... What am I supposed to do when I cant change the algorithm (no major changes only minor ones) and I need to free some RAM?