반응형

Troubleshooting 5

[MCU] 워치독 타이머(Watchdog) 무한 리셋 버그 원인과 메인 루프 구조 개선 방법

[Quick Summary (TL;DR) - For Global Developers]Symptom: 시스템이 정상 주기를 무시하고 무한히 재부팅(Infinite Reset Loop)되거나 특정 주변장치 응답 대기 시 MCU가 완전히 먹통(System Freeze)이 됨.Cause: 메인 루프 내부에 HAL_Delay() 같은 차단형(Blocking) 지연 함수를 사용하거나 외부 하드웨어의 응답을 무한 대기(Infinite polling)하여 독립형 워치독 타이머(IWDG) 레지스터를 제때 리프레시(Kicking)하지 못함.Solution: 차단형 대기 코드를 HAL_GetTick() 기반의 비차단(Non-blocking) 시간 비교 구조 및 상태 머신(State Machine) 아키텍처로 전면 수정하여 ..

Troubleshooting 2026.06.09

ARM Cortex-M 하드폴트(Hard Fault) 디버깅: 레지스터 추적으로 원인 코드 찾는 법

Quick Summary (TL;DR) - For Global DevelopersSymptom: The MCU suddenly stops executing normal code and jumps to an infinite loop inside the HardFault_Handler(), often causing the watchdog timer to reset the system.Cause: Execution of illegal instructions, memory access violations (such as null pointer dereferencing or unaligned memory access), or stacking failures during exception entry.Solution..

Troubleshooting 2026.06.08

[C언어 임베디드] 버퍼 오버플로우(Buffer Overflow) 에러 예방과 안전한 메모리 복사

[Quick Summary (TL;DR) - For Global Developers]Symptom: Unexpected modification of adjacent variables, sudden system resets, or immediate jumps to HardFault_Handler during data parsing.Cause: Writing data beyond the allocated array boundary, which overwrites the Stack Frame (return address) or adjacent global variables in RAM.Solution: Implement strict input validation (Bounds Checking) before a..

Troubleshooting 2026.06.07

[MCU 디버깅] Wild Pointer 및 Dangling Pointer로 인한 시스템 다운 방지 대책

[Quick Summary (TL;DR) - For Global Developers]Symptom: Random system resets, infinite loops in HardFault_Handler, unexpected peripheral behaviors, or silent data corruption that alters operation based on Compiler Optimization levels.Cause: Dereferencing uninitialized pointer variables (Wild Pointer) or accessing memory addresses that have already been deallocated from the heap or stack frame (D..

Troubleshooting 2026.06.06

[임베디드 C] 스택 오버플로우(Stack Overflow) 원인 분석과 MAP 파일 활용한 해결 방법

[Quick Summary (TL;DR) - For Global Developers]Symptom: MCU enters HardFault_Handler or suddenly resets, causing memory corruption and unpredictable runtime behavior.Cause: A thread or function exceeds its allocated stack space due to large local variables, deep recursion, or high interrupt nesting.Solution: Optimize local memory allocation using static or dynamic memory, increase stack size in ..

Troubleshooting 2026.06.05
반응형