cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected Error in managing pointer: ''void HardFault_Handler (void)''

Francesco Di Cecio
Associate
Posted on August 25, 2017 at 13:22

In a project I'm using a pointer to read data from memory.

I have problems with this procedure.

My pointer is a uint32_t * punt.

The pointer extracts the data and then increments itself.

extraction = *punt;

punt = punt +1;

With a loop 'for' the program repeats the operation n times.

If I run the cycle one or two times, everything is fine.

If I run the cycle for n> = 3 then I fall into 'void HardFault_Handler (void)'.

Please help me.

Thank

#void-hardfault_handler-(void) #stm32f4 #pointer
1 REPLY 1
Posted on August 25, 2017 at 14:46

Have a proper Hard Fault handler so you can examine the code (the stuff the processor executes, not your high level code). Disassemble the instructions that are faulting. Look at those and the processor registers in the context of why they would fault.

Here is an example of a Handler that isn't a non-instructive while(1) loop,

https://community.st.com/0D50X00009XkfOXSAZ

Present a complete, compilable, example that demonstrates the issue.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..