2023-09-15 11:55 PM
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
2023-09-16 03:58 AM
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.