mirror of
https://github.com/apache/nuttx.git
synced 2026-10-04 04:38:10 +00:00
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 <yukangzhi@xiaomi.com>
This commit is contained in:
parent
8cdf58d124
commit
b82ad5c495
1 changed files with 14 additions and 4 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue