你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

STM32 如何快速创建 FREERTOS和RTX 工程  

[复制链接]
lovewyufeng 发布时间:2015-1-8 12:08
赞 收藏 14 评论97 发布时间:2015-1-8 12:08
97个回答
lovewyufeng 回答时间:2015-1-8 12:52:49
cxtarm 发表于 2015-1-8 12:50* t! v' v, A# S% D9 p( {
cubemx 好用吗

4 e3 B, a. A" `; l- g看帖 应该  就知道很好用了  基本上 点几下鼠标就创建一个可以直接使用的  工程
cxtarm 回答时间:2015-1-8 12:54:34
lovewyufeng 发表于 2015-1-8 12:52
+ @& L/ l4 `' `, ]) b' N+ B看帖 应该  就知道很好用了  基本上 点几下鼠标就创建一个可以直接使用的  工程 ...
2 O# j# z8 F' t2 ^% C
那只是可用,效率怎么样呢
lovewyufeng 回答时间:2015-1-8 12:56:36
cxtarm 发表于 2015-1-8 12:547 r2 _7 F! G6 ^  d" K/ c$ @
那只是可用,效率怎么样呢
0 i/ N' o: F# H6 t: u5 J
本人建议  库只用于 比较复杂的 外设初始化 比如  串口 ,SPI SDIO等等4 U" i  |9 E; \( J; J0 L/ Q- U! \
8 k. w7 H+ w' D
初始化完成之后的操作 建议使用寄存器
ewfty 回答时间:2015-1-8 13:12:10
在实际开发中,我还是喜欢裸奔,不过像这些OS学习还是可以的。
yceast 回答时间:2015-1-8 13:21:50
很好啊
moyanming2013 回答时间:2015-1-8 15:58:52
前来支持
我是东哥 回答时间:2015-1-8 16:20:57
看Freertos头文件Semphr.h的注释。
% R9 [0 e3 C8 l! e, n7 r2) Resource management.- S/ S/ h: C# Y% ^" K' b$ v4 e
*    In this usage scenario the count value indicates the number of resources) C- @( D& {( g/ ?
*    available.  To obtain control of a resource a task must first obtain a$ L% Q2 c) C  B
*    semaphore - decrementing the semaphore count value.  When the count value
" r5 P& E* V* ?+ j$ f3 e9 X3 } *    reaches zero there are no free resources.  When a task finishes with the
1 N% S' ?2 t4 H0 S2 I3 r *    resource it 'gives' the semaphore back - incrementing the semaphore count
: Y8 u) X! j+ n, ?4 j+ o *    value.  In this case it is desirable for the initial count value to be5 {  E1 P: v0 |1 Y4 e
*    equal to the maximum count value, indicating that all resources are free.
我是东哥 回答时间:2015-1-8 16:28:35
这种用法应该是先take,再give回去。而不是像第一种用法(也就是楼主说的常用用法)那样,需要先give,然后才能take。
我是东哥 回答时间:2015-1-8 16:31:40
刚刚贴的代码怎么不见了?再贴一遍头文件中的注释,很明了:6 l' f+ i2 e1 k8 u6 l  M
* Counting semaphores are typically used for two things:
0 T0 h. {+ I# B *" f: f7 H+ l2 [' U5 n, B; i
* 1) Counting events.
' l4 ~/ t2 R' L& R *
) s6 f# X7 p0 N! A *    In this usage scenario an event handler will 'give' a semaphore each time, l! V+ ]+ J; D: D$ h1 ]! K
*    an event occurs (incrementing the semaphore count value), and a handler
( l1 o/ I0 G2 g( C" d/ @- q5 Q6 t *    task will 'take' a semaphore each time it processes an event
- {( M* J9 G7 e4 h *    (decrementing the semaphore count value).  The count value is therefore
& l4 y1 M; q; H. ?9 ~- ^: ` *    the difference between the number of events that have occurred and the
+ Q5 R, m$ X! E *    number that have been processed.  In this case it is desirable for the
- H- _/ A  T3 h6 V  l% |- b4 y *    initial count value to be zero.2 ~! I, ^4 x3 }4 c3 A! o* a
*9 r# c% d( R! K; ^
* 2) Resource management.
7 U( W+ Y: ^5 |( |6 S *  J5 `2 @( e$ p
*    In this usage scenario the count value indicates the number of resources
/ \; o* u' Q% {& s4 Z; S2 t *    available.  To obtain control of a resource a task must first obtain a2 A- z  F: X. f  s# H, g9 N
*    semaphore - decrementing the semaphore count value.  When the count value2 D0 s6 H% x1 I! L
*    reaches zero there are no free resources.  When a task finishes with the3 f0 z0 T" v7 A
*    resource it 'gives' the semaphore back - incrementing the semaphore count. I) N# B2 i$ f
*    value.  In this case it is desirable for the initial count value to be
, i6 @4 t$ j2 \& X *    equal to the maximum count value, indicating that all resources are free.
lovewyufeng 回答时间:2015-1-8 21:29:57
我是东哥 发表于 2015-1-8 16:28
0 V! N6 `' Y7 k% c4 G8 E这种用法应该是先take,再give回去。而不是像第一种用法(也就是楼主说的常用用法)那样,需要先give,然后 ...

" |0 l$ P5 v- k! V7 P是的  因为我的 资源一开始是不可用的  1 b- I5 |( F" c

) C3 F! c- ~7 {8 V4 _. \; @8 x" l/ n. R这是典型的 生产消费问题; l" q% c! b2 c) R8 C% d
! c( b+ E8 J# E0 d5 X& C3 O* }
串口接收数据(生产)
  e0 a) j) S1 M! O$ q' C$ d3 j4 h6 J/ {" U7 f" w
线程消费数据  
. y9 ^; ]8 D: m. R* O9 j5 X% x2 r! [7 F1 e& y
一开始是没有现成的数据的
3 I9 Y/ c; t% B8 y  m3 y+ n. L
# r+ D' q& q4 i1 X9 _) ?而这个 函数接口  只能以另一种方式使用那就是一开始就存在资源,这在实际使用中是不合理的!!
serge 回答时间:2015-1-8 21:50:06
支持楼主,留下记号,还能拿钱
lovewyufeng 回答时间:2015-1-9 08:38:07
serge 发表于 2015-1-8 21:50! r" H% i8 ]* H+ j2 ^
支持楼主,留下记号,还能拿钱
6 H( Y2 y8 M( X1 v; ]' m
哈哈 你来晚了钱都被他们拿完了~~
ataudio 回答时间:2015-1-13 14:16:31
楼主强帖,当然要支持了。好好向楼主学习。
maxiaoxiaoq 回答时间:2015-1-13 14:21:50
好贴,正好用的着啊。。
w453509596 回答时间:2015-1-13 23:25:01
楼主写的太好了,刚拿到开发板,我要好好学习一下
关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
人形机器人运动控制、感知与智能配电
半导体创新技术与应用方向
EE架构与软件定义汽车
12V/48V 汽车智能配电(SPD)
区域控制单元(ZCU)与分区架构
关注我们
st-img 微信公众号
st-img 手机版