Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Configuration OpenOCD + FT2232 under Ubuntu     - Hadoop 0.23 compile common errors (Server)

- Ubuntu Linux use MAC binding against ARP attacks (Linux)

- How to upgrade the kernel to 3.13.7 on Ubuntu / Linux Mint (Linux)

- JavaScript basic tools list (Programming)

- Graphics of Java Tools (Programming)

- MySQL master-slave database configuration and error handling Raiders (Database)

- Linux Getting Started tutorial: build your own Vim (Linux)

- Ubuntu GCC, G ++ and fortran Version Switch (Linux)

- Linux set to select the appropriate level of security of the network according to deployment (Linux)

- Linux Mint 17 set up the Ruby environment (Linux)

- Ubuntu Gitolite management Git Server code base permissions (Server)

- Ubuntu study notes and related problem solving (Linux)

- Mass data storage application of MongoDB database (Database)

- Java String and StringBuffer and StringBuilder Comments (Programming)

- Summary Linux operating system some tips to prevent attacks (Linux)

- [SHELL] MySQL primary recovery solution from + Keepalived online (Server)

- Getting case of Python Hello World (Programming)

- RHEL5 multipath configuration (Linux)

- Java string concatenation techniques (StringBuilder tips) (Programming)

- General Linux interface server parameter tuning (Server)

  Configuration OpenOCD + FT2232 under Ubuntu
  Add Date : 2016-07-14      
  Configuration OpenOCD + FT2232

1) confirm the debugger program
The debugger into your computer, lsusb a look:

Bus 003 Device 009: ID 1457: 5118 First International Computer, Inc. OpenMoko Neo1973 Debug board (V2 +)
dmesg a look:

[1223.230752] usb 3-12: new full-speed USB device number 7 using xhci_hcd
[1223.364173] usb 3-12: New USB device found, idVendor = 1457, idProduct = 5118
[1223.364181] usb 3-12: New USB device strings: Mfr = 1, Product = 2, SerialNumber = 0
[1223.364185] usb 3-12: Product: USB <=> JTAG & RS232
[1223.364188] usb 3-12: Manufacturer: www.100ask.net
[1223.366931] usb 3-12: Ignoring serial port reserved for JTAG
[1223.369248] ftdi_sio 3-12: 1.1: FTDI USB Serial Device converter detected
[1223.369341] usb 3-12: Detected FT2232C
[1223.369349] usb 3-12: Number of endpoints 2
[1223.369356] usb 3-12: Endpoint 1 MaxPacketSize 64
[1223.369362] usb 3-12: Endpoint 2 MaxPacketSize 64
[1223.369369] usb 3-12: Setting MaxPacketSize 64
[1223.369636] usb 3-12: FTDI USB Serial Device converter now attached to ttyUSB0
OK, recognized as FT2232C program, later to OPENOCD According to this configuration.

2) increase the udev rules to use normal user privileges to operate our debugger.

Plug openocd, dmesg a look:

As root create /etc/udev/rules.d/45-openjtag.rules (file name can be replaced by another), which reads as follows:

SYSFS {idProduct} == "5118", SYSFS {idVendor} == "1457", MODE = "666", GROUP = "plugdev"
After adding a rules file, re-plug the debugger effect.

3) Confirm JTAG line sequence, and connect the device with the debugger. The following are the OPENJTAG 100ask.com line sequence. May need to use an adapter plate or Dupont cable equipment and debuggers, EB-SAM9G45 need to use the built-in 20pin-10pin adapter board.

4) Install openocd.

[4.1] ubuntu 14.10 repository, the current version is 0.8 openocd. ubuntu 14.04 is 0.7.

apt-get install openocd
[4.2] Download Source Package installation

sourceforge page: http: //sourceforge.net/projects/openocd/
I downloaded the file openocd-0.8.0.tar.bz2, extract from the file:

aclocal.m4 config.sub Doxyfile.in missing NEWTAPS
ChangeLog configure.ac install-sh NEWS-0.3.0 README.Windows
common.mk contrib jimtcl NEWS-0.4.0 src
compile COPYING ltmain.sh NEWS-0.5.0 tcl
config.guess depcomp Makefile.am NEWS-0.6.0 TODO
config.h.in doc Makefile.in NEWS-0.7.0 tools
Dependent libraries:

apt-get install libusb-1.0-0-dev libftdi-dev
Compile and install, where to install the / opt / openocd under

./configure --enable-ftdi --prefix = / opt / openocd
sudo mkdir / opt / openocd
sudo chmod a + w opt / openocd
make install
[4.3] Get the latest development version via git:

git clone git: //git.code.sf.net/p/openocd/code openocd-code
The resulting files are:

AUTHORS configure.ac jimtcl NEWS-0.6.0 src
AUTHORS.ChangeLog contrib Makefile.am NEWS-0.7.0 tcl
bootstrap COPYING NEWS NEWS-0.8.0 testing
ChangeLog Doxyfile.in NEWS-0.3.0 README tools
common.mk guess-rev.sh NEWS-0.4.0 README.OSX uncrustify.cfg
config_subdir.m4 HACKING NEWS-0.5.0 README.Windows
Download sub-module, compile and install:

./configure --enable-ftdi --prefix = / opt / openocd
sudo mkdir / opt / openocd
sudo chmod a + w opt / openocd
make install
5) Configure openocd
[5.1] interface section profile path here is my ~ / .openocd / openjtag.cfg, reads as follows:

#openocd 0.8 ftdi default use the new interface if you want to use the old ft2232 interface, you need to specify when compiling openocd.
interface ftdi
# Description specified by the device, and dmesg should be consistent with the Product
#ftdi_device_desc "USB <=> JTAG & RS232"
# PID VID specified by the debugger, and more accurate than those described
ftdi_vid_pid 0x1457 0x5118
# If there are multiple similar debugger, the debugger can also specify a sequence number to be used

# Pin definitions, equivalent to older versions of ft2232_layout jtagkey
ftdi_layout_init 0x0c08 0x0f1b
ftdi_layout_signal nTRST -data 0x0100 -noe 0x0400
ftdi_layout_signal nSRST -data 0x0200 -noe 0x0800
At this point you can try to run the openocd, to check the connection and configuration:

1. Turn off the device,
2. Link devices, debugger, PC
3. Power on the device (because no processor, can only open a device for automatic detection)
4. Run openocd:

openocd -f ~ / .openocd / openjtag.cfg -c jtag_rclk 3000
The command, -f specify the configuration file can be specified as -f a.cfg -f b.cfg multiple configuration files;
-c executes a command, this is when the processor does not support RCLK, the clock used by the debugger.
openocd print as follows:

Open On-Chip Debugger 0.8.0 (2014-05-10-23: 20)
Licensed under GNU GPL v2
For bug reports, read
Info: only one transport option; autoselect 'jtag'
RCLK - adaptive
RCLK - adaptive
Info: RCLK (adaptive clock speed) not supported - fallback to 3000 kHz
Warn: There are no enabled taps AUTO PROBING MIGHT NOT WORK !!.
Warn: AUTO auto0.tap - use "jtag newtap auto0 tap -expected-id 0x0792603f ..."
Warn: AUTO auto0.tap - use "... -irlen 4"
Warn: gdb services need one or more targets defined
Here automatically detect a TAP (Test Access Ports, JTAG core devices on a chip may have multiple TAP) out, expected-id and expected (if openocd support the processor, you can read the configuration file, otherwise look same datasheet, etc.), which proves the JTAG interface is connected and configured correctly.
If it is like this print, check the JTAG line sequence, interface definition openocd configuration, the target board power supply:

Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway ...
Error: IR capture error at bit 0, saw 0x00 not 0x ... 3
Warn: Bypassing JTAG setup events due to errors
Warn: gdb services need one or more targets defined
I encountered was the case before the line sequence and ftdi_layout not right ......

[5.2] processor section.
openocd 0.8 already supports sam9g45, the configuration file for the target / at91sam9g45.cfg, the document cites at91sam9.cfg same directory. After finishing as follows:

# Try using equipment provided by the debug clock (RTCK pin), fails then the specified frequency (KHZ)
adapter_khz 3
# Reset Configuration
reset_config trst_and_srst separate trst_push_pull srst_open_drain
adapter_nsrst_delay 300
jtag_ntrst_delay 200

# About to give a name to add TAP configuration
set _CHIPNAME at91sam9g45
# Chip TAP identification ID, the entire AT91SAM9 series are using this TAP ID
set _CPUTAPID 0x0792603f
# Little-endian
set _ENDIAN little

# $ _CHIPNAME Name to create a new tap
jtag newtap $ _CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $ _CPUTAPID
# Define the target processor
target create $ _TARGETNAME arm926ejs -endian $ _ENDIAN -chain-position $ _TARGETNAME -variant arm926ejs

# SRAM built into the processor
$ _TARGETNAME Configure -work-area-phys 0x00300000 -work-area-size 0x200000 -work-area-backup 1
Try to run openocd:
1. Turn off the device,
2. Link devices, debugger, PC
3. Turn the machine
4. Run openocd:

openocd -f ~ / .openocd / openjtag.cfg -f target / at91sam9g45.cfg
target / at91sam9g45.cfg actually in / usr / share / openocd / scripts /, and where the default search path.
openocd print as follows:

Info: only one transport option; autoselect 'jtag'
RCLK - adaptive
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
adapter_nsrst_delay: 300
jtag_ntrst_delay: 200
adapter speed: 3 kHz
Info: clock speed 3 kHz
Info: JTAG tap: at91sam9g45.cpu tap / device found: 0x0792603f (mfg: 0x01f, part: 0x7926, ver: 0x0)
Info: Embedded ICE version 6
Info: at91sam9g45.cpu: hardware has 2 breakpoint / watchpoint units
He won the ICE version number, not being given.

5. Keep openocd run, to re-power the device. openocd on the device is powered on, is printed as follows:

Error: invalid mode value encountered 0
target state: halted
target halted in Thumb state due to debug-request, current mode: Thread
cpsr: 0x00000020 pc: 0xffffffee
MMU: disabled, D-Cache: disabled, I-Cache: disabled
If the results start openocd in case the device is powered down, printed as described in 5.1. At this point the device to power, openocd will print the above information, the same can demonstrate proper operation (under the debugger case of electricity, parked in the initial state).

[5.3] board section. This part can be defined on-board peripherals (such as NAND), the setting operation of some event occurs (such as a CPU Reset) after performing the like.
I made reference board / icnova_sam9g45_sodimm.cfg written.
board profiles usually referenced target section.
[5.4] telnet listening port settings.

#telnet listening port, default 4444. You can telnet command execution jtag, openocd document has jtag instruction interpretation.
#telnet_port 4444
[5.5] gdb listen port settings.

#gdbsever the TCP / IP listener port 3333. The default is set to disable, close gdbserver; pipe to standard input and output, which is the pipeline
#gdb_port 3333
transport select swd need to write in the interface ftdi, otherwise it will prompt

Error: Debug adapter does not support any transports?
0.8 version will do the following tips, you may only support a specific interface.

Info: only one transport option; autoselect 'jtag'
Error: session's transport is already selected.
0.9-dev version, you will be prompted:

Info: FTDI SWD mode enabled
Error: SWD mode is active but SWD_EN signal is not defined
in procedure 'init'
Next you need to set the signal pins on later research.
- Source code compiled by the installation program under Linux (Linux)
- MySQL Study of --Percona Server 5.5 Upgrade 5.6 (Database)
- IP Security Policy is to learn how to prevent Ping and closed ports (Linux)
- Cacti Linux-based system monitoring and alarm (Linux)
- Server Security Analysis attack on Linux (Linux)
- Linux (CentOS) directory file management and file system file compression packing (Linux)
- Java thread pool: ExecutorService, Executors (Programming)
- MySQL fuzzy query: LIKE and REGEXP pattern mode (Database)
- Linux kernel update error, update-initramfs: failed Solution (Linux)
- Linux smart small switch rfkill (Linux)
- Ubuntu install video conversion tool Selene (Linux)
- Security measures under Unix multi-user operating system (Linux)
- RHEL7 Apache MPM configuration (Server)
- Oracle 11g maintenance partitions - Adding Partitions (Database)
- Ubuntu amend resolv.conf restart failure problem (Linux)
- Linux boot the system does not display a progress bar setting method (Linux)
- Linux system started to learn: the Linux syslog (Linux)
- Java-based data source database access (Programming)
- CentOS directory structure Explanation (Linux)
- Depth Java Singleton (Programming)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.