RT-Thread是一个物联网实时操作系统(RTOS),它提供了线程调度、时钟管理、内存管理、线程同步与通信、中断管理等基本功能要素,具有组件完整丰富、高度可伸缩、简易开发、超低功耗、高安全性等特点。在深入分析RT-Thread的功能要素和函数调用关系基础上,简要给出了其在STM32单片机芯片上的启动流程,重点剖析了RT-Thread的芯片上电、板级初始化、定时器初始化、调度器初始化、线程创建、线程切换等流程,可作为RT-Thread在不同微控制器上移植的技术基础,也可作为分析其他RTOS启动过程的技术参考。
Abstract
RT-Thread is a real-time operating system (RTOS) for the Internet of Things.It provides basic functional elements such as thread scheduling,clock management,memory management,thread communication,interrupt management and so on.It has features of complete and rich components,high scalability,easy development,ultra-low power consumption,high security and so on.On the basis of in-depth analysis of functional elements and function call relationship of RT-Thread,the startup process of STM32 microcontroller chip is briefly given,focusing on the analysis of RT-Thread chip power-on,board-level initialization,timer initialization,scheduler initialization,thread creation,thread switch and other processes.It provides a technical basis for the transplantation of RT-Thread on different microcontrollers,and can also be used as a technical reference to analyze the startup process of other RTOS.
关键词
RT-Thread /
STM32 /
启动流程 /
线程调度
Key words
RT-Thread /
STM32 /
startup process /
thread scheduling
{{custom_sec.title}}
{{custom_sec.title}}
{{custom_sec.content}}
参考文献
[1] 王宜怀,朱仁浪,姚望舒.嵌入式实时操作系统MQX应用开发技术——ARM Cortex-M微处理器[M].北京:电子工 业出版社,2014:39-52.
[2] 刘博文,顾乃杰,谷德贺,等.移动平台Android操作系统虚拟化技术的实现[J].计算机工程与应用,2017,53(14):37-43.
[3] 蒋建武,王宜怀.MQX操作系统启动流程剖析[J].福州大学学报(自然科学版),2016,44(2):64-68.
[4] 乔焱,陈媛,贾家宁,等.μC/OS-III操作系统的优化[J].兵工自动化,2019,38(3):31-33.
[5] 冯瑞青,张激,赵俊才.异构处理器多操作系统协同技术研究[J].计算机系统应用,2018,27(12):92-97.
[6] 任振强.MTX操作系统内核与启动流程分析[J].信息技术与网络安全,2019,38(2):54-58.
[7] 杨冠军,王竹平,刘曦.基于ARM9E的启动程序设计与实现[J].电子设计工程,2017,25(4):189-193.