本帖最后由 watershade 于 2015-9-23 21:34 编辑 本意外mbed os会在八月中旬发布,作为一个喜欢新鲜的人,自然焦灼等待。结果等到九月初,也没发现mbed os beta的发布。可是上周无意发现mbed os发布了,而且官网首页也换了。网址由mbed.org更换成mbed.com。之前不支持中文,现在由中英文两个版本,(心里欢喜,这次终于被公平对待了)。6 S+ U: [1 h% F+ F 首页提供一个入门教程的链接。现在将要素写下来。 首先要说明mbed os只是mbed生态系统很小的一环,mbed还包含mbed客户端,mbed服务器(由mbed提供),mbed tls和其它工具。当然还包含硬件和硬件平台。 大致的树形关系应该是这样(自己的理解): mbed服务器(云端)! ~3 X4 Z. y( _: U+ S5 } ______________________|______________________ | | | | |- \: e" X4 b) |" G' w% \0 O% H mbed客户端 ...其他客户端... mbed客户端: u$ t7 g( Q" {) J+ H, c0 O ______________|____________8 S9 R9 y# `. r( ^* K# Z0 g4 _ | | |( ]4 T% v' J. l. {' B mbed os设备 mbed os设备 _________|_________ | | | | 传感器 执行器 指示与显示设备等 【可能错了】 1 O6 ^ j7 J/ b( [4 @, a3 |6 P4 j ' j6 w7 F4 O1 P7 x# b - h6 a, m7 v7 W : o' u: u3 y% B0 k; o& W/ h0 T9 x 工具用于设置和编译等,LTS是安全通讯,也就是设备之间通讯互联的基础。在不同设备之间支持多种通讯协议。由许多协议一个外行还从没听过。 , }" P$ ]8 ~) ?; x$ W+ ^! T' ] . K. L4 K$ x3 A( P. ^8 I5 z step 1: 安装yotta& ]% o$ H! A1 Q$ m+ ` yotta就是上述所谓的工具中对mbed os最重要的工具,相当于ide和项目和模块管理系统。官方叫做软件模块系统。9 W) U) M" H% ~$ s http://www.mbed.com/zh-cn/development/software/tools/yotta/) D; b0 {" W/ _9 @- X( R# @( c 这个是全新的体验,可以在三个主流系统上使用。在windows上听麻烦,我安装了一下,但是不知道是那个地方配置的问题,没有build成功。而且windows上不支持native编译,只能交叉编译。不过无所谓吧。之后慢慢解决出现的问题(目前遇到的问题是ninja error,环境变量应该配置没有问题,用yotta clean也没解决)。 安装请参考http://yottadocs.mbed.com/#installing$ G$ b# V% o; r 我最终实在linux上用的,没办法木有mac。 step 2: 点灯-初始mbed os5 k8 g" z! P! q& D 在还没有对mbed os有一个清晰的认识之前,只能照葫芦画瓢。5 q9 t5 ]# L8 `# Z* l9 _ 官方网址: http://docs.mbed.com/docs/gettin ... FirstProjectmbedOS/- b7 L) X, E. k; {$ i3 K4 ]- J" t ) @# _4 J: C n3 M: W 需要说明的有两点。一点是在yotta target (你的平台,比如stm32f429i-disco-gcc)。之后接着yotta target是没有设备的,提示missing。 需要执行玩install mbed-drivers之后,在执行就有了设备。 另外一点是,支持的设备目前不限于官方提供的几个。search到的设备都应该可以。没有的设备需要自己修改和添加。 当前支持的有: test-target-dep 0.0.2: Test Target Test Dependencies frdm-k64f-gcc 0.0.24: Official mbed build target for the mbed frdm-k64f development board. frdm-k64f-armcc 0.0.16: Official mbed build target for the mbed frdm-k64f development board, using the armcc toolchain.0 r' V/ ?% D5 N& T8 h6 Z bbc-microbit-classic-gcc 0.1.3: Official mbed build target for the mbed nrf51822 development board, using the armgcc toolchain.) c" O- ]/ V* d; R st-nucleo-f401re-gcc 0.1.0: Official mbed build target for the mbed st-nucleo-f401re development board.( l7 J3 v5 I$ a% J3 B p bbc-microbit-classic-armcc 0.1.0: Official mbed build target for the microbit, using the armcc toolchain.7 k7 F# z( P9 ^ i stm32f429i-disco-gcc 0.0.5: Official mbed build target for the mbed st-nucleo-f429zi development board. nordic-nrf51822-16k-gcc 0.0.9: Official mbed build target for the mbed nrf51822 development board, using the armgcc toolchain.! o# P7 F( n# f2 i* L- C: f nordic-nrf51822-32k-gcc 0.0.6: Official mbed build target for the nrf51822 32KB chip. st-stm32f439zi-gcc 0.0.3: Official mbed build target for the st stm32f439zi microcontroller.9 [- E4 l8 r* Q/ ^ nordic-nrf51822-16k-armcc 0.0.8: Official mbed build target for the mbed nrf51822 development board, using the armcc toolchain. stm32f411re-nucleo-gcc 0.0.1: Official mbed build target for the mbed st-nucleo-f411re development board.* P! u4 m8 L3 c- E- H bbc-microbit-classic-gcc-nosd 0.1.2: Official mbed build target for the BBC micro:bit, using the armgcc toolchain, without Softdevice.+ h7 ~# [2 t/ [0 r# w nordic-nrf51822-32k-armcc 0.0.8: Official mbed build target for the mbed nrf51822 development board, using the armcc toolchain.5 M( m; M: S5 l* `# e bbc-microbit-classic-armcc-nosd 0.1.0: Official mbed build target for the microbit, using the armcc toolchain, without soft device. x86-linux-native 0.0.6: Build target for programs compiled natively for Linux x86-osx-native 0.0.7: Build target for programs compiled natively for OS X/ n1 h3 s ]& W* R* C9 T mbed-gcc 0.0.14: base mbed build target for gcc toolchain mbed-armcc 0.0.16: Official mbed base target description for compiling with the ARMCC compiler; I0 `3 ]0 L, p9 Q% P) h4 o libc 0.0.3: libc shim module: pulls in the platform libc when compiling for nostdlib targets ublox-odin-w2-gcc 0.0.3: Official mbed build target for the ublox odin-w2 module. ublox-odin-w2-evk-gcc 0.0.0: Official mbed build target for the mbed ublox c029 evkelopment board.6 l5 H1 t6 J4 l& Q! S! M8 B! s seeedtinyble-gcc 0.0.2: Official mbed build target for the nrf51822 16KB chip. mkit-gcc 0.0.1: Official mbed build target for the nrf51822 16KB chip. ublox-c029-gcc 0.0.0: Official mbed build target for the mbed ublox c029 development board./ R0 X0 d, U8 H+ I2 ~/ q. g mkit-classic-armcc 0.0.1: mbed classic build target for nrf51822 mkit. lex-test-gcc 0.0.1: lex's first target to test7 ?8 I# D/ A! J8 S) d9 ^, j( r 此外这一段还提供了一段简单的代码,代码是cpp编写的。有一个域名空间minar很重要。之后要关注一下。语法和之前的mbed差不多。openocd还没用过。目前准备参照http://github.com/texane/stlink ... torial/tutorial.pdf来执行stlink的驱动。5 D8 [0 d4 G( ]6 O5 A; b 此外还需要在linux上安装串口终端,不放试试minicom,ubuntu上安装方便:sudo apt-get install minicom# F O: `0 _0 @' c) f7 P3 i' K6 U1 [- [ 在编译成功之后,需要讲代码复制到mbed上去,但是问题是stlink又有原生的linux驱动,这是一个大问题。在后续后详细介绍。但是,一种讨巧的办法是装虚拟机。这样就可以方便编译了。 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||% o- Y' g/ \! i* W' v9 e8 |4 e/ t 2015.09.237 ^) B* H1 v; h7 v0 _* R ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 今天再补充一下mbed os的文件结构,这个是很重要的。: x/ l- ]# N" R u2 R9 x5 {; i 官方的文档:http://www.mbed.com/zh-cn/development/software/tools/yotta/- o& L( b+ H4 y5 S' K9 D 文档结构,用下图: yotta 模块或应用程序的结构 ; l% O" @! p8 ]$ Q 应用程序和可重用的 yotta 模块均有类似的结构:
建议mbed的开发,要了解这个基础知识。 & Y; g3 Q9 R# A7 Z( b, X 目前只做到这里,后续希望慢慢更新" t( T! X$ W4 Y% f - x3 s! F- ~, a% i6 w |
2 ^6 }& f- S" [% v
需要说明的是我对mbed客户端的理解可能错误了,因为官方介绍的有些看不懂。官方的意思应该是说mbed客户端是和mbed os是同一级别的,是为了方便设备制造上考虑的。总之我前面的描述有问题。
http://www.mbed.com/zh-cn/development/software/mbed-client/
今年iot系统不是几大厂商在推吗,尝尝鲜。看看到底对开发有什么帮助。
现在只有推出可裁剪的桌面系统(非操作系统)才有大量用户。
尝试了一下,感觉还是有些难度。桌面系统,这个我还真没有概念,这是什么?阁下赐教。
其实,就看看,架构我呀还没理顺。慢慢了解。一起学习交流呀。话说现在支持的板子不多。
7 b0 f: j) b0 Z7 C
可以請樓主分享一下yt build之後的完整log嗎?2 p7 m2 H. |/ x- f: M8 q& ?" X
小弟下載了http://github.com/ARMmbed/helloyotta
然後試著yt build
info: generate for target: frdm-k64f-gcc 0.1.3 at /tmp/aaa/helloyotta/yotta_targets/frdm-k64f-gcc: H8 b# E+ e2 |, E- U; e
GCC version is: 4.8.3& B- n' Y: R. t9 ~' L: O
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/aaa/helloyotta/build/frdm-k64f-gcc: g' F; O( } j& w
log: warning: no configuration file specified, using default values# J1 \1 l8 B! O! g. ]8 \5 t; b
log: ninja version 0.1.3 initializing
log: magic group: gid=0 (root)
log: entering main loop
log: generating initial pid array..# _7 w1 m9 |+ G# R
log: now monitoring process activity
& g6 M$ d! B: \: x0 a+ G
就卡在上面這行不會動了# U2 Q; \# A2 ?( K+ S) |- o
請教一下這是什麼問題呢?----! [8 ?5 [6 N0 V) f: }$ d
更新一下最新進度( w3 W G3 D: t9 L( c5 J
先執行yt clean之後就build的出來了& F# Z" \4 ~) A' t8 [# w
應該是測試時把環境搞亂了: V- j- E" Q3 v
在此建議大家build之前先執行一次yt clean8 ` t! ^) G1 a1 d
发现官方search出来的F401和411都编译不成功,不论linux还是windows上。但是F429可以