How to identify the function/line that triggered a watchdog reset?

Hi :airplane:,
I’m using ArduPilot 4.1-dev. After a watchdog reset, I would like to know which function or line of code actually triggered the problem.

For example, during my test on experimental hardware (where I intentionally trigger the watchdog with an infinite loop), I get a message like this:

WDG: T27 SL0 FL217 FT3 FA3001E7B0 FTP183 FLR1E000007

What we have tried so far:

  • Reading PC and LR register values and checking them against the .map file, but we couldn’t reliably resolve them to the exact function/line.
  • Attempted to use task.function to get the function address, but in this version it’s a functor and doesn’t give a reliable raw function address.
  • At the moment we can only log task.name.

My question is:

  • What is the recommended or correct way in ArduPilot to determine which function/line caused the watchdog reset?
  • Is there an alternative mechanism besides PC/LR, or does this require using debug symbols or another approach?

Thanks!

First, update to 4.6.x, there is no reason to sit on such old version of Ardupilot.

Watchdog reset log message is described on the wiki.

I have the same problem in 4.7, it still does not give the error line.