OpenOCD compile on Windows

來源:互聯網
上載者:User
OpenOCD compile on Windows

  • About Open On-Chip Debugger

The Open On-Chip Debugger (openocd) aims to provide debugging, in-system programming and boundary-scan testing for embedded target devices. The targets are interfaced using JTAG (IEEE 1149.1) compliant hardware, but this may be extended to other connection types in the future.

Openocd currently supports Wiggler (clones), FTDI FT2232 based JTAG interfaces, the Amontec JTAG Accelerator, and the Gateworks GW1602. It allows ARM7 (ARM7TDMI and ARM720t), ARM9 (ARM920t, ARM922t, ARM926ej-s, ARM966e-s), XScale (PXA27x,PXA25x, IXP42x) and Cortex-M3 (Luminary Stellaris LM3 and ST STM32) based cores to be debugged.

Flash writing is supported for external CFI compatible flashes (Intel and AMD/Spansion command set) and several internal flashes (LPC2000, AT91SAM7, STR7x, STR9x, LM3 and STM32x). Preliminary support for using the LPC3180's NAND flash controller is included.

This OpenFacts entry will try to document openocd's current state, and provide general information about the technology involved.


  1. 安裝cygwin
必須安裝的組件包括: gcc, autoconf, automake, M4, perl


  1. 下載openocd原始碼
The OpenOCD Wiki entries always document the latest version of OpenOCD. You can download the current SVN version with SVN client of your choice from the following repositories:
 svn://svn.berlios.de/openocd/trunk
or
http://svn.berlios.de/svnroot/repos/openocd/trunk
Using the SVN command line client, you could use the following command to fetch the latest version (make sure there is no (non-svn) directory called "openocd" in the current directory):svn checkout svn://svn.berlios.de/openocd/trunk


  1. 編譯openocd


  • ./bootstrap
Bootstrap generates the configure script, and prepares building on your system.


  • ./configure --enable-parport --enable-parport_giveio
Configure generates the Makefiles used to build OpenOCD.


  • make
Make builds the OpenOCD, and places the final executable in ./src/


  1. 可能出現的編譯錯誤及解決辦法:
  • 編譯parport.c時出錯:

parport.c:65:20: sys/io.h: No such file or directory

解決辦法:在parport.c中定義宏_WIN32,注意不能在config.h中定義這個宏,否則在編譯其他模組代碼時會出錯。


  • -DPKGLIBDIR 錯誤:

        src/target src/flash

gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/helper -I../../src/jtag -I../../src/target  -DPKGLIBDIR=/"/usr/local/lib/openocd/
"    -g -O2 -MT flash.o -MD -MP -MF .deps/flash.Tpo -c -o flash.o flash.c
gcc: no input files

解決辦法:由於gcc不識別DPKGLIBDIR造成,更改DPKGLIBDIR即可。


  • OPENOCD_VERSION宏的錯誤

gcc -DHAVE_CONFIG_H -I. -I.. -I../src/helper -I../src/jtag -I../src/target -I../src/xsvf -I../src/server -I../src/flash -I../
src/pld  -DPKGLIBDIR=/"/usr/local/lib/openocd/" -DPKGBLDDATE=/"`date +%F-%R`/" -DPKGBLDREV=/"`../guess-rev.sh`/"    -g -O2 -M
T openocd-openocd.o -MD -MP -MF .deps/openocd-openocd.Tpo -c -o openocd-openocd.o `test -f 'openocd.c' || echo './'`openocd.c

openocd.c: In function `handle_version_command':
openocd.c:55: error: missing terminating " character
openocd.c: In function `main':
openocd.c:93: error: missing terminating " character

解決辦法:更改-DPKGBLDREV=/"`../guess-rev.sh`/"即可。


  1. 運行
telnet localhost 4444



參考:
1.Building OpenOCD:http://openfacts.berlios.de/index-en.phtml?title=Building_OpenOCD
2.OpenOCD compile on Windows XP:http://forum.sparkfun.com/viewtopic.php?t=7743&highlight=xscale
3.parport issues: http://forum.sparkfun.com/viewtopic.php?t=3795

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.