More Related Content
Similar to RTOS on ARM cortex-M platform -draft (20)
RTOS on ARM cortex-M platform -draft
- 17. 即時 - REAL TIME
deadline => priority -> renice -> preemptive
Linux : RTOS ?
kernel 非搶佔, user 權限⾼也無法搶佔
時間計算/限制機制
改良
重改 linux - PREEMPT_RT
dual kernel - 替換底層 - Xenomai ( 底層⽤ Nucleus )
- 19. HW FOR RTOS
MSP / PSP
LR - branch (bx lr), EXC_RETURN
auto push/pop stack
privileged / handler - thread
- 26. TEXT / DATA
* Howard - HyperC OS
* Linker script -http://njiot.blogspot.tw/2016/03/arduino-ameba-100-textdatabssheapstack.html
- 29. 動態管理
cortex-M : no MMU , no virtual address
經濟 <-> 技術, RAM 價格曲線
MMU overhead / die size cost
fragment / chunk / page / utilization
- 37. 線程排程 - TIMER - 1
One shot / period
latency : 8 cycles
auto push pop by HW
Pros : easy, quick, less
overhead
- 38. TICKER SCHEDULER
ESP 8266 - yield() do back ground functions ; https://github.com/Toshik/TickerScheduler
void setup(void)
{
…
if (ts.add(0, 5000, task0, true))
{
Serial.println("Tick task - task0 ok");
}
if (ts.add(1, 2000, task1, true))
{
Serial.println("Tick task - task1 ok");
}
….
}
void task0(void)
{
Serial.println("Task0");
}
…
void loop(void) {
ts.update();
}
- 42. TIMER CONS
HW timer 有限
SW timer : 延遲
preemptive
no reentrant
context switch ?
function execution -> starvation
- 44. 多⼯ - 3
⼯作 Task 程式執⾏最⼩單位?
Process =>Thread
Unix -> Mach
第⼀代 micro kernel
Mac OSX
- 58. IPC - 1
Inter Process Communication
L4 kernel - 第⼆代微核⼼重點
f9-kernel: http://wiki.csie.ncku.edu.tw/
embedded/f9-kernel
- 67. MBED OS
LoRa : https://docs.mbed.com/docs/lora-with-mbed/en/latest/intro-to-lora/
- 71. 安全- 硬體設計
Ameba Cortex-M3 :
MPU -> mbed uvisor
hardware crypto engine
加解密, 簽章 : AES / SHA-2
TrustZone : v8m : SAU
stack limit
- 72. FUTURE
Benchmark
ARM mbed / Arduino
CMSIS++ / mbed minar
NUTTX : ardupilot / cortex-m4
Zephyr : Linux ⼩弟
dynamic linking / module loading
hypervisor