5 Replies Latest reply on Dec 29, 2014 6:03 PM by SuMa_296631

    Stop watchdog while debugging


      I think the watchdog is timing out and resetting my device while I'm debugging.


      The symptoms I'm seeing are that the terminal connected to the UART is outputting text while I'm stopped at a breakpoint. The text that is being sent is from the "printf" statements near the start of my code.


      Id there a way to stop the watchdog or, better still, not let it start until I'm ready to use the code in 'release' mode?


      If the watchdog IS still working and resetting the device, this may also explain why I'm not able to continue form one breakpoint to another, nor single step into code etc.. If the watchdog is not part of that explanation, then I have a second question!!!



        • 1. Re: Stop watchdog while debugging

          In the "wiced_defaults.h" file, as distributed there is a commented out definition for "WICED_DISABLE_WATCHDOG".

          After I removed the commenting so that the #define took place, the debugging seems to work without being constantly reset.

          However, I'm surprised that this definition is not surrounded by a test to see if the compile is for "debug" and to define this symbol if it is. In that way, the watchdog would be allowed for release builds and disallowed for debug builds automatically.


          • 2. Re: Stop watchdog while debugging



            You may add "GLOBAL_DEFINES += WICED_DISABLE_WATCHDOG" to your application makefile to disable watchdog as well.



            • 3. Re: Stop watchdog while debugging


              That does not really solve the problem I was talking about, unless you also add in the conditional statements around the one you suggested. Therefore that is just shifting the problem to a different place.


              • 4. Re: Stop watchdog while debugging

                Can you verify whether the watchdog is getting kicked properly by running a non-debug build?


                In debug mode, the timers are paused when you hit a breakpoint or assert.

                Also, when you do hit a watchdog reset in debug mode, gdb hit a breakpoint saying so, specifically in WICED/platform/MCU/xxxx/peripherals/platform_watchdog.c


                 *             IRQ Handlers Definition
                PLATFORM_DEFINE_ISR( dbg_watchdog_irq )
                    /* If the code breaks here, it means that the independent watchdog is about to bite.
                     * Observe the Debug view and examine where the software gets stuck and why
                     * the watchdog wasn't kicked.
                     * Click "Resume" to continue and let the actual watchdog take effect.
                    TIM7->SR = (uint16_t)~TIM_IT_Update;
                    WICED_TRIGGER_BREAKPOINT( );


                If you're not hitting this breakpoint, then I am guessing you're not dealing with a watchdog/debugging issue.

                • 5. Re: Stop watchdog while debugging

                  Hello Cory,

                  That was the exact bit of code I did encounter which is why I was thinking that it was the watchdog that was causing my problems.

                  From what you are saying, my problem was that the watchdog timer (at least) was NOT being paused at a breakpoint.

                  The work-around is to disable the watchdog (as I've outlined above) but that is a work-around. Something else must be wrong if the watchdog is continuing while I'm at a breakpoint and I'd like to know what that might be.