Forums - QCA4020 WatchDog Timer.

9 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
aisahoga
Join Date: 25 May 22
Posts: 1
Posted: Wed, 2022-05-25 09:43

Thanks for this thread..  mobdro app

 
  • 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
jasonroy1565
Join Date: 7 Jan 23
Posts: 4
Posted: Tue, 2023-02-21 02:24
Here's an overview of how to initialize and start the Watchdog Timer, as well as how to feed the timer:
 
Initialization and starting of Watchdog Timer:
To initialize and start the Watchdog Timer, you can use the following code:
// Include the watchdog header file
#include "qapi_wdt.h"
 
// Define the watchdog timeout value in seconds
#define WDT_TIMEOUT_SEC 10
 
// Initialize the watchdog
qapi_WDT_Init(WDT_TIMEOUT_SEC);
 
// Start the watchdog
qapi_WDT_Enable();
In the above code, qapi_WDT_Init() function initializes the watchdog with a timeout of WDT_TIMEOUT_SEC seconds, and qapi_WDT_Enable() function starts the watchdog.
 
Feeding Watchdog Timer:
To feed the Watchdog Timer, you can use the following code:
// Include the watchdog header file
#include "qapi_wdt.h"
 
// Feed the watchdog
qapi_WDT_Pet();
In the above code, qapi_WDT_Pet() function feeds the watchdog.
 
I hope this helps you in configuring the Watchdog Timer for your QCA4020 device
  • Up0
  • Down0
shaguftashamid92
Join Date: 14 Apr 23
Posts: 1
Posted: Fri, 2023-04-14 03:17

A problem has arisen in the QCA4020 WatchDog Timer. The system has been powered up, but the timer has not been activated. This means that if an unexpected shutdown or power outage were to occur, the device would not be rebooted and the system would be left in a vulnerable state. This could lead to data loss, system instability in logistic-branch, or even a complete system crash. As such, it is important to enable the WatchDog timer in order to ensure the system is properly protected from unexpected shutdowns.

  • 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.