|
本帖最后由 watershade 于 2015-9-23 21:34 编辑 - @, ^$ _; w3 c3 B, u* O4 i" Z 本意外mbed os会在八月中旬发布,作为一个喜欢新鲜的人,自然焦灼等待。结果等到九月初,也没发现mbed os beta的发布。可是上周无意发现mbed os发布了,而且官网首页也换了。网址由mbed.org更换成mbed.com。之前不支持中文,现在由中英文两个版本,(心里欢喜,这次终于被公平对待了)。 首页提供一个入门教程的链接。现在将要素写下来。; N+ l( B9 g9 I7 d/ E( R$ E4 x 首先要说明mbed os只是mbed生态系统很小的一环,mbed还包含mbed客户端,mbed服务器(由mbed提供),mbed tls和其它工具。当然还包含硬件和硬件平台。 大致的树形关系应该是这样(自己的理解): mbed服务器(云端) ______________________|______________________ | | | | | mbed客户端 ...其他客户端... mbed客户端, @, }! K- F& J6 M; `# v' J ______________|____________ | | | mbed os设备 mbed os设备 _________|_________ | | | | 传感器 执行器 指示与显示设备等# D' Q3 s' a% E' ?- A4 p5 k& z 【可能错了】 ) C* A5 }' z0 n ?7 P- L' r [ g' f+ i5 U& k3 d* U h 工具用于设置和编译等,LTS是安全通讯,也就是设备之间通讯互联的基础。在不同设备之间支持多种通讯协议。由许多协议一个外行还从没听过。 4 h6 H2 w6 y8 X step 1: 安装yotta! v: t; S' t9 ^5 U) m7 P0 C yotta就是上述所谓的工具中对mbed os最重要的工具,相当于ide和项目和模块管理系统。官方叫做软件模块系统。 http://www.mbed.com/zh-cn/development/software/tools/yotta/0 Z$ z1 B8 U9 K7 r) Y" ~0 k 这个是全新的体验,可以在三个主流系统上使用。在windows上听麻烦,我安装了一下,但是不知道是那个地方配置的问题,没有build成功。而且windows上不支持native编译,只能交叉编译。不过无所谓吧。之后慢慢解决出现的问题(目前遇到的问题是ninja error,环境变量应该配置没有问题,用yotta clean也没解决)。 安装请参考http://yottadocs.mbed.com/#installing 我最终实在linux上用的,没办法木有mac。 step 2: 点灯-初始mbed os 在还没有对mbed os有一个清晰的认识之前,只能照葫芦画瓢。 官方网址: http://docs.mbed.com/docs/gettin ... FirstProjectmbedOS/0 A; x! v% l2 T # p) J. T/ t1 d 需要说明的有两点。一点是在yotta target (你的平台,比如stm32f429i-disco-gcc)。之后接着yotta target是没有设备的,提示missing。 需要执行玩install mbed-drivers之后,在执行就有了设备。 另外一点是,支持的设备目前不限于官方提供的几个。search到的设备都应该可以。没有的设备需要自己修改和添加。$ L' }( o5 [6 Q# {" K1 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. 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.5 L7 P' `+ k, Z3 ^6 R6 U+ C C7 v 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.( C% W3 u& S$ w! |9 }) [- b stm32f429i-disco-gcc 0.0.5: Official mbed build target for the mbed st-nucleo-f429zi development board.8 \: B, ^$ `( o E: n nordic-nrf51822-16k-gcc 0.0.9: Official mbed build target for the mbed nrf51822 development board, using the armgcc toolchain. nordic-nrf51822-32k-gcc 0.0.6: Official mbed build target for the nrf51822 32KB chip.. |% R9 @' m3 z; p 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.6 |& X0 Z0 z& w0 }( w& F stm32f411re-nucleo-gcc 0.0.1: Official mbed build target for the mbed st-nucleo-f411re development board.' F: o f; ~0 W9 q 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. bbc-microbit-classic-armcc-nosd 0.1.0: Official mbed build target for the microbit, using the armcc toolchain, without soft device.* G! @1 @- }2 S! w9 m7 D 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" }7 N1 M& i& I- N6 a: K mbed-gcc 0.0.14: base mbed build target for gcc toolchain2 G% ^) F4 k" x2 R' [" v mbed-armcc 0.0.16: Official mbed base target description for compiling with the ARMCC compiler. y. c1 \1 `7 L libc 0.0.3: libc shim module: pulls in the platform libc when compiling for nostdlib targets& s' d7 t7 x7 G# l& }' N 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. 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. O" f+ n7 U; U# ~! s. b 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. lex-test-gcc 0.0.1: lex's first target to test 此外这一段还提供了一段简单的代码,代码是cpp编写的。有一个域名空间minar很重要。之后要关注一下。语法和之前的mbed差不多。openocd还没用过。目前准备参照http://github.com/texane/stlink ... torial/tutorial.pdf来执行stlink的驱动。 此外还需要在linux上安装串口终端,不放试试minicom,ubuntu上安装方便:sudo apt-get install minicom8 q. {) R1 d" C) y& t" M 在编译成功之后,需要讲代码复制到mbed上去,但是问题是stlink又有原生的linux驱动,这是一个大问题。在后续后详细介绍。但是,一种讨巧的办法是装虚拟机。这样就可以方便编译了。, }- W9 r* [& ]- z0 L- ] |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||$ z& i0 G. O& B" q& \. v( @8 W4 X! C 2015.09.23 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 今天再补充一下mbed os的文件结构,这个是很重要的。) }+ I8 M! \; [3 J) I6 N- r3 Q8 z 官方的文档:http://www.mbed.com/zh-cn/development/software/tools/yotta/7 u# M! h! t. a( O3 d: L 文档结构,用下图:+ ^- s9 n& }" o4 o yotta 模块或应用程序的结构 ( N$ c0 O. z* u9 r7 `% P 应用程序和可重用的 yotta 模块均有类似的结构:
建议mbed的开发,要了解这个基础知识。 7 L0 v/ |8 I9 J1 P3 r# q 目前只做到这里,后续希望慢慢更新 6 q/ X0 s( S; e5 n6 D 6 Z4 F) J" @7 q4 q, K$ W. B |
微信公众号
手机版
需要说明的是我对mbed客户端的理解可能错误了,因为官方介绍的有些看不懂。官方的意思应该是说mbed客户端是和mbed os是同一级别的,是为了方便设备制造上考虑的。总之我前面的描述有问题。
http://www.mbed.com/zh-cn/development/software/mbed-client/
今年iot系统不是几大厂商在推吗,尝尝鲜。看看到底对开发有什么帮助。
现在只有推出可裁剪的桌面系统(非操作系统)才有大量用户。
尝试了一下,感觉还是有些难度。桌面系统,这个我还真没有概念,这是什么?阁下赐教。
其实,就看看,架构我呀还没理顺。慢慢了解。一起学习交流呀。话说现在支持的板子不多。
3 o+ D+ b1 s' X3 c! f
可以請樓主分享一下yt build之後的完整log嗎?8 c$ `' |6 u( L6 P& ]# A
小弟下載了http://github.com/ARMmbed/helloyotta% t. d4 P+ S: H* p. G/ j; |+ `) t; H
然後試著yt build
$ A( [, q! g q* Z A( |, @$ K
info: generate for target: frdm-k64f-gcc 0.1.3 at /tmp/aaa/helloyotta/yotta_targets/frdm-k64f-gcc+ I2 Y0 m8 I% O9 @ m4 e4 }
GCC version is: 4.8.35 K7 w6 l x% G8 e( i0 s$ Y
-- Configuring done7 v7 Y% v% h! E
-- Generating done$ x/ L6 Y6 n i* {- w
-- Build files have been written to: /tmp/aaa/helloyotta/build/frdm-k64f-gcc
log: warning: no configuration file specified, using default values" X# L. L4 b8 u, @) _
log: ninja version 0.1.3 initializing- D9 r& W0 q" e: e; ~. D0 S
log: magic group: gid=0 (root)6 \6 Y& Q3 b$ Y$ T6 p W, Z% G/ c
log: entering main loop
log: generating initial pid array..8 M) r5 l1 j5 |1 Q; @
log: now monitoring process activity0 T1 K( p) R: P& m
- v6 w0 p# o4 b; m9 P2 }
就卡在上面這行不會動了
請教一下這是什麼問題呢?----
更新一下最新進度
先執行yt clean之後就build的出來了
應該是測試時把環境搞亂了/ s& c* R/ D' x B0 q( X
在此建議大家build之前先執行一次yt clean. K& B: T7 W& `6 P" Q- ?
发现官方search出来的F401和411都编译不成功,不论linux还是windows上。但是F429可以