I'm working for 1 year for a big company in the embedded engineering field and I have faced some bugs that make me tell to colleagues: "It's doing the wrong thing but everything looks fine....seems magic!!!".
Unfortunately or not, there is no magic. Everything happens from a reason and there are few many cases where this is due to HW issues. Often the bug depends on particular time or configuration that makes it appear or disappear simply adding a safe printf. Also a stressfull day is not the best friend when facing these issues
and probably it is better to have a break or simply tackle it the day
after. In this way, all the "polarization" your mind has about how the
things are (not) working are kind of released and a fresh mind can
easily find new views of the problem. Asking for help is also a good way
have a new point of view and ideas to solve the issue.
I will publish time to time some "tip" about what to look at when facing a difficult bug and how to approach them, hoping that sharing what turned to be my solution can help someone on their debugging journey.