2020-10-26 01:59 AM
On a serial product after a firmware update, there are some sporadic cases, where we get a hang up situation. It would be very helpful to know where exactly the program is stuck. According to ES0346 Rev. 6 chapter 2.8 it is possible to access program counter even with RDP set. How can I exactly read the value with CubeProgrammer + ST-Link (or alternatively with J-Link).
2020-10-28 05:29 PM
I'd use an EXTI interrupt.
Another way may be to focus on the stack frame.
>>PC is always FFFFFFFE?
Sure it is not vectoring out of blank Flash?
2020-10-29 05:14 AM
Yes of course I have tried this as well, but my problem is, that the hang-up is not frequently enough to have a realistic chance to get it in the debugger, but it is too often for accepting it for our customers.
2020-10-29 05:15 AM
Thanks for the tip, I didn´t recognize this first. I still wonder why there seems to be a reset although the mode setting is HOTPLUG.
2020-10-29 05:46 AM
That Flash is not blank is sure, as after a reset the program operates normally. Stack seems to have no problem, as the area is pre-filled with a pattern and so an overflow can be excluded.
But what exactly do you mean with "I´d use an EXTI Interrupt"? It would be nice to have the possibility to generate an EXTI in the hangup-case and then to check what´s on the stack, but the problem is, that the hangup is very seldom and so it´s difficult to get the situation on my development place.
But I instrumented my code with IWDG functionality now and all exceptions will directly lead to a reset, so I hope, the problem can be solved this way.
Thanks for the support!