Skip to main content
Visitor II
September 16, 2023
Question

hardfault handler

  • September 16, 2023
  • 1 reply
  • 884 views

I was using stm32 cube mx to configure a pin to toggle the led so code generated using cube mx and then i just wrote the required function to toggle the led but once the code is compiled it shows zero errrors. when i debugged it and started running the code it goes to the hardfault handler where using the fault analyzer i came to know its a bus fault error and the kind of error is imprecise error. what am i supposed to avoid this errror

 

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    September 16, 2023

    Imprecise suggest it is a buffered/pipeline write.

    You will need to review the MCU registers and the code disassembly immediately prior to the fault.

    Hard to diagnose remotely with no detail, or code that fails. Check pointers and structures are properly initialized.

    The compiler can only flag syntax errors, not flaws in the logic or implementation. 

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