2013-08-05 05:58 AM
Hello;
am using UART communication between 2 boards contaning STM32F3, the first send the same frame every 320 ms, and the second just receive this and make autobaud.after 2 minutes of working my MCU go into HARD-FAULT-HANDLER !i don't undestand why !(HARD_FAULT_STAT = 0x40000000) #stm32f3-hard_fault-uart2013-08-05 07:04 AM
i don't undestand why !
Probably the same reason most people end up there, cause you're writing to memory you shouldn't be. Check the bounds of arrays you are writing. Use a Hard Fault handler which allows you to identify the faulting instruction, and registers at the fault.2013-08-06 12:02 AM
thank you for reply,
i don't know how to do this : ''Use a Hard Fault handler which allows you to identify the faulting instruction''in my Hard Fault handler there is just an empty infinite loop,
2013-08-06 02:33 AM
Using your favourite search engine, look for joseph yiu and hard fault handler. He has written nice books, covering this topic (beside others).
BTW, I guess your problem is either stack overflow, out-of-bounds array access, or a dangling pointer. I use debug output via UART at such occasions. This way, you can easily narrow down to the bug location.2013-08-06 07:49 AM
As you can imagine this topic come up over-and-over
[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/How%20to%20debug%20hard%20fault%20handler%20exceptions&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=1163]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FHow%20to%20debug%20hard%20fault%20handler%20exceptions&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=1163http://blog.frankvh.com/2011/12/07/cortex-m3-m4-hard-fault-handler/