|
1. Keil RTX和CMSIS-RTOS以及CMSIS-RTOS RTX是什么关系
(1)RTX: keil公司出品,详细上www.keil.com了解下。
(2)CMSIS-RTOS RTX:对于这个系统,官方手册里面有一个很完善的解释:
Compared to the classic Keil RTX version, the CMSIS-RTOS RTX library is extended with the CMSIS API interface
module (source file rt_cmsis.c) which implements the function translation. The header file cmsis_os.h provides the
API to the RTX CMSIS-RTOS for the user application. Refer to Using CMSIS-RTOS RTX for more information.
说白了RTX和CMSIS-RTOS RTX最关键的地方就在rt_cmsis.c这个文件里面,rt_cmsis.c对RTX提供的函数重新做了封装,并
加入了一些自己的特性。
(3)CMSIS-RTOS: 和CMSIS-RTOS RTX是一样的东西,不知道为什么手册上面做了一下区分,估计是为了照顾RTX以前
的老客户吧,详细看这个帖子:http://www.armbbs.cn/forum.php?mod=viewthread&tid=1976
2. CMSIS-RTOS的优先级设置
和以前咱们常用的RTOS不同,这里只有以下几种优先级,要注意
typedef enum {
osPriorityIdle = -3, ///< priority: idle (lowest)
osPriorityLow = -2, ///< priority: low
osPriorityBelowNormal = -1, ///< priority: below normal
osPriorityNormal = 0, ///< priority: normal (default)
osPriorityAboveNormal = +1, ///< priority: above normal
osPriorityHigh = +2, ///< priority: high
osPriorityRealtime = +3, ///< priority: realtime (highest)
osPriorityError = 0x84 ///< system cannot determine priority or thread has illegal priority
} osPriority;
3. CMSIS-RTOS启动以后创建好的线程
和咱们以前用的RTOS也不同,这里可以选择是否将main函数也设置成线程。像UCOS, FreeRTOS, embOS都没有这
么做,都是main函数后开始的。详细手册上面有个说明:
At startup time, the CMSIS-RTOS RTX creates the following threads:
(1)main : the 'main' function of the application code is started as thread with the osPriorityNormal
(2)os_idle_demon : this thread executes when no other thread is in RUNNING state. The code of that thread is
provided in the RTX_Conf_CM.c Configuration File and is typically used to put the system into a power-saving mode.
(3)this thread executes the Timer Management callback functions. This thread can be disabled; refer to Settings for CMSIS-RTOS Timer Management
for configuration options.
暂时只说这几个问题,后面了再补充 |
|