特殊:Badtitle/NS100:OpenOCD:修订间差异
小 创建新页面为 '{{From|https://help.ubuntu.com/community/OpenOCD}} {{Languages|UbuntuHelp:OpenOCD}} <<Include(Tag/NeedsExpansion)>> == OpenOCD == == Introduction == OpenOCD provides [http://ope...' |
(没有差异)
|
2009年11月17日 (二) 20:16的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/OpenOCD }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/af | • {{#if: UbuntuHelp:OpenOCD|Afrikaans| [[::OpenOCD/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/ar | • {{#if: UbuntuHelp:OpenOCD|العربية| [[::OpenOCD/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/az | • {{#if: UbuntuHelp:OpenOCD|azərbaycanca| [[::OpenOCD/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/bcc | • {{#if: UbuntuHelp:OpenOCD|جهلسری بلوچی| [[::OpenOCD/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/bg | • {{#if: UbuntuHelp:OpenOCD|български| [[::OpenOCD/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/br | • {{#if: UbuntuHelp:OpenOCD|brezhoneg| [[::OpenOCD/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/ca | • {{#if: UbuntuHelp:OpenOCD|català| [[::OpenOCD/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/cs | • {{#if: UbuntuHelp:OpenOCD|čeština| [[::OpenOCD/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/de | • {{#if: UbuntuHelp:OpenOCD|Deutsch| [[::OpenOCD/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/el | • {{#if: UbuntuHelp:OpenOCD|Ελληνικά| [[::OpenOCD/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/es | • {{#if: UbuntuHelp:OpenOCD|español| [[::OpenOCD/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/fa | • {{#if: UbuntuHelp:OpenOCD|فارسی| [[::OpenOCD/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/fi | • {{#if: UbuntuHelp:OpenOCD|suomi| [[::OpenOCD/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/fr | • {{#if: UbuntuHelp:OpenOCD|français| [[::OpenOCD/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/gu | • {{#if: UbuntuHelp:OpenOCD|ગુજરાતી| [[::OpenOCD/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/he | • {{#if: UbuntuHelp:OpenOCD|עברית| [[::OpenOCD/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/hu | • {{#if: UbuntuHelp:OpenOCD|magyar| [[::OpenOCD/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/id | • {{#if: UbuntuHelp:OpenOCD|Bahasa Indonesia| [[::OpenOCD/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/it | • {{#if: UbuntuHelp:OpenOCD|italiano| [[::OpenOCD/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/ja | • {{#if: UbuntuHelp:OpenOCD|日本語| [[::OpenOCD/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/ko | • {{#if: UbuntuHelp:OpenOCD|한국어| [[::OpenOCD/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/ksh | • {{#if: UbuntuHelp:OpenOCD|Ripoarisch| [[::OpenOCD/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/mr | • {{#if: UbuntuHelp:OpenOCD|मराठी| [[::OpenOCD/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/ms | • {{#if: UbuntuHelp:OpenOCD|Bahasa Melayu| [[::OpenOCD/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/nl | • {{#if: UbuntuHelp:OpenOCD|Nederlands| [[::OpenOCD/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/no | • {{#if: UbuntuHelp:OpenOCD|norsk| [[::OpenOCD/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/oc | • {{#if: UbuntuHelp:OpenOCD|occitan| [[::OpenOCD/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/pl | • {{#if: UbuntuHelp:OpenOCD|polski| [[::OpenOCD/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/pt | • {{#if: UbuntuHelp:OpenOCD|português| [[::OpenOCD/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/ro | • {{#if: UbuntuHelp:OpenOCD|română| [[::OpenOCD/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/ru | • {{#if: UbuntuHelp:OpenOCD|русский| [[::OpenOCD/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/si | • {{#if: UbuntuHelp:OpenOCD|සිංහල| [[::OpenOCD/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/sq | • {{#if: UbuntuHelp:OpenOCD|shqip| [[::OpenOCD/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/sr | • {{#if: UbuntuHelp:OpenOCD|српски / srpski| [[::OpenOCD/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/sv | • {{#if: UbuntuHelp:OpenOCD|svenska| [[::OpenOCD/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/th | • {{#if: UbuntuHelp:OpenOCD|ไทย| [[::OpenOCD/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/tr | • {{#if: UbuntuHelp:OpenOCD|Türkçe| [[::OpenOCD/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/vi | • {{#if: UbuntuHelp:OpenOCD|Tiếng Việt| [[::OpenOCD/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/yue | • {{#if: UbuntuHelp:OpenOCD|粵語| [[::OpenOCD/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/zh | • {{#if: UbuntuHelp:OpenOCD|中文| [[::OpenOCD/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/zh-hans | • {{#if: UbuntuHelp:OpenOCD|中文(简体)| [[::OpenOCD/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:OpenOCD | UbuntuHelp:OpenOCD | {{#if: | :}}OpenOCD}}/zh-hant | • {{#if: UbuntuHelp:OpenOCD|中文(繁體)| [[::OpenOCD/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:OpenOCD|:OpenOCD|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :OpenOCD/zh | | {{#ifexist: OpenOCD/zh | | {{#ifeq: {{#titleparts:OpenOCD|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:OpenOCD|1|-1|}} | zh | | }}
<<Include(Tag/NeedsExpansion)>>
OpenOCD
Introduction
OpenOCD provides Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing
Installation Instructions
Look for the package named openocd in the Synaptic Package Manager and install it.
Usage examples
Using OpenOCD with Olimex ARM-USB-OCD and LPC-H2103
OpenOCD Setup
After installing OpenOCD package, you need to set permissions right. Create a file ""/etc/udev/rules.d/45-ft2232.rules"" with following contents:
BUS!="usb", ACTION!="add", SUBSYSTEM!=="usb_device", GOTO="kcontrol_rules_end" SYSFS{idProduct}=="0003", SYSFS{idVendor}=="15ba", MODE="664", GROUP="plugdev" LABEL="kcontrol_rules_end"
Then connect ARM-USB-OCD to the USB port. Check ""dmesg"" which should give approximately the following output:
[ 347.868034] usb 2-2: new full speed USB device using uhci_hcd and address 3 [ 348.172550] usb 2-2: configuration #1 chosen from 1 choice [ 348.360463] usbcore: registered new interface driver usbserial [ 348.360496] USB Serial support registered for generic [ 348.360556] usbcore: registered new interface driver usbserial_generic [ 348.360561] usbserial: USB Serial Driver core [ 348.525815] USB Serial support registered for FTDI USB Serial Device [ 348.526020] usb 2-2: Ignoring serial port reserved for JTAG [ 348.526109] ftdi_sio 2-2:1.1: FTDI USB Serial Device converter detected [ 348.526155] usb 2-2: Detected FT2232C [ 348.526250] usb 2-2: FTDI USB Serial Device converter now attached to ttyUSB0 [ 348.526277] usbcore: registered new interface driver ftdi_sio [ 348.526282] ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
Connect ARM-USB-OCD dongle to LPC-H2103 prototype board via JTAG cable. Power on LPC-H2103 board by giving 5 volts between Vin and gnd pins. Refer to board schematics for correct pins ( http://www.olimex.com/dev/pdf/lpc-h2103-pins.pdf ). The board should now have power led (red) on and the other led (green) blinking. Next you need to create a configuration file. More information here: http://openfacts.berlios.de/index-en.phtml?title=OpenOCD_configuration The file can be named for example openocd.cfg, and the contents of that file:
source [find interface/olimex-arm-usb-ocd.cfg] source [find target/sam7x256.cfg]
This configuration should automatically find the correct default configurations for the board and for the dongle. Start OpenOCD daemon with the following command:
openocd -f openocd.cfg TODO: Add output here
Test the setup by connecting to openocd daemon with telnet:
telnet localhost 4444 TODO: add some more stuff here
ARM development toolchain
As there currently is no package for gnuarm toolchain, probably the easiest way to install the toolchain is first download the binaries from GNU ARM site: http://www.gnuarm.com/files.html I chose GNU/Linux (x86) package called "binutils-2.15, gcc-3.4.3-c-c++-java, newlib-1.12.0, insight-6.1, TAR BZ2" [56.0MB] Save this file to some directory, e.g. /home/username/bin, and extract it there by right-clicking the package and selecting "Extract here". This results to a directory /home/username/bin/gnuarm-3.4.3. You may want to make a softlink to this directory:
ln -s /home/username/bin/gnuarm-3.4.3 /home/username/bin/arm
There is now a directory /home/username/bin/arm/bin which includes all gnu arm tools. This directory can be added to your path for easier access by adding the following to the end of /etc/profile:
# set PATH so it includes ARM cross-compiling tools if [ -d "/home/username/bin/arm/bin" ] ; then PATH="/home/username/bin/arm/bin:$PATH" fi
You may need to activate the change with
source /etc/profile
until the changes are made active. Finally, try out the toolchain by issuing a command:
user@machine:~$ arm-elf-gcc --version arm-elf-gcc (GCC) 3.4.3 Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
In case you want to compile the toolchain from sources, have a look at these sites: http://blog.nutaksas.com/2009/05/installing-gnuarm-arm-toolchain-on.html http://www.alphapogo.de/
Blinking led example
Todo: Blinking led code Todo: Compilation TODO: upload with openocd TODO: Running
Further Help and Documentation
Most of the instructions in this page are adopted from http://danielromaniuk.com/?q=node/19 OpenOCD website: http://openocd.berlios.de
Further Reading
SparkFun Electronics forum: http://forum.sparkfun.com/ Usage info: http://openfacts.berlios.de/index-en.phtml?title=Open%20On-Chip%20Debugger Good howto: http://www.sparkfun.com/tutorial/ARM/ARM_Cross_Development_with_Eclipse.pdf