RTOS Sleep Control Without Idle Task Context Switching
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Real time operating systems (RTOS) waste resources and time due to the execution of an idle task during context switches, as no useful work is performed during these transitions, leading to inefficient power management.
Innovation Solution
Implementing a 'Sleep on Exit' feature in ARM processors to enter sleep mode after servicing all interrupts, eliminating the need for an idle task by incorporating its functions into interrupt service routines and the PendSV exception handler, allowing operation in both handler and thread modes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of energy
If an idle task is used to determine when sleep mode may be entered, then the system can manage power consumption, but the idle task executes unnecessary context switches and consumes wasted time and resources
Solution Approach 1:
The patent removes the idle task from the RTOS system entirely. Instead of having an idle task that wastes time executing during context switches, the system uses the SLEEP ON EXIT feature to directly transition to sleep mode after servicing interrupts, eliminating the unnecessary idle task and its associated context switch overhead.
Solution Approach 2:
The patent merges the idle task functionality into the interrupt service routines and PendSV exception handler. The SLEEP ON EXIT feature is implemented within the exception handling mechanism, combining the sleep determination logic with the interrupt servicing process, thereby eliminating the need for a separate idle task.
2Reliability
If an idle task is executed during context switches, then the system maintains readiness for task execution, but no useful work is performed during these transitions
Solution Approach 1:
The system uses the SLEEP ON EXIT feature to automatically determine when to enter sleep mode based on the state of ready tasks and interrupt conditions. The PendSV exception handler and interrupt service routines inherently manage system readiness without requiring a separate idle task, allowing the system to serve itself by directly transitioning to sleep when appropriate.
3Loss of energy
If the SLEEP ON EXIT feature is enabled, then power consumption is reduced, but the feature must be disabled when tasks are ready to execute
Solution Approach 1:
The system implements feedback control by monitoring the state of ready tasks and interrupt conditions to dynamically enable or disable the SLEEP ON EXIT feature. The PendSV exception handler checks whether tasks are ready and adjusts the sleep feature accordingly, ensuring power savings are achieved without compromising system responsiveness.
Data Source
AI summary
A system and method for managing sleep mode in a real time operating system is disclosed. The system utilizes certain ARM processors which incorporate a SLEEP ON EXIT feature. This feature allows the processing unit to enter sleep mode once the lowest priority exception handler has terminated operation. Additionally, the system utilizes thread mode, or user mode, without the use of an idle task. The functions typically performed by the idle task are now incorporated into various interrupt service routines and the PendSV exception handler. Further, the system supports two or more different sleep modes.


