Amazon FreeRTOS Kernel
Manuals and User Guides for Amazon FreeRTOS Kernel. We found 1 manuals for free downloads Developer Guide
The FreeRTOS Kernel is a real-time operating system (RTOS) for deeply embedded applications. Ideal for microcontrollers or small microprocessors. The kernel offers features like preemptive or cooperative operation, task prioritization, queues, semaphores, mutexes, software timers, event groups, and more.
Key Features
Preemptive or cooperative operation
Task prioritization
Queues
Software timers
Event groups
Stack overflow checking
Trace recording
Task runtime statistics gathering
Optional commercial licensing and support
Pages: 250 Amazon FreeRTOS Kernel Developer Guide
Brand: Amazon Category: Software Size: 4 MB
Languages: English
Table of contents
- 1 FreeRTOS Kernel
- 3 Table of Contents
- 8 About the FreeRTOS Kernel
- 8 Value Proposition
- 8 A Note About Terminology
- 9 Why Use a Real-time Kernel?
- 10 FreeRTOS Kernel Features
- 10 Licensing
- 11 Included Source Files and Projects
- 12 FreeRTOS Kernel Distribution
- 12 Understanding the FreeRTOS Kernel Distribution
- 12 Building the FreeRTOS Kernel
- 12 FreeRTOSConfig.h
- 12 The Official FreeRTOS Kernel Distribution
- 13 The Top Directories in the FreeRTOS Distribution
- 13 FreeRTOS Source Files Common to All Ports
- 14 FreeRTOS Source Files Specific to a Port
- 15 Header Files
- 15 Demo Applications
- 17 Creating a FreeRTOS Project
- 17 Creating a New Project from Scratch
- 18 Data Types and Coding Style Guide
- 19 Variable Names
- 19 Function Names
- 19 Formatting
- 19 Macro Names
- 20 Rationale for Excessive Type Casting
- 21 Heap Memory Management
- 21 Prerequisites
- 21 Dynamic Memory Allocation and Its Relevance to FreeRTOS
- 22 Options for Dynamic Memory Allocation
- 22 Example Memory Allocation Schemes
- 22 Heap_1
- 23 Heap_2
- 24 Heap_3
- 25 Heap_4
- 26 Setting a Start Address for the Array Used by Heap_4
- 27 Heap_5
- 27 vPortDefineHeapRegions() API Function
- 30 Heap-Related Utility Functions
- 30 xPortGetFreeHeapSize() API Function
- 31 xPortGetMinimumEverFreeHeapSize() API Function
- 31 Malloc Failed Hook Functions
- 32 Task Management
- 32 Task Functions
- 33 Top-Level Task States
- 34 Creating Tasks
- 34 xTaskCreate() API Function
- 35 Creating Tasks (Example 1)
- 38 Using the Task Parameter (Example 2)
- 40 Task Priorities
- 40 Time Measurement and the Tick Interrupt
- 42 Experimenting with Priorities (Example 3)
- 44 Expanding the Not Running State
- 44 The Blocked State
- 44 The Suspended State
- 44 The Ready State
- 44 Completing the State Transition Diagram
- 45 Using the Blocked State to Create a Delay (Example 4)
- 49 vTaskDelayUntil() API Function
- 50 Converting the Example Tasks to Use vTaskDelayUntil() (Example 5)
- 51 Combining Blocking and Non-Blocking Tasks (Example 6)
- 53 The Idle Task and the Idle Task Hook
- 54 Idle Task Hook Functions
- 54 Limitations on the Implementation of Idle Task Hook Functions
- 54 Defining an Idle Task Hook Function (Example 7)
- 56 Changing the Priority of a Task
- 56 vTaskPrioritySet() API Function
- 57 uxTaskPriorityGet() API Function
- 57 Changing Task Priorities (Example 8)
- 60 Deleting a Task
- 60 vTaskDelete() API Function
- 61 Deleting Tasks (Example 9)
- 63 Scheduling Algorithms
- 63 A Recap of Task States and Events
- 64 Configuring the Scheduling Algorithm
- 64 Prioritized Preemptive Scheduling with Time Slicing
- 67 Prioritized Preemptive Scheduling (Without Time Slicing)
- 68 Cooperative Scheduling
- 71 Queue Management
- 71 Characteristics of a Queue
- 71 Data Storage
- 73 Access by Multiple Tasks
- 73 Blocking on Queue Reads
- 73 Blocking on Queue Writes
- 74 Blocking on Multiple Queues
- 74 Using a Queue
- 74 xQueueCreate() API Function
- 75 xQueueSendToBack() and xQueueSendToFront() API Functions
- 76 xQueueReceive() API Function
- 78 uxQueueMessagesWaiting() API Function
- 78 Blocking When Receiving from a Queue (Example 10)
- 82 Receiving Data from Multiple Sources
- 82 Blocking When Sending to a Queue and Sending Structures on a Queue (Example 11)
- 88 Working with Large or Variable-Sized Data
- 88 Queuing Pointers
- 90 Using a Queue to Send Different Types and Lengths of Data
- 93 Receiving from Multiple Queues
- 93 Queue Sets
- 93 xQueueCreateSet() API Function
- 95 xQueueAddToSet() API Function
- 95 xQueueSelectFromSet() API Function
- 96 Using a Queue Set (Example 12)
- 99 More Realistic Queue Set Use Cases
- 101 Using a Queue to Create a Mailbox
- 102 xQueueOverwrite() API Function
- 103 xQueuePeek() API Function
- 105 Software Timer Management
- 105 Software Timer Callback Functions
- 105 Attributes and States of a Software Timer
- 105 Period of a Software Timer
- 106 One-Shot and Auto-Reload Timers
- 106 Software Timer States
- 107 The Context of a Software Timer
- 107 RTOS Daemon (Timer Service) Task
- 108 Timer Command Queue
- 108 Daemon Task Scheduling
- 111 Creating and Starting a Software Timer
- 111 xTimerCreate() API Function
- 112 xTimerStart() API Function
- 113 Creating One-Shot and Auto-Reload Timers (Example 13)
- 116 Timer ID
- 116 vTimerSetTimerID() API Function
- 116 pvTimerGetTimerID() API Function
- 117 Using the Callback Function Parameter and the Software Timer ID (Example 14)
- 119 Changing the Period of a Timer
- 119 xTimerChangePeriod() API Function
- 122 Resetting a Software Timer
- 123 xTimerReset() API Function
- 124 Resetting a Software Timer (Example 15)
- 127 Interrupt Management
- 127 The Interrupt-Safe API
- 128 Advantages of Using a Separate Interrupt-Safe API
- 128 Disadvantages of Using a Separate Interrupt-Safe API
- 128 xHigherPriorityTaskWoken Parameter
- 130 portYIELD_FROM_ISR() and portEND_SWITCHING_ISR() Macros
- 130 Deferred Interrupt Processing
- 131 Binary Semaphores Used for Synchronization
- 134 xSemaphoreCreateBinary() API Function
- 134 xSemaphoreTake() API Function
- 135 xSemaphoreGiveFromISR() API Function
- 136 Using a Binary Semaphore to Synchronize a Task with an Interrupt (Example 16)
- 140 Improving the Implementation of the Task Used in Example 16
- 144 Counting Semaphores
- 146 xSemaphoreCreateCounting() API Function
- 147 Using a Counting Semaphore to Synchronize a Task with an Interrupt (Example 17)
- 148 Deferring Work to the RTOS Daemon Task
- 149 xTimerPendFunctionCallFromISR() API Function
- 150 Centralized Deferred Interrupt Processing (Example 18)
- 152 Using Queues Within an Interrupt Service Routine
- 153 xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() API Functions
- 154 Considerations When Using a Queue from an ISR
- 154 Sending and Receiving on a Queue from Within an Interrupt (Example 19)
- 158 Interrupt Nesting
- 160 ARM Cortex-M and ARM GIC Users
- 162 Resource Management
- 164 Mutual Exclusion
- 164 Critical Sections and Suspending the Scheduler
- 164 Basic Critical Sections
- 166 Suspending (or Locking) the Scheduler
- 167 vTaskSuspendAll() API Function
- 167 xTaskResumeAll() API Function
- 168 Mutexes (and Binary Semaphores)
- 168 xSemaphoreCreateMutex() API Function
- 169 Rewriting vPrintString() to Use a Semaphore (Example 20)
- 172 Priority Inversion
- 172 Priority Inheritance
- 173 Deadlock (or Deadly Embrace)
- 174 Recursive Mutexes
- 175 Mutexes and Task Scheduling
- 178 Gatekeeper Tasks
- 179 Rewriting vPrintString() to Use a Gatekeeper Task (Example 21)
- 183 Event Groups
- 183 Characteristics of an Event Group
- 183 Event Groups, Event Flags, and Event Bits
- 184 More About the EventBits_t Data Type
- 73 Access by Multiple Tasks
- 184 A Practical Example of the Use of an Event Group
- 185 Event Management Using Event Groups
- 185 xEventGroupCreate() API Function
- 185 xEventGroupSetBits() API Function
- 186 xEventGroupSetBitsFromISR() API Function
- 187 xEventGroupWaitBits() API Function
- 190 Experimenting with Event Groups (Example 22)
- 194 Task Synchronization Using an Event Group
- 197 xEventGroupSync() API Function
- 198 Synchronizing Tasks (Example 23)
- 202 Task Notifications
- 202 Communicating Through Intermediary Objects
- 202 Task Notifications: Direct-to-Task Communication
- 203 Benefits and Limitations of Task Notifications
- 203 Limitations of Task Notifications
- 204 Using Task Notifications
- 204 Task Notification API Options
- 204 xTaskNotifyGive() API Function
- 205 vTaskNotifyGiveFromISR() API Function
- 206 ulTaskNotifyTake() API Function
- 207 Method 1 for Using a Task Notification in Place of a Semaphore (Example 24)
- 210 Method 2 for Using a Task Notification in Place of a Semaphore (Example 25)
- 212 xTaskNotify() and xTaskNotifyFromISR() API Functions
- 213 xTaskNotifyWait() API Function
- 215 Task Notifications Used in Peripheral Device Drivers: UART Example
- 221 Task Notifications Used in Peripheral Device Drivers: ADC Example
- 223 Task Notifications Used Directly Within an Application
- 228 Developer Support
- 228 configASSERT()
- 228 Example configASSERT() Definitions
- 229 TraceAnalyzer
- 232 Debug-Related Hook (Callback) Functions
- 232 Viewing Runtime and Task State Information
- 232 Task Runtime Statistics
- 232 The Runtime Statistics Clock
- 233 Configuring an Application to Collect Runtime Statistics
- 234 uxTaskGetSystemState() API Function
- 236 vTaskList() Helper Function
- 237 vTaskGetRunTimeStats() Helper Function
- 238 Generating and Displaying Runtime Statistics, a Worked Example
- 240 Trace Hook Macros
- 241 Available Trace Hook Macros
- 242 Defining Trace Hook Macros
- 243 FreeRTOS-Aware Debugger Plugins
- 245 Troubleshooting
- 245 Chapter Introduction and Scope
- 245 Interrupt Priorities
- 246 Stack Overflow
- 246 uxTaskGetStackHighWaterMark() API Function
- 246 Overview of Runtime Stack Checking
- 247 Method 1 for Runtime Stack Checking
- 247 Method 2 for Runtime Stack Checking
- 247 Inappropriate Use of printf() and sprintf()
- 248 Printf-stdarg.c
- 248 Other Common Errors
- 248 Symptom: Adding a simple task to a demo causes the demo to crash
- 248 Symptom: Using an API function in an interrupt causes the application to crash
- 249 Symptom: Sometimes the application crashes in an interrupt service routine
- 249 Symptom: The scheduler crashes when attempting to start the first task
- 249 Symptom: Interrupts are unexpectedly left disabled, or critical sections do not nest correctly
- 249 Symptom: The application crashes even before the scheduler is started
- 250 Symptom: Calling API functions while the scheduler is suspended, or from inside a critical section, causes the application to crash
Frequently Answers and Questions
What is a real-time kernel?
A real-time kernel (RTOS) is a type of operating system that is designed to respond to events in a timely and predictable manner. This is important for applications where delays could have negative consequences, such as in industrial control systems or medical devices.
Why use FreeRTOS Kernel?
FreeRTOS Kernel offers numerous benefits, including: abstraction of timing information, maintainability and extensibility, modularity, improved efficiency, idle time management, power management, flexible interrupt handling, and support for mixed processing requirements.
What are the benefits of using an RTOS?
RTOS provide functionalities like task prioritization, event-driven processing, resource management, and synchronization mechanisms, leading to improved performance, reliability, and maintainability of embedded systems.
advertisement