This is an automated email from the ASF dual-hosted git repository.

ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new b82ad5c495d arch/tricore: disable CPU and system watchdogs during 
startup
b82ad5c495d is described below

commit b82ad5c495d5b7830059df2fef80847a1d39c032
Author: yukangzhi <[email protected]>
AuthorDate: Wed Jan 21 13:34:32 2026 +0800

    arch/tricore: disable CPU and system watchdogs during startup
    
    Some Aurix Boot-FW configurations leave watchdogs enabled by default,
    which can cause unexpected resets during early bring-up. This change
    explicitly disables the CPU and system watchdogs during core0 startup to
    ensure reliable system initialization.
    
    - For TC3XX chips, call `IfxScuWdt_disableCpuWatchdog()` and
      `IfxScuWdt_disableSafetyWatchdog()`.
    - For TC4XX chips, call `IfxWtu_disableCpuWatchdog()` and
      `IfxWtu_disableSystemWatchdog()`.
    
    This is a low-risk startup change and does not alter watchdog behavior
    after system initialization.
    
    Signed-off-by: yukangzhi <[email protected]>
---
 arch/tricore/src/common/tricore_main.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/tricore/src/common/tricore_main.c 
b/arch/tricore/src/common/tricore_main.c
index 17181c99591..2d6708b7e30 100644
--- a/arch/tricore/src/common/tricore_main.c
+++ b/arch/tricore/src/common/tricore_main.c
@@ -28,8 +28,8 @@
 #include <nuttx/init.h>
 
 #include "Ifx_Types.h"
-#include "IfxScuWdt.h"
 #include "IfxCpu.h"
+#include "IfxScuWdt.h"
 
 /****************************************************************************
  * Private Functions
@@ -43,9 +43,6 @@ static void core_main(void)
    * Enable the watchdogs and service them periodically if it is required
    */
 
-  IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
-  IfxScuWdt_disableSafetyWatchdog(IfxScuWdt_getSafetyWatchdogPassword());
-
   /* Wait for CPU sync event */
 
   IfxCpu_emitEvent(&g_sync_event);
@@ -66,6 +63,19 @@ static void core_main(void)
 
 void core0_main(void)
 {
+  /* All WDTs except WDTCPU0 and system watchdog WDTSYS are in
+   * disabled mode after Boot-FW execution. Disable the watchdog
+   * to ensure the normal startup of the system.
+   */
+
+#if defined(CONFIG_ARCH_CHIP_AURIX_TC3XX)
+  IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());
+  IfxScuWdt_disableSafetyWatchdog(IfxScuWdt_getSafetyWatchdogPassword());
+#elif defined(CONFIG_ARCH_CHIP_AURIX_TC4XX)
+  IfxWtu_disableCpuWatchdog(IfxWtu_getCpuWatchdogPassword());
+  IfxWtu_disableSystemWatchdog(IfxWtu_getSystemWatchdogPassword());
+#endif
+
   core_main();
 }
 

Reply via email to