您的位置 首页 方案

msp430几种不同开发渠道的比照

TinyOS(moteivmica)编辑器没有特定的编辑器,记事本类似的都行,保证所编辑的源文件是nc结尾的nesC程序。工程管理一个目录即为一个

TinyOS (moteiv & mica)

修改器
没有特定的修改器,记事本相似的都行,确保所修改的源文件是“.nc”结束的nesC程序。
工程办理
一个目录即为一个工程,包含一个makefile檔和一个或多个“components”,组件有两种:
1. 配件(configuration):描绘不同组件之间的联系;
2. 模块:(module):描绘组件供给的接口中的函数功用的试验进程。
开发环境
在windows下装置cygwin环境,并在cygwin下装置TinyOS的开发东西包,其间包含
avr-binutils, 二进制代码东西
avr-gcc,
avr-insight,
avr-libc,
nesC-1.1.2 nesC编译器
编译、运转和下载
TinyOS支撑多种硬件渠道,每个硬件渠道在tos/platform有自己的目录。
在应用程序的目录里/app/Blink下输入:
make tmote //其间tmote代表的是渠道品种。假如target为pc,刚生成的main.exe可
//用于GDB的调试。
上面的句子实际上是依照当时目录的makefile文件运转的,makefile檔中包含了编译、衔接等。具体的完成如下:
1.ncc编译链接: #ncc –o main.exe –target=tmote Blink.nc //编译生成了main.exe,能够作
//PC机上的模仿之用。
2.转化: #msp430-objcopy –output-target=ihex main.exe main.ihex //生成了main.ihex
下载:运转: #make tmote reinstall,1 //设置网络地址为1
其间运转进程中首要的两个指令如下:
installing tmote bootloader using bsl ####装置发动引导檔,依据开发板的不同而不同。
tos-bsl –telosb –c 7 –r –I –p C:/cygwin/opt/moteiv/tos/lib/Deluge/TOSBoot/build/tmote/main.ihex
installing tmote binary using bsl #####装置二进制程序。ihex与ihex.out-1文件相同
tos-bsl –telosb –c 7 –r –I –p build/tmote/main.ihex.out-1
make进程剖析
其间说到的目录阐明如下:(具体参照上面的图)
opt inyos-1.x oslib —————————————-包含了用到的库函数.
opt inyos-1.x osinterfaces———————————-包含接口函数,
opt inyos-1.x osplatform———-包含了不同硬件渠道间的装备文件.(发动引导檔在这儿)
opt inyos-1.x ossensorboards ——————————包含板载传感器的具体完成
能够看到一切的程序都是调用了同一个make规矩,除了工程自身地点目录的makefile文件与本工程相关外,在opt inyos-1.xapps目录下的makerule文件是共用的,其间界说了选用的编译器及硬件渠道的挑选。
TinyOS操作系统规划思维
1.轻量级线程技能(lightweight thread)
2.自动音讯通讯技能(active message)
3.事情驱动模块(event driver)
4.组件化编程(component-based programming)
nesC言语把组件化/模块化思维和根据事情驱动的履行模型结合起来。
组件化:其间的组件即“Configuration”(配件)、“Module”。两个东西就像零件相同组合在一起。
模块化:
MSPGCC
修改器
能够装备一些IDE(集成开发环境),如VIM、UltraEdit、CodeBlocks等,其间VIM是指令行的,用起来很有感觉,CodeBlocks是开源的,UltraEdit为商业软件。但不管怎么样,都是调用的mspgcc装置程序里的make.exe,调试环境是msp430-insight
工程办理
用UltraEdit能够很好的办理工程文件,在工程目录里边应该有一个makefile檔,告知make怎么去生成所要的目录文件和文件之间的依靠联系。相同,用开源的CodeBlocks也能够自己建立一个很好的IDE,鉴于对CodeBlocks都比较了解,即采用之!
开发环境
在windows下装置mspgcc-2007021.exe,留意,这儿最好是装置最新版的,在之前我下载的是2003版的,又许多东西都不全,导致一个人探索了良久。
然后在CodeBlocks里的“settings”项里装备相关的compiler和debugger,最重要的部分是库函数地点的目录方位。
编译、运转和下载
编译和链接部分基本上和相同,仅仅别离调用的是msp430-gcc.exe、msp430-ld.exe
下载是经过msp430-downloader.exe来下载的。
make进程剖析
下面是makefile文件的部分剖析:
${NAME}.elf: ${OBJECTS} #######################msp430-gcc进行编译
msp43o-gcc.exe -mmcu=${CPU} -o $@ ${OBJECTS} ####生成了 “*.elf”文件
${NAME}.a43: ${NAME}.elf ##################方针文件进行转化
msp430-objcopy -O ihex $^ $@ ##################将elf文件转化为*.a43文件
${NAME}.lst: ${NAME}.elf ##################反汇编,生成*.lst文件,其间
msp430-objdump -dSt $^ >$@ ##################这个文件包含了c源码,汇 ##################编原码
download-jtag: all
msp430-jtag -e ${NAME}.elf
download-bsl: all #####这儿的下载东西也是bsl,和TinyOS的tos-bsl相似
msp430-bsl -e ${NAME}.elf
其间,*.a43为TI-Text格局, *.hex为Intel-hex格局.
IAR_MSP430
修改器
IAR Embedded Workbench IDE一个瑞士开发的商用软件的,价格好象在6500.00;现在个人感觉比较开源的MSPGCC也没太大的优势。
工程办理
一个“.eww ”即为一个工程,
开发调试环境
编译、运转和下载
编译:调用“icc430.exe”编译器和现已设定好的一些参数,包含指定的动态库文件,输出文件地点的目录,具体的代码好下:
icc430.exe -I D:Program FilesIAR SystemsEmbedded Workbench 4.0430INC
-I D:Program FilesIAR SystemsEmbedded Workbench 4.0430INCDLIB
-o C:Documents and SettingsAdministratorMy DocumentsDebugObj
-z3 –no_cse –no_unroll –no_inline –no_code_motion –no_tbaa –debug -e –double=32
-D_DLIB_CONFIG_FILE=D:ProgramFilesIARSystemsEmbeddedWorkbench4.0430LIBDLIBdl430fn.h
D:Program FilesIAR SystemsEmbedded Workbench 4.0430FET_examplesfet140C-sourcefet140_1.c
运转上面的指令之后,在“..obj”目录下生成了“*.r43”文件。(The Obj directory is the destination directory for the object files from the compiler and the assembler. These files have the extension r43 and will be used as input to the IAR XLINK Linker.)
链接:这儿调用的是“xlink.exe”,具体的代码好下:
xlink.exe C:Documents and SettingsAdministratorMy DocumentsDebugObjfet140_1.r43
-o C:Documents and SettingsAdministratorMy DocumentsDebugExeSMC4200.d43 –I D:Program FilesIAR SystemsEmbedded Workbench 4.0430LIB
-f D:Program FilesIAR SystemsEmbedded Workbench 4.0430CONFIGlnk430F149.xcl
-f D:Program FilesIAR SystemsEmbedded Workbench 4.0430configmultiplier.xcl -D_STACK_SIZE=50
-rt D:Program FilesIAR SystemsEmbedded Workbench 4.0430LIBDLIBdl430fn.r43
-e_PrintfLarge=_Printf
-e_ScanfLarge=_Scanf
-D_HEAP_SIZE=50
-s __program_start
##### -o This option creates a UBROF output file, with a DE>d43DE> filename extension, to be used with the IAR C-SPY Debugger. (The Exe directory is the destination directory for the executable file. It has the extension d43 and will be used as input to the IAR C-SPY Debugger. Note that this
directory will be empty until you have linked the object files.) <> P66
下载:
在下载部分,IAR没有给出很具体的,
总结:
下面是和IAR、Jennic及TinyOS渠道做的比照:
开发东西包
IAR
Jennic
TinyOS
MSPGCC
compiler
编译器
C Compiler
icc430.exe
ba-elf-gcc.exe
ncc.exe
msp430-gcc.exe
msp430-gcc.exe
C++ Compiler
ba-elf-g++.exe
msp430-g++.exe
Linker
链接器
动态库的链接器
xlink.exe
ba-elf-ld.exe
msp430-ld.exe
静态库的链接器
?
ba-elf-ar.exe
msp430-ar.exe
Debugger
ba-elf-gdb.exe
msp430-gdb.exe
make
Make.exe
Make.exe
Make.exe
Download file
?
*.bin
*.hex.out-1 (tmote)
*.elf *.hex *.txt
downloader
tos-bsl
download-bsl
AVRGCC、ARMGCC和MSPGCC
IAR
ü application and library projects.
ü The Obj directory is the destination directory for the object files from the compiler and the assembler. These files have the extension r43 and will be used as input to the IAR XLINK Linker(<> P69)
嵌入式开发,C言语不可或缺。优异的编译器直如倚天屠龙。读书时,用过MSP430,编译器为IAR(盗版),code有2K约束。为此,曾攻读过专门以此器为布景的C言语书(蓝封面,北航社,忘其名)。此器,功用强大,调试便利,硬件寄存器皆有显现。窥430之门径,离Hello World之苦海,伴我几易寒暑,初踏嵌入式之地者,正是此器。
后,一向未曾用430。前些天,某使命要用。我重拾往日之事。IAR终为不完全盗版,破解太烦。懒,不肯做。放狗搜,见mspgcc,版本号:20081230。与gcc一脉传承,想必不错。试用几日,感觉这才是利器!

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/fangan/259048.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部