MCU Flash Bootloader Recovery From Invalid Application Keys
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Flash memory errors due to unexpected power off during application key erasure or writing cause CPU core exceptions, leading to infinite repetition of power-on and key reading processes, preventing execution of the application and flash bootloader.
Innovation Solution
A microcontroller unit (MCU) with a flash memory configuration that includes a flash bootloader, application block, and application key block, allowing the MCU to enter a flash boot loader mode upon invalidity, reprogram the application key block, and reset when the key value is invalid, enabling reprogramming and writing a valid key value.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If the application key block is made erasable and resettable for flexibility, then the system can adapt to reprogramming scenarios, but unexpected power off during erasure or writing causes memory damage and CPU core exceptions
Solution Approach 1:
The flash bootloader checks the application key validity before attempting to execute the application. This preliminary validation prevents the system from entering a state where power loss during key operations could cause damage, as the key is verified to be in a safe state before any risky operations proceed.
Solution Approach 2:
The flash bootloader acts as an intermediary layer between the application key block and the application execution. It manages the key validation process and controls the transition between bootloader mode and application mode, preventing direct access that could lead to unsafe operations during power transitions.
2Reliability
If the system performs strict key validation on power on, then security is ensured, but infinite repetition occurs when the key is invalid preventing application execution
Solution Approach 1:
The system dynamically switches between two operational modes based on key validation results: bootloader mode for reprogramming when the key is invalid, and application mode when the key is valid. This dynamic state transition resolves the infinite repetition by providing an escape path from the validation loop through mode switching.
Solution Approach 2:
The system changes its operational parameter (execution mode) based on the key validation result. When validation fails, it transitions from application execution mode to bootloader mode, allowing reprogramming. This parameter change breaks the infinite repetition cycle by altering the system's behavioral state.
3Ease of repair
If the flash bootloader mode is entered for reprogramming, then the system can be restored to functional state, but the system cannot execute the application until reprogramming is complete
Solution Approach 1:
The flash bootloader provides self-service functionality by automatically detecting invalid keys and initiating the restoration process without external intervention. When an invalid key is detected, the system autonomously enters bootloader mode and prepares for reprogramming, eliminating the need for manual diagnostic procedures.
Data Source
Figure 1~2
Figure 3
Figure 4
AI summary
A micro controller unit (MCU) includes a flash memory, wherein the flash memory may determine a key value of an application when the MCU is powered on, and, when the key value of the application is invalid, the flash memory may enter a mode that enables reprogramming.