fix: improve boot fault visibility and defer watchdog start
This commit is contained in:
+11
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user