SlideShare a Scribd company logo
1 of 23
FreeRTOS嵌入式系統移植研究
21天移植FreeRTOS
組長 :黃0閔
組員 :陳0丞、郭0澤、高0穎
專題指導老師 : Joseph
105 艾鍗科技嵌入式Linux系統工程師人才養成班
105 艾鍗科技嵌入式Linux系統工程師人才養成班
21DAYS FREERTOS PORTING ON
RASPBERRY PI2
•Raspberry Pi2:
900 MHz quad core ARM Cortex-A7 CPU
1GB RAM
4 USB ports
40 GPIO pins
105 艾鍗科技嵌入式Linux系統工程師人才養成班
WHAT IS RTOS
•General purpose OS:
• Linux
• Windows
•Real-Time OS (RTOS):
• Without buffering delays
• Hard real-time
• Soft real-time
Hard real-time Soft real-time
Program no response while landing
105 艾鍗科技嵌入式Linux系統工程師人才養成班
TODAY RTOS ON MCU
• MCU:
• Data bus
From 8bit to 32bit
• CPU clock
ARM Cortex-M (60MHz ↑)
• RTOS:
Multi-task
Small code size
RTOS
TasksTasks TasksTask
MCU & Peripheral
Peripheral Drivers
MCU & Peripheral
Peripheral Drivers
105 艾鍗科技嵌入式Linux系統工程師人才養成班
RTOS FEATURE
•Task scheduler:
Task create
Task save
Task restore
Invoke task switch (timer interrupt)
Task communication:
Queue, semaphore,…etc
• Memory Management
105 艾鍗科技嵌入式Linux系統工程師人才養成班
RTOS
• RTOS:
• FreeRTOS, QNX, uC/OS, RTEMS
• FreeRTOS:
Free open source
Small: 9000 lines code
Simple : Only 3 ~ 4 files for porting
Multi-platforms:ARM-M series, ARM7, Cortex-A(A8, A9)
105 艾鍗科技嵌入式Linux系統工程師人才養成班
DEVELOPMENT TOOL
• IDE:
Eclipse-cdt 4.4.2
• Toolchain:
gcc (arm-none-eabi-4.9)
• Debug Tool:
ICE, J-link, nu-link, st-link
LED, UART
105 艾鍗科技嵌入式Linux系統工程師人才養成班
ARM BOOT AND INTERRUPT
_start:
Usually start from 0x0000
Interrupt table
0x0000~0x001C (7 mode)
rest:
Basic hardware, memory
initialize and jump into OS
main function
0x00
…
…
0x1C
Interrupt
Table
RAM
105 艾鍗科技嵌入式Linux系統工程師人才養成班
ARM INTERRUPT
Enter IRQ
Disable IRQ
spsr_irq = cpsr
pc = 0x18
IRQ Handler
IRQ function
Leave IRQ
Enable IRQ
pc=LR - 4
spsr =
spsr_irq
0x00
0x04
0x08
0x0c
0x10
0x14
0x18
0x1C
105 艾鍗科技嵌入式Linux系統工程師人才養成班
SIMPLE RASPBERRY PI BOOT
• PI GPU Boot
• Black magic(closed source)
• GPU, memory, clock initialize
• Parse config.txt
• Linux Boot
• Load cmdline.txt and Linux kernel
• Send boot argument to linux kernel
• Start from 0x8000
PI GPU Boot
Linux Boot: 0x8000
Shell
FreeRTO
S
105 艾鍗科技嵌入式Linux系統工程師人才養成班
COMPILE A PROGRAM
Stage 1 Stage 2 Stage 3
Stage1
• Generate object file
Stage 2
• Put object together
Stage 3
• Output binary file
105 艾鍗科技嵌入式Linux系統工程師人才養成班
LINKER SCRIPT
•Put things to section
init, text, data, bss
•Assign section address
Put init to INIT_RAM: 0
INIT_RAM start: 0x8000
105 艾鍗科技嵌入式Linux系統工程師人才養成班
FREERTOS BOOT
_start:
Start from 0x8000
Interrupt table
0x8000~0x801C (7 mode)
rest:
Move interrupt table to 0x0000
Initial interrupt stack
0x0000
…
…
0x001C
BCM2836
Interrupt
Table
Memory
0x8000
…
…
0x801C
FreeRTOS
Interrupt
Table
105 艾鍗科技嵌入式Linux系統工程師人才養成班
FREERTOS FOR PI2 BOOT
•Interrupt failed
Hyper mode
•Make interrupt work
• Go back to SVC
105 艾鍗科技嵌入式Linux系統工程師人才養成班
BCM2836 INTERRUPT
BCM2836 Interrupt
Controller
Peripherals
GPIO
UAR
T
TIME
R
ARM
FIQ IRQ
Enter IRQ
Disable IRQ
spsr_irq = cpsr
pc = 0x18
IRQ Handler
BCM2836 IRQ
Controller
Handler
Leave IRQ
Enable IRQ
spsr = spsr_irq
pc=LR - 4
….
105 艾鍗科技嵌入式Linux系統工程師人才養成班
FREERTOS PORTING TODO LIST
Hardware config:
FreeRTOSConfig.h
portmacro.h
Hardware TIMER IRQ:
port.c
portISR.c
105 艾鍗科技嵌入式Linux系統工程師人才養成班
FIRST STEP PORTING
GPIO
• LED
• Boot
• Linker script
UART
• Debug
Interrupt
• Timer IRQ
105 艾鍗科技嵌入式Linux系統工程師人才養成班
BOOT LOADER U-BOOT
Debug & Build
Power off
Put image to SD
card
Plug in SD
Test
Debug &
Build
U-boot tftp
get
U-boot
load
Test
105 艾鍗科技嵌入式Linux系統工程師人才養成班
FREERTOS IRQ INTERRUPT
Enter IRQ Mode
Save Task
Timer Handler
FreeRTOS tick
increase
Context switch if
needed
Leave IRQ Mode
Restore Task
105 艾鍗科技嵌入式Linux系統工程師人才養成班
FREERTOS PORTING
•Implement Timer Handler
• FreeRTOS tick increase
• Context switch if needed
•Install FreeRTOS as IRQ Handler
• Save Task
• Restore Task
105 艾鍗科技嵌入式Linux系統工程師人才養成班
FREEROTS PORTING FLOW
Develop
Environment
• IDE
• Toolchain
• Debug tool
Basic
knowledge
• Boot startup code
• Linker script
• Interrupt setting
Basic drivers
• LED
• GPIO
• Interrupt
FreeRTOS
• Timer ISR as tick
service
• FreeRTOS as IRQ
handler
FreeRTOS
Application
105 艾鍗科技嵌入式Linux系統工程師人才養成班
FREERTOS DEMO
Basic task communication demo:
1 task send
1 task receive (toggle LED)
Application demo:
CLI(Command Line Interface)
105 艾鍗科技嵌入式Linux系統工程師人才養成班
Thanks for your attention
105 艾鍗科技嵌入式Linux系統工程師人才養成班

More Related Content

What's hot

10分で分かるLinuxブロックレイヤ
10分で分かるLinuxブロックレイヤ10分で分かるLinuxブロックレイヤ
10分で分かるLinuxブロックレイヤTakashi Hoshino
 
プロセスとコンテキストスイッチ
プロセスとコンテキストスイッチプロセスとコンテキストスイッチ
プロセスとコンテキストスイッチKazuki Onishi
 
Kubernetes Security with DevSecOps
Kubernetes Security with DevSecOpsKubernetes Security with DevSecOps
Kubernetes Security with DevSecOpsShingo Kitayama
 
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily JobLuca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Joblinuxlab_conf
 
コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線Motonori Shindo
 
Eclipse Iceoryx Overview
Eclipse Iceoryx OverviewEclipse Iceoryx Overview
Eclipse Iceoryx OverviewTomoya Fujita
 
第三回IoT関連技術勉強会 データ通信編
第三回IoT関連技術勉強会 データ通信編第三回IoT関連技術勉強会 データ通信編
第三回IoT関連技術勉強会 データ通信編tzm_freedom
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Linaro
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareBrendan Gregg
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux SystemJian-Hong Pan
 
DAIS19: On the Performance of ARM TrustZone
DAIS19: On the Performance of ARM TrustZoneDAIS19: On the Performance of ARM TrustZone
DAIS19: On the Performance of ARM TrustZoneLEGATO project
 
インテルMEの秘密 - チップセットに隠されたコードと、それが一体何をするかを見出す方法 - by イゴール・スコチンスキー - Igor Skochinsky
インテルMEの秘密 - チップセットに隠されたコードと、それが一体何をするかを見出す方法 - by イゴール・スコチンスキー - Igor SkochinskyインテルMEの秘密 - チップセットに隠されたコードと、それが一体何をするかを見出す方法 - by イゴール・スコチンスキー - Igor Skochinsky
インテルMEの秘密 - チップセットに隠されたコードと、それが一体何をするかを見出す方法 - by イゴール・スコチンスキー - Igor SkochinskyCODE BLUE
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBshimosawa
 
YoctoをつかったDistroの作り方とハマり方
YoctoをつかったDistroの作り方とハマり方YoctoをつかったDistroの作り方とハマり方
YoctoをつかったDistroの作り方とハマり方wata2ki
 
Introduction to the LLVM Compiler System
Introduction to the LLVM  Compiler SystemIntroduction to the LLVM  Compiler System
Introduction to the LLVM Compiler Systemzionsaint
 

What's hot (20)

10分で分かるLinuxブロックレイヤ
10分で分かるLinuxブロックレイヤ10分で分かるLinuxブロックレイヤ
10分で分かるLinuxブロックレイヤ
 
プロセスとコンテキストスイッチ
プロセスとコンテキストスイッチプロセスとコンテキストスイッチ
プロセスとコンテキストスイッチ
 
レシピの作り方入門
レシピの作り方入門レシピの作り方入門
レシピの作り方入門
 
Kubernetes Security with DevSecOps
Kubernetes Security with DevSecOpsKubernetes Security with DevSecOps
Kubernetes Security with DevSecOps
 
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily JobLuca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
 
コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線コンテナネットワーキング(CNI)最前線
コンテナネットワーキング(CNI)最前線
 
eBPF Basics
eBPF BasicseBPF Basics
eBPF Basics
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
Eclipse Iceoryx Overview
Eclipse Iceoryx OverviewEclipse Iceoryx Overview
Eclipse Iceoryx Overview
 
第三回IoT関連技術勉強会 データ通信編
第三回IoT関連技術勉強会 データ通信編第三回IoT関連技術勉強会 データ通信編
第三回IoT関連技術勉強会 データ通信編
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
 
Launch the First Process in Linux System
Launch the First Process in Linux SystemLaunch the First Process in Linux System
Launch the First Process in Linux System
 
DAIS19: On the Performance of ARM TrustZone
DAIS19: On the Performance of ARM TrustZoneDAIS19: On the Performance of ARM TrustZone
DAIS19: On the Performance of ARM TrustZone
 
Network Drivers
Network DriversNetwork Drivers
Network Drivers
 
インテルMEの秘密 - チップセットに隠されたコードと、それが一体何をするかを見出す方法 - by イゴール・スコチンスキー - Igor Skochinsky
インテルMEの秘密 - チップセットに隠されたコードと、それが一体何をするかを見出す方法 - by イゴール・スコチンスキー - Igor SkochinskyインテルMEの秘密 - チップセットに隠されたコードと、それが一体何をするかを見出す方法 - by イゴール・スコチンスキー - Igor Skochinsky
インテルMEの秘密 - チップセットに隠されたコードと、それが一体何をするかを見出す方法 - by イゴール・スコチンスキー - Igor Skochinsky
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
YoctoをつかったDistroの作り方とハマり方
YoctoをつかったDistroの作り方とハマり方YoctoをつかったDistroの作り方とハマり方
YoctoをつかったDistroの作り方とハマり方
 
Introduction to the LLVM Compiler System
Introduction to the LLVM  Compiler SystemIntroduction to the LLVM  Compiler System
Introduction to the LLVM Compiler System
 

Viewers also liked

GPS + Google fusion table 雲端應用
GPS + Google fusion table 雲端應用GPS + Google fusion table 雲端應用
GPS + Google fusion table 雲端應用艾鍗科技
 
銀髮幼童健康定位手環
銀髮幼童健康定位手環銀髮幼童健康定位手環
銀髮幼童健康定位手環艾鍗科技
 
The magic behind self balancing robot ver1.2
The magic behind self balancing robot ver1.2The magic behind self balancing robot ver1.2
The magic behind self balancing robot ver1.2艾鍗科技
 
使用XMPP進行遠端設備控制
使用XMPP進行遠端設備控制使用XMPP進行遠端設備控制
使用XMPP進行遠端設備控制艾鍗科技
 
Raspberry Pi 智能風扇
Raspberry Pi 智能風扇Raspberry Pi 智能風扇
Raspberry Pi 智能風扇艾鍗科技
 
成果展簡報-Zigbee無線自動燈光及溫度調控系統
成果展簡報-Zigbee無線自動燈光及溫度調控系統成果展簡報-Zigbee無線自動燈光及溫度調控系統
成果展簡報-Zigbee無線自動燈光及溫度調控系統艾鍗科技
 
BLE室內定位技術實現龍珠雷達裝置
BLE室內定位技術實現龍珠雷達裝置BLE室內定位技術實現龍珠雷達裝置
BLE室內定位技術實現龍珠雷達裝置艾鍗科技
 
用Raspberry Pi 完成一個智慧型六足機器人
用Raspberry Pi 完成一個智慧型六足機器人用Raspberry Pi 完成一個智慧型六足機器人
用Raspberry Pi 完成一個智慧型六足機器人艾鍗科技
 
Raspberry Pi專題製作四旋翼飛行器
Raspberry Pi專題製作四旋翼飛行器Raspberry Pi專題製作四旋翼飛行器
Raspberry Pi專題製作四旋翼飛行器艾鍗科技
 

Viewers also liked (9)

GPS + Google fusion table 雲端應用
GPS + Google fusion table 雲端應用GPS + Google fusion table 雲端應用
GPS + Google fusion table 雲端應用
 
銀髮幼童健康定位手環
銀髮幼童健康定位手環銀髮幼童健康定位手環
銀髮幼童健康定位手環
 
The magic behind self balancing robot ver1.2
The magic behind self balancing robot ver1.2The magic behind self balancing robot ver1.2
The magic behind self balancing robot ver1.2
 
使用XMPP進行遠端設備控制
使用XMPP進行遠端設備控制使用XMPP進行遠端設備控制
使用XMPP進行遠端設備控制
 
Raspberry Pi 智能風扇
Raspberry Pi 智能風扇Raspberry Pi 智能風扇
Raspberry Pi 智能風扇
 
成果展簡報-Zigbee無線自動燈光及溫度調控系統
成果展簡報-Zigbee無線自動燈光及溫度調控系統成果展簡報-Zigbee無線自動燈光及溫度調控系統
成果展簡報-Zigbee無線自動燈光及溫度調控系統
 
BLE室內定位技術實現龍珠雷達裝置
BLE室內定位技術實現龍珠雷達裝置BLE室內定位技術實現龍珠雷達裝置
BLE室內定位技術實現龍珠雷達裝置
 
用Raspberry Pi 完成一個智慧型六足機器人
用Raspberry Pi 完成一個智慧型六足機器人用Raspberry Pi 完成一個智慧型六足機器人
用Raspberry Pi 完成一個智慧型六足機器人
 
Raspberry Pi專題製作四旋翼飛行器
Raspberry Pi專題製作四旋翼飛行器Raspberry Pi專題製作四旋翼飛行器
Raspberry Pi專題製作四旋翼飛行器
 

Similar to 移植FreeRTOS 之嵌入式軟體研究與開發

Porting_uClinux_CELF2008_Griffin
Porting_uClinux_CELF2008_GriffinPorting_uClinux_CELF2008_Griffin
Porting_uClinux_CELF2008_GriffinPeter Griffin
 
FreeLix: Semplicità & Controllo
FreeLix: Semplicità & ControlloFreeLix: Semplicità & Controllo
FreeLix: Semplicità & ControlloValerio Balbi
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONLyon Yang
 
Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Hajime Tazaki
 
Porting FreeRTOS on OpenRISC
Porting FreeRTOS   on   OpenRISCPorting FreeRTOS   on   OpenRISC
Porting FreeRTOS on OpenRISCYi-Chiao
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing LandscapeSasha Goldshtein
 
Fastsocket Linxiaofeng
Fastsocket LinxiaofengFastsocket Linxiaofeng
Fastsocket LinxiaofengMichael Zhang
 
From L3 to seL4: What have we learnt in 20 years of L4 microkernels
From L3 to seL4: What have we learnt in 20 years of L4 microkernelsFrom L3 to seL4: What have we learnt in 20 years of L4 microkernels
From L3 to seL4: What have we learnt in 20 years of L4 microkernelsmicrokerneldude
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsSerge Stinckwich
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing LandscapeKernel TLV
 
OSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install EnvironmentOSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install EnvironmentNETWAYS
 
Tech Days 2015: Embedded Product Update
Tech Days 2015: Embedded Product UpdateTech Days 2015: Embedded Product Update
Tech Days 2015: Embedded Product UpdateAdaCore
 
Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Narender Kumar
 
Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Narender Kumar
 
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...Felipe Prado
 
DEVNET-1112 The DevNet Hackathon Awards
DEVNET-1112	The DevNet Hackathon AwardsDEVNET-1112	The DevNet Hackathon Awards
DEVNET-1112 The DevNet Hackathon AwardsCisco DevNet
 
Introduction to RIoT Hardware Kits & ESP32 Programming [Road to RIoT 2017]
Introduction to RIoT Hardware Kits & ESP32 Programming [Road to RIoT 2017]Introduction to RIoT Hardware Kits & ESP32 Programming [Road to RIoT 2017]
Introduction to RIoT Hardware Kits & ESP32 Programming [Road to RIoT 2017]Alwin Arrasyid
 

Similar to 移植FreeRTOS 之嵌入式軟體研究與開發 (20)

Porting_uClinux_CELF2008_Griffin
Porting_uClinux_CELF2008_GriffinPorting_uClinux_CELF2008_Griffin
Porting_uClinux_CELF2008_Griffin
 
FreeLix: Semplicità & Controllo
FreeLix: Semplicità & ControlloFreeLix: Semplicità & Controllo
FreeLix: Semplicità & Controllo
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
 
Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)
 
Ansible docker
Ansible dockerAnsible docker
Ansible docker
 
Porting FreeRTOS on OpenRISC
Porting FreeRTOS   on   OpenRISCPorting FreeRTOS   on   OpenRISC
Porting FreeRTOS on OpenRISC
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
 
Fastsocket Linxiaofeng
Fastsocket LinxiaofengFastsocket Linxiaofeng
Fastsocket Linxiaofeng
 
From L3 to seL4: What have we learnt in 20 years of L4 microkernels
From L3 to seL4: What have we learnt in 20 years of L4 microkernelsFrom L3 to seL4: What have we learnt in 20 years of L4 microkernels
From L3 to seL4: What have we learnt in 20 years of L4 microkernels
 
Using Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systemsUsing Smalltalk for controlling robotics systems
Using Smalltalk for controlling robotics systems
 
Modern Linux Tracing Landscape
Modern Linux Tracing LandscapeModern Linux Tracing Landscape
Modern Linux Tracing Landscape
 
Rhce ppt
Rhce pptRhce ppt
Rhce ppt
 
OSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install EnvironmentOSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install Environment
 
Tech Days 2015: Embedded Product Update
Tech Days 2015: Embedded Product UpdateTech Days 2015: Embedded Product Update
Tech Days 2015: Embedded Product Update
 
Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02
 
Ironic
IronicIronic
Ironic
 
Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02Ironic 140622212631-phpapp02
Ironic 140622212631-phpapp02
 
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
DEF CON 27 - HUBER AND ROSKOSCH - im on your phone listening attacking voip c...
 
DEVNET-1112 The DevNet Hackathon Awards
DEVNET-1112	The DevNet Hackathon AwardsDEVNET-1112	The DevNet Hackathon Awards
DEVNET-1112 The DevNet Hackathon Awards
 
Introduction to RIoT Hardware Kits & ESP32 Programming [Road to RIoT 2017]
Introduction to RIoT Hardware Kits & ESP32 Programming [Road to RIoT 2017]Introduction to RIoT Hardware Kits & ESP32 Programming [Road to RIoT 2017]
Introduction to RIoT Hardware Kits & ESP32 Programming [Road to RIoT 2017]
 

More from 艾鍗科技

TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition 艾鍗科技
 
Appendix 1 Goolge colab
Appendix 1 Goolge colabAppendix 1 Goolge colab
Appendix 1 Goolge colab艾鍗科技
 
Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用艾鍗科技
 
02 IoT implementation
02 IoT implementation02 IoT implementation
02 IoT implementation艾鍗科技
 
Tiny ML for spark Fun Edge
Tiny ML for spark Fun EdgeTiny ML for spark Fun Edge
Tiny ML for spark Fun Edge艾鍗科技
 
2. 機器學習簡介
2. 機器學習簡介2. 機器學習簡介
2. 機器學習簡介艾鍗科技
 
5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 艾鍗科技
 
心率血氧檢測與運動促進
心率血氧檢測與運動促進心率血氧檢測與運動促進
心率血氧檢測與運動促進艾鍗科技
 
利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆艾鍗科技
 
IoT感測器驅動程式 在樹莓派上實作
IoT感測器驅動程式在樹莓派上實作IoT感測器驅動程式在樹莓派上實作
IoT感測器驅動程式 在樹莓派上實作艾鍗科技
 
無線聲控遙控車
無線聲控遙控車無線聲控遙控車
無線聲控遙控車艾鍗科技
 
最佳光源的研究和實作
最佳光源的研究和實作最佳光源的研究和實作
最佳光源的研究和實作 艾鍗科技
 
無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車 艾鍗科技
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning艾鍗科技
 
人臉辨識考勤系統
人臉辨識考勤系統人臉辨識考勤系統
人臉辨識考勤系統艾鍗科技
 
智慧家庭Smart Home
智慧家庭Smart Home智慧家庭Smart Home
智慧家庭Smart Home艾鍗科技
 

More from 艾鍗科技 (20)

TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
 
Appendix 1 Goolge colab
Appendix 1 Goolge colabAppendix 1 Goolge colab
Appendix 1 Goolge colab
 
Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用
 
02 IoT implementation
02 IoT implementation02 IoT implementation
02 IoT implementation
 
Tiny ML for spark Fun Edge
Tiny ML for spark Fun EdgeTiny ML for spark Fun Edge
Tiny ML for spark Fun Edge
 
Openvino ncs2
Openvino ncs2Openvino ncs2
Openvino ncs2
 
Step motor
Step motorStep motor
Step motor
 
2. 機器學習簡介
2. 機器學習簡介2. 機器學習簡介
2. 機器學習簡介
 
5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron)
 
3. data features
3. data features3. data features
3. data features
 
心率血氧檢測與運動促進
心率血氧檢測與運動促進心率血氧檢測與運動促進
心率血氧檢測與運動促進
 
利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆
 
IoT感測器驅動程式 在樹莓派上實作
IoT感測器驅動程式在樹莓派上實作IoT感測器驅動程式在樹莓派上實作
IoT感測器驅動程式 在樹莓派上實作
 
無線聲控遙控車
無線聲控遙控車無線聲控遙控車
無線聲控遙控車
 
最佳光源的研究和實作
最佳光源的研究和實作最佳光源的研究和實作
最佳光源的研究和實作
 
無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning
 
人臉辨識考勤系統
人臉辨識考勤系統人臉辨識考勤系統
人臉辨識考勤系統
 
智慧家庭Smart Home
智慧家庭Smart Home智慧家庭Smart Home
智慧家庭Smart Home
 
智能健身
智能健身智能健身
智能健身
 

Recently uploaded

Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 

Recently uploaded (20)

Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 

移植FreeRTOS 之嵌入式軟體研究與開發

  • 1. FreeRTOS嵌入式系統移植研究 21天移植FreeRTOS 組長 :黃0閔 組員 :陳0丞、郭0澤、高0穎 專題指導老師 : Joseph 105 艾鍗科技嵌入式Linux系統工程師人才養成班 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 2. 21DAYS FREERTOS PORTING ON RASPBERRY PI2 •Raspberry Pi2: 900 MHz quad core ARM Cortex-A7 CPU 1GB RAM 4 USB ports 40 GPIO pins 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 3. WHAT IS RTOS •General purpose OS: • Linux • Windows •Real-Time OS (RTOS): • Without buffering delays • Hard real-time • Soft real-time Hard real-time Soft real-time Program no response while landing 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 4. TODAY RTOS ON MCU • MCU: • Data bus From 8bit to 32bit • CPU clock ARM Cortex-M (60MHz ↑) • RTOS: Multi-task Small code size RTOS TasksTasks TasksTask MCU & Peripheral Peripheral Drivers MCU & Peripheral Peripheral Drivers 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 5. RTOS FEATURE •Task scheduler: Task create Task save Task restore Invoke task switch (timer interrupt) Task communication: Queue, semaphore,…etc • Memory Management 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 6. RTOS • RTOS: • FreeRTOS, QNX, uC/OS, RTEMS • FreeRTOS: Free open source Small: 9000 lines code Simple : Only 3 ~ 4 files for porting Multi-platforms:ARM-M series, ARM7, Cortex-A(A8, A9) 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 7. DEVELOPMENT TOOL • IDE: Eclipse-cdt 4.4.2 • Toolchain: gcc (arm-none-eabi-4.9) • Debug Tool: ICE, J-link, nu-link, st-link LED, UART 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 8. ARM BOOT AND INTERRUPT _start: Usually start from 0x0000 Interrupt table 0x0000~0x001C (7 mode) rest: Basic hardware, memory initialize and jump into OS main function 0x00 … … 0x1C Interrupt Table RAM 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 9. ARM INTERRUPT Enter IRQ Disable IRQ spsr_irq = cpsr pc = 0x18 IRQ Handler IRQ function Leave IRQ Enable IRQ pc=LR - 4 spsr = spsr_irq 0x00 0x04 0x08 0x0c 0x10 0x14 0x18 0x1C 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 10. SIMPLE RASPBERRY PI BOOT • PI GPU Boot • Black magic(closed source) • GPU, memory, clock initialize • Parse config.txt • Linux Boot • Load cmdline.txt and Linux kernel • Send boot argument to linux kernel • Start from 0x8000 PI GPU Boot Linux Boot: 0x8000 Shell FreeRTO S 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 11. COMPILE A PROGRAM Stage 1 Stage 2 Stage 3 Stage1 • Generate object file Stage 2 • Put object together Stage 3 • Output binary file 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 12. LINKER SCRIPT •Put things to section init, text, data, bss •Assign section address Put init to INIT_RAM: 0 INIT_RAM start: 0x8000 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 13. FREERTOS BOOT _start: Start from 0x8000 Interrupt table 0x8000~0x801C (7 mode) rest: Move interrupt table to 0x0000 Initial interrupt stack 0x0000 … … 0x001C BCM2836 Interrupt Table Memory 0x8000 … … 0x801C FreeRTOS Interrupt Table 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 14. FREERTOS FOR PI2 BOOT •Interrupt failed Hyper mode •Make interrupt work • Go back to SVC 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 15. BCM2836 INTERRUPT BCM2836 Interrupt Controller Peripherals GPIO UAR T TIME R ARM FIQ IRQ Enter IRQ Disable IRQ spsr_irq = cpsr pc = 0x18 IRQ Handler BCM2836 IRQ Controller Handler Leave IRQ Enable IRQ spsr = spsr_irq pc=LR - 4 …. 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 16. FREERTOS PORTING TODO LIST Hardware config: FreeRTOSConfig.h portmacro.h Hardware TIMER IRQ: port.c portISR.c 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 17. FIRST STEP PORTING GPIO • LED • Boot • Linker script UART • Debug Interrupt • Timer IRQ 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 18. BOOT LOADER U-BOOT Debug & Build Power off Put image to SD card Plug in SD Test Debug & Build U-boot tftp get U-boot load Test 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 19. FREERTOS IRQ INTERRUPT Enter IRQ Mode Save Task Timer Handler FreeRTOS tick increase Context switch if needed Leave IRQ Mode Restore Task 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 20. FREERTOS PORTING •Implement Timer Handler • FreeRTOS tick increase • Context switch if needed •Install FreeRTOS as IRQ Handler • Save Task • Restore Task 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 21. FREEROTS PORTING FLOW Develop Environment • IDE • Toolchain • Debug tool Basic knowledge • Boot startup code • Linker script • Interrupt setting Basic drivers • LED • GPIO • Interrupt FreeRTOS • Timer ISR as tick service • FreeRTOS as IRQ handler FreeRTOS Application 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 22. FREERTOS DEMO Basic task communication demo: 1 task send 1 task receive (toggle LED) Application demo: CLI(Command Line Interface) 105 艾鍗科技嵌入式Linux系統工程師人才養成班
  • 23. Thanks for your attention 105 艾鍗科技嵌入式Linux系統工程師人才養成班