吉林大学学报(信息科学版) ›› 2022, Vol. 40 ›› Issue (4): 663-671.

• • 上一篇    下一篇

基于 ARM Cortex-M4 的 mbedOS 调度机制剖析

刘长勇1a,1b,2 , 王宜怀2   

  1. 1. 武夷学院 a. 数学与计算机学院; b. 认知计算与智能信息处理福建省高校重点实验室, 福建 武夷山 354300; 2. 苏州大学 计算机科学与技术学院, 苏州 215006
  • 收稿日期:2021-12-19 出版日期:2022-08-16 发布日期:2022-08-17
  • 作者简介:刘长勇(1974— ), 男, 福建建瓯人, 武夷学院副教授, 主要从事嵌入式技术, 数字学习与数据挖掘研究, ( Tel) 86- 13860072215(E-mail)121903852@qq.com。
  • 基金资助:
    国家自然科学基金资助项目(61672369); 福建省自然科学基金资助项目(2017J01651)

Analysis of mbedOS Scheduling Mechanism Based on ARM Cortex-M4h

LIU Changyong 1a,1b,2 , WANG Yihuai 2   

  1. 1a. Department of Mathematics and Computer Science; 1b. Key Laboratory of Cognitive Computing and Intelligent Information Processing of Fujian Education Institutions, Wuyi University, Wuyishan 354300, China; 2. School of Computer Science and Technology, Soochow University, Suzhou 215006, China
  • Received:2021-12-19 Online:2022-08-16 Published:2022-08-17

摘要: 为了能清晰理解 mbedOS 调度基本原理与机制, 通过阐述 ARM(Advanced RISC Machines) Cortex-M4 内核对实时操作系统的支持特性, 分析了实时操作系统常用的调度策略, 采用流程图分析、 上下文核心代码解析等方法重点剖析了 SVC(Supervisor Call)中断、 PendSV 中断和 SysTick 中断 3 种 mbedOS 调度策略实现方法, 最后以意法半导体的 STM32L431 芯片为例给出了 mbedOS 的线程调度剖析实践。 通过对 mbedOS 的线程调度剖析, 有助于深入理解 mbedOS 的调度机理, 为设计多任务系统提供帮助, 也为分析其他实时操作系统提供参考借鉴。

关键词: 实时操作系统; , 调度策略; , ARM Cortex-M4 内核; , mbedOS 系统; , STM32 芯片

Abstract: In order to clearly understand the basic principle and mechanism of mbedos scheduling, the support characteristics of arm cortex-m4 kernel for real-time operating system is studied. The common scheduling strategies of real-time operating system is analyzed. Using the methods of flow chart analysis and
context core code analysis,this paper focuses on the implementation of three mbedos scheduling strategies, SVC( Supervisor Call) interrupt, pendsv interrupt and systick interrupt. Finally, taking stm32l431 chip of STMicroelectronics as an example, the thread scheduling analysis practice of mbedOS is given. By analyzing the thread scheduling of mbedOS, it is helpful for readers to deeply understand the scheduling mechanism of mbedOS, provide help for the design of multitasking system, and also provide reference for the analysis of other real-time operating systems.

Key words: real time operating system; , scheduling strategy, advanced RISC machines ( ARM) Cortex-M4; , mbedOS; , STM32 chip

中图分类号: 

  • TP316. 2