本帖最后由 watershade 于 2015-9-23 21:34 编辑 - u2 T; K+ W8 w" T& [/ g4 n$ ~ 本意外mbed os会在八月中旬发布,作为一个喜欢新鲜的人,自然焦灼等待。结果等到九月初,也没发现mbed os beta的发布。可是上周无意发现mbed os发布了,而且官网首页也换了。网址由mbed.org更换成mbed.com。之前不支持中文,现在由中英文两个版本,(心里欢喜,这次终于被公平对待了)。( P: I5 p! F, ^+ y& X 首页提供一个入门教程的链接。现在将要素写下来。+ S5 @9 q8 O! A p1 s$ Q0 G 首先要说明mbed os只是mbed生态系统很小的一环,mbed还包含mbed客户端,mbed服务器(由mbed提供),mbed tls和其它工具。当然还包含硬件和硬件平台。+ R1 K3 h& u. v1 C 大致的树形关系应该是这样(自己的理解):9 ?+ K+ j7 m0 H" M8 j mbed服务器(云端)/ g1 A2 C- A7 }! w. A ______________________|______________________/ E0 E4 k# `+ U | | | | | mbed客户端 ...其他客户端... mbed客户端 ______________|____________ | | |, E* _! m9 h F mbed os设备 mbed os设备2 s5 ~/ C8 o+ k; B7 d3 d6 T _________|_________ | | | |" f, i1 t; ?3 O 传感器 执行器 指示与显示设备等 ^5 H3 z7 k( A7 O3 Y: U 【可能错了】 工具用于设置和编译等,LTS是安全通讯,也就是设备之间通讯互联的基础。在不同设备之间支持多种通讯协议。由许多协议一个外行还从没听过。& o# K6 r' o- a7 d3 ] ( t9 e% G, T( F9 r) s- c . U C3 Q4 J( `; c" u step 1: 安装yotta& Q' ^. i6 _# f: _* b3 P2 W% ] yotta就是上述所谓的工具中对mbed os最重要的工具,相当于ide和项目和模块管理系统。官方叫做软件模块系统。3 O* f; q2 Z$ x2 r. E/ v http://www.mbed.com/zh-cn/development/software/tools/yotta/. a$ h) C7 J4 |3 [# z) X0 k 这个是全新的体验,可以在三个主流系统上使用。在windows上听麻烦,我安装了一下,但是不知道是那个地方配置的问题,没有build成功。而且windows上不支持native编译,只能交叉编译。不过无所谓吧。之后慢慢解决出现的问题(目前遇到的问题是ninja error,环境变量应该配置没有问题,用yotta clean也没解决)。 安装请参考http://yottadocs.mbed.com/#installing& G5 i( T! P3 C9 I6 k6 @ / w6 b* L& G( G7 p9 ? 我最终实在linux上用的,没办法木有mac。! b1 Z! z) C% T7 U step 2: 点灯-初始mbed os 在还没有对mbed os有一个清晰的认识之前,只能照葫芦画瓢。 官方网址:) p$ b. S z" [6 ^" v+ k http://docs.mbed.com/docs/gettin ... FirstProjectmbedOS/ 3 @, u. p7 a( O- W% M/ s 需要说明的有两点。一点是在yotta target (你的平台,比如stm32f429i-disco-gcc)。之后接着yotta target是没有设备的,提示missing。8 d& h. n* Y6 [7 J0 S/ b 需要执行玩install mbed-drivers之后,在执行就有了设备。 另外一点是,支持的设备目前不限于官方提供的几个。search到的设备都应该可以。没有的设备需要自己修改和添加。 当前支持的有:3 m6 D$ Q& r% o test-target-dep 0.0.2: Test Target Test Dependencies' Q6 s& Q! G) E, U 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. bbc-microbit-classic-gcc 0.1.3: Official mbed build target for the mbed nrf51822 development board, using the armgcc toolchain.* Z/ Y% ~9 J' V' x6 D; A' R st-nucleo-f401re-gcc 0.1.0: Official mbed build target for the mbed st-nucleo-f401re development board.0 f0 Y! V0 p$ V! K$ `) S 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.& H) O3 p1 D2 @1 j7 i nordic-nrf51822-32k-gcc 0.0.6: Official mbed build target for the nrf51822 32KB chip.2 `* Z M f9 _* ^/ z4 s$ G; o st-stm32f439zi-gcc 0.0.3: Official mbed build target for the st stm32f439zi microcontroller. 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.3 F. T2 Q9 m. ?2 A, f f bbc-microbit-classic-gcc-nosd 0.1.2: Official mbed build target for the BBC micro:bit, using the armgcc toolchain, without Softdevice. nordic-nrf51822-32k-armcc 0.0.8: Official mbed build target for the mbed nrf51822 development board, using the armcc toolchain.6 `) h5 N3 U3 Y3 Z" z! c" j L* U bbc-microbit-classic-armcc-nosd 0.1.0: Official mbed build target for the microbit, using the armcc toolchain, without soft device.( q1 q7 Z; [" @& g/ N 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. H% c9 N( r X( {2 X/ N6 I mbed-gcc 0.0.14: base mbed build target for gcc toolchain) ?5 _) k0 I7 w. ]9 g2 @9 d* S 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 ublox-odin-w2-gcc 0.0.3: Official mbed build target for the ublox odin-w2 module.9 q$ v; s% l0 p, p$ Z" U2 }: Q& t% o ublox-odin-w2-evk-gcc 0.0.0: Official mbed build target for the mbed ublox c029 evkelopment board.- \' m- C) s3 N9 M3 X 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.. P6 {2 Y( d; n7 q( J0 G4 \ mkit-classic-armcc 0.0.1: mbed classic build target for nrf51822 mkit.' e, C# Q! E v3 p5 Q2 i: Y lex-test-gcc 0.0.1: lex's first target to test: D: e* \0 p* }4 h5 O " J* q" V( n4 ]1 t q' G; H) } 此外这一段还提供了一段简单的代码,代码是cpp编写的。有一个域名空间minar很重要。之后要关注一下。语法和之前的mbed差不多。openocd还没用过。目前准备参照http://github.com/texane/stlink ... torial/tutorial.pdf来执行stlink的驱动。# ^( I- r$ o0 c0 G 此外还需要在linux上安装串口终端,不放试试minicom,ubuntu上安装方便:sudo apt-get install minicom 在编译成功之后,需要讲代码复制到mbed上去,但是问题是stlink又有原生的linux驱动,这是一个大问题。在后续后详细介绍。但是,一种讨巧的办法是装虚拟机。这样就可以方便编译了。) O* O: u. J, N9 Y, h* r ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 2015.09.23 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 今天再补充一下mbed os的文件结构,这个是很重要的。& G5 y J' [3 r; e& R0 Y 官方的文档:http://www.mbed.com/zh-cn/development/software/tools/yotta// O% v M% c: z' [ 文档结构,用下图: yotta 模块或应用程序的结构 应用程序和可重用的 yotta 模块均有类似的结构:
建议mbed的开发,要了解这个基础知识。 目前只做到这里,后续希望慢慢更新4 o5 I: E3 @$ m @5 n% G8 V |
5 J' t& R2 @% f& ?/ n5 _
需要说明的是我对mbed客户端的理解可能错误了,因为官方介绍的有些看不懂。官方的意思应该是说mbed客户端是和mbed os是同一级别的,是为了方便设备制造上考虑的。总之我前面的描述有问题。
http://www.mbed.com/zh-cn/development/software/mbed-client/
今年iot系统不是几大厂商在推吗,尝尝鲜。看看到底对开发有什么帮助。
现在只有推出可裁剪的桌面系统(非操作系统)才有大量用户。
尝试了一下,感觉还是有些难度。桌面系统,这个我还真没有概念,这是什么?阁下赐教。
其实,就看看,架构我呀还没理顺。慢慢了解。一起学习交流呀。话说现在支持的板子不多。
8 f) g) ?! |5 [8 A# J' Q( N8 g
可以請樓主分享一下yt build之後的完整log嗎?
小弟下載了http://github.com/ARMmbed/helloyotta
然後試著yt build+ x" h$ h2 a" i
! N8 j" d2 y X
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$ [4 U" a0 u0 n
-- Configuring done. e; L/ H2 f# P( S
-- Generating done
-- Build files have been written to: /tmp/aaa/helloyotta/build/frdm-k64f-gcc- Q3 L* D3 N7 Y1 B7 W$ ^# X
log: warning: no configuration file specified, using default values. {6 r V# G, }3 K- F* Y. ^3 }! V
log: ninja version 0.1.3 initializing) W4 M0 ], C/ f$ ]
log: magic group: gid=0 (root)
log: entering main loop
log: generating initial pid array..
log: now monitoring process activity
就卡在上面這行不會動了, Q' c0 S; j+ d' g. [" w# R5 O
請教一下這是什麼問題呢?----
更新一下最新進度
先執行yt clean之後就build的出來了: Y5 J4 x) y% `/ k
應該是測試時把環境搞亂了
在此建議大家build之前先執行一次yt clean0 o! G/ H2 X* | T, ~
发现官方search出来的F401和411都编译不成功,不论linux还是windows上。但是F429可以