硬汉嵌入式论坛

 找回密码
 立即注册
查看: 9186|回复: 5
收起左侧

[CMSIS-RTOS简易教程] 第一期:学习CMSIS-RTOS前需要弄清的几个问题

[复制链接]

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
106649
QQ
发表于 2013-10-30 18:34:12 | 显示全部楼层 |阅读模式
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.


暂时只说这几个问题,后面了再补充
回复

使用道具 举报

116

主题

799

回帖

1147

积分

至尊会员

积分
1147
QQ
发表于 2013-11-12 08:23:36 | 显示全部楼层
[s:151] [s:151] [s:151] 居然没人支持
回复

使用道具 举报

0

主题

8

回帖

0

积分

新手上路

积分
0
发表于 2014-4-20 11:09:20 | 显示全部楼层
[s:141] 什么时候,大侠有空补充补充,完善完善?
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
106649
QQ
 楼主| 发表于 2014-4-20 18:03:55 | 显示全部楼层

回 mico_chen 的帖子

mico_chen:[s:141] 什么时候,大侠有空补充补充,完善完善? (2014-04-20 11:09) 
好的
回复

使用道具 举报

1

主题

11

回帖

1

积分

新手上路

积分
1
发表于 2014-11-7 09:36:23 | 显示全部楼层
[s:141]  [s:141]  [s:141]  [s:141]
回复

使用道具 举报

0

主题

1

回帖

0

积分

新手上路

积分
0
发表于 2015-5-30 16:01:26 | 显示全部楼层
[s:143] [s:143] [s:143] [s:143] [s:143] [s:143]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-4-27 21:28 , Processed in 0.296564 second(s), 31 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表