Forums - QCA4020 WatchDog Timer.

6 posts / 0 new
Last post
QCA4020 WatchDog Timer.
vaibhav.t
Join Date: 3 Aug 20
Posts: 14
Posted: Wed, 2020-10-14 07:26

Hello Team.

I want to use watch dog timer in my project. Following is my DevCfg_master_devcfg_out_cdb.xml  configuration for watchdog.

</driver>
<driver name="Dog_Cfg">
  <device id="0x02000019">
    <!-- If this flag is set to 0x0, hw wdog and grace timer will be initialized -->
    <!-- If this flag is set to 0x1, hw wdog and grace timer will NOT be initialized -->
    <props name="dog_hal_disable" type="0x00000002">
      0
    </props>
    <!-- Grace timer value in sclk, This timer will declare a stalled initialization,
if intialization does not complete before it times out. -->
    <props name="dog_hal_grace_timer_timeout" type="0x00000002">
      160000 <!-- s*32000, 5s -->
    </props>

 

Still result is negative.

Things I want to know.

1) How to Initialize and start WatchDog for QCA4020.

2) How to Feed WatchDog Timer.

Any example code would be helpful.

Thank you. 

  • Up0
  • Down0
ss.pandiri
Join Date: 29 May 18
Posts: 58
Posted: Tue, 2020-12-15 02:03

hi,

As per your configuration, watchdog is enabled. The property "dog_hal_grace_timer_timeout" is used to configure watchdog timer.

The QCLI demo demonstrates some of the watchdog functionality. You can refer to code in this path:

QCA4020_sdk/target/quartz/demo/QCLI_demo/src/platform/platform_demo.c

thanks

  • Up0
  • Down0
drglennwolfe
Join Date: 23 Sep 19
Posts: 9
Posted: Tue, 2022-02-22 08:04

I also cannot get the WDT to reset the system.  I set the "Dog_Cfg" parameter to zero in the xml file.  It simply doesn't work at all.  Is there an new information on this?  Has anyone else got it to work? 

Thanks,

Dr. Wolfe

  • Up0
  • Down0
akshay.b
Join Date: 2 Aug 19
Posts: 62
Posted: Wed, 2022-02-23 20:41
  1. Open DevCfg_master_devcfg_out_cdb.xml file and enable watchdog timer as below

<driver name="Dog_Cfg">

  <device id="0x02000019">

    <!-- If this flag is set to 0x0, hw wdog and grace timer will be initialized -->

    <!-- If this flag is set to 0x1, hw wdog and grace timer will NOT be initialized -->

    <props name="dog_hal_disable" type="0x00000002">  0
 

   2.   Set the watchdog grace timer as below

<!-- Grace timer value in sclk, This timer will declare a stalled initialization,

        if intialization does not complete before it times out. -->

    <props name="dog_hal_grace_timer_timeout" type="0x00000002">   256000 <!-- s*32000, 8s -->

The timer is set for 8 secs (8 * 3200). Change the value to set timer.
 

   3.  WDT will run only if ramdump is disable

</props>

    <props id="7" id_name="PLATFORM RAMDUMP ENABLED" oem_configurable="true" helptext="Enable or Disable Ramdump. 1--Enabled, 0--Disabled" type="0x00000002">    0

  • Up0
  • Down0
drglennwolfe
Join Date: 23 Sep 19
Posts: 9
Posted: Wed, 2022-07-06 09:18

I would like to add that the "main thread" must be allowed to run for correct WDT functionality. 

void app_start(qbool_t cold_boot) {
  bdg_init(cold_boot); // never returns
  return;
}
void bdg_init(uint32_t _cold_boot) {
  qapi_Status_t status = 0;
  qurt_thread_t thread_handle;
  qurt_thread_attr_t thread_attr;
  qurt_thread_attr_init(&thread_attr);
  qurt_thread_attr_set_name(&thread_attr, "bdg_thread");
  qurt_thread_attr_set_priority(&thread_attr, BDG_THREAD_PRIORITY);
  qurt_thread_attr_set_stack_size(&thread_attr, BDG_THREAD_STACK_SIZE);
  qurt_thread_create(&thread_handle, &thread_attr, thread, NULL); // launch main application thread
  while(1) { sleep_ms(1*60*1000); } // This thread must live for WDT to function properly
}


 

  • Up0
  • Down0
ervinjelvos9
Join Date: 17 Jun 22
Posts: 2
Posted: Fri, 2022-09-09 14:54

I want to use watch dog timer in my project. Following is my DevCfg_master_devcfg_out_cdb.xml  configuration for watchdog.

</driver>
<driver name="Dog_Cfg">
  <device id="0x02000019">
    <!-- If this flag is set to 0x0, hw wdog and grace timer will be initialized -->
    <!-- If this flag is set to 0x1, hw wdog and grace timer will NOT be initialized -->
    <props name="dog_hal_disable" type="0x00000002">
      0
    </props>
    <!-- Grace timer value in sclk, This timer will declare a stalled initialization,
if intialization does not complete before it times out. -->
    <props name="dog_hal_grace_timer_timeout" type="0x00000002">
      160000 <!-- s*32000, 5s -->
    </props>

 

Still result is negative.

Things I want to know.

1) How to Initialize and start WatchDog for QCA4020.

2) How to Feed WatchDog Timer.

Any example code would be helpful.

As per your configuration, watchdog is enabled. The property "dog_hal_grace_timer_timeout" is used to configure watchdog timer.

The QCLI demo demonstrates some of the watchdog functionality. You can refer to code in this path:

QCA4020_sdk/target/quartz/demo/QCLI_demo/src/platform/platform_demo.c

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.