I am encountering random freezes with the STM32F7. This issue is difficult to debug as any debug session launched in Eclipse crashes when trying to halt the core, which makes it impossible to see where in the code the freeze occured.
Similarly, I am not able to access the device registers to inspect the program counter, the stack pointer and the IPSR, either via the eclipse debug session or using the ST-Link Utility software (the device resets when connecting and the state is lost).
I would appreciate any information on how to extract the device state when frozen, or whether any states can be recovered after a reset. Also if this situation sounds familiar to anyone, please let me know if you found a root cause. I am available to answer any questions and provide more detail.
additional details
(a) The hardware - I'm afraid I can't give you too much info here, it's a custom proprietary design.
(b) The history - This freeze issue has only become a problem recently. When I retested our older code however, the issue was seen, albeit less frequently (I think). I have been reverting bits of code to see if the issue still occurs. The issue is that I have no logs or debugging capabilities when the device freezes, so I cannot pinpoint where the code is failing.
The issue occurs infrequently, so it is difficult to say whether or not a change has had any effect.
(c) I haven't tried reducing the (system?) clock speed, and I will retest the device more thoroughly with different connections removed.
(d) Failure rate is roughly 1 failure per device per day, but it is difficult to quantify any improvement/regression (device is running all day).
(e) You ask about capturing data after a reset, but you report the problem is the MCU "freezing", not that it is resetting. I guess (but it isn't clear) that the problem is always that the MCU freezes. It's you who can perform a manual reset, and you are asking whether any useful info can be captured after manual reset. Is that correct?
Correct. Retrieving info during the freeze would be even better though.
Debug steps
(i) This problem is not reproducible with a test despite my best efforts.
(ii) what you are doing after that e.g. are you performing a manual reset?
Trying to read the registers, pinpoint where the code hung.