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
+2 -1
View File
@@ -44,6 +44,7 @@
/* USER CODE BEGIN Includes */
/* Section where include file can be added */
#include "debug_log.h"
/* USER CODE END Includes */
/* Ensure definitions are only used by the compiler, and not by the assembler. */
@@ -137,7 +138,7 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
/* Normal assert() semantics without relying on the provision of an assert.h
header file. */
/* USER CODE BEGIN 1 */
#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}
#define configASSERT( x ) do { if ((x) == 0) { debug_log_fault_context("config-assert", __FILE__, __LINE__); taskDISABLE_INTERRUPTS(); for( ;; ) { } } } while (0)
/* USER CODE END 1 */
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
+1
View File
@@ -17,6 +17,7 @@ void debug_log_printf(const char *fmt, ...);
void debug_log_boot(const char *tag);
void debug_log_fault(const char *tag);
void debug_log_runtime_snapshot(void);
void debug_log_fault_context(const char *tag, const char *file, int line);
#ifdef __cplusplus
}
+1 -1
View File
@@ -38,7 +38,7 @@ extern IWDG_HandleTypeDef hiwdg;
/* USER CODE END Private defines */
void MX_IWDG_Init(void);
HAL_StatusTypeDef MX_IWDG_Init(void);
/* USER CODE BEGIN Prototypes */