<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > msp430幾種不同開發(fā)平臺(tái)的對(duì)比

          msp430幾種不同開發(fā)平臺(tái)的對(duì)比

          作者: 時(shí)間:2016-11-25 來(lái)源:網(wǎng)絡(luò) 收藏
          TinyOS (moteiv & mica)
          編輯器
          沒(méi)有特定的編輯器,記事本類似的都行,保證所編輯的源文件是“.nc”結(jié)尾的nesC程序。
          工程管理
          一個(gè)目錄即為一個(gè)工程,包括一個(gè)makefile檔和一個(gè)或多個(gè)“components”,組件有兩種:
          1. 配件(configuration):描述不同組件之間的關(guān)系;
          2. 模塊:(module):描述組件提供的接口中的函數(shù)功能的實(shí)驗(yàn)過(guò)程。
          開發(fā)環(huán)境
          在windows下安裝cygwin環(huán)境,并在cygwin下安裝TinyOS的開發(fā)工具包,其中包括
          avr-binutils, 二進(jìn)制代碼工具
          avr-gcc,
          avr-insight,
          avr-libc,
          nesC-1.1.2 nesC編譯器
          編譯、運(yùn)行和下載
          TinyOS支持多種硬件平臺(tái),每個(gè)硬件平臺(tái)在tos/platform有自己的目錄。
          在應(yīng)用程序的目錄里/app/Blink下輸入:
          make tmote //其中tmote代表的是平臺(tái)種類。如果target為pc,剛生成的main.exe可
          //用于GDB的調(diào)試。
          上面的語(yǔ)句實(shí)際上是按照當(dāng)前目錄的makefile文件運(yùn)行的,makefile檔中包含了編譯、連接等。具體的實(shí)現(xiàn)如下:
          1.ncc編譯鏈接: #ncc –o main.exe –target=tmote Blink.nc //編譯生成了main.exe,可以作
          //PC機(jī)上的模擬之用。
          2.轉(zhuǎn)換: #msp430-objcopy –output-target=ihex main.exe main.ihex //生成了main.ihex
          下載:運(yùn)行: #make tmote reinstall,1 //設(shè)置網(wǎng)絡(luò)地址為1
          其中運(yùn)行過(guò)程中主要的兩個(gè)命令如下:
          installing tmote bootloader using bsl ####安裝啟動(dòng)引導(dǎo)檔,根據(jù)開發(fā)板的不同而不同。
          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 #####安裝二進(jìn)制程序。ihex與ihex.out-1文件相同
          tos-bsl –telosb –c 7 –r –I –p build/tmote/main.ihex.out-1
          make過(guò)程分析
          其中提到的目錄說(shuō)明如下:(具體參照上面的圖)
          opt inyos-1.x oslib ----------------------------------------包括了用到的庫(kù)函數(shù).
          opt inyos-1.x osinterfaces----------------------------------包括接口函數(shù),
          opt inyos-1.x osplatform----------包括了不同硬件平臺(tái)間的配置文件.(啟動(dòng)引導(dǎo)檔在這里)
          opt inyos-1.x ossensorboards ------------------------------包括板載傳感器的具體實(shí)現(xiàn)
          可以看到所有的程序都是調(diào)用了同一個(gè)make規(guī)則,除了工程本身所在目錄的makefile文件與本工程相關(guān)外,在opt inyos-1.xapps目錄下的makerule文件是公用的,其中定義了選用的編譯器及硬件平臺(tái)的選擇。
          TinyOS操作系統(tǒng)設(shè)計(jì)思想
          1.輕量級(jí)線程技術(shù)(lightweight thread)
          2.主動(dòng)消息通信技術(shù)(active message)
          3.事件驅(qū)動(dòng)模塊(event driver)
          4.組件化編程(component-based programming)
          nesC語(yǔ)言把組件化/模塊化思想和基于事件驅(qū)動(dòng)的執(zhí)行模型結(jié)合起來(lái)。
          組件化:其中的組件即“Configuration”(配件)、“Module”。兩個(gè)東西就像零件一樣組合在一起。
          模塊化:
          MSPGCC
          編輯器
          可以配置一些IDE(集成開發(fā)環(huán)境),如VIM、UltraEdit、CodeBlocks等,其中VIM是命令行的,用起來(lái)很有感覺(jué),CodeBlocks是開源的,UltraEdit為商業(yè)軟件。但不管怎么樣,都是調(diào)用的mspgcc安裝程序里的make.exe,調(diào)試環(huán)境是msp430-insight
          工程管理
          用UltraEdit可以很好的管理工程文件,在工程目錄里面應(yīng)該有一個(gè)makefile檔,告訴make如何去生成所要的目錄文件和文件之間的依賴關(guān)系。同樣,用開源的CodeBlocks也可以自己搭建一個(gè)很好的IDE,鑒于對(duì)CodeBlocks都比較熟悉,即采用之!
          開發(fā)環(huán)境
          在windows下安裝mspgcc-2007021.exe,注意,這里最好是安裝最新版的,在之前我下載的是2003版的,又很多工具都不全,導(dǎo)致一個(gè)人摸索了好久。
          然后在CodeBlocks里的“settings”項(xiàng)里配置相關(guān)的compiler和debugger,最重要的部分是庫(kù)函數(shù)所在的目錄位置。
          編譯、運(yùn)行和下載
          編譯和鏈接部分基本上和相同,只是分別調(diào)用的是msp430-gcc.exe、msp430-ld.exe
          下載是通過(guò)msp430-downloader.exe來(lái)下載的。
          make過(guò)程分析
          下面是makefile文件的部分分析:
          ${NAME}.elf: ${OBJECTS} #######################msp430-gcc進(jìn)行編譯
          msp43o-gcc.exe -mmcu=${CPU} -o $@ ${OBJECTS} ####生成了 “*.elf”文件
          ${NAME}.a43: ${NAME}.elf ##################目標(biāo)文件進(jìn)行轉(zhuǎn)換
          msp430-objcopy -O ihex $^ $@ ##################將elf文件轉(zhuǎn)換為*.a43文件
          ${NAME}.lst: ${NAME}.elf ##################反匯編,生成*.lst文件,其中
          msp430-objdump -dSt $^ >$@ ##################這個(gè)文件包含了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一個(gè)瑞士開發(fā)的商用軟件的,價(jià)格好象在6500.00;目前個(gè)人感覺(jué)相比開源的MSPGCC也沒(méi)太大的優(yōu)勢(shì)。
          工程管理
          一個(gè)“.eww ”即為一個(gè)工程,
          開發(fā)調(diào)試環(huán)境
          編譯、運(yùn)行和下載
          編譯:調(diào)用“icc430.exe”編譯器和已經(jīng)設(shè)定好的一些參數(shù),包括指定的動(dòng)態(tài)庫(kù)文件,輸出文件所在的目錄,具體的代碼好下:
          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
          運(yùn)行上面的命令之后,在“..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.)
          鏈接:這里調(diào)用的是“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沒(méi)有給出很詳細(xì)的,
          總結(jié):
          下面是和IAR、Jennic及TinyOS平臺(tái)做的對(duì)比:
          開發(fā)工具包
          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
          鏈接器
          動(dòng)態(tài)庫(kù)的鏈接器
          xlink.exe
          ba-elf-ld.exe
          msp430-ld.exe
          靜態(tài)庫(kù)的鏈接器
          ?
          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)
          嵌入式開發(fā),C語(yǔ)言不可或缺。優(yōu)秀的編譯器直如倚天屠龍。讀書時(shí),用過(guò)MSP430,編譯器為IAR(盜版),code有2K限制。為此,曾攻讀過(guò)專門以此器為背景的C語(yǔ)言書(藍(lán)封面,北航社,忘其名)。此器,功能強(qiáng)大,調(diào)試方便,硬件寄存器皆有顯示。窺430之門徑,離Hello World之苦海,伴我?guī)滓缀?,初踏嵌入式之地者,正是此器?/div>
          后,一直未曾用430。前些天,某任務(wù)要用。我重拾往日之事。IAR終為不完全盜版,破解太煩。懶,不愿做。放狗搜,見(jiàn)mspgcc,版本號(hào):20081230。與gcc一脈傳承,想必不錯(cuò)。試用幾日,感覺(jué)這才是利器!
          上一頁(yè) 1 2 下一頁(yè)

          關(guān)鍵詞: msp430開發(fā)平

          評(píng)論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();