ST WGDB7 Manual
ST WGDB7 Manual

ST WGDB7 Manual

Windows debugger for the st7 emulator, simulator and development kit
Table of Contents

Advertisement

Quick Links

WGDB7

WINDOWS DEBUGGER FOR THE ST7 EMULATOR,
SIMULATOR AND DEVELOPMENT KIT
PREFACE
Purpose of the Manual
This manual describes how to configure, start and operate the WGDB7 Windows Debugger, to
debug programs written for the ST7 family of microcontrollers, in any of these development
and test environments:
• Program debugging with ST7 emulators,
• Program debugging with ST7 simulators,
• Program debugging with ST7 development kits.
WGDB7 communicates with the user via the standard Windows Graphical User Interface.
It is based on the GNU Debugger (GDB) command set, and uses additional ST7-specific com-
mands. Consequently, the manual discusses also basic GDB commands.
Audience
This book is intended for persons who have previous experience using assembler or C lan-
guages, but who are beginners in the ST7 microcontroller field and need to know how to han-
dle related development and test tools.
Related Publications
The following publications contain useful complementary information:
• ST7-Family, Data Sheets ,
• ST7-Family, 8-bit MCUs, Product Overview , Ref. BKST7/2
• Software Tools for the ST7 Family , Ref. Doc-ST7ASMLK-SW
• ST7-Family, Programming Manual ,
• ST7-Family Development Kit, Getting Started , Ref. Doc-ST7MDTx-DVP
Rev. 2.2
July 1998
1/76
151

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the WGDB7 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for ST WGDB7

  • Page 1: Wgdb7

    SIMULATOR AND DEVELOPMENT KIT PREFACE Purpose of the Manual This manual describes how to configure, start and operate the WGDB7 Windows Debugger, to debug programs written for the ST7 family of microcontrollers, in any of these development and test environments: •...
  • Page 2: Table Of Contents

    1.3.5 WGDB7 Debugging Capabilities ........
  • Page 3 8.7 WHAT DOES “STOP AT USER REQUEST” MEAN? ......70 8.8 HOW DO I EXECUTE WGDB7 FROM WINEDIT? ......70...
  • Page 4 Chapter 5, Chapter 6, CUSTOMISING OPERATING WORKING WITH WGDB7, WGDB7, WORKSPACES, explains how to tai- explains is devoted to pro- lor WGDB7 to you use the debugger. gram workspace own needs. management. Chapter 8, Chapter 7, QUESTIONS USING GDB7 AND ANSWERS,...
  • Page 5: Introduction

    WGDB7 1 INTRODUCTION 1.1 An ST7-Family Debugging Tool WGDB7 is a debugger for programs developed for the ST7 family of microcontrollers and based on either the STMicroelectronics ST7 Macro-Assembler and linker ASM/LYN or the Hi- ware ST7 C Toolchain. WGDB7 runs under Windows 3.x...
  • Page 6 WGDB7 The ST7 Simulator is a program that simulates the execution of ST7 programs, instruction by instruction. The behaviour of the peripherals is also simulated. The following diagram shows the WGDB7 simulator operating configuration: WGDB7 SIMULATOR You may see that, in this case, no external hardware is required. This is the major difference between the debugging methods presently available: using a simulator or an emulator.
  • Page 7: Wgdb7 Main Features

    1.3.2 Entering Data When you operate WGDB7, you enter data in standard Windows dialog boxes. In some cas- es, you’ll notice that when you update fields, the field name is highlighted in red. This indicates that you have changed a value but the changes have not yet been implemented by the emu- lator or simulator.
  • Page 8: Workspaces

    WGDB7 Windows interface. 1.3.5 WGDB7 Debugging Capabilities WGDB7 enables you to execute ST7 programs, and view the contents of the ST7 data and program memory as the program progresses. You can examine source code, as you would with a C-language source program, and assembler code.
  • Page 9 The features supported by WGDB7 when running with an emulator, a simulator or a develop- ment kit are summarized in the following table: Table 1.
  • Page 10 WGDB7 Table 1. WGDB7 Debugging Features for the Development Kit, Emulator and Simulator Debugger Debugger Debugger +DEVKIT +EMU +SIMU Description Entering, Assembling Mnemonics to Emu /Simu ST7 Memory Using GDB7 Commands Choosing Emulated/Simulated ST7 Micro Name Changing ST7 Emulated/Simulated Memory Mapping...
  • Page 11: Installing Wgdb7

    • Microsoft Windows 3.1x, Windows 95 or Windows NT • For Emulators and Development Kits: Your PC parallel port must have been configured as an output-only type port. WGDB7 does not support EPP, ECP or bi-directional parallel port configurations. 2.2 Compatibility WGDB7 is compatible with all families of Development Kits and ST7 HDS2 emula- tors.
  • Page 12: Installing Wgdb7 In The Windows Nt Environment: Completing The Installation

    2.4 Installing WGDB7 in the Windows NT Environment: Completing the Installation If you are installing WGDB7 on a Windows NT platform, and you want to use WGDB7 with an HDS Emulator or a Development Kit over a parallel port, you must install the genport.sys parallel port driver that is supplied in the diskette labelled “NT Driver Installation”...
  • Page 13: Connection Troubleshooting

    Once the test has been performed, the results are displayed in the Hardware Test dialog box: NOTE: In case of test failure, contact your local support representative. Click the Close button to close the Hardware Test dialog box. You are directed to the WGDB7 main window.
  • Page 14: Powering Up The Development Kit

    Windows NT driver that is supplied on the diskette labelled “NT Driver Installation Diskette”. • Check that your PC parallel port has been configured as an output-only parallel type port (BIOS settings). WGDB7 does not support EPP, ECP or bi-directional parallel port configu- rations. 2.6 Powering Up the Development Kit 2.6.1 Connecting the Development Kit...
  • Page 15: Running The Hardware Test

    The green POWER LED lights up. 2.6.2 Running the Hardware Test The hardware test lets you check that the evaluation board is correctly connected, configured and working. To run the hardware test: 1 Run WGDB7. 2 On the Commands menu, click Hardware Test. 15/76...
  • Page 16 WGDB7 The components of the development kit are tested one after the other During the tests the following message box is displayed: Upon successful completion of the tests the following message box appears: NOTE: In case of test failure, contact your local support representative.
  • Page 17: Preparing Programs For Debugging

    Some example macro-assembler source programs are provided in the Sample subdirectory of the WGDB7 installation directory. To be able to load a program, WGDB7 must have access to the *.s19 file in the Srecord for- mat or the .abs file for the Hiware ST7 toolchain.
  • Page 18: Operating Wgdb7

    WGDB7 online help (see “Getting Help” on page 19). 4.2 Starting WGDB7 The WGDB7 debugger is installed in the installation root directory. By default, you will find it in: C:\St7tools To start WGDB7, just click the appropriate icon (or name in the cascading menus) in the Win- dows desktop.
  • Page 19: Getting Help

    NOTE: All the task procedures described in this book start from the main window. 4.3 Getting Help WGDB7 enables you to access two types of help messages: • Task-based help, where you choose a task about which you want information.
  • Page 20: Emulator/Simulator Configuration Options

    This configuration file includes the micro name, the memory configuration, micro configuration and the trace analyser settings. When WGDB7 is used with a simulator, this information is saved in the application workspace.
  • Page 21: Changing The Emulated/Simulated St7 Memory Mapping

    1 On the Commands menu, click Memory Configuration. The Memory Configuration dialog box opens, displaying the defined memory mapping for the emulated/simulated ST7: WGDB7 with Simulator: 2To modify or create a mapped area, click the Modify button. The New/Modify Map window opens:...
  • Page 22 4 From the Area type combo box, select the type of memory for the above area: Peripher- als, Stack, RAM, ROM, Vectors, or Reserved. 5 Click Apply to implement each creation/change. 6 Click the OK button to confirm the changes. The new or modified memory area is now mapped. WGDB7 with Emulator or Development Kit: 22/76...
  • Page 23 WGDB7 7 To modify a mapped area, select the area and click the Modify button. To create a new area, click the New Area button. The New/Modify Map window opens: 23/76...
  • Page 24: Viewing And Setting Additional Emulator Configuration Options

    WGDB7 8 Next, enter in the appropriate fields the First and Last address of the memory area you want to define/modify. 9 From the Map type combo box, select the type of memory for the above area: Peripher- als, Stack, RAM, ROM, Vectors, or Reserved.
  • Page 25 • Select a new clock frequency for the microcon- troller. Click OK to confirm. WGDB7 with Emulator or Development Kit: 2 Select the feature you want to reconfigure from the list, then click the Modify but- ton. New dialog boxes appear for you to se- lect a new setting for the selected fea- ture.
  • Page 26: Viewing St7 Resources

    WGDB7 When you close an application, the micro definition settings are stored in the file <applica- tion>.CF7. The settings stored in this file are automatically reinstated when you load the ap- plication. 4.5 Viewing ST7 Resources Once you have started the debugger, even if you have not yet loaded a program, you can view the contents of the ST7 memory and registers.
  • Page 27: Viewing Disassembled Program Code

    Enter the symbol name or any valid C expression in the Address field. NOTE: Setting this window as Hot can reduce the execution speed of WGDB7. You can save time by not setting this screen as hot, and updating the display when required using the Refresh button.
  • Page 28: Viewing Register Contents

    Go to Line, Finish Subroutine options in the Commands menu. 4.5.3 Viewing Register Contents You can view and modify register contents using WGDB7: 1 On the Windows menu, click Registers. 2 The Registers window now opens: 3 To modify the value held in a displayed register, overtype the displayed value then press the Enter key.
  • Page 29: Loading A Program

    WGDB7 This field: Displays this: Program The Program Counter (PC) register value. This is a 16-bit register that stores Counter the address of the next instruction to be executed. Stacks The Stack Pointer (SP) value. This value points to the next free stack location.
  • Page 30: Viewing Program Information

    WGDB7 2 In the drive list, click the drive that contains the program. 3 In the box beneath the drive list, double-click the name of the folder that contains the pro- gram. Continue double-clicking subfolders until you open the subfolder that contains the program.
  • Page 31 WGDB7 2 Either: Click Modules List... then click the module you want to open. Click the module you want to open from the list. The module window opens displaying the module you just opened: From the module window, you can perform the following operations:...
  • Page 32: Finding And Viewing Symbols

    WGDB7 4.7.2 Finding and Viewing Symbols To find symbols and view detailed information about them: 1 On the Windows menu, click Browser. The Browser window opens: 2 In the Symbol Selection box: Select the symbol type you want to find from the Type drop-down list.
  • Page 33: Watching Variable Or Expression Values

    Watch window (see below). 4.7.3 Watching Variable or Expression Values WGDB7 enables you to watch the values of variables or expressions, which are updated each time program execution is suspended (for example, after a next or step instruction). To view a...
  • Page 34 WGDB7 From the Watch window, you can perform the following operations: Sort by drop-down Expression box list To do this: Do this: Change the format in which newly displayed Choose the appropriate option from the Preferences submenu on the Display menu.
  • Page 35: Executing Loaded Programs

    Remove a line from the Watch list Select the line and click the Delete button. 4.8 Executing Loaded Programs WGDB7 includes the following program execution commands, which are available either as buttons in the main window or other windows (where appropriate) or on the Commands menu.
  • Page 36: Using Software Breakpoints

    NOTE: If you try to place a breakpoint on an inappropriate line, such as on a While condition or a comment, WGDB7 will set the breakpoint on the next available line. 4.9.2 Managing Software Breakpoints You can perform all software breakpoint management tasks in the BreakPoints List window.
  • Page 37: Using Hardware Breakpoints

    4.10.1 Hardware and Advanced Breakpoints As a general rule, hardware breakpoints stop program execution when a specific hardware event occurs. WGDB7 provides you with various features that enable you to set hardware breakpoints that cover a large number of situations.
  • Page 38: 2Setting Hardware Breakpoints

    2 Click Hardware Breakpoints A Hardware Breakpoints window opens showing options that depends on the type of device WGDB7 is associated with: simulator, emulator, or development kit. This dialog box appears: The upper box “Current Settings” reminds you which Advanced Breakpoint options are set.
  • Page 39 WGDB7 4 In the New Settings box, select an option according to the table below: To stop program execution if: Select this: The address being accessed is within the hardware breakpoint Read/Write (Not On range. The address must be a data address.
  • Page 40: 3Setting Advanced Breakpoints

    Output Triggers (option available only for emulator and development kit, see “Work- ing with Output Triggers” on page 43). 2 Click Hardware Breakpoints. A Hardware Breakpoints window opens showing options that depends on the type of device WGDB7 is associated with: simulator, emulator, or development kit. 40/76...
  • Page 41 By default, the limit is the lower address of the stack area for the current microcontroller. Note that the TRIGIN Signal option is availa- ble only if you run WGDB7 with the Develop- ment Kit (the option is greyed with the simulator).
  • Page 42: 4Managing Hardware Breakpoints

    WGDB7 To stop program execution if: Do this: An external input signal is triggered on the Check TRIGIN Signal evaluation board TRIGIN pin. box. A stack underflow occurs. Check Stack Underflow/Overflow box. A stack overflow occurs. Check Stack Underflow/Overflow box.
  • Page 43: Working With Output Triggers

    WGDB7 4.11 Working with Output Triggers 4.11.1 Overview Triggers are output signals that can be connected to an external resource from the Emulator or Development Kit. These signals can be used to synchronize an external measurement instrument, such as an oscilloscope. When the defined set of condi-...
  • Page 44: 2Setting Trigger Events

    This dialog box appears: The upper box “Current Settings” shows no ad- vanced settings for output triggers. This fea- ture is not available for WGDB7 running with an emulator. The central box shows a list of Output Triggers already set.
  • Page 45 WGDB7 4 In the New Settings box, select a trigger event type: For the Emulator , select Trigger OUT1 to output the signal on Trigger 1, or Trigger OUT2 to output the signal on Trigger 2. For the Development Kit , select Force High to generate a high-level signal on the TRIG- OUT pin, or Force Low to generate a low-level signal on the TRIGOUT pin.
  • Page 46: 3Setting The Trigout Mode

    From field which will cause a signal to be output when accessed. 7 Click the OK button. The trigger event is now set. 4.11.3 Setting the TRIGOUT Mode WGDB7 with Development Kit Only To choose the waveform mode for the external TRIGOUT signal: 1 In the Windows menu, click Hardware Events.
  • Page 47 WGDB7 You may specify any of these modes: • Pulse Mode • Windows Mode In Pulse Mode , only Force High events cause a signal to be gener- ated on the TRIGOUT pin. In this case, the signal is a one clock cycle impulse as shown in the picture op- posite.
  • Page 48: 4Managing Trigger Event Definitions

    The emulator trace buffer records hardware events that occur when a program is executed. WGDB7 enables you to view either all the trace buffer contents or filter those that you view. You can also use the logic analyser to define up to three areas of memory, which when ac- cessed either: •...
  • Page 49: 1Viewing Trace Buffer Contents

    WGDB7 Event 2 causes each access made to the specified area to be recorded a specified number of times. 4.12.1 Viewing Trace Buffer Contents 1 On the Windows menu, click Trace. 2 The Trace window opens, displaying the events recorded in the emulator hardware trace buffer.
  • Page 50: Managing Trace Buffer Recording Using The Logic Analyser

    Trace window. NOTE: Setting this window as Hot reduces the WGDB7 performance for application load or save. To update the display and save time, don’t use the Hot check box; use the Re- fresh button instead.
  • Page 51 WGDB7 • Event 1 and Event 3 cannot be used together without Event 2, Event 1 should be used instead. To define an event: 1 On the Commands menu, click Set Analyser. The Set Analyser dialog box opens: 2 Above the button associated with the event you want to define, select On. If you want to stop program execution when trace buffer recording is completed, check the Stop execu- tion box.
  • Page 52 WGDB7 the symbol name preceded by the $ symbol in the Address or $symbol Value field. Don’t care check boxes indicate individual bits to be ignored in the address. The leftmost bit is bit 15. To consider all bits, click the Reset button. By default, all Don’t care check boxes are checked, which means that the entire address will be ignored.
  • Page 53: Pin Input/Output Simulation

    If you execute the program in step by step mode, no trace records are recorded. 4.14 Pin Input/Output Simulation WGDB7 with Simulator Only 4.14.1 The Input-Process-Output Scheme Simulating the execution of a program on an ST7 microcontroller would be quite frustrating if you were not able to input signals and see the resulting output.
  • Page 54: 2How To Setup Pin Input Simulation

    WGDB7 Table 2. Example of Pin Configuration (ST72251 MCU) Pin No. Pin Name Type Description (SDIP32) PC5/EXTCLK_A/AIN5 Port C5 or Timer A Input Clock or ADC Analog Input 5 For more information on a specific ST7 MCU pin assignment, refer to the appropriate ST7xxxx Datasheet .
  • Page 55 WGDB7 Binary Signals PIN <pin_name> -i <value> <start_time> Where <pin_name> is the name of the pin. You can use any name (maximum 8 alphameric characters). It is recommended to use port names as specified in the corresponding datasheet. Examples: PB7, PC0, PA1 is the signal type for binary signals.
  • Page 56 WGDB7 is the signal type for analog signals. <value> is the value of the simulated analog input signal. Specify a value between 0 and 255. <start_time> Specify the absolute time in machine cycles (CPU ticks) when the simulated event (ana- log signal) should occur.
  • Page 57 WGDB7 is the period of the signal in machine cycles (CPU ticks). Example of Pin Input Simulation File File Name: example.in This text file would contain, for example, these lines: PIN PA1 -i 0 0 PIN PA1 -i 1 10...
  • Page 58: 3Starting Pin Input Simulation

    WGDB7 NOTE: The Pin Input Simulation File can also be created directly by the Waveform Editor. For more information refer to the on-line help messages of the Waveform Editor you are running. 4.14.3 Starting Pin Input Simulation To start pin input simulation proceed as follows, assuming that you have already started the...
  • Page 59: 4Pin Output Signals Generated By Your Program

    NOTE: The order in which you load the application and the pin input simulation file is irrele- vant as long as you are in the WGDB7 simulator environment. You may load the <filename>.in file first as well.
  • Page 60: Time Management

    For more information on how to use the Waveform Editor , open the on-line help file provided with the Editor. 4.15 Time Management When using WGDB7 with a simulator, you can access features closely related to time management. 60/76...
  • Page 61 WGDB7 These features enables you to: • View the cpu time spent since the program to be debugged was started ( system time ), or the time calculated from an arbitrary origin you specified ( user time ), • Set (or reset) program breaks based on elapsed cpu time.
  • Page 62: Customising Wgdb7

    WGDB7 5 CUSTOMISING WGDB7 You can customise the following features in WGDB7: • The screen fonts. • The breakpoint line, Program Counter line and currently selected line colours. • The action taken when events occur. 1 Changing the Screen FontsOn the File menu, point to Preferences, then click Screen Fonts.
  • Page 63: Selecting Which Events Are Indicated

    WGDB7 ii Select the Colored button then click to list the available marker colours and select one for the current breakpoint line. 3 To change the display mode for the current PC line, in the Display mode for the current PC line box: Select the Bold button to display the current PC line in bold.
  • Page 64: Working With Workspaces

    WGDB7 enables you to save a workspace definition, so that you can restore it at a later date. It also enables you to enable/disable automatic default workspace saving, so each time you close a program its workspace is saved.
  • Page 65: Saving And Loading Workspace Definitions

    WGDB7 6.1 Saving and Loading Workspace Definitions 1 On the File menu point to Prefer- ences, then click Workspace. The Workspace dialog box opens: 2 To load a saved workspace settings file: Select the file you want to load from the list.
  • Page 66: Using Gdb7 Commands

    • Record GDB7 command dialog in a log file. The following paragraphs explain how to perform these tasks. 7.1 Executing GDB7 Commands When a Program is Loaded When you load a program, WGDB7 executes either of the following files if they exist in the pro- gram directory: hardware.gdb <program>.gdb...
  • Page 67: Entering Gdb7 Commands Using Your Keyboard

    WGDB7 7.3 Entering GDB7 Commands Using Your Keyboard WGDB7 lets you enter GDB7 commands using your keyboard. To enter GDB7 commands us- ing your keyboard: 1 On the Windows menu, click Console. The Console window now opens, enabling you to enter commands using your keyboard: 2 Click the first available line in the Console window.
  • Page 68: Viewing Gdb7 Dialog Executed By Wgdb7

    The Console window now opens. In the Console window, check the Verbose check box. You can now view all the GDB7 commands that are executed by WGDB7 in the Console win- dow and their results. 7.5 Recording GDB7 Commands in a Log FIle...
  • Page 69: Questions And Answers

    ), this means that WGDB7 is executing a com- mand, or the program is running. Note that you can click the WGDB7 Stop button to stop program execution and return the cur- sor to its normal state. 8.2 Why is the Locals window empty? This is either because you are debugging a macro-assembler application—macro assembler...
  • Page 70: Why Are Some Hardware Breakpoints Never Triggered

    Information messages will no longer be displayed. 8.8 How Do I execute WGDB7 from Winedit? To execute WGDB7 from Winedit, enter the full wgdb7.exe path, and specify the same argu- ment string as that specified by the WGDB7 emulator/simulator shortcut or icon.
  • Page 71 Index colour settings ........62 Symbols displayed format of symbols .... 34 screen fonts ........62 .abs files ............29 value of a symbol ......34 .asm files ............. 17 Choose a File dialog box ......29 .CF7 configuration file .......
  • Page 72 Index software breakpoint executing programs ......37 ........35 trigger definition expression (view value) ......... 48 ......34 disassembled code (display) ....49 disassembler ..........27 Disassembler command ......27 F1 key (help) ..........20 Disassembler window ....... 27 filter displayed event types ......
  • Page 73 ........49 installation troubleshooting ...... 13 installing WGDB7 ........11 Parallel port (PC) ........11 installing WGDB7 on a Windows NT plat- pin input simulation file ......54 form ..........12 probes ............52 Program Counter ........29 program execution history ......
  • Page 74 (continue) start address (hardware breakpoint) ..... 35 ..40 running the hardware test start/stop conditions (running a program) ....12, 15 starting WGDB7 ......... 18 Step button ..........35 step one instruction ........35 save default workspace ......63 Stepi button ..........
  • Page 75 Watch window TRIGOUT pin ..........33 ..........43 watchdog function troubleshooting (installation) ........25 ....13 Waveform Editor ........57 WGDB7 customising ....... 62 to 63 update Trace window contents display modes ....49 ........7 user time features ............. 61 ..........
  • Page 76 This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not authorized for use as critical components in life support devices or systems without the express written approval of STMicroelectronics. The ST logo is a registered trademark of STMicroelectronics ©1998 STMicroelectronics - All Rights Reserved.

Table of Contents