您的位置:首页 > 移动开发

Real-time programming applied to the FreeRTOS operating system

2014-07-11 04:49 507 查看
http://www.ac6-training.com/cours.php/cat_FSCA/ref_RT3/
First Day

RTOS Introduction

Cortex-M resources used by RTOS
Cortex-M Architecture Overview
Two stacks pointers
Different Running-modes and Privileged Levels
MPU Overview
Systick Timer Description

Exception / Interrupt Mechanism Overview
Interrut entry and return Overview
SVC / PendSV / Systick Interrupt Presentation

Developing with the IDE
Exercice : Interrupt Management on Cortex-M4
Introduction to Real Time
Base real time concepts
The Real Time constraints
Multi-task and real time

Thread safe data structures
Need for specific data structures
Thread safe data structures
Linked lists
Circular lists
FIFOs
Stacks

Data structures integrity proofs
Assertions
Pre and post-conditions

Exercice : Build a general purpose thread safe linked list
Second Day

Element of a real time system
Tasks and Task Descriptors
Content of the task descriptor
List of task descriptors

Context Switch
Task Scheduling and Preemption
Tick based or tickless scheduling

Scheduling systems and schedulability proof
Fixed priorities scheduling
RMA and EDF scheduling

Scheduling through FReeRTOS
Deterministic preemptive scheduling
Scheduling strategies
Cooperative scheduling
Hybrid scheduling

Exercice : Analyse a Context Switch
Task Management
The Task life-cycle
Creating tasks
Deleting tasks
The Endless-loop pattern

Task Priorities
Assigning task priorities
Changing task priorities

The idle task
Idle task hooks

Timing
Exercice : Managing tasks
Memory Management
Memory management algorithms
Buddy System
Best fit / First Fit
Pools Management

FreeRTOS-provided memory allocation schemes
Allocate-only scheme
Best-fit without coalescing
Thread-safe default malloc

Checking remaining free memory
Adding an application-specific memory allocator
Memory management errors
Stack monitoring
Exercice : Write a simple, thread safe, buddy system memory manager
Exercice : Write a generic, multi-level, memory manager
Exercice : Enhance the memory manager for memory error detection
Exercice : Detect stack overflow
Third Day

Synchronization Primitives
Introduction
Waiting and waking up tasks
Semaphores
Events
Mailboxes

Binary Semaphores through FreeRTOS
Give a Binary Semaphore
Take a binary Semaphore

Queue Management through FreeRTOS
Creation
Sending on a queue
Receiving from a queue
Data management
Sending compound types
Transfering large data

Exercice : Synchronizing a task with another one through binary semaphores
Exercice : Synchronizing a task with another one through queues
Resource Management
Mutual Exclusion
Spinlocks and interrupt masking
Mutex or Semaphore
Recursive or not recursive mutexes
Priority inversion problem
Priority inheritance (the automatic answer)
Priority ceiling (the design centric answer)

Mutual exclusion through FreeRTOS
Mutexes and binary semaphores
Deadlocks
Priority inversion
Priority inheritance

Critical sections
Critical sections
Suspending (locking) the scheduler

Gatekeeper tasks
Exercice : Implement mutual exclusion between two tasks
Fourth Day

Parallelism Problems Solution
Parallel programming problems
Uncontrolled parallel access
Deadlocks
Livelocks
Starvation

Exercice : The producer-consumer problem, illustrating (and avoiding) concurrent access problems
Exercice : The philosophers dinner problem, illustrating (and avoiding) deadlock, livelock and starvation
Interrupt Management
Need for interrupts in a real time system
Software Interrupt
Time Interrupts
Device Interrupts

Level or Edge interrupts
Hardware and Software acknowledge
Interrupt vectoring
Interrupts and scheduling
Deferred interrupt processing through FreeRTOS
Tasks with interrupt synchronization
Using semaphores within an ISR
Counting semaphores
Using queues within an ISR

FreeRTOS interrupt processing
Writing ISRs in C
Interrupt safe functions
Interrupt nesting

Exercice : Synchronize Interrupts with tasks
Software Timer
The Timer Daemon Task
Timer Configuration
One-shot / Auto-reload Timer
Software Timer API
Exercice : Implement Soft Timers
Trouble Shooting
Checking for stack problems
Common pitfalls

FreeRTOS-MPU
The Cortex/M MPU
User and privileged modes
Access permissions

Defining MPU regions
Overlapping regions
Predefined regions
Programmer-defined regions

Needed linker configuration
Practical usage tips
Exercice : Implement protected memory regions
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐