Home

OpenJTAG User Manual

image

Contents

1. T M D D C NC 20 to 8 wire adaptor board 20 pin male connector 4 i ui Y c 9 Pin Connector E ui 8 5 8 wire 5 lt cable co 9 oe lt gt Oo OpenJTAG Figure 2 6 20 to 8 wire adapter board with 8 wire cable 2 5 3 9 pin male connector OpenJTAG provides 9 pin male connector for future usage which includes I2C and SPI in SCLK MISO SCL GND SS MOSI SDA SPI 12 Figure 2 7 9 pin male connector OpenJTAG USER MANUAL www dynalith com 2 9 Chapter 2 Installation for PC Windows 2 10 www dynalith com OpenJTAG USER MANUAL sya Chapter 3 Getting started with OpenJTAG API This chapter addresses a quick tutorial of how to use OpenJTAG API to develop an application 3 1 Reading identification register JTAG test logic architecture contains a TAP Test Access Port a TAP controller an instruction register and a group of test data reg isters When TAP controller is in Test Logic Reset state the instruction register will be set to give the IDCODE or BYPASS depending on the implementation of the TAP controller Thus the IDCODE can be read by shifting the data register while staying at Shift DR state In other words the following sequence gets IDCODE from
2. 1 1 TAG SUDPPEPSL 1 1 Open 1 2 Related senserit sire qut I ttis rv Id eue 1 2 CHAPTER2 Installation for PC Windows 2 1 Prerequisites what to 2 1 ell Steps M 2 1 Softwareinstallation 2 1 Standard installation directory structure 2 2 Enviro ment variable 2 3 OpenJTAG software uninstallation ees 2 3 Device driver 2 4 Hardware connection 2 7 20 pin male connector for 2 7 20 to 8 wire adapter board 2 8 J pri TALS DOE e eir 2 9 CHAPTERS Getting started with OpenJTAG API ee 3 1 Reading identification feglslet sais patrem pes ris van EUREN exe sun id 3 1 Programming with Open LAG API 3 2 How to compile with Visual Studio 6 0 3 3 How to compile with GNU GCC 3 10 CHAPTER4 OpenJTAG API and Programming 4 1 Open T AU aio p eee Ee uta AVE 4 1 int oj init int config 1 int oj close void 1 int oj set speed float clk 1 Bitwise control TED aeo eta oio ter oem ter 4 2 int oj write unsigned int tall 2 int oj read unsigne
3. 13 Add library at Object library modules of Link tab which will be C OpenJTAG lib visualc 6 0 open_jtag lib 14 Then select OK button OpenJTAG USER MANUAL www dynalith com 3 7 Chapter 3 Getting started with OpenJTAG Project Settings Settings For Win32 Debug X General Debug C C Link Resources Bi J Source Files Category General tis Reset 8 main c i Header Files Output file name Resource Files Debug jtag_scan exe Object library modules SRE Cade CoA Kernel32 lib 1 Generate debug info Ignore all default libraries Link incrementally Generate mapfile Enable profiling Project Options kernel32 lib user32 lib gdi32 lib winspool lib comdlg32 lib advapi32 lib shell32 lib ole32 lib oleaut32 lib uuid lib odbc32 lib odbccp32 lib Select Rebuild All from Build menu to compile the code jtag_scan Microsoft Visual C File Edit View Insert Project Build Tools Window Build jtag_scan exe F7 Batch Build Workspace scar Clean 2 43 Source Files main c Header Files Execute jtag scan exe Ctrl F5 Resource Files Start Debug Debugger Remote Connection Set Active Configuration Configurations Profile 15 Select Execute jtag_scan exe from Build menu but do not forget to connect OpenJTAG to the your computer through
4. Reading identification register ingis What kind of Console Application do you want to create An empty project Asimple application A Hello World application C An application that supports cane Click OK button on the following window New Project Information Win32 Console Application will create a new skeleton project with the following specifications Empty console application No files will be created or added to the project Project Directory D WTMPHjtag scan Cancel 9 Specify the file OpenJTAG USER MANUAL www dynalith com 3 5 Chapter 3 Getting started with OpenJTAG jtag_scan Microsoft Visual C File Edit View Insert Project Build Tools Window Help 2 _ gt All global members v al xl 5 Workspace jtag scan 1 jtag scan files Header File Ne Folder Resource F Settings Add to Source Control IV Docking View Hide Rm Properties ClassView FileView xi 10 Select Settings from Project menu jtag_scan Microsoft Visual C File Edit View Insert Project Build Tools Window Help ug 4 Set Active Project Add To Project Globals Source Control 4 Workspace Dependencies jtag_scan mae
5. It is assumed that your BA12 Debug IF satisfy the followings If you are not sure about it please consult your IP provider or have a look at debug if defines v file JTAG TAP controller JTAG IDCODE 0x14951185 debug if HW version 3 Implementation version 0 www dynalith com OpenJTAG USER MANUAL Steps to setup synt Also your OpenRISC Debug IF satisfy the followings If you are not sure about it please consult your IP provider or have a look at dbg defines v file 5 3 Steps to setup JTAG TAP controller JTAG IDCODE BA12 1 5 Connect JTAG wires of OpenJTAG to the target board and make sure that JTAG TCK TMS TDI TDO VCC and GND are connected correctly Connect OpenJTAG to the debugging server computer through USB Run GDB server for BA12 and OpenJTAG which is oj ba12 in the OPENJTAG bin directory Run GDB debugger for BA12 which may be ba elf gdb in the OPENJTAG bin directory or the one you have in your cross compilation environment Then enjoy your BA12 and OpenJTAG OpenRISC 1 5 Connect JTAG wires of OpenJTAG to the target board and make sure that JTAG TCK TMS TDI VCC and GND are connected correctly Connect OpenJTAG to the debugging server computer through USB Run GDB server for OpenRISC and OpenJTAG which is or12 in the OPENJTAG bir directory Run GDB debugger for OpenRISC which may
6. Source Fi Export Makefile main c Insert Project into Workspace Header F j Resource Files 11 Select Preprocessor from C C tab 3 6 www dynalith com OpenJTAG USER MANUAL 5 Reading identification register ien Project Settings Settings For Win32 Debug Source Files 8 main c Header Files Resource Files Level 3 Code Generation Customize Listing Files Optimizations Precompiled Headers Preprocessor Warning ate browse info Program Database for Edit and Continue Preprocessor definitions WIN32 DEBUG CONSOLE MBCS Project Options inologo MLd GX 21 Od JD WIN32 JD DEBUG 0 _CONSOLE D MBCS IFp Debug jtag scan pch YX Fo Debug 12 Add OpenJTAG include directory at Additional include directo ries which will be C OpenJTAG include Project Settings Settings For Win32 Debug Debug C C Link Resources Bi jtag scan gt Source Files Category Preprocessor 8 main c Z3 Header Files Resource Files EM eset Preprocessor definitions WIN32 DEBUG CONSOLE MBCS Undefined symbols Undefine all symbols Additional include directories C WOpenJTAGHWinclude Ignore standard include paths Project Options inologo MLd GX 121 04 WIN32 JD DEBUG D _CONSOLE D MBCS IFp Debug jtag scan pch YX Fo Debug
7. 6 4 www dynalith com OpenJTAG USER MANUAL Debugger tab Debugger penlTAG Wbirfba ell adb exe Option command OpenJTAG gdb Catat Nill iis EMEN Debugger Command OpenJ TAG bintba elf gdb exe command OpenJTAG gdb GUI selection EE buttons Execute Figure 6 5 OpenJTAG Debugger tab 6 4 1 Debugger field This field specify which debugger program is used By selecting debugger selection button ready to run debugger can be selected or user s own debugger can be also selected Debugger Selection Debugger Choice Beyond BA12 debugger gi OpenRISC OR1200 debugger Figure 6 6 Ready to run debugger OpenJTAG USER MANUAL www dynalith com 6 5 Chapter 6 OpenJTAG GUI 6 4 2 Option field Debugger specific options can be provided through this field 6 4 3 Command field This field is filled automatically by the contents of debugger and option field 6 4 4 Execute file field This filed specify which program i e debuggee program to be debugged 6 4 5 Start and stop button When Start button is selected the specified debugger runs When Stop button is selected the specified debugger and its related processes are killed 6 5 Debugger GUI tab Through this tab debugger GUI i e DDD can be invoked Note that this GUI uses the debugger specified at Debugger tab and debuggee program specified at Debugger tab GUI pro
8. des 6 2 Scan DC VICE eT m 6 2 vicini PDT 6 3 Fost IP eldest ata icum diste 6 3 Socket POP eld ee dade oL Hae n iade bi du tms 6 3 Seryer TS 6 4 Stait and Stop DEOR der eec te 6 4 Debugger dr pee 6 4 Deb sser operates i nnda Fotos 6 5 Held 2 a dedita iin naue taller afi iEn 6 6 Command field 529 taa Qaa td e ot Mako edite 6 6 Executedile field oon e th etie a tea 6 6 Start anid stop button a paetos uude 6 6 Debugger GU beoag 6 6 GUI program field 6 6 Option Held aote ated tum 6 7 Command Heli tio ceti tue ota chest Mion ary ao 6 7 Start and stop Dutton nae 6 7 How to use Open TAG for BAT2 eec i tonto Ich rere dtt i tee 6 8 How to use OpenJTAG for OpenRISC s 6 9 lier eR E 1 iv www dynalith com OpenJTAG USER MANUAL OpenJTAG USER MANUAL www dynalith com List of Figures 1 1 OpenJ TAG structure tuse ede rate uer ue eue 1 1 software installation 2 2 Uminstall SOY M PH 2 4 OpenJTAG 20 pin male connector for JTAG 2 7 Conceptual schematic of OpenJTAG JTAG signals 2 8 OpenJTAG 8 wir
9. DOpenJTAG hardwaretteif 200 oj7 eif Figure 6 3 OpenJTAG Server tab 6 3 1 Host IP field This field specify which computer is used to run debugger server Current local host is selected automatically Note that OpenJTAG GUI should be run on the computer where debugger server is run 6 3 2 Socket Port field This field specify which socket port is used to debugger server 9999 is used by default Note that care should be taken when you change socket port num ber since some ports are already used for other services 1 EIF stands for Emulation Information File and is sort of hardware configura tion data OpenJTAG USER MANUAL www dynalith com 6 3 Chapter 6 OpenJTAG GUI 6 3 3 Server field This field specify which debugger server program is used By selecting sever selection button ready to run debugger server can be selected or user s own debugger server can be also selected Server Selection Server Choice Beyond BA12 server OpenRISC OR1200 server Figure 6 4 Ready to run debugger server list Beyond BA12 server L Note that the current version of Beyond BA12 server is optimized for a single JTAG tab OpenRISC OR1200 server 6 3 4 Start and stop button When Start button is selected the specified server runs When Stop button is selected the specified server and its related processes are killed 6 4 Debugger tab Through this tab debugger i e GDB can be invoked
10. OR1200 server from ready to run debug ger server list on Server tab Start on Server tab 9 Select OpenRISC OR1200 debugger from ready to run debugger list on Debugger tab 10 Start on Debugger tab DUE UE DP Now enjoy your debugging OpenJTAG USER MANUAL www dynalith com 6 9 Chapter 6 OpenJTAG GUI 6 10 www dynalith com OpenJTAG USER MANUAL Index Numerics 20 to 8 wire adapter board 8 wire cable 9 pin COMMECCOL B Boundary Scan BYPASS debug_if_defines v debugging host debugging server E Environment variable 2 3 G GDB debugger no GDB Setver e Ee eerie eres 3 1 5 2 5 3 P 3 3 4 4 J Joint Test Action Group See JTAG glo 1 1 jtag Nocalhost 9999 5 5 L libopen 3 10 4 4 localhost oj cycle oj cycle out cycle Wide iiec here irre 4 3 oj init oj read oset speed xcii res tere ae eS HER 4 1 OJ 4 2 open PAS 3 3 3 10 4 4 open jtag lib i retenti 3 3 3 7 4 4 2 3 1 1 S SOCket POTT endete enis 5 5 5 6 OpenJTAG USER MANUAL TAP controller
11. USB port and connect a JTAG port to the OpenJTAG 3 8 www dynalith com OpenJTAG USER MANUAL Reading identification register jtag_scan Microsoft Visual C File Edit Yiew Insert Project Build Tools Window jals 99 Build jtag_scan exe Batch Build Workspace scar Clean GR jtag scan files Source Files main c Start Debug Debugger Remote Connection Header Files Resource Files 2 External Depent Set Active Configuration Configurations Profile lt ClassView FileView jtag scan exe 6 error s 8 warning s Build Debug X Find in Files 1 3 Find in Files 2 s Create New Class X Deleting intermediate files and output files for project jtag scan Win32 Results 501 Debugging 11 Executes the program 16 When you see something like the following window you pro gram runs but the IDCODE value may differ since it reflect the JTAG device connected to your OpenJTAG D TMP jtag_scan Debug jtag_scan exe IDCODE 8x1414093 ress any key to continue OpenJTAG USER MANUAL www dynalith com 3 9 Chapter 3 Getting started with OpenJTAG 3 1 3 How to compile with GNU GCC There is nothing special to compile a program for OpenJTAG except for specifying where OpenJTAG header file open_jtag h locates and gi
12. and what to install OpenJTAG package consists of hardware and software The hardware is comprised of OpenJTAG 20 to 8 wire adapter board 8 wire cable and USB cable The software contains USB device driver and OpenJTAG API library In addition to this it may contains various debugger server programs depending on software package We the following should be prepared before install OpenJTAG Computer platform PC Windows XP Platform requirement Pentium IV or later with main memory of more than 512MByte and free hard disk space of more than 100Mbyte e Platform with USB 2 0 2 2 Installation steps Software installation should be done prior to hardware connection since device driver is required during hardware connection step 1 software installation step 2 device driver installation step 3 hardware connection 2 3 Software installation OpenJTAG software will be given one of several forms Download from Dynalith Systems web page i e http www dynalith com e USB memory stick or Compact Disk OpenJTAG hardware should be disconnected from the host com puter during the initial software installation OpenJTAG USER MANUAL www dynalith com 2 1 Chapter 2 Installation for PC Windows Installation will start by invoking installation software which will be something like OpenJUTAG_V1_1_BO1 exe Installing steps are so conventional that just follow the on screen instructions as
13. game controllers System devices Universal Serial Bus controllers Intel R 82801EB USB unica Host Controller 24D2 Intel R 82801EB USB Universal Host Controller 2404 Intel R 82801EB USB Universal Host Controller 24D7 Intel R 82801EB USB Universal Host Controller 24DE Intel R 82801EB USB2 Enhanced Host Controller 24DD USB Root Hub USB Root Hub USB Root Hub USB Root Hub USB Root Hub Windows invokes the Found New Hardware wizard each time the OpenJTAG is plugged into a different physical USB port for the first time Thus you should follow the above device driver installation procedure www dynalith com OpenJTAG USER MANUAL i dynalith Hardware connection eng 2 5 Hardware connection OpenJTAG provides two different connectors 20 pin male connector for JTAG 20 to 8 wire adapter 9 pin male connector for I2C and SPI this is not supported yet 2 5 1 20 pin male connector for JTAG There are five JTAG pins which are as follows nTRST i e TRSTn active low JTAG reset output in terms of OpenJTAG nTRST is not used for some cases TCK JTACK clock output in terms of OpenJTAG TMS JTAG mode set output in terms of OpenJTAG TDI JTAG data output in terms of OpenJTAG TDO JTAG data input in terms of OpenJTAG In addition to this three power pins and nine signal ground pins Vcc IN High level voltage input for JTAG signal Vsupply 3 3V High level voltage
14. output for external board Vsupply 5V High level voltage output for external board GND Signal ground pins It should be noted that VCC IN and GND should be connected to the target JTAG port 5 N _ 57 aa a 8 gt 0 E c gt 1 9 0000000000 9009099299090 Vsupply GND 3 3V 20 pin JTAG connector Figure 2 3 OpenJTAG 20 pin male connector for JTAG OpenJTAG USER MANUAL www dynalith com 2 7 Chapter 2 Installation for PC Windows 2 8 mor ERE TMS TDI VCC m a TDO 5V 3 3V OpenJTAG 20 pin male connector GND VCC IN gt nTRST lt gt 5 gt i D n gt TMS gt 2 c TDI 5 lt gt Vsupply 5V gt Vsupply 3 3V OpenJTAG Figure 2 4 Conceptual schematic of OpenJTAG JTAG signals 2 5 2 20 to 8 wire adapter board OpenJTAG also provides a 8 wire cable for a normal 6 pin JTAG connection 0 5 5 5 Q 9 Figure 2 5 OpenJTAG 8 wire cable www dynalith com OpenJTAG USER MANUAL i dynalith Hardware connection eng In order to use 8 wire cable with 20 pin male connector 20 to 8 wire adapter board is used
15. server Figure 6 9 Debugging environment with BA12 1 DUE UE DP Prepare debuggee program ie executable for BA12 using BA12 cross compiler Connect OpenJTAG to the target board through JTAG Connect OpenJTAG to the debugger server which is where OpenJTAG runs Invoke OpenJTAG on the debugger server Detect OpenJTAG on Diagnostic tab Scan Device on Diagnostic tab Select Beyond BA12 server from ready to run debugger server list on Server tab Start on Server tab Select Beyond BA12 debugger from ready to run debug ger list on Debugger tab 10 Start on Debugger tab Now enjoy your debugging www dynalith com OpenJTAG USER MANUAL m How to use OpenJTAG for OpenRISC 6 7 How to use OpenJTAG for OpenRISC It is quite easy to use OpenJTAG GUI for OpenRISC As shown in Figure 6 10 GDB server oj or12 and GDB debugger or32 uclinux gdb should be run along with OpenJTAG Debugging host Debugging server Figure 6 10 Debugging environment with OpenRISC 1 Prepare debuggee program i e executable for OpenRISC using OpenRISC cross compiler Connect OpenJTAG to the target board through JTAG Connect OpenJTAG to the debugger server which is where OpenJTAG runs Invoke OpenJTAG on the debugger server Detect OpenJTAG on Diagnostic tab Scan Device on Diagnostic tab Select OpenRISC
16. shown in Figure 2 1 The default installation direc tory will be C OpenJTAG but you can change if you want while installation Default installation directory is as follows For Windows XP C OpenJTAG f confirm installation OpenJTAG icon g install progress h install complete Figure 2 1 OpenJTAG software installation steps 2 3 1 Standard installation directory structure After installation OpenJTAG software builds its directory in the installation directory as given in Table 2 1 where installation direc tory will be C OpenJTAG by default 2 2 www dynalith com OpenJTAG USER MANUAL synt Software installation Table 2 1 OpenJTAG directory structure Directory Remarks bin programs doc manuals drv device driver example example programs hardware eif 200 for OpenJTAG 200 eif 400 for OpenJT AG 400 include headers lib gcc x y z library for GCC version x y x mingw a b c library for GCC version a b c on MinGW visualc 6 0 library for Visual Studio 6 0 resource GUI related resources On successful installation there will be an entry for OpenJTAG at Start 2 Programs menu as shown below 8 OpenJTAG uninstall Website When you allowed registration of short cut icon during installation the OpenJTAG icon will appear on the desktop as follows 2 3 2 Environment variable OpenJTAG installer registers OPENJTAG environment variable au
17. successfully OpenRISC GDB server for OpenRISC oj or12 will be found from OPEN JTAG bin directory and it should be run at the computer where OpenJTAG is connected The GDB server for OpenRISC oj or12 has various options and these options can be seen by running oj or12 with h option a open jtag specify which cable ICE is used d cid specify card ID of OpenJTAG e eif specify hardware configuration file of OpenJTAG h print help message O verbose mode on p port specify which port is used for this server Most of all a open_jtag should be used and come first place of options and other options can be committed since default value will work well The GDB server for OpenRISC support localhost connection only So p port should be use only socket port number Thus typical usage is as follows OPENJTAG bin oj orl2 a open jtag p 9999 www dynalith com OpenJTAG USER MANUAL Steps to setup CID The card ID is used to specify the OpenJTAG in the USB bus It can be 0 7 and 7 is default value The card ID is determined by the switch as shown below OpenJTAG Card ID CID switch 5 3 3 Run GDB debugger BA12 After the GDB server is running GDB can be invoked as follows ba elf gdb hello bal where ba elf gdb is GNU GDB for 12 and hello ba1 is the file name of executable after cross compiling When GDB comes up issues the following GDB comm
18. the Yes this time only and click Next Found New Hardware Wizard Welcome to the Found New Hardware Wizard Windows will search for current and updated software by looking on your computer on the hardware installation CD or on the Windows Update Web site with your permission Read our privacy policy Can Windows connect to Windows Update to search for software Yes this time only Yes now and every time connect a device nat this time Click Next to continue 4 Select Install from a list or specific location Advanced and click Next gt Found New Hardware Wizard This wizard helps you install software for WORY If your hardware came with an installation CD lt or floppy disk insert it now What do you want the wizard to do O Install the software automatically Recommended Install from a list or specific location Advanced Click Next to continue lt Back Next gt N Cancel 5 Specify the directory name where OpenJTAG device driver locates e g C OpenJTAG drv and click Next gt Found New Hardware Wizard Please choose your search and installation options om Y Search for the best driver in these locations Use the check boxes below to limit or expand the default search which includes local paths and removable media The best driver found will be installed Search removable media floppy CD ROM
19. v Include this location in the search CAWINSPIRE drv B v Browse Don t search will choose the driver to install Choose this option to select the device driver from a list Windows does not guarantee that the driver you choose will be the best match for your hardware ey 6 The hardware wizard will search for the device driver Note that you might encounter a warning message regarding Win OpenJTAG USER MANUAL www dynalith com 2 5 Chapter 2 Installation for PC Windows 2 6 dows Logo testing and just ignore it by clicking Continue Any way 7 Then the hardware wizard installs the OpenJTAG device driver 8 Finally the hardware wizard should report the completion of installation Found New Hardware Wizard Completing the Found New Hardware Wizard The wizard has finished installing the software for Dynalith Systems WORY Click Finish to close the wizard 9 After installation the device driver can be found from system hardware device manager i e Start gt Control Panel gt System gt Hardware gt Device Manager where a new entry of Dynalith Systems iVORY as one of Universal Serial Bus controllers will be found 2 Device Manager File Action View Help Mice and other pointing devices d Monitors Bg Network adapters Other devices X Ports COM amp LPT Processors SCSI and RAID controllers 9 Sound video and
20. 2007 Start of documentation by Ando Ki www dynalith com OpenJTAG USER MANUAL sya Introduction Chapter 1 1 1 What is OpenJTAG OpenJTAG provides an easy to use channel between application program and JTAG port i e Boundary Scan TAP Test Access Port where USB 2 0 is used as a physical channel Note In this document JTAG Joint Test Action Group and Boundary Scan are used interchangeably User application e g debugger SS OpenJTAG Figure 1 1 OpenJTAG 1 2 OpenJTAG structure OpenJTAG consists of hardware and software the hardware con nects a USB to the JTAG TAP and the software consists of device driver and API Device Driver User application e g debugger Boundary Scan TAP Figure 1 2 OpenJTAG structure OpenJTAG USER MANUAL www dynalith com 1 1 Chapter 1 Introduction 1 3 OpenJTAG environment Table 1 1 OpenJTAG environment Platform Windows XP Linux Programming environment Visual Studio 6 0 GNU GCC GNU GCC Supporting programs GNU GDB GNU GDB 1 4 Related documents IEEE Std 1149 1 2001 IEEE Standard Test Access Port and Boundary Scan Architecture Test Technology Standards Commit tee of the IEEE Computer Society 1 2 www dynalith com OpenJTAG USER MANUAL sya Chapter 2 Installation for PC Windows XP This chapter describes installation of the environment for the Open JTAG 2 1 Prerequisites
21. 2130 Loading section rodata size 0x14 Ima 0x2134 Start address 0x100 load size 628 Transfer rate 32205 bits sec 157 bytes write gdb OpenRISC After the GDB server is running GDB can be invoked as follows or32 uclinux gdb hello or32 where or32 uclinux gdb is GNU GDB for OpenRISC and hello or32 is the file name of executable after cross compiling When GDB comes up issues the following GDB commands gdb d jtag jtag localhost 9999 gdb lo gdb ue 0x100 gdb break main gdb continue Where target jtag jtag localhost 9999 command let GDB con nect to GDB server at this computer through socket port 9999 load command writes the given program in to the hardware memory set pc 0x100 command sets PC value to 0x100 break main command sets a break point at the beginning of main func tion continue command lets the OpenRISC processor start at the address specified by the PC 5 8 www dynalith com OpenJTAG USER MANUAL Steps to setup Cygwin Bash Shell of x adkit amp namu ba elf gdb hello bal GNU gdb 6 6 Copyright C 2006 Free Software Foundation Inc GDB is free software covered by the GNU General Public License and you are Welcome to change it and or distribute copies of it under certain conditions Type show copying to see the conditions There is absolutely no warranty for GDB Type show warranty for details This GDB was conf
22. JTAG TAP controller 1 Goto Test Logic Reset state Holding TMS at high during at lease five rising edges of TCK rasta TMS 1 1 1 1 1 TDI Don t pm TDO Nothing to a with it 2 Go to Shift DR state through Run Test Idle Select DR Scan Capture DR respectively OpenJTAG USER MANUAL www dynalith com 3 1 Chapter 3 Getting started with OpenJTAG Feeding 0010 bit sequence LSB first in to TMS in which TRSTn should be high and TDI is don t care TRSTn TCK 4 TMS 0 1 0 TDI Don t um TDO Nothing to do with it 3 Providing 32 rising edges of TCK while TMS stays low Feeding 0xOOFF bit sequence in to TDI which is invalid IDCODE in order to detect end of sequence TRSTn 8 jm TMS 0 0 0 lt lt TDi b m ine Yso b s E inst 3 1 1 Programming with OpenJTAG API OpenJTAG software library provides an API that controls TRSTn TMS TDI and TDO during a certain number of rising edge of TCK oj cycle unsigned int num unsigned int trstn unsigned int tms unsigned int tdi unsigned int tdo This oj cycle generates JTAG cycles specified by num which can be up to 32 Each JTAG cycle uses the value of trstn tms and tdi from i
23. OpenJTAG USER MANUAL Version 1 Revision 4 Dynalith Systems Co Ltd www dynalith com contact dynalith com July 2008 Copyright Copyright 2007 2008 Dynalith System Co Ltd All rights reserved No part of this publication may be reproduced or used in any form or by any means including graphic electronic or mechanical or by photocopy ing recording taping or information storage and retrieval systems without written permission of Dynalith System Co Ltd Trademarks Dynalith is registered trademark of Dynalith System Co Ltd The Dynalith logo iPROVE the iPROVE logo iProveBaseBoard iProveAppBoard BILA DPP iGnite RTL BILA RTL SCAN iTUTOR iNSPIRE iVORY OpenIDEA iNCITE iNCITE AVREM and OpenJTAG are trademarks of Dynalith System Co Ltd All other brand or product names may be trademarks or registered trademarks of their respective holders in system dynalith verification company Dynalith System Co Ltd 14 2 Yangjae dong Taejin Bldg 2F Seocho ku Seoul 137 888 Korea Dynalith Systems R amp D Center 335 Gwahangno 373 1 Kusong Dong Yusong Gu CHiPS B D KAIST Daejon 305 701 Korea Tel 82 2 556 0020 Fax 82 2 556 2252 E mail contact Dynalith com URL http www Dynalith com www dynalith com OpenJTAG USER MANUAL Table of Contents About this mantal ix CHAPTERI Introduction 1 1 Whatis Open
24. ands gdb target jtag jtag localhost 9999 gdb load gdb set pc 0x100 gdb break main gdb continue Where target jtag jtag localhost 9999 command let GDB con nect to GDB server at this computer through socket port 9999 load command writes the given program in to the hardware memory set pc 0x100 command sets PC value to 0x100 break main command sets a break point at the beginning of main func tion continue command lets the BA12 processor start at the address specified by the PC OpenJTAG USER MANUAL www dynalith com 5 7 Chapter 5 GDB Server Cygwin Bash Shell of x adk i namu ba elf gdb hello bal GNU gdb 6 6 Copyright C 2006 Free Software Foundation Inc GDB is free software covered by the GNU General Public License and you are Welcome to change it and or distribute copies of it under certain conditions Type show copying to see the conditions There is absolutely no warranty for GDB Type show warranty for details This GDB was configured as host i686 pc cygwin target ba elf gdb target jtag jtag localhost 9999 Remote ba debugging using jtag localhost 9999 Processor version BAl2 revision 20 configuration 4 Units present PIC TICK TIMER DEBUG 4 hw watchpoints available 0x00000000 in gdb load Loading section vectors size 0 12 Ima 0 0 Loading section text size 0 130 Ima 0 2000 Loading section sdata size 0x4 Ima 0x
25. be or32 uclinux gdb in the OPENJTAG bin directory or the one you have in your cross compilation environment Then enjoy your OpenRISC and OpenJTAG 5 3 1 OpenJTAG setup This step place OpenJTAG between the debugging server com puter and the target board OpenJTAG USER MANUAL www dynalith com 5 3 Chapter 5 GDB Server 1 Plug 8 wire cable 9 pin connector to 20 to 8 wire adapter board JTAG ADAPTER 20 to 8 wire adapter blue uj brown TMS mmu Too green Pi nite me 9 purple a D 2 ees 72 VCC me lt 2 Plug the 20 to 8 wire adapter board to 20 pin connector or OpenJTAG 20 to 8 wire EE adaptor board 20 pin male connector OpenJTAG JTAG ADAPTER _ 4a 8 wire cable 3 Plug wire of 8 wire cable to the JTAG port of the target board Red wire goes to VCC Black wire goes to GND Yellow wire goes to TCK Purple wire goes to TDO White wire goes to TDI Green wire goes to TMS OOOOOU 5 4 www dynalith com OpenJTAG USER MANUAL m Steps to setup 4 Connect OpenJTAG to the debugging server computer through USB USB connection 5 3 2 Run GDB server BA12 GDB server for BA12 oj ba12 will be found from OPENJTAG bin directory and it sho
26. d tall 2 Dit sequedee control ATI ug oe ei edt a tea einen eee 4 2 int oj cycle out unsigned int num unsigned int trstn unsigned int tms unsigned int tdi 2 int oj cycle unsigned num unsigned trstn unsigned tms unsigned tdi unsigned tdo int oj cycle wide unsigned int num unsigned int trstn unsigned int tms unsigned int tdi unsigned int tdo 3 Dit sequence control example 4 3 Programming with Open LAG part VER tr ipae 4 4 Open LAG header file iu 4 4 Open library fil P 4 4 OpenJTAG USER MANUAL www dynalith com Visual Studio 6 0 for Windows XP 4 GNU gcc for Linux 4 CELAPTEBS GOD SERV el vay uon Ue RUE uda 5 1 Introduction to overall environment 5 1 a 5 2 Steps tO SetU polpra enaga e E e Eria E EEA Ea E Eea 5 3 Open TAG Sebup qned etate a ARAE 5 3 R n GDB Serv CP 5 5 R n GDB debugger ounce inpet Ne od eH EHE 5 7 CHAPTER6 Open TAG CT gd achete teas 6 1 Open TAG GUP nenen dope ee vitse iv iie PR e I ie rin 6 1 Diagnostic oed o ione gave epe ea edad 6 2 Detect Open EAD PI EDS 6 2
27. e 2 8 20 to 8 wire adapter board with 8 wire 2 9 9 pin male nennen nnns 2 9 One cycle operation MERE 4 3 Holes clie ae ED 0 4 4 Debugging environment around 5 1 TAG Lay OUD 6 1 OpenJTAG Diagnostics 6 2 OpenJTAG Server Rc c 6 3 Ready to run debugger server list esses 6 4 Open TAG Debugger tab eraat proe 6 5 Ready to run debugger uscire 6 5 OpenJTAG Debugger 6 6 Ready to run debugger 6 7 Debugging environment with 12 6 8 Debugging environment with OpenRISC 6 9 vi www dynalith com OpenJTAG USER MANUAL List of Tables OpenJTAG environment OpenJTAG directory structure OpenJTAG USER MANUAL www dynalith com vii viii www dynalith com OpenJTAG USER MANUAL sya About this manual This manual is about OpenJTAG Typographical conventions The following typographical conventions are used in this manual Courier font indicates message
28. e found from OPENJTAG nclude directory 4 4 2 OpenJTAG library file OpenJTAG library is given at the following directories depending on platform and compilers Visual Studio 6 0 for Windows XP OPENJTAG lib visualc 6 0 open_jtag lib GNU gcc for Linux OPENJTAG ib gcc xx yy zz libopen jtag a where xx yy zz stands for GCC version 4 4 www dynalith com OpenJTAG USER MANUAL sya GDB Server This chapter describes how to use OpenJTAG for Beyond BA12 processor and OpenRISC processor debugger Chapter 5 For more information about Beyond BA12 processor OpenRISC processor and GNU debugger please refer to the following docu ments which are available from http www beyondsemi com http www opencores org and http www gnu org Beyond Architecture 1 Architecture Manual Beyond Semicon ductor March 21 2007 12 Processor User Manual Beyond Semiconductor Beyond Semiconductor Debug IF Beyond Semiconductor 2007 OpenRISC 1000 Architecture Manuel OPENCORES Novem ber 4 2005 Debugging with The GNU Source Level Debugger 9th Ed Free Software Foundation Inc 5 1 Introduction to overall environment There are four major components in the context of debugging soft ware along with actual hardware board as shown in Figure 5 1 Socket JTAG RUM processor GDB Debugger GDB Server unit memories peripherals OpenJTAG JTAG Target Board S Debugging host Debugging ser
29. gram OpenJTAGbinWddd exe Option debugger OpenJ TAG ft bint ba elf adb exe command 0 penJTAG adb display Debugger Command OpenJ TAG debugger OpenJ TAG W bintba elf gdb exe comr m Figure 6 7 OpenJTAG Debugger GUI tab 6 5 1 GUI program field This field specify which debugger GUI program is used 6 6 www dynalith com OpenJTAG USER MANUAL Debugger GUI tab By selection debugger GUI selection button ready to run debugger GUI can be selected or user s own debugger GUI can be also selected Debugger GUI Selection Debugger GUI Choice DDD Data Display Debugger Figure 6 8 Ready to run debugger GUI 6 5 2 Option field Debugger GUI specific options can be provided through this field 6 5 3 Command field This field is filled automatically by the contents of debugger and option field 6 5 4 Start and stop button When Start button is selected the specified GUI runs When Stop button is selected the specified GUI and its related processes are killed OpenJTAG USER MANUAL www dynalith com 6 7 Chapter 6 OpenJTAG GUI 6 6 How to use OpenJTAG for BA12 It is quite easy to use OpenJTAG GUI for BA12 As shown in Fig ure 6 9 GDB server 12 and GDB debugger ba elf gdb should be run along with OpenJTAG ce GDB Debugger Socket GDB Server ba elf gdb 0j ba12 Debugging host Debugging
30. igured as host i686 pc cygwin target ba elf gdb target jtag jtag localhost 9999 Remote ba debugging using jtag localhost 9999 Processor version BAl2 revision 20 configuration 4 Units present PIC TICK TIMER DEBUG 4 hw watchpoints available 0x00000000 in gdb load Loading section vectors size 0 12 Ima 0x0 Loading section text size 0x130 Ima 0 2000 Loading section sdata size 0x4 Ima 0x2130 Loading section rodata size 0x14 Ima 0x2134 Start address 0x100 load size 628 Transfer rate 32205 bits sec 157 bytes write gdb OpenJTAG USER MANUAL www dynalith com 5 9 Chapter 5 GDB Server 5 10 www dynalith com OpenJTAG USER MANUAL sya OpenJTAG GUI This chapter describes how to use OpenJTAG GUI Chapter 6 6 1 OpenJTAG GUI OpenJTAG GUI consists of four major parts as shown in Figure 6 1 Shortcut OpenJTAG Launcher Dynalith Systems buttons Device list window Session tabs OpenJTAG CID v Detect OpenJTAG EIF Download EIF File Download EIF File Execution log window Figure 6 1 OpenJTAG GUI Layout Shortcut buttons buttons as shortcuts to access to frequently used functions Device list window display JIAG device list after Scan Device Session tabs OpenJTAG USER MANUAL www dynalith com 6 1 Chapter 6 OpenJTAG GUI Execution log window display execution resu
31. le your program for OpenJTAG are two things is specifying where OpenJTAG header file locates which will be C OpenJTAG include and the other is specifying OpenJTAG library file which is C OpenJTAG lib visualc 6 0 open_jtag lib 1 Invoke Microsoft Visual C studio 6 0 2 Select New from File menu OpenJTAG USER MANUAL www dynalith com 3 3 Chapter 3 Getting started with OpenJTAG Microsoft Visual C File Edit Yiew Insert Project Build Tools Window Help BAR Open rl al xi Uo Open Workspace Select Win32 Console Application Specify Project as jtag_scan or whatever you like Select Location where the main file locates for example C OpenJTAG example jtag_scan 6 Then click OK button 9d n Files Projects Workspaces Other Documents ej ATL COM AppWizard Project name Cluster Resource Type Wizard AppWizard Database Project det Add in Wizard Location jtag scan Extended Stored Proc Wizard D MTMPHjtag scan ISAPI Extension Wizard Makefile MFC ActiveX ControlWizard AppWizard dll Create new workspace AppWizard exe C Add X New Database Wizard irrent workspace Win32 Dynamic Link Library 38 Win32 Static Library Platforms iv Win32 Cancel 7 Select An empty project 8 Then click Finish button 3 4 www dynalith com OpenJTAG USER MANUAL
32. lts 6 2 Diagnostic tab Through this tab various functions can be done including Open JTAG hardware detection JTAG device detection and so on Diagnostics OpenITAG CID 08 Detect penJTAG CEIF Download EIF Fie Scan Device Download EIF File Figure 6 2 OpenJTAG Diagnostics tab 6 2 1 Detect OpenJTAG When Detect OpenJTAG button is selected USB is scanned and displays OpenJTAG hardware if any 6 2 2 Diagnostics When Diagnostics button is selected the detected OpenJTAG hardware is tested When EIF Download box is checked the specified EIF is down loaded before diagnostics is carried out For normal case it is not necessary 6 2 3 Scan Device When Scan Device button is selected JTAG device is scanned and the results is displayed at Device List window 1 EIF stands for Emulation Information File and is sort of hardware configura tion data 6 2 www dynalith com OpenJTAG USER MANUAL s d lith Server tab When EIF Download box is checked the specified EIF is down loaded before diagnostics is carried out For normal case it is not necessary 6 3 Server tab Through this tab debugger server i e GDB Server can be invoked Host IP 147 Socket Port 9999 Server selection CEIF Download buttons EIF File Option hardwareff eit 200 f oj7 eif Command
33. rol over all JTAG signals including TCK int oj write unsigned int tall oj write updates all JTAG output pins given by tall argument which contains TRSTn TCK TMS TDI don t care For example oj write 0x12 updates as follows TRSTn 1 0 TMS 1 01 0 TDO not affected int oj read unsigned int tall read gets value of all JTAG pins For example oj_read amp tall call after oj write 0x12 will return 0x12 or 0x13 at tall variable depending on the value of TDO 4 3 Bit sequence control API int oj cycle out unsigned int num unsigned int trstn unsigned int tms unsigned int tdi oj cycle out generates a number of JTAG cycles specified by num where TRSTn TMS and TDI pins are driven by the values given at the arguments It only outputs and does not get value of TDO The number of cycle can be 32 at most Values given at the arguments are driven at JTAG pins Isb least significant bit first int oj cycle unsigned num unsigned trstn unsigned tms unsigned tdi unsigned oj cycle generates a number of JTAG cycles specified by num where TRSTn TMS and TDI pins are driven by the values given at 4 2 www dynalith com OpenJTAG USER MANUAL Bit sequence control the arguments After completion bit sequence is stored at the argument tdo The number of cycle can be 32 at most Values given at the argumen
34. s prompts and program files that the system displays It also indicates literal commands that you enter in a syntactical statement However braces in Courier are not literal and square brackets in Courier are literal only in the case of bus specifications such as bus 7 0 Courier also indicates commands that you select from a menu File Open Italic font denotes the following items Variable in a syntax statement for which you must sup ply values Emphasis within text Square brackets indicate optional entry or parameter However in bus specifications such as bus 7 0 they are man datory Braces enclose a list of items from which you must choose one or more type reset clock VDD VSS A vertical bar separates items in a list of the choice type reset clock VDD VSS Signal name conventions Use square bracket for bus signals such as ADDR 7 0 Use postfix b or for active low signals such as RESETb Technical Support For technical support go to www dynalith com or send e mail to contact dynalith com OpenJTAG USER MANUAL www dynalith com ix Revision history The following shows the revision history of this manual July 18 2008 Version 1 Revision 4 by K S Jeon June 19 2008 Version 1 Revision 3 by 5 Jeon Feb 18 2008 Version 1 Revision 2 by Ando Ki and 5 Jeon Jan 5 2008 Version 1 Revision 1 by Ando Ki Oct 18
35. target board user tei Pat Test Access Port See TAP www dynalith com 2 www dynalith com OpenJTAG USER MANUAL
36. tomatically and it directs where OpenJTAG is installed Thus will be C OpenJTAG by default 2 3 3 OpenJTAG software uninstallation To remove OpenJTAG software products from your system use the Dynalith Systems un installation program Follow this proce dure 1 Quit OpenJTAG before trying to un install it OpenJTAG USER MANUAL www dynalith com 2 3 Chapter 2 Installation for PC Windows 2 Start the un installer Click the Start button of Windows select Programs menu and move the cursor over the OpenJTAG entry On the application menu that appears click the entry for the un installer as shown in Figure 2 2 Uninstall Figure 2 2 Uninstall entry 2 4 Device driver installation After installing OpenJTAG software the first time the OpenJTAG is attached Windows invokes the Found New Hardware wizard As the OpenJTAG and the host computer are connected each other through USB the host computer requires USB device driver for the OpenJTAG hardware The device driver for the OpenJTAG resides in drv directory under the OpenJTAG installation directory e g C OpenJTAG drv and it contains the following ivory inf ivory sys To install the OpenJTAG USB device driver 1 Connect the OpenJTAG hardware to the host computer through the USB cable 2 The hardware wizard will be invoked 2 4 www dynalith com OpenJTAG USER MANUAL synt Device driver installation 3 Select
37. ts Isb least significant bit After completion tdo con tains TDO values Thus the IDCODE can be read by calling the following calls cycle b OXFFFFFFFF amp tdo oj cycle 4 OXFFFFFFFF 0x02 0x0 amp tdo oj cycle 32 OXFFFFFFFF 0x00 OxFF amp tdo 3 2 www dynalith com OpenJTAG USER MANUAL s Reading identification register issu In addition to these there are two API which should be called in order to use OpenJTAG oj init int config oj close The oj init takes care of preparing necessary things for Open JTAG and the oj close cleans up before closing OpenJTAG Thus the program can be as follows include lt stdio h gt include open_jtag h int main int argc char argv unsigned int tdo if oj init 0 return 1 oj cycle b OXFFFFFFFF Ox1F amp tdo cycle 4 OXFFFFFFFF 0x02 amp tdo oj cycle 32 OXFFFFFFFF 0x00 OxFF amp tdo printf IDCODE 0x x n tdo oj close return 0 Where open jtag h is a header file locates at OpenJTAG include directory where OpenJTAG stands for the installation directory say C OpenJTAG for Windows case Note that this example is available at OpenJTAG example jtag_scan directory 3 1 2 How to compile with Visual Studio 6 0 It is assumed you have created the file containing the above main function at D tmp jtag_scan directory What to do to compi
38. ts are driven at JTAG pins Isb first and the first value at the TDO pins is stored at the Isb bit of tdo int oj cycle wide unsigned int num unsigned int trstn unsigned int tms unsigned int tdi unsigned int tdo cycle wide is the same as the cycle but the number of bit sequence can be up to 128 To support wider than 32 bit each argument is given by array pointer and the array should be larger than 4 Values given at the arguments are driven at JTAG pins Isb first and the first value at the TDO pins is stored at the Isb bit of tdo 4 3 1 Bit sequence control example oj cycle 1 trstn tms tdi amp tdo generates JTAG signal as shown in Figure 4 1 TCK ANY TRST Wow TMS is TDI BINE reg Figure 4 1 One cycle operation TRSTn TMS and TDI are driven when TCK goes low Then TCK goes high and TDO is read oj cycle n trstn tms tdi amp tdo generates JTAG signal as shown in Figure 4 2 OpenJTAG USER MANUAL www dynalith com 4 3 Chapter 4 OpenJTAG API and Programming TCK 1 2 3 1 TRST E yr Yin rn TMS Mna N Mmi TDI jo ist yin ye I Yeni mo Wow Yel We TDO reg Isb yn We XS Mn Figure 4 2 Multi cycle operation 4 4 Programming with OpenJTAG API 4 4 1 OpenJTAG header file OpenJTAG API is defined at open jtag h which will b
39. uld be run at the computer where Open JTAG is connected The GDB server for BA12 oj ba12 has various options and these options can be seen by running oj ba12 with h option a open jtag specify which cable ICE is used d cid specify card ID of OpenJTAG e eif specify hardware configuration file of OpenJTAG h print help message O verbose mode on p url specify which computer is used for this server Most of all a open jtag should be used and come first place of options and other options can be committed since default value will work well The GDB server computer is specified by p option with the value of IP address and socket port number It s default value is jtag localhost 9999 where localhost stands for this computer and 9999 is socket port number Thus typical usage is as follows OPENJTAG bin oj bal2 a open p jtag local host 9999 OpenJTAG USER MANUAL www dynalith com 5 5 Chapter 5 GDB Server 5 6 The following shows a message after running 12 BA12 GDB server Cygwin Bash Shell of x adki namu oj bal2 exe a open_jtag p jtag localhost 9999 Connected to OpenJTAG through USB with CID 7 JTAG chain length 1 Found device 0 IDCODE 014951185 to have a debug if connected to it HW version 3 Implementation version 0 Remote orik debugging using jtag localhost 9999 JTAG Proxy server started at jtag localhost 9999 Server started
40. ver Figure 5 1 Debugging environment around OpenJTAG Target board contains processor memory and other peripher als where the processor should have a proper hardware debugger unit with JTAG port OpenJTAG USER MANUAL www dynalith com 5 1 Chapter 5 GDB Server QOpenJTAG connects debugger program and the debugger unit in the processor through USB and JTAG GDB server running on the debugging server deals with requests from source level debugger for the OpenJTAG e GDB debugger running on the debugging host debugs the pro gram run by the processor GDB server and GDB debugger can be run on different computers over Ethernet but these two run on the same computer in most cases For the case of BA12 the GDB debugger will be ba elf gdb which is a GNU GDB ported for BA12 processor and the GDB server will be oj ba12 which is a version for For the case of OpenRISC the GDB debugger will be or32 uclinux gdb which is a GNU GDB ported for OpenRISC processor and the GDB server will be oj or12 which is a version for Open JTAG 5 2 Prerequisite It is assumed that the followings are ready to use in your environ ment 1 12 cross compilation environment GNU GCC for BA12 GNU GDB for BA12 1 OpenRISC cross compilation environment GNU GCC for OpenRISC GNU GDB for OpenRISC 2 OpenJTAG software For installation of OpenJTAG software please refer to Chapter 2 Installation
41. ving OpenJTAG library libopen_jtag a file To be added 3 10 www dynalith com OpenJTAG USER MANUAL sya OpenJTAG API and Programming This chapter addresses application programming interface func tions for OpenJTAG Chapter 4 There are three groups of API bit wise control group bit sequence control group and OpenJTAG control group The bit wise control group API reads and writes JTAG pins while the bit sequence control group API generates and receive a num ber of bit sequence of JTAG pins The OpenJTAG control group API provides metallization and cleanup process 4 1 OpenJTAG control API int oj init int config oj init prepares all necessary things to use OpenJTAG so that it should be called before any API calls When the argument is given as 1 the OpenJTAG hardware is initialized When the argument is given as 0 the OpenJTAG hardware are used without additional initialization int oj close void oj close cleans up before terminating the application program so that it is recommended to call this call before end the program int oj set speedf float clk set speed sets JTAG signal speed in terms of Mhz For example when the argument is given as 16 0 OpenJTAG will generates TCK at 16Mhz speed The maximum speed will be 16Mhz OpenJTAG USER MANUAL www dynalith com 4 1 Chapter 4 OpenJTAG API and Programming 4 2 Bit wise control API This API enables bit by bit cont

Download Pdf Manuals

image

Related Search

Related Contents

NOUVEAUTÉS Notre sélection DVD du mois INTERVIEW Philippe  ISD handbook - Motor Technology Ltd    Samsung 19"-os, LED-es üzleti monitor fejlett ergonómiával Felhasználói kézikönyv  honestech™ VHS to DVD™ 5.0  carbureted evo press flywheel kits  IT - Parlamento Italiano  User manual - PH Systems b.v.b.a.  BOSTIK AGOPLAC DI LIQUIDE  Canon L2000  

Copyright © All rights reserved.
Failed to retrieve file