Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Configuration OpenOCD + FT2232 under Ubuntu     - SaltStack installation and testing (Server)

- C # Future: Method Contract (Programming)

- Xmanager Remote Desktop login CentOS 6.5 (Linux)

- Spark source code compiler package (Linux)

- Nginx-1.9.7 TCP reverse proxy (Server)

- Linux vi command list (Linux)

- Ubuntu users how to install the latest Nvidia graphics drivers (Linux)

- Install OpenGL development environment in Fedora and Ubuntu (Linux)

- Several back door and log tool under Linux (Linux)

- To install OwnCloud 7.0.4 under Ubuntu (Linux)

- Oracle 11g maintenance partitions - Adding Partitions (Database)

- Install Ubuntu Software Center App Grid (Linux)

- MySQL High Availability plan several options (Database)

- GCC and gfortran write MEX program (Matlab2012a) under Ubuntu 14.04 (Programming)

- Linux instructions and examples GPG encryption and decryption (Linux)

- Installation CD audio file extraction tool Flacon (Linux)

- The difference between vi and nano (Linux)

- Struts2 form of non-use component tags (Programming)

- map and hash_map STL containers (Programming)

- Linux Basics Tutorial: Linux Kickstart automated installation (Linux)

 
         
  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:

openocd-0.8.0:
aclocal.m4 config.sub Doxyfile.in missing NEWTAPS
AUTHORS config_subdir.m4 HACKING NEWS README
BUGS configure INSTALL NEWS-0.2.0 README.OSX
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
make
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:

openocd-code:
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
BUGS doc NEWS-0.2.0 NEWTAPS TODO
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:

./bootstrap
./configure --enable-ftdi --prefix = / opt / openocd
make
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
#ftdi_serial

# 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
    http://openocd.sourceforge.net/doc/doxygen/bugs.html
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
set _TARGETNAME $ _CHIPNAME.cpu
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
1
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
[SWD]
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
swd
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.
     
         
       
         
  More:      
 
- Fragment Android developers learning to resolve (Programming)
- Usage Linux device tree (Programming)
- shell script: a key to install LAMP, LNMP script (Server)
- Copy Recovery using RMAN repository development environment (Database)
- Using C / C ++ extensions Python (Programming)
- The difference between vi and nano (Linux)
- Ubuntu 14.04 Boot Repair (Linux)
- I use the desktop environment in GNU / Linux combination tool (Linux)
- Java logging performance of those things (Programming)
- Ubuntu install OpenMPI (Linux)
- To install and use Docker under linux (Server)
- Linux System Tutorial: How to browse the Linux command line, weather forecast (Linux)
- Linux file system data file deletion problem space is not freed (Database)
- How to install with JSON support in Ubuntu 15.04 SQLite 3.9.1 (Database)
- Achieve single backup of MySQL by innobackupex (Database)
- Empty password Linux operating system (Linux)
- Ubuntu install virtual machine software VirtualBox 4.3.10 (Linux)
- Oracle 10g after the failure to start the upgrade (Oracle instance terminated. Disconnection forced) (Database)
- Iptables in Ubuntu (Linux)
- Memory leak analysis using Android studio (Programming)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.