Skip to main content
Associate III
March 25, 2025
Question

HardFault and MemManage Handler being called randomly in simple code

  • March 25, 2025
  • 3 replies
  • 948 views

Hey I have a stm32f722RE that is supposed to receive CAN messages via through the canbus and active output pins via timer pins.It worked fine for some months but now its jumping to the hardfault and mem handler manager out of nowhere.

Its a custom board and I have nreset connected to gnd.What I also notted is that during operation the debugger starts losing connection to my pc and then the board stops working/resets itself and then gets stuck at some handler or just jumps to handler directly.

Ive attached the code,and a print of the debugger during error and the schematic of the microcontroler.Ive disconnected basically everything else that were not vital and could potencially cause an error,like sensors inputs and other outputs.Ive also checked the adress 0x08000DF8 via stm32cube programmer and it seemed fine.

 

3 replies

Associate III
March 25, 2025

Forgot to mention but i ve already resoldered the uC and have stable 3.3v to it

Andrew Neil
Super User
March 25, 2025
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
March 25, 2025

On a single VCAP (64-pin) instance, the capacitor should be 4.7 uF

Would expect to see 1.25V on it. Often a cause of odd/unexplained errors.

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