SlideShare uma empresa Scribd logo
1 de 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系統工程師人才養成班

Mais conteúdo relacionado

Mais procurados

The Microkernel Mach Under NeXTSTEP
The Microkernel Mach Under NeXTSTEPThe Microkernel Mach Under NeXTSTEP
The Microkernel Mach Under NeXTSTEPGregor Schmidt
 
用十分鐘 向jserv學習作業系統設計
用十分鐘  向jserv學習作業系統設計用十分鐘  向jserv學習作業系統設計
用十分鐘 向jserv學習作業系統設計鍾誠 陳鍾誠
 
中3女子でもわかる constexpr
中3女子でもわかる constexpr中3女子でもわかる constexpr
中3女子でもわかる constexprGenya Murakami
 
Integrated Register Allocation introduction
Integrated Register Allocation introductionIntegrated Register Allocation introduction
Integrated Register Allocation introductionShiva Chen
 
AIチップ戦国時代における深層学習モデルの推論の最適化と実用的な運用を可能にするソフトウェア技術について
AIチップ戦国時代における深層学習モデルの推論の最適化と実用的な運用を可能にするソフトウェア技術についてAIチップ戦国時代における深層学習モデルの推論の最適化と実用的な運用を可能にするソフトウェア技術について
AIチップ戦国時代における深層学習モデルの推論の最適化と実用的な運用を可能にするソフトウェア技術についてFixstars Corporation
 
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜Ryoma Sin'ya
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtAnne Nicolas
 
COM Hijacking Techniques - Derbycon 2019
COM Hijacking Techniques - Derbycon 2019COM Hijacking Techniques - Derbycon 2019
COM Hijacking Techniques - Derbycon 2019David Tulis
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debuggingHao-Ran Liu
 
LLVM Register Allocation
LLVM Register AllocationLLVM Register Allocation
LLVM Register AllocationWang Hsiangkai
 
標的型攻撃からどのように身を守るのか
標的型攻撃からどのように身を守るのか標的型攻撃からどのように身を守るのか
標的型攻撃からどのように身を守るのかabend_cve_9999_0001
 
ARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいwata2ki
 
C・C++用のコードカバレッジツールを自作してみた話
C・C++用のコードカバレッジツールを自作してみた話C・C++用のコードカバレッジツールを自作してみた話
C・C++用のコードカバレッジツールを自作してみた話simotin13 Miyazaki
 
系統程式 -- 第 3 章 組合語言
系統程式 -- 第 3 章 組合語言系統程式 -- 第 3 章 組合語言
系統程式 -- 第 3 章 組合語言鍾誠 陳鍾誠
 
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingFastBit Embedded Brain Academy
 
Introduction to the LLVM Compiler System
Introduction to the LLVM  Compiler SystemIntroduction to the LLVM  Compiler System
Introduction to the LLVM Compiler Systemzionsaint
 

Mais procurados (20)

The Microkernel Mach Under NeXTSTEP
The Microkernel Mach Under NeXTSTEPThe Microkernel Mach Under NeXTSTEP
The Microkernel Mach Under NeXTSTEP
 
用十分鐘 向jserv學習作業系統設計
用十分鐘  向jserv學習作業系統設計用十分鐘  向jserv學習作業系統設計
用十分鐘 向jserv學習作業系統設計
 
中3女子でもわかる constexpr
中3女子でもわかる constexpr中3女子でもわかる constexpr
中3女子でもわかる constexpr
 
Integrated Register Allocation introduction
Integrated Register Allocation introductionIntegrated Register Allocation introduction
Integrated Register Allocation introduction
 
AIチップ戦国時代における深層学習モデルの推論の最適化と実用的な運用を可能にするソフトウェア技術について
AIチップ戦国時代における深層学習モデルの推論の最適化と実用的な運用を可能にするソフトウェア技術についてAIチップ戦国時代における深層学習モデルの推論の最適化と実用的な運用を可能にするソフトウェア技術について
AIチップ戦国時代における深層学習モデルの推論の最適化と実用的な運用を可能にするソフトウェア技術について
 
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
AVX2時代の正規表現マッチング 〜半群でぐんぐん!〜
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
COM Hijacking Techniques - Derbycon 2019
COM Hijacking Techniques - Derbycon 2019COM Hijacking Techniques - Derbycon 2019
COM Hijacking Techniques - Derbycon 2019
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
LLVM Register Allocation
LLVM Register AllocationLLVM Register Allocation
LLVM Register Allocation
 
標的型攻撃からどのように身を守るのか
標的型攻撃からどのように身を守るのか標的型攻撃からどのように身を守るのか
標的型攻撃からどのように身を守るのか
 
ARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくい
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
GCC RTL and Machine Description
GCC RTL and Machine DescriptionGCC RTL and Machine Description
GCC RTL and Machine Description
 
系統程式 -- 第 1 章
系統程式 -- 第 1 章系統程式 -- 第 1 章
系統程式 -- 第 1 章
 
C・C++用のコードカバレッジツールを自作してみた話
C・C++用のコードカバレッジツールを自作してみた話C・C++用のコードカバレッジツールを自作してみた話
C・C++用のコードカバレッジツールを自作してみた話
 
系統程式 -- 第 3 章 組合語言
系統程式 -- 第 3 章 組合語言系統程式 -- 第 3 章 組合語言
系統程式 -- 第 3 章 組合語言
 
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
 
Introduction to the LLVM Compiler System
Introduction to the LLVM  Compiler SystemIntroduction to the LLVM  Compiler System
Introduction to the LLVM Compiler System
 

Destaque

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專題製作四旋翼飛行器艾鍗科技
 

Destaque (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專題製作四旋翼飛行器
 

Semelhante a 移植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
 

Semelhante a 移植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]
 

Mais de 艾鍗科技

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艾鍗科技
 

Mais de 艾鍗科技 (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
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
人臉辨識考勤系統
人臉辨識考勤系統人臉辨識考勤系統
人臉辨識考勤系統
 
智慧家庭Smart Home
智慧家庭Smart Home智慧家庭Smart Home
智慧家庭Smart Home
 

Último

Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxMuhammadAsimMuhammad6
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 

Último (20)

Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 

移植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系統工程師人才養成班