fix: improve boot fault visibility and defer watchdog start

This commit is contained in:
2026-04-20 08:12:06 +08:00
parent 77da670f5c
commit c8f27e21f1
7 changed files with 54 additions and 9 deletions
+11 -1
View File
@@ -89,13 +89,23 @@ static void StartDefaultTask(void *argument)
{
TickType_t last_snapshot = xTaskGetTickCount();
BaseType_t alive_logged = pdFALSE;
BaseType_t iwdg_ready = pdFALSE;
(void)argument;
debug_log_boot("default-task");
if (MX_IWDG_Init() == HAL_OK) {
debug_log_write("[BOOT] iwdg-started\r\n");
iwdg_ready = pdTRUE;
} else {
debug_log_write("[BOOT] iwdg-init-fail\r\n");
}
for (;;) {
HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_13);
HAL_IWDG_Refresh(&hiwdg);
if (iwdg_ready == pdTRUE) {
HAL_IWDG_Refresh(&hiwdg);
}
if (alive_logged == pdFALSE) {
debug_log_write("[RTOS] alive\r\n");
alive_logged = pdTRUE;