11 Replies Latest reply on May 11, 2016 8:14 PM by axel.lin_1746341

    Watchdog can't trigger the RESET

    feng@ibiquity.com

      Hi ,

       

      The make target is demo.watchdog_example-ISM43362_M3G_L44 download run in SDK 3.1.2. I am trying to use the watchdog function wiced_watchdog_kick() to trigger the reset of the system. My code is below

       

      void application_start( )

      {

        

          /* Initialize Wiced system */

          wiced_init();

          WPRINT_APP_INFO(("kick watchdog..... \r\n"));

          wiced_watchdog_kick();

          while(1);

      }

      I also comment out the system_monitor_thread creation in  the  application_thread_main() of wiced_rtos.c. But the Inventek EVB never reboots after the watchdog timeout(22 seconds). Can you investigate this?

       

       

      Thanks,

        • 1. Re: Watchdog can't trigger the RESET
          seyhan

          Hi ,

           

          Perhaps you are looking for the thread monitoring (/apps/snip/thread_monitor) snip application.

          If this application is run in debug mode, it will break at below location.

           

          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( );
          }
          
          

           

          The WICED_TRIGGER_BREAKPOINT( ) could be commented out to remove the break where the target would reset after watchdog is triggers.

           

          Make target:

               snip.thread_monitor-BCM943362WCD4 download run

               or

               snip.thread_monitor-ISM43362_M3G_L44 download run

           

          It was test using BCM943362WCD4 and it should work with ISM43362_M3G_L44 as well.

           

          Seyhan

          • 2. Re: Watchdog can't trigger the RESET
            feng@ibiquity.com

            Hi,

             

            I am not using the thread monitoring (/apps/snip/thread_monitor) snip application. I even can't see the /apps/snip/thread_monitor in my SDK 3.1.2. my application code is below

             

            void application_start( )

            {

             

                /* Initialize Wiced system */

                wiced_init();

             

                WPRINT_APP_INFO(("kick watchdog..... \r\n"));

                wiced_watchdog_kick();

                while(1);

            }

            But the Inventek EVB never reboots after the max watchdog timeout. Can you investigate this?


            Thanks

            • 3. Re: Watchdog can't trigger the RESET
              seyhan

              Hi,

               

              Here is thread_monitor snip application.

               

              Seyhan

              • 4. Re: Watchdog can't trigger the RESET
                feng@ibiquity.com

                Hi,

                 

                I can compile and download the thread_monitor example. But the watchdog never bites and the WICED eval board cannot reboot. Below is the output from the windows terminal.

                 

                Registering my thread monitor

                Do some work

                Updating monitor: 0

                Do some work

                Updating monitor: 1

                 

                Do some work

                • 5. Re: Watchdog can't trigger the RESET
                  dickb_1995216

                  I have determined why the watchdog doesn’t trigger reset. The watchdog being used by WICED
                  is the STM32 Independent Watchdog (IWDG) which does not reset the MCU. You need to implement the Window
                  Watchdog Timer (WWDG) which when it triggers will cause a reset.

                  • 6. Re: Watchdog can't trigger the RESET
                    feng@ibiquity.com

                    Hi,

                     

                    Current watchdog in SDK 3.1.2 has been implemented using Independent Watchdog (IWDG), but my test shows that it doesn't work. See my email above. How can you says the Window Watchdog Timer (WWDG) can trigger the reset. If yes, can you post your implementation code?


                    Thanks

                    • 7. Re: Watchdog can't trigger the RESET
                      feng@ibiquity.com

                      Hi,

                       

                      Can you run the thread_monitor example using the BCM943362WCD4 EVB?  What is the result?  The watchdog can trigger the reboot? Our project was stuck at this issue.

                       

                      Thanks

                      • 8. Re: Watchdog can't trigger the RESET
                        seyhan

                        Hi,

                         

                        Run the attached thread_monitor snippet application using WICED SDK-3.1.2 on the BCM943362WCD4 platform and following is the terminal output with the below change:

                         

                        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( );
                        }
                        

                         

                         

                        Below terminal output is with not commented out "WICED_TRIGGER_BREAKPOINT( );" where the handling is implemented as break point. It is meant to allow debugging if there is an issue with the implementation. It could be replaced with your own specific handler if needed.

                         

                        Seyhan

                        1 of 1 people found this helpful
                        • 9. Re: Watchdog can't trigger the RESET
                          feng@ibiquity.com

                          Hi,

                           

                          When I commented out "WICED_TRIGGER_BREAKPOINT( ). Watchdog can reboot the Inventel ECB. But it still cannot reboot my production board that is based on the Inventek EVB. Below is the terminal output. Any clue for this problem?


                          Registering my thread monitor

                           

                           

                          Do some work

                          Updating monitor: 0

                           

                           

                          Do some work

                          Updating monitor: 1

                           

                           

                          Do some work

                          Updating monitor: 2

                           

                           

                          Do some work

                          Updating monitor: 3

                           

                           

                          Do some work

                          Updating monitor: 4

                           

                           

                          Do some work

                          Updating monitor: 5

                           

                           

                          Do some work

                          Updating monitor: 6

                           

                           

                          Do some work

                          Updating monitor: 7

                           

                           

                          Do some work

                          Updating monitor: 8

                           

                           

                          Do some work

                          Updating monitor: 9

                           

                           

                          Uh oh, I'm about to watchdog because an unexpected delay occurred!

                           

                           

                          Do some work

                          Updating monitor: 10

                           

                           

                          Do some work

                          Updating monitor: 11

                           

                           

                          Do some work

                           



                          Thanks

                          • 10. Re: Watchdog can't trigger the RESET
                            callmekart

                            seyhan

                             

                            Structure system_monitor need mutex?

                            • 11. Re: Watchdog can't trigger the RESET
                              axel.lin_1746341

                              callmekart wrote:

                               

                              seyhan    Structure system_monitor need mutex?

                              Both system_monitors[] and system_monitor need lock protection because they are accessed by multiple threads.