Architecture of FreeRTOS

advertisement

FreeRTOS

G23

9961256 9960114 9961217

王偉一 江哲維 洪心為

1

2

/23

Outline

• PART1

• Introduction

• PART2

• Architecture

• PART3

• Application

• Future View

• Conclusion

王偉一,江哲維,洪心為

PART

I

Introduction

9961257 王偉一

3

FreeRTOS

• A R eal T ime O perating S ystem

• Written by Richard Barry & FreeRTOS Team

• Owned by Real Time Engineers Ltd but free to use

• Huge number of users all over the world

• 6000 Download per month

• Simple but very powerful

4

/23

王偉一 ,江哲維,洪心為

Real-Time Operating System ?

5

/23

• A type of an operating system

• It’s all about scheduler :

• multi user operating system(UNIX) - fair amount of the processing time

• desk top operating system(Windows) - remain responsive to its user

• ……

• RTOS scheduler focuses on predictable execution pattern

王偉一 ,江哲維,洪心為

6

/23

Why using FreeRTOS

• Abstract out timing information

• Maintainability/Extensibility

• Modularity

• Cleaner interfaces

• Easier testing (in some cases)

• Code reuse

• Improved efficiency?

• Idle time

…...

……

王偉一 ,江哲維,洪心為

When to use FreeRTOS

7

/23

王偉一 ,江哲維,洪心為

License of FreeRTOS

 Modified GPL

8

/23

王偉一 ,江哲維,洪心為

9

/23

History of FreeRTOS

FreeRTOS v1.0.1

FreeRTOS v2.0.0

FreeRTOS v3.0.0

FreeRTOS v4.0.0

FreeRTOS v5.0.0

+Scalability

+New Task API

+API Changes

+Directory

Names

Changed

+Changes in

Kernel

+Co-routines +API Changes

王偉一 ,江哲維,洪心為

What is the current version?

10

/23

FreeRTOS v7.6.0

+ Tick Suppression

+ Queue sets

+ Port optimized task selection http://www.freertos.org/History.txt

王偉一 ,江哲維,洪心為

PART

II

Architecture

9961217 洪心為

11

12

/23

Architecture Overview

• Tasks (50%)

• task.c

and task.h

do all the heavy lifting for creating, scheduling, and maintaining tasks.

• Communication (40%)

• queue.c

and queue.h

handle FreeRTOS communication.

Tasks and interrupts use queues to send data to each other and to signal the use of critical resources using semaphores and mutexes.

• Hardware Interfacing (6%)

王偉一,江哲維, 洪心為

Task States

(1/3)

• Running

• Ready

• Blocked

• Suspended

13

/23

王偉一,江哲維, 洪心為

14

/23

Task Priorities

(2/3)

• Each task is assigned a priority from 0 to

( configMAX_PRIORITIES - 1 ). Low priority numbers denote low priority tasks. The idle task has priority zero (tskIDLE_PRIORITY).

• The task placed into the Running state is always be the highest priority task that is able to run.

• Ready state tasks of equal priority share the available processing time using a time sliced round robin scheduling scheme.

王偉一,江哲維, 洪心為

15

/23

Idle Task

(3/3)

• Created automatically when the RTOS scheduler is started to ensure there is always at least one task that is able to run.

• Responsible for freeing memory allocated by the

RTOS to tasks that have since been deleted.

• An idle task hook is a function that is called during each cycle of the idle task.

王偉一,江哲維, 洪心為

16

/23

Communication & Synchronization

• Queues

• Binary Semaphores

• Counting Semaphores

• Mutexes

• Recursive Mutexes

王偉一,江哲維, 洪心為

17

/23

Hardware Interfacing

• Hardware Independent

• The same code runs whether FreeRTOS is running on the humble 8051 or the newest, shiniest ARM core.

• FreeRTOS software layers

王偉一,江哲維, 洪心為

PART

III

Application

& Future View

9960114 江哲維

18

19

/23

Applications & Future view

• Because of the basic kernel of FreeRTOS, it’s more flexible for users to attach other expanded modules on OS to get more applications.

• New cloud managed service, file system API, TCP/IP, safety certified kernel…

王偉一, 江哲維 ,洪心為

20

/23

FreeRTOS+Nabto

• FreeRTOS+Nabto is a small piece of C code.

• Each Internet of Things (IoT) device has a unique URL over the Internet, and the technology allows secure, authenticated and extremely low bandwidth P2P connections.

• accessible over a local network in the absence of Internet connectivity.

• combined with FreeRTOS's special low power features, makes FreeRTOS a natural choice for implementing the Internet of Things.

王偉一, 江哲維 ,洪心為

21

/23

Benefits

• A resolvable URL for each device

• Remote access over the Internet from computer, tablet or smart phone

• No firewall hassles

• No embedded file system, TCP/IP stack necessary

• Low bandwidth for enhanced performance

• Increased privacy and security

• Reduced hardware and software cost

王偉一, 江哲維 ,洪心為

22

/23

Conclusion

• An Free Real-Time OS with essential kernel of low power(Tick-less kernel) & high efficiency.

• Support many architecture.

Ex. ARM, Altera, Xilinx, IBM, Intel, Cortus…

• Co-routine – multitasking by coding

• Open source, implantable, flexible and easy learning

王偉一, 江哲維 ,洪心為

Reference

• The Architecture of Open Source Applications (Volume 2): FreeRTOS http://www.aosabook.org/en/freertos.html

• FreeRTOS official Website http://www.freertos.org/

23

/23

王偉一,江哲維,洪心為

Download