本帖最后由 watershade 于 2015-9-23 21:34 编辑 $ g9 ?" \ k% v8 b" L " ]/ x4 [( p8 b! u; G 本意外mbed os会在八月中旬发布,作为一个喜欢新鲜的人,自然焦灼等待。结果等到九月初,也没发现mbed os beta的发布。可是上周无意发现mbed os发布了,而且官网首页也换了。网址由mbed.org更换成mbed.com。之前不支持中文,现在由中英文两个版本,(心里欢喜,这次终于被公平对待了)。 首页提供一个入门教程的链接。现在将要素写下来。' P' @: A4 D7 p" S% a3 r1 y 首先要说明mbed os只是mbed生态系统很小的一环,mbed还包含mbed客户端,mbed服务器(由mbed提供),mbed tls和其它工具。当然还包含硬件和硬件平台。 大致的树形关系应该是这样(自己的理解): mbed服务器(云端)1 e. Z( y% B- k! g# l ______________________|______________________ | | | | | mbed客户端 ...其他客户端... mbed客户端 ______________|____________9 x" r# b t& S/ k. _! i! Y | | | mbed os设备 mbed os设备 _________|_________6 C" w* [5 t; b- y. o/ i q | | | |2 P# `) Q: Z( x" l# R8 k6 r 传感器 执行器 指示与显示设备等 【可能错了】2 D% o" C" Q( h9 j3 Q+ E 2 j( S6 r, @) G6 k1 ], n0 A 7 E* ~) Z$ N/ o5 s 工具用于设置和编译等,LTS是安全通讯,也就是设备之间通讯互联的基础。在不同设备之间支持多种通讯协议。由许多协议一个外行还从没听过。7 ?7 i8 W2 L" y . ~; c8 ~( G! ~! e% c) n, V4 Y - _+ n, o$ z |1 T; s' a& b - o' V6 u, ~9 T0 K8 W step 1: 安装yotta1 f/ ~/ @5 O( r1 u4 \. H yotta就是上述所谓的工具中对mbed os最重要的工具,相当于ide和项目和模块管理系统。官方叫做软件模块系统。 http://www.mbed.com/zh-cn/development/software/tools/yotta// _$ b& V& O. d3 S ]1 p; p Z 这个是全新的体验,可以在三个主流系统上使用。在windows上听麻烦,我安装了一下,但是不知道是那个地方配置的问题,没有build成功。而且windows上不支持native编译,只能交叉编译。不过无所谓吧。之后慢慢解决出现的问题(目前遇到的问题是ninja error,环境变量应该配置没有问题,用yotta clean也没解决)。; \) I+ I s; P% O* N 安装请参考http://yottadocs.mbed.com/#installing& L2 y# |, H1 j; W 9 K$ i8 d! d+ F* Y 我最终实在linux上用的,没办法木有mac。 step 2: 点灯-初始mbed os. J" l; D# u/ ^( m 在还没有对mbed os有一个清晰的认识之前,只能照葫芦画瓢。$ I3 B2 x& i p( B+ I" f 官方网址: http://docs.mbed.com/docs/gettin ... FirstProjectmbedOS/2 [. [ X1 ^/ o* |, W+ K$ | . P1 k. z m$ W1 n' n2 g5 f 需要说明的有两点。一点是在yotta target (你的平台,比如stm32f429i-disco-gcc)。之后接着yotta target是没有设备的,提示missing。3 n. G: W3 w4 [/ J 需要执行玩install mbed-drivers之后,在执行就有了设备。6 t) ^# M+ ], A4 B 另外一点是,支持的设备目前不限于官方提供的几个。search到的设备都应该可以。没有的设备需要自己修改和添加。- V- I6 e1 P: S( T3 X! ? 当前支持的有:$ d ?2 W+ \- _ 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. V! Y+ | A" \" L# V; } frdm-k64f-armcc 0.0.16: Official mbed build target for the mbed frdm-k64f development board, using the armcc toolchain. bbc-microbit-classic-gcc 0.1.3: Official mbed build target for the mbed nrf51822 development board, using the armgcc toolchain. st-nucleo-f401re-gcc 0.1.0: Official mbed build target for the mbed st-nucleo-f401re development board. bbc-microbit-classic-armcc 0.1.0: Official mbed build target for the microbit, using the armcc toolchain. 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.5 F* m ` u. i( t# o8 S 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.8 X/ r- k( c4 A9 o+ i' O 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./ J$ [! Z3 G2 [1 W bbc-microbit-classic-gcc-nosd 0.1.2: Official mbed build target for the BBC micro:bit, using the armgcc toolchain, without Softdevice.& z3 n' b: {6 {( L1 A2 a nordic-nrf51822-32k-armcc 0.0.8: Official mbed build target for the mbed nrf51822 development board, using the armcc toolchain. 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" U6 j1 Q' p" s" @; R+ p x86-osx-native 0.0.7: Build target for programs compiled natively for OS X6 V5 l) [- |' a1 W% Q5 ]; [ mbed-gcc 0.0.14: base mbed build target for gcc toolchain! v, M( F. I5 G4 ]$ i mbed-armcc 0.0.16: Official mbed base target description for compiling with the ARMCC compiler libc 0.0.3: libc shim module: pulls in the platform libc when compiling for nostdlib targets) Q5 f$ C n8 n0 l2 |2 I 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.( y4 O: ^. Q. ? seeedtinyble-gcc 0.0.2: Official mbed build target for the nrf51822 16KB chip.( G4 g7 e4 Q% s; r/ s6 v mkit-gcc 0.0.1: Official mbed build target for the nrf51822 16KB chip.5 B* M0 d# F2 }% i. \* f+ I4 x ublox-c029-gcc 0.0.0: Official mbed build target for the mbed ublox c029 development board. mkit-classic-armcc 0.0.1: mbed classic build target for nrf51822 mkit.3 q z* v3 s( ` lex-test-gcc 0.0.1: lex's first target to test/ P9 y* i2 [4 _. ?% ^7 p 此外这一段还提供了一段简单的代码,代码是cpp编写的。有一个域名空间minar很重要。之后要关注一下。语法和之前的mbed差不多。openocd还没用过。目前准备参照http://github.com/texane/stlink ... torial/tutorial.pdf来执行stlink的驱动。 此外还需要在linux上安装串口终端,不放试试minicom,ubuntu上安装方便:sudo apt-get install minicom 在编译成功之后,需要讲代码复制到mbed上去,但是问题是stlink又有原生的linux驱动,这是一个大问题。在后续后详细介绍。但是,一种讨巧的办法是装虚拟机。这样就可以方便编译了。5 P' H1 p4 d. e X ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2015.09.23 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||2 r; u1 T& Z, b7 x1 E! h d 今天再补充一下mbed os的文件结构,这个是很重要的。% \. N8 T \8 v7 M) e 官方的文档:http://www.mbed.com/zh-cn/development/software/tools/yotta/; M# |+ x0 g$ p- s. Z 文档结构,用下图:# L# N0 G2 D2 k: `( M- R yotta 模块或应用程序的结构 应用程序和可重用的 yotta 模块均有类似的结构:
建议mbed的开发,要了解这个基础知识。/ e1 q+ \: }( d; r1 W* Y 2 g& i4 V- B# V P. `/ a" N1 { 目前只做到这里,后续希望慢慢更新 U/ a) k! _" U! u |
需要说明的是我对mbed客户端的理解可能错误了,因为官方介绍的有些看不懂。官方的意思应该是说mbed客户端是和mbed os是同一级别的,是为了方便设备制造上考虑的。总之我前面的描述有问题。$ R W# w5 G: V5 ~' g
http://www.mbed.com/zh-cn/development/software/mbed-client/
今年iot系统不是几大厂商在推吗,尝尝鲜。看看到底对开发有什么帮助。
现在只有推出可裁剪的桌面系统(非操作系统)才有大量用户。
尝试了一下,感觉还是有些难度。桌面系统,这个我还真没有概念,这是什么?阁下赐教。
其实,就看看,架构我呀还没理顺。慢慢了解。一起学习交流呀。话说现在支持的板子不多。
可以請樓主分享一下yt build之後的完整log嗎?
小弟下載了http://github.com/ARMmbed/helloyotta
然後試著yt build# F3 t4 C# t0 W* s. S9 ?0 s7 P
info: generate for target: frdm-k64f-gcc 0.1.3 at /tmp/aaa/helloyotta/yotta_targets/frdm-k64f-gcc
GCC version is: 4.8.3( f* D/ l G' j3 m, [! ]' }
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/aaa/helloyotta/build/frdm-k64f-gcc0 m' l+ V* J6 Q
log: warning: no configuration file specified, using default values
log: ninja version 0.1.3 initializing, e1 t9 t. L5 Y- _7 P
log: magic group: gid=0 (root)
log: entering main loop* F# | @6 J6 F2 n' B! e- G' }) {& J
log: generating initial pid array..8 p$ D, ]& f9 v1 q
log: now monitoring process activity, a2 ~2 Q/ @8 E& t2 I
就卡在上面這行不會動了
請教一下這是什麼問題呢?----
更新一下最新進度
先執行yt clean之後就build的出來了. ]) n" t7 a' D7 x
應該是測試時把環境搞亂了
在此建議大家build之前先執行一次yt clean
发现官方search出来的F401和411都编译不成功,不论linux还是windows上。但是F429可以