2022-09-30 08:32 AM
We are using STM32G0B1CBT MCU in our product. We assembled 10 pieces and out of 10, 2 devices are randomly going in hard fault sometime instantly after reset and sometime even after 1 hour.
What would be the cause? What measures should be taken to resolve it?
2022-09-30 02:08 PM
>>What would be the cause?
Accesses to undefined addresses, via pointers, etc.
Misaligned data accesses, unaligned structures, or pointers
>>What measures should be taken to resolve it?
Have a Hard Fault Handler that outputs actionable diagnostic information that the CPU provides.
Look at the faulting code, and registers.
Entirely random, look at what interrupts are doing, if stack is adequate, or buffers are corrupted.
Perhaps look at flash wait states, powering issues.
DEBUG THE PROBLEM
ARM has Technical Reference Manuals for the core, ST has "Programming Manuals" covering similar material. Joseph Yiu has several books from an alternative perspective.
2022-10-01 06:57 AM
Only 2 boards out of 10 with this problem, it sounds like a hardware problem.
Check the soldering, the quality of the power supplies (voltage, noise, decoupling).