代码暂存 修复看门狗在关闭RC32K时偶现无法复位问题

This commit is contained in:
常正强 2025-05-17 14:35:14 +08:00
parent 6e091395d9
commit dc9559625f
2 changed files with 11 additions and 3 deletions

View File

@ -5,7 +5,7 @@
"type": "mrs-debugger",
"request": "launch",
"name": "IoT_SCV_CH584M1",
"cwd": "c:\\Users\\123\\Desktop\\纯电自闭阀\\iot_-scv_-ch584-m",
"cwd": "c:\\Users\\123\\Desktop\\自闭阀项目\\CDZBF\\iot_-scv_-ch584-m",
"openOCDCfg": {
"useLocalOpenOCD": true,
"executable": "d:/MounRiverV2/MounRiver_Studio2/resources/app/resources/win32/components/WCH/OpenOCD/OpenOCD/bin/openocd.exe",
@ -39,8 +39,8 @@
"additionalCommands": []
},
"loadedFiles": {
"executableFile": "c:\\Users\\123\\Desktop\\纯电自闭阀\\iot_-scv_-ch584-m\\obj\\IoT_SCV_CH584M1.elf",
"symbolFile": "c:\\Users\\123\\Desktop\\纯电自闭阀\\iot_-scv_-ch584-m\\obj\\IoT_SCV_CH584M1.elf",
"executableFile": "c:\\Users\\123\\Desktop\\自闭阀项目\\CDZBF\\iot_-scv_-ch584-m\\obj\\IoT_SCV_CH584M1.elf",
"symbolFile": "c:\\Users\\123\\Desktop\\自闭阀项目\\CDZBF\\iot_-scv_-ch584-m\\obj\\IoT_SCV_CH584M1.elf",
"executableFileOffset": 0,
"symbolFileOffset": 0
},

View File

@ -231,6 +231,14 @@ void HAL_Init()
{
halTaskID = TMOS_ProcessEventRegister(HAL_ProcessEvent);
HAL_TimeInit();
#if 1
// 开启独立看门狗会强制开启内部32K但是开启状态没有跟内部的RC32K寄存器同步
// 而复位时候是根据内部RC32K寄存器状态来决定是否启动RC32K
// 不关闭ch584的内部32KRC
sys_safe_access_enable();
R8_CK32K_CONFIG |= RB_CLK_INT32K_PON;
sys_safe_access_disable();
#endif
#if(defined HAL_SLEEP) && (HAL_SLEEP == TRUE)
HAL_SleepInit();
#endif