2021-04-30 11:51 PM
Good morning,
Im using the CAN-Module of STM32H743 NUCLEO board and so far I'm quite happy with it. But now I ran in to this hard fault error which seems to occur at a random point in time, but it will appear sooner or later. Using the built in Fault Analyzer I can see, that a data access violation (PRECISERR) is the cause of the error. From the content of r2 and r3 I can tell, that the error is related to the message reception.
Can someone please make some suggestions how to solve this problem?
2021-05-01 05:27 AM
Debug it like any other flaw in your code.
Almost certainly due to buffer or pointer corruption, either within existing structures, or those on the stack.
Add sanity checking to the code close to the point of the identified fault, perhaps with asserts or similar methods.
Have and effective Hard Fault Handler that can output actionable information, so you can identify the memory area that triggers the fault. Precise means its a read of some sort. Look at the faulting code, and that immediately prior and relate that to the source, and the code flow at that point,and where those values came from.
2021-05-02 11:24 PM
Thank you for your quick reply. Is there a way to find out, what part of my program was executed right before the error?