• AVR Freaks

Breakpoints On WDT Reset

Author
tahoe
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2018/01/30 11:27:12
  • Location: 0
  • Status: offline
2019/06/26 18:07:10 (permalink)
0

Breakpoints On WDT Reset

Hello Everyone,
 
Is possible to set a breakpoint on a WDT reset and then look back at either the call stack or something that would tell me whats getting hung up? 
#1

3 Replies Related Threads

    Larry.Standage
    Super Member
    • Total Posts : 902
    • Reward points : 0
    • Joined: 2011/12/30 09:50:47
    • Location: 0
    • Status: offline
    Re: Breakpoints On WDT Reset 2019/06/26 22:20:26 (permalink)
    0
    Yes. You'll want to override the _on_reset function, which is called when the processor resets. Have the routine check the flags to determine if the WDT triggered it, and set your breakpoint there.
    #2
    NKurzman
    A Guy on the Net
    • Total Posts : 17506
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Breakpoints On WDT Reset 2019/06/27 03:46:48 (permalink)
    0
    It is not nessasary to do the override.
    The flags can be checked in the users startup code.
    #3
    moser
    Super Member
    • Total Posts : 481
    • Reward points : 0
    • Joined: 2015/06/16 02:53:47
    • Location: Germany
    • Status: offline
    Re: Breakpoints On WDT Reset 2019/06/27 04:54:43 (permalink)
    0
    Looking at RCON at start only tells you that a WTD or DMT timeout happend, but not where and why.
     
    Another way to find out about the "where and why" is to set RNMICON.NMICNT to a value and implement _nmi_handler(). This handler gets called on WDT or DMT timeout. Setting NMICNT gives you some time before the reset occurs (which would otherwise occur immediately). You can even remove the respecting flag which stops the reset. And you can set a breakpoint there, or write interesting information into a memory location which is defined with __attribute__((persistent,aligned(16))), which you can still read out after the reset.
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5