Stack Dummy Overflow Detection in Microcontroller Memory

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing systems face challenges in detecting and addressing application stack overflows, which can lead to system failures without clear recognition of the issue.

Innovation Solution

The method involves designating a stack dummy for each application stack and checking for overflows based on these dummies, allowing for the shutdown of a micro control unit (MCU) or recovery of the application stack.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a stack dummy is designated for each application stack and overflow checking is implemented, then system reliability is improved through proactive overflow detection, but device complexity increases due to additional memory management overhead

Engineering Contradiction:
Improvestack overflow detection capabilityVSAvoidmemory management complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent designates a stack dummy area at a predetermined location adjacent to each application stack before the stack can overflow. This preliminary placement of a sentinel marker enables the system to detect stack overflow conditions proactively by checking whether the stack has grown to occupy the dummy area, rather than waiting for actual overflow damage to occur.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The stack dummy acts as an intermediary marker between the application stack and the protected memory area. When the stack grows, it will encounter the dummy area first. The dummy serves as a detectable intermediate state that signals potential overflow before the stack actually invades protected memory regions, enabling early intervention.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If stack dummy areas are designated and memory protection traps are activated, then measurement precision of stack overflow is improved, but loss of time increases due to interrupt handling overhead

Engineering Contradiction:
Improvestack overflow detection accuracyVSAvoidinterrupt handling time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent replaces complex software-based stack overflow detection mechanisms with a hardware-level memory protection trap system. By configuring the memory management unit to automatically generate traps when access attempts are made to protected dummy areas, the system achieves precise overflow detection through hardware enforcement rather than software polling or checking routines.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The memory protection trap provides immediate feedback to the system when a stack overflow condition is detected. The trap interrupt serves as a real-time notification mechanism that informs the operating system or monitoring code of the overflow event, enabling prompt corrective action. This feedback loop ensures that overflow conditions are detected and reported without delay.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12235750B2Method for protecting application stacks
Publication Date: 2025.02.25 HYUNDAI AUTOEVER
  • US12235750B2 patent drawing
  • US12235750B2 patent drawing
  • US12235750B2 patent drawing

AI summary

Disclosed herein is a method for protecting application stacks. In particular, the method includes: designating, by an operating system (OS) module, an additional stack dummy to an application stack in connection with a micro control unit (MCU); generating, by the MCU, an interrupt by recognizing, through the stack dummy, whether the application stack overflows; and performing, by the OS module, a measure of protection for the overflowed application stack according to whether the interrupt is generated.