Microcontroller Firmware Bank Swapping Without Reboot
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing microcontroller systems require a reboot to switch firmware execution between memory banks, leading to increased downtime and cost due to the stopping of CPU processes and interrupt service routines.
Innovation Solution
A method and system for seamless switching of firmware execution between memory banks in a microcontroller without shutting down the CPU or interrupt controller, using software pointers to replace the address location of the first application with that of a second application in a second bank, allowing simultaneous operation and updating of firmware in a spare bank.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a reboot is performed to switch firmware execution between memory banks, then the firmware update is completed, but the CPU processes and interrupt service routines are stopped causing increased downtime
Solution Approach 1:
The system prepares the second memory bank with updated firmware in advance while the first bank remains active. The pointer update mechanism is pre-configured to enable seamless switching. This preliminary preparation allows the transition to occur without stopping CPU processes or interrupt service routines, thereby eliminating downtime while ensuring firmware update completion.
Solution Approach 2:
A pointer mechanism serves as an intermediary between the CPU and the memory banks. By updating the pointer value stored in a specific memory location rather than directly switching banks, the system enables smooth transition. The pointer acts as a mediator that redirects execution flow from the first bank to the second bank without requiring a reboot, thus maintaining continuous operation of CPU processes and interrupt handlers.
2Adaptability or versatility
If the microcontroller is rebooted to execute new firmware, then the new firmware version is run, but system operation is interrupted increasing operational costs
Solution Approach 1:
The system dynamically switches between firmware versions by updating a pointer value at runtime rather than requiring a static reboot. The pointer can be modified to point to either the first or second memory bank depending on which firmware version should execute. This dynamic approach allows the system to adapt to different firmware versions while maintaining continuous operation, thus preserving productivity and system operation continuity.
Solution Approach 2:
The second memory bank is pre-loaded with the new firmware version before the switch occurs. This preliminary action ensures that when the pointer is updated, the system can immediately execute the new firmware without interruption. The pre-prepared firmware in the second bank enables seamless version switching while maintaining system productivity and avoiding operational interruptions.
Data Source
AI summary
A method is provided of swapping code execution among multiple microcontroller code banks. The microcontroller has computer-readable memory, a central processing unit, and an interrupt controller. The method comprises executing an instruction to process a first pointer storing an address location of a first application within a first code bank of computer-readable memory. The first application is executed based on processing the first pointer. The method also comprises replacing the address location of the first application stored within the first pointer with an address location of a second application stored with a second code bank of the computer-readable memory. The instruction to process the first pointer is executed to process the address location of the second application to execute the second application without stopping operation of the interrupt controller.


