cancel
Showing results for 
Search instead for 
Did you mean: 

32F429IDISCOVERY board hard fault/default handler

mchalapetr
Associate II
Posted on March 14, 2015 at 20:36

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:

http://i.imgur.com/0LF7Zf9.png

Thanks for your help of comments...

#hard-fault #stm32 #discovery #ocr
4 REPLIES 4
Posted on March 14, 2015 at 22:26

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mchalapetr
Associate II
Posted on March 14, 2015 at 23:10

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6h6&d=%2Fa%2F0X0000000btP%2FW02kO578aMjm0oZmZkMas9vZ_jXnU8KJCJKtbiZaUXY&asPdf=false
Posted on March 15, 2015 at 02:38

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mchalapetr
Associate II
Posted on March 16, 2015 at 19:19

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?