INC. Users Guide Version 2.0 SB-USB2 Emulator
Table of Contents 1 INTRODUCTION... 3 1.1 Features... 3 1.2 Package Contents... 4 1.3 Related Components... 4 2 INSTALLATION... 4 3 INTEGRATION WITH LSI LOGIC S TOOLS... 5 3.1 Command Line Parameters... 5 3.2 MDI Commands... 6 3.3 LSI Logic s ZSP IDE... 7 3.4 Sample Debug Session... 10 4 BOXVIEW IDE... 12 4.1 Sample BoxView IDE Debug Session... 13 5 BOXVIEW DEBUGGER... 16 5.1 Sample Debug Session... 17 6 ZSP500 INITIALIZATION WITHOUT MONITOR CODE... 21 6.1 LSI Logic s ZSP IDE... 21 6.2 Steps Using ZDBUG... 22 6.3 Steps Using BoxView s Graphical User Interface (GUI)... 24 2 SB-USB2 Users Guide (2.0)
1 Introduction The SB-USB2 emulator enables efficient and productive embedded software debugging. This compact and portable probe utilizes the JTAG interfaces for debug and in-circuit testing supplied with the LSI Logic ZSP cores. It integrates well with both LSI Logic's ZSP SDK debuggers and Domain Technologies' BoxView IDE, allowing for the maximum amount of flexibility in choosing a debugging front-end. The emulator supports unlimited software breakpoints within all ranges of program memory implemented in RAM. When used with Domain Technologies BoxView, the ZSP-USB-JTAG supports multi-core and multi-user debugging on a network over a TCP/IP connection, as well as JTAG boundary scan operations such as testing and flash memory programming. 1.1 Features The SB-USB2 has the following features: Powered by USB port JTAG interface Logic Levels: 3.3V, 2.5V, 1.8V TCK: 32kHz - 10MHz Integrates with: o BoxView IDE o ZSP-ARM Development System o BoxView o ZSP IDE o ZSP Console GDB SB-USB2 Installation Guide (2.0) 3
1.2 Package Contents The SB-USB2 ships with the following: Emulator USB cable Drivers for MS Windows Installation Guide 1.3 Related Components The following items are suggested for use with your SB-USB2 emulator: BoxView Integrated Development Environment (IDE) ZSP-ARM Development System The following documents may be helpful for review when using your emulator: BoxView IDE Users Guide For more information contact Domain Technologies or see www.domaintech.com. 2 Installation Included with the SB-USB2 emulator is a 6-ft. USB cable, 24 pin to 10/14 pin ribbon cable and an installation CD. Verify all have been delivered with the emulator. The installation CD contains a number of executables and DLLs; these enable the SB-USB2 emulator to operate with both Domain Technologies BoxView debugger and LSI Logic s ZSP development tools. In addition, the CD contains BoxView help files, sample code for ZSP400 and ZSP500, and the JTAG BSDL files. The software installation should be executed before connecting USB emulator to the system. The installation procedure provides information about location of the USB drivers, so Windows can find them automatically. Insert the installation CD into your CD ROM drive. If auto detect is enabled in your system environment setup, then the installation program will automatically launch. Otherwise, double-click the DtiZspInstall.exe file located on the CD drive from within Windows Explorer. Follow the steps through the installation program to perform a complete or partial install of the SB- USB2 supporting software. 4 SB-USB2 Users Guide (2.0)
3 Integration with LSI Logic s Tools The SB-USB2 JTAG emulator can be used with either Domain Technologies BoxView Debugger or with LSI Logic s Debugging tools. To properly activate the debug interface, the appropriate command line parameters must be specified when using either LSI Logic s SDBUG400.EXE or ZDBUG.EXE. The initial JTAG TCK operating frequency can be set with the MDI command, after the debugger is started, and before the target processor is stopped with the TARGET JTAG command. SB-USB2 provides three different VCC levels for different target types. The output voltage can be changed with the MDI command, but since the driver is trying to detect connected devices during program initialization, VCC level should be set through the environment variable before program is started: SET SBUSB2_VCC=level Where level can be 33, 25 or 18 for output levels of 3.3V, 2.5V or 1.8V. For the 5V targets - 3.3V configuration can be used. 3.1 Command Line Parameters The following command line parameters are supported with both SDBUG400.EXE and ZDBUG.EXE: Parameter --mdi_library=mdisbusb2 --mdi_library= mdiserver Description Direct (non-tcp/ip) connection to the emulator. Provides a universal interface that detects the target ZSP type by the value of the JTAG s IDCODE or by measuring the length of the EX JTAG register. TCP/IP connection to the emulator For direct (non-tcp/ip) connection to the SB-USB2 JTAG emulator the following command line parameter should be used: --mdi_library=mdizsbusb2 SB-USB2 Installation Guide (2.0) 5
For a remote TCP/IP connection to the SB-USB2 JTAG emulator, the IP address of the remote computer must be stored in the environment variable EMU_SERVER. Use the following option to indicate a remote connection: --mdi_library=mdiserver To set the environment variable EMU_SERVER, execute the following command from a DOS window: set EMU_SERVER=server_address where server_address can be any format recognized by the operating system. Optionally, the environment variable can also be set by using the System Properties Window found in Microsoft s Control Panel; through the Advanced Tab, environment variables can be created and modified. The target access can fail in case of invalid version of the monitor code in the evaluation board s flash memory. A Flash update is possible with the Boundary Scan Programming procedure described at: http://www.domaintec.com/zspflash.html 3.2 MDI Commands The following MDI commands are supported after the target board is initialized through SDBUG400.EXE or ZDBUG.EXE: MDI Command bvlog [filename] bvlog off dis_ice en_ice fastdrupdate [val] Description Enables detailed logging feature which could be used to document a problem with the SB-USB2 JTAG emulator Disable detailed logging feature Disable hardware emulation mode Enable hardware emulation mode Enables fast transition through the JTAG s UpdateDr state, during issuing the ADI request (stop in software emulation mode). With this feature enabled, the SB-USB2 JTAG will issue 8 clocks with TMS set high, causing the JTAG state machine to go from Pause-DR, through Update-DR, to TestLogic/Reset, and then to RunTest/Idle. The default TCK frequency for the above operation is 3 MHz, and can 6 SB-USB2 Users Guide (2.0)
idcode mapfile [name] measure reset tck [val] be controlled with the next parameter between 6 MHz and 100 khz. This option should be only used, if the HWFLAG register is cleared during the ADI request (stop in software emulation mode). read device's IDCODE JTAG register Assign map filename for hardware emulation mode Measure hardware scan length, to verify if the MAP file matches the target device. Performs hardware reset for the target Set or get emulators delay counter to slow down the JTAG TCK operation The default value is 1041 khz. The frequency value can be entered in format n [MHz khz ]: mdi tck 8 MHz mdi tck 32 khz mdi tck 320000 TCK value will be set to the closes available frequency. Send JTAG s TRST command to the target trst vcc [val] Set or get the current output level. The valid options are 33, 25 and 18. version Reports emulator revision information 3.3 LSI Logic s ZSP IDE LSI Logic s ZSP IDE has been pre-configured to support the SB-USB2 JTAG probe. Selection of the appropriate processor type in the Compiler Settings Tab of the Settings Dialog populates the Target Files list box on the Debug Target Tab. 1. In the Main Window, choose Build->Settings to enable the Settings Dialog. SB-USB2 Installation Guide (2.0) 7
2. In the Compiler Settings Tab, select the appropriate Processor radio button. Below, ZSP400 has been selected: 3. From the Debug Target Tab, the Target Files listbox is populated with the associated files for the selected processor. The following choices are Processor SB-USB2 JTAG Debug Description Target File ZSP400 domain_sb_usb2_400.tgt JTAG for ZSP400: direct (non-tcp/ip) connection to the emulator. ZSP500 domain_sb_usb2_500.tgt JTAG for ZSP500, ZSP540 and ZSP600. Direct (non-tcp/ip) connection to the emulator. available with the SB-USB2 JTAG emulator: Selecting the appropriate Target File will populate the Description, Debug Command and Initialization Command fields. Note, the provided initialization commands include more than one mapfile definition; users should un-comment the appropriate mapfile for their use. The IDE allows modified files to be saved from within the Target Files tab. 8 SB-USB2 Users Guide (2.0)
For the ZSP400 processor, the following are available: Debug Target File : domain_sb_usb2_400.tgt Description Domain SB-USB2 JTAG Probe for ZSP400 Debug Command sdbug --mdi_library=mdisbusb2.dll Initialization Commands target jtag jtag mapfile=mapfile_402zx_rev2 #jtag mapfile=mapfile_403lp #jtag mapfile=mapfile_403lp_rev2 load tbreak *$pc run For the ZSP500, ZSP540, and ZSP600 processors, the following is available: Debug Target File : domain_sb_usb2_500.tgt Description Domain SB-USB2 JTAG Probe for ZSP G2 targets Debug Command zdbug --mdi_library=mdisbusb2.dll Initialization Commands target jtag jtag mapfile=mapfile_500p_rev1 load tbreak *$pc run Below, the ZSP400 processor was selected on the Compiler Tab; the Debug Target Tab was populated with the following content: SB-USB2 Installation Guide (2.0) 9
3.4 Sample Debug Session Several sample programs are supplied on the SB-USB2 JTAG installation CD. The following sample debug session will demonstrate the procedure using SDBUG400.EXE to debug sample program DEMOSINE400.OUT. The SB- USB2 JTAG is connected via the USB port to the PC, and connected through its ribbon cable to the target board. In this example the target board is Domain Technologies DT402EB. 1. Using a Dos Window, enter the following command to start the debugger from the directory containing the sample application. By default the sample applications are placed in \ZSPTools\ZSP400. >sdbug400 mdi_library=mdizu400 demosine400.out In this example, the interface type is set by using the mdizu400 command line parameter: 2. At the debugger prompt type: <sdbug> mdi? A list of the supported MDI commands will be displayed. 10 SB-USB2 Users Guide (2.0)
3. Multiple ZSP JTAG targets are possible, but for the purpose of this example, a single target is used. Connect the debugger to the first target by using the following command: <sdbug> target jtag 1 Upon completion, the start address, load size, and transfer rate will be displayed: 4. The debugger session is now ready for actions like setting a breakpoint, examining data, viewing the stack, etc. Refer to LSI Logic s documentation or utilize the help command to continue this debug session: SB-USB2 Installation Guide (2.0) 11
4 BoxView IDE The BoxView Integrated Development Environment (IDE) features Domain Technologies' high level language DSP target debugger as part of the Eclipse software development environment. Eclipse is an open, industry-supported, extensible, software development platform. Programmers create, test and debug applications with fast data access and extensive display capabilities. A typical debugging environment consists of the BoxView IDE running on a host, the host connected to any Domain Technologies emulator, and the emulator connected to the target DSP. More complex configurations such as debugging with multiple users, multiple DSP targets, or remote access are supported with the addition of BoxServer connectivity software. This multi-core/device development capability allows the user to start/stop/single-step selected devices simultaneously. Access to multiple devices is provided from single or multiple workstations via TCP/IP connection. 12 SB-USB2 Users Guide (2.0)
4.1 Sample BoxView IDE Debug Session Several sample programs are supplied on the installation CD. The following will demonstrate the procedure using BoxViewIDE to debug sample project Demosine.. The ZSP-USB-JTAG is connected via the USB port to the PC, and connected through its ribbon cable to the target board. In this example the target board is Domain Technologies DT402EB. 1. From the Windows Start Menu in the ZSP Development Tools folder, run BoxView IDE. Double click on the Demosine folder in the Navigator window. The folder will expand to reveal the project contents. Double click on the Demosine.c file. An Edit window will be opened for file demosine.c: 2. The DemoSine project was built automatically by the BoxView IDE. This feature is enabled through the project's properties. The Console Window displays the results of the build operation. To display the Console window, choose menu option Window->Show View->Console. 3. Use the BoxView IDE's Debug Perspective to enable and control the display windows for debugging the sample project. To change the perspective choose Window->Open Perspective->BoxViewDebug or select the BoxView Debug perspective from the icon bar. SB-USB2 Installation Guide (2.0) 13
The Debug perspective will show the Debug, Variable, Breakpoints, Expressions, Memory, Graph, BoxView Console, Stderr, and Stdout windows for your project. 4. Define and connect the hardware target; in this example it will be the DT402EB. To connect, choose the menu option BoxView->Open Connection. Select the Interface Type: SB-USB2. Select required operating voltage levels. Emulator can operate with different pin out modes, but for standard ZSP connections the auto can be selected. Select the Query button to automatically populate the Target Select field based upon the connected device. Select OK to initialize. Note, if the connected target device does not have known JTAG IDCODE to identify it, use JTAG command to configure JTAG scan chain. The Query button only allows auto configuration of known devices. With the addition of BoxServer software, BoxView supports debugging of remote targets. In the Open Connection dialog, choose radio button TCP/IP and specify the server s IP Address. The Query and Setup buttons can be used to define the Target. For additional information on the Open Connection function, review the online help by selecting Help->Contents from the BoxViewIDE main Window. 14 SB-USB2 Users Guide (2.0)
5. The DemoSine sample project has a debug session already configured; the configuration is named DemoSine. Select menu option Run- >Debug followed by the named debug configuration; for this example choose DemoSine. When the debugger is started, the application will stop at the entry to the main function. Local variables are not initialized yet, since the functions pre-amble was not executed. 6. To set a breakpoint, right click with the mouse in the margin of the source window; choose toggle breakpoint from the displayed list. The Breakpoints window will be updated with the new breakpoint, the breakpoint symbol will be visible in the source window, and the code window will highlight the active breakpoint. Once all desired breakpoints have been set, users may control the debugger behavior through BoxView IDE s Run menu option. SB-USB2 Installation Guide (2.0) 15
5 BoxView Debugger BoxView, Domain Technologies Windows based software debugger, allows programmers to test and debug applications with fast data access and extensive display capabilities. For each BoxView debug session, information is controlled and organized by interacting with the target ZSP through monitoring software or on-chip hardware circuitry. BoxView's capabilities include standard debugger actions like start/step/set breakpoint/halt as well as many custom features: symbolically edit stack, register, and memory values; startup/memory of debug session parameters; and graphical windows supporting numeric formats, graphical plots, stack information, watch information, etc. In addition, powerful boundary scan operations (requires BSDL file access) are supported which enables non-intrusive monitoring of the target device pins, even while the target device is executing its own application code. More complex configurations such as debugging with multiple users, multiple DSP targets, or remote access are supported with the addition of BoxServer connectivity software. This multi-core/device development capability allows the user to start/stop/single-step selected devices simultaneously. Access to multiple devices is provided from single or multiple workstations via TCP/IP connection. 16 SB-USB2 Users Guide (2.0)
5.1 Sample Debug Session Several sample programs are supplied on the installation CD. The following sample debug session will demonstrate the procedure using BoxView to debug sample program DEMOSINE400.OUT. The SB-USB2 JTAG is connected via the USB port to the PC, and connected through its ribbon cable to the target board. In this example the target board is Domain Technologies DT402EB. 1. From the Windows Start Menu in the ZSP Development Tools folder, run BoxView for ZSP. The following initial window will be displayed: SB-USB2 Installation Guide (2.0) 17
2. Select Options ->Open Connection from the main BoxView Window. To initialize the connection, the Interface Type and Target Select fields must be populated with the correct values for this debug session. Set the Interface Type to SB-USB2. This will enable control over the output levels and connector pin outs. SB-USB2 can be configured in standard ZSP mode, 14-pin Motorola DSP mode, or in 20-pin ARM JTAG mode. Select the Query button to automatically populate the Target Select field based upon the connected device. Select OK to initialize. Note, if the connected target device does not have known JTAG IDCODE to identify it, use the Setup option to add the device to the selection list. From the JTAG Device Definition dialog, select the target device type: LSI40x or LSI50x and enter a logical name (used to identify when multiple devices are on the JTAG scan chain). With the addition of BoxServer software, BoxView supports debugging of remote targets. In the Open Connection dialog, choose radio button TCP/IP and specify the server s IP Address. The Query and Setup buttons can be used to define the Target. For additional information on the Open Connection dialog, review the online help by selecting Help->Contents from the BoxView Window or reviewing the BvZsp.chm help file. 18 SB-USB2 Users Guide (2.0)
3. During the emulator initialization process, a progress dialog will be displayed. 4. Once the connection has been initialized, stop the monitor code running on the target by executing the Process->Halt command or choosing the Halt button in the toolbar: Halt 5. Optionally, peripheral registers can be configured. There are two configuration files supplied: regszsp400.ini and regszsp500.ini. Custom sections will be added to the menu entry at View->Peripherals after the following is entered into the command window: cmd> PERIPHERALS regszsp400.ini 6. From the BoxView main window choose File->Load to browse and select the application program. This example uses \ZSPTools\ZSP400\demosine400.out ; additional examples are provided with the SB-USB2 JTAG installation. SB-USB2 Installation Guide (2.0) 19
7. BoxView is now ready to perform standard debug operations like setting breakpoints, examining data, step over / run/ halt execution functionality, etc. The Code dialog can display the debugged program in one of three modes: source, assembly, or mixed; simply right click in the code window for options. The Symbols dialog displays the global symbols available in the application. Multiple memory windows are available to display the contents of DSP memories; the starting memory address can be issued in the command dialog with micro-help for syntax support in the lower left corner of the main window. Register contents are visible and modifiable through multiple register dialogs. Multiple graph windows are available to display memory in graphical formats. Complete product guide available by choosing Help->Contents. 20 SB-USB2 Users Guide (2.0)
6 ZSP500 Initialization without Monitor Code The SB-USB2 JTAG can load the ZSP500 without ROM monitor code. In order to accomplish the load, users need an application with an interrupt vector including a debug interrupt that contains the debug monitor. The monitor code for software debugging must have an interrupt vector table configured at instruction memory address 0x0000. The following sections will describe the procedure for LSI Logic s IDE, ZDBUG.EXE, and Domain Technologies BoxView Debugger to: Invoke the debugger Set the register mapfile Enable hardware debug mode Load the program image with the debug monitor Set UVT bit in %smode Turn off hardware debug mode and debug in normal mode 6.1 LSI Logic s ZSP IDE When using LSI Logic s ZSP IDE, the project must feature and application with software monitor code included. Specifically, it must include a debug interrupt that contains the debug monitor and the monitor code must have an interrupt vector table configured at instruction memory address 0x0000. When compiling an linking your project, be sure to update the Debug Target tab s Initialization Commands as described below. Note, the IDE allows modified files to be saved from within the Target Files tab. The following steps create a new target file containing the necessary initialization procedure. 1. In the Main Window, choose Build->Settings to enable the Settings Dialog. 2. In the Compiler Settings Tab, select the appropriate Processor radio button. 3. From the Debug Target Tab, the Target Files listbox is populated with the associated files for the selected processor. Selecting the appropriate SB-USB2 Installation Guide (2.0) 21
Target File will populate the Description, Debug Command and Initialization Command fields. Select the existing Domain Target file: domain_sb_usb2_500.tgt. 4. Select Save As and enter a filename when prompted. This example uses filename domain_sb_usb2_500monitorcode.tgt 5. Update the Description, Debug Command and Initialization Commands fields as follows: Debug Target File : domain_sb_usb2_500monitorcode.tgt Description Domain SB-SUB2 JTAG for ZSP500 Monitor Code Debug Command zdbug --mdi_library=mdisbusb2.dll Initialization Commands mdi mapfile mapfile_500p_rev1 mdi en_ice target jtag load set $smode=0x80 hw ret_to_sw_dbg set $pc=_start 6. Select Save to commit the changes to disk for new target file: 7. Continue debugging as normal. 6.2 Steps Using ZDBUG In the following steps, the user program IMAGE.OUT will be used as the application with an interrupt vector including a debug interrupt that contains the debug monitor. The monitor code for software debugging has an interrupt vector table configured at instruction memory address 0x0000. 1. In a DOS Window, invoke ZDBUG.EXE with the appropriate command line parameter to identify the target ZSP: <zdbug> -mdi_library=mdisbusb2 image.out 2. Set the register map file as shown below: 22 SB-USB2 Users Guide (2.0)
<zdbug> mdi mapfile <mapfile of the chip> 3. Enable hardware debug mode with the following command: <zdbug> mdi en_ice 4. Connect the debugger to the target board by using the following command: <zdbug> target jtag 5. Load the monitor image with the following command: <zdbug> load 6. Set %smode s UVT bit as shown: <zdbug> set $smode=0x80 7. Turn off hardware debug mode with the following command: <zdbug> hw return_to_sw_dbg 8. Continue debugging as normal. SB-USB2 Installation Guide (2.0) 23
6.3 Steps Using BoxView s Graphical User Interface (GUI) 1. From the Windows Start Menu in the ZSP Development Tools folder, run BoxView for ZSP. The following initial window will be displayed: 2. Select Options ->Open Connection from the main BoxView Window. Set the Interface Type to SBUSB2. Select the Query button to automatically populate the Target Select field based upon the connected device. Select OK to initialize. 24 SB-USB2 Users Guide (2.0)
3. Select Breakpoint->Hardware Break from the BoxView Window to display the ZSP Hw Break G2 dialog. Fill the Core Mapfile field with the appropriate mapfile; in this example, mapfile_500_rev1 was used. Enable the Hardware debug mode by selecting Enable HW Debug Mode. Choose the Apply button. 4. From the BoxView main window choose File->Load to browse and select the application program. This example uses image.out. SB-USB2 Installation Guide (2.0) 25
5. From the BoxView main window View->Peripherials->Core to open the Core Register Dialog. Set the %smode UVT bit by selecting the value of SMODE and entering 0x80. When the value is non-zero, the interrupt vector table will be at 0x0000: Note, if the View->Peripherials->Core menu item does not exist in your BoxView, type the following instruction in the Command Window: cmd>peripherals regszsp500.ini. 6. Select Breakpoint->Hardware Break from the BoxView Window to display the ZSP Hw Break G2 dialog again. Disable the Hardware debug mode by de-selecting Enable HW Debug Mode. Choose the OK button. 7. Continue debugging as normal. 26 SB-USB2 Users Guide (2.0)
SB-USB2 Installation Guide (2.0) 27
Domain Technologies Inc. 811 East Plano Pkwy Suite 115 Phone 972.578.1121 Fax 972.578.1086 http://www.domaintec.com email: support@domaintec.com