CWM Cu Debugger RM
CWM Cu Debugger RM
CWM Cu Debugger RM
Debugger Manual
How to Contact Us
Introduction
Manual Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1 Introduction 25
Freescale Debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Debugger Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Debugger Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Demo Version Limitations on Components . . . . . . . . . . . . . . . . . . . . . . . . . 26
2 Debugger Interface 27
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Application Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Starting the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Starting from within the IDE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Debugger Command Line Start. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Debugger Main Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Debugger Main Window Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Debugger Main Window Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Main Window Menu Bar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Component Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Help Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Component Associated Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Component Main Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3 Debugger Components 61
Component Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
CPU Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
Window Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
Connection Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
Loading Component Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
General Debugger Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64
Assembly Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64
Command Line Component. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
Coverage Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73
DA-C Link Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
Data Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
Memory Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90
Module Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102
Procedure Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104
Profiler Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
Recorder Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109
Register Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
Source Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115
Terminal Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125
Trace Component. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130
Visualization Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133
Inspector Component. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133
Visualization Tool Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141
Index 871
Manual Contents
The Microcontrollers Debugger Manual consists of the following books:
Book 1: Debugger engine - defines the HC08 and HC(S)08 common and base features,
their functionality, and a description of the components that are available in the debugger.
• Introduction
• Debugger Interface
• Debugger Components
• Control Points
• Real Time Kernel Awareness
• How To...
• CodeWarrior IDE Integration
• Debugger DDE Capabilities
• Synchronized Debugging Through DA-C IDE
Book 2: HC08 Debugger Connections - defines the connections available for debugging
code written for HC08 CPUs.
• Microcontroller Debugging First Steps
• HC08 Full Chip Simulation
• MON08 Interface Connection
• ICS MON08 Interface Connection
• HC08 P&E Multilink/Cyclone Pro Connection
• HC08 ICS P&E Multilink/Cyclone Pro Connections
• SofTec HC08 Connection
• HC08 FSICEBASE Emulator
Book 3: HCS08 Debugger Connections - defines the connections available for debugging
code written for HCS08 CPUs
• HCS08 Full Chip Simulation
• HCS08 P&E Multilink/Cyclone Pro Connection
• HCS08 Open Source BDM Connection
• HCS08 Serial Monitor Connection
• SofTec HCS08 Connection
NOTE The Flexis series of devices is the 8- to 32-bit connection point on the Freescale
Controller Continuum, where complementary families of HCS08 and ColdFire
V1 microcontrollers share a common set of peripherals and development tools
to deliver migration flexibility.
These devices include the MC9S08QE128, MC9S08QE64, MC9S08QE96,
MCF51QE128, MCF51QE64, and MCF51QE96, which are covered in Book 3
and Book 5 respectively.
Book I Contents
Each section of the Debugger manual includes information to help you become more
familiar with the Debugger, to use all its functions and help you understand how to use the
environment. This book, the Debugger engine, defines the HC(S)08, RS08, and
ColdFire® common and base features and their functionality, and gives a description of
the components that are available in the debugger.
This book is divided into the following chapters:
• This chapter describes the manual and special features of the Debugger.
• The Introduction Chapter introduces the Debugger concept.
• The Debugger Interface Chapter provides all details about the Debugger user
interface environment i.e., menus, toolbars, status bars and drag and drop facilities.
• The Debugger Components Chapter contains descriptions of each basic component
and visualization utility.
• The Control Points Chapter is dedicated to the control points and associated
windows.
• The Real Time Kernel Awareness Chapter contains descriptions of the Real Time
concept and related applications.
• The How To... Chapter provides answers for common questions and describes how
to use advanced features of the Debugger.
• The CodeWarrior IDE Integration chapter explains how to configure the Debugger
for use with the CodeWarrior IDE.
• The Debugger DDE Capabilities chapter describes the debugger DDE features.
• The Synchronized Debugging Through DA-C IDE chapter explains the use of tools
with the DA-C IDE from RistanCase
Freescale Debugger
The Debugger is a member of the tool family for Embedded Development. It is a
Multipurpose Tool that you can use for various tasks in the embedded system and
industrial control world. Some typical tasks are:
• Simulation and debugging of an embedded application.
• Simulation and debugging of real-time embedded applications.
• Simulation and/or cross-debugging of an embedded application.
• Multi-Language Debugging: Assembly, C and C++
• True-Time Simulation
• User Components creation with the Peripheral Builder
• Simulation of a hardware design (e.g., board, processor, I/O chip).
• Building a target application using an object oriented approach.
• Building a host application controlling a plant using an object oriented approach.
Debugger Application
A Debugger Application contains the Debugger Engine and a set of debugger components
bound to the task that the components must perform (for example a simulation and
debugging session). The Debugger Engine is the heart of the system. It monitors and
coordinates the tasks of the components. Each Debugger Component has its own
functionality (e.g., source level debugging, profiling, I/O stimulation).
You can adapt your Debugger application to your specific needs. Integrating or removing
the Debugger Components is very easy. You can add additional Debugger Components
(for example, for simulation of a specific I/O peripheral chip) and integrate them with
your Debugger Application.
You can also open several components of the same type.
Debugger Features
• True 32-bit application
• Powerful features for embedded debugging
• Special features for real time embedded debugging
• Powerful features for True Time Simulation
• Various and Same look Target Interfaces
• User Interface
• Versatile and intuitive drag and drop functions between components
• Folding and unfolding of objects like functions, structures, classes
• Graphical editing of user defined objects
• Visualization functions
• Smart interactions with objects
• Extensibility function
• Both Powerful Simulation & Debugger
• Show Me How Tool
• GUI (graphical user interface) version including command line
• Context sensitive help
• Configurable GUI with Tool Bar
• Smooth integration into third party tools
• Supports both Freescale and ELF/DWARF Object File Format and S-Records.
Introduction
The CodeWarrior™ IDE main window acts as a container for windows of debugger
components. The main window provides a main menu bar, a tool bar, a status bar for
status information, and object information bars for several components.
The Debugger main window allows you to manage the layout of the different component
windows (Window menu of the Debugger application). Component windows are
organized as follows:
• Tiled arrangement - Auto tiled, component windows are automatically resized when
the main window is resized
• Component windows are overlapped
• Component windows that are currently minimized are Debugger Main window
icons.
Application Programs
The CodeWarrior IDE installer places executable programs in the prog subdirectory of
the CodeWarrior IDE installation directory. For example, installing the CodeWarrior IDE
software in C:\Program Files\Freescale, locates all program files in the folder
C:\Program Files\Freescale\CodeWarrior for Microcontrollers
V6.1\prog.
The following list is an overview of files that the CodeWarrior IDE uses for C/C++
debugging:
• hiwave.exe Debugger executable file
• hibase.dll Debugger main function dll
• elfload.dll Debugger loader dll
• *.wnd Debugger component
• *.tgt Debugger target file
• *.cpu Debugger CPU awareness file
-Target=<targetname>
This option sets the specified connection. For example:
C:\Program Files\Freescale\CodeWarrior for Microcontrollers
V6.1\prog\hiwave.exe c:\Program Files\Freescale\CodeWarrior
for Microcontrollers V6.1\demo\hc12\sim\fibo.abs -w -
Target=sim
The command in the above example starts the debugger and loads fibo.abs file.
-Instance=%currentTargetName
This option defines a build instance name. Once you define a build instance, the debugger
uses same build instance the next time you start the debugger. For example:
c:\Program Files\Freescale\CodeWarrior for Microcontrollers
V6.1\prog\hiwave.exe -Instance=%currentTargetName
If you attempt to start the debugger again, the existing instance of the debugger is brought
to the foreground.
-Prod= <fileName>
This option specifies the project directory and/or project file to be used at start-up. For
example:
c:\Program Files\Freescale\CodeWarrior for Microcontrollers
V6.1\prog\hiwave.exe -Prod=c:\demoproject\test.pjt
-Nodefaults
This prevents the debugger from loading the default layout. For example:
c:\Program Files\Freescale\CodeWarrior for Microcontrollers
V6.1\prog\hiwave.exe -nodefaults
-Cmd = <Command>
This option specifies a command to be executed at start-up: -cmd = {command}. For
example:
c:\Program Files\Freescale\CodeWarrior for Microcontrollers
V6.1\prog\hiwave.exe -cmd="open recorder"
-C <cmdFile>
This option specifies a command file to be executed at start-up. For example:
c:\Program Files\Freescale\CodeWarrior for Microcontrollers
V6.1\prog\hiwave.exe -c c:\temp\mycommandfile.txt
Order of Commands
Commands specified by options are executed in the following order:
1. Load (activate) the project file (see below). If the project file is not specified,
project.ini is used by default.
2. Load <exeFile> if available and start running unless option |(W) was specified
3. Execute command file <cmdFile> if specified
4. Execute command if specified
5. Start running unless option |(W) was specified
NOTE In version 6.1 of the debugger, the loaded program starts after all command and
command files are executed.
NOTE The function Open in the File menu interprets any file without an .ini
extension as a command file and not a project file.
Example
C:\Program Files\Freescale\CodeWarrior for Microcontrollers
V6.1\PROG\DEMO\TEST.ABS -w -d
ep
ep
ew
er
y
ic
t
lt
t
lp
Cu
ou
ge
op
Ha
pe
Ru
v
st
p
He
ov
Sa
st
st
to
N
Pa
ar
C
O
ep
y
le
ep
t
on
bl
St
et
ng
St
es
lp
Si
se
He
R
As
A tool tip is available when you point the mouse at an icon.
NOTE You can select menu commands by pressing the ALT key to select the menu
bar then press the key corresponding to the underlined letter in the menu
command.
File Menu
The File menu shown in Figure 2.7 is dedicated to the debugger project.
Open Configuration Opens the debugger project window. You can load a project file
.PJT or .INI. Additionally you can load an existing .HWC file
corresponding to a debugger configuration file. You can load a
project .INI file containing component names, associated
window positions and parameters, window parameters (fonts,
background colors, etc.), connection name (e.g., Simulator)
and the .ABS application file to load.
Save Project As Opens the debugger project window to save the project file
under a different path and name, and format (PJT; INI...).
You can shortcut some of these functions by clicking toolbar icons (refer to the Debugger
Main Window Toolbar section).
Configuration Window
Open the Configuration window by selecting Configuration from the Files menu. With
this window (Figure 2.8) it is possible to set up environment variables for the current
project. New variables are saved in the current project file when you click the OK button.
NOTE The corresponding menu entry (File > Configuration) is only enabled if a
project file is loaded.
Command Buttons:
• OK: Changes are confirmed and saved in current project file.
• Cancel: Closes dialog box without saving changes.
• Help: Opens the help file.
View Menu
In the Main Window View menu (Figure 2.10) you can choose to show or hide the toolbar,
status bar, window component titles and headlines (see the Component Windows Object
Info Bar). You can select smaller window borders and customize the toolbar. Table 2.3
describes the View Menu entries.
Status Bar Check / uncheck Status Bar if you want to display or hide it.
Hide Tile Check / uncheck Hide Title if you want to hide or display the
window title.
Hide Headline Check / uncheck Hide Headline if you want to hide or display the
headline.
Small Borders Check / uncheck Small Border if you want to display or hide
small window borders.
• Select the desired shortcut button in the Available buttons list box and click Add to
install it in the toolbar.
• Select a button in the Toolbar buttons list box and click Remove to remove it from
the toolbar.
Figure 2.14 shows a component window without a title and headline, and with a small
border.
Figure 2.14 Component Window without Title and Headline, and with Small Border
Figure 2.15 shows a component window without headline and small border
Run Menu
The Main Window Run menu, shown in Figure 2.16 is associated with the debug session.
You can monitor a simulation or debug session from this menu. Run menu entries are
described in Table 2.4.
Restart Starts execution of the loaded application from its entry point.
Shortcut: CTRL + Shift + F5 keys
Halt Interrupts and halts a running application. You can examine the state
of each variable in the application, set breakpoints, watchpoints, and
inspect source code.
Shortcut: F6 key
Single Step If the application is halted, this command performs a single step at the
source level. Execution continues until the next source reference is
reached. If the current statement is a procedure call, the debugger
“steps into” that procedure. The Single Step command does not treat
a function call as one statement, therefore it steps into the function.
Shortcut: F11 key
Step Over Similar to the Single Step command, but does not step into called
functions. A function call is treated as one statement.
Shortcut: F10 key
Step Out If the application is halted inside of a function, this command continues
execution and then stops at the instruction following the current
function invocation. If no function calls are present, then the Step Out
command is not performed.
Assembly If the application is halted, this command performs a single step at the
Step assembly level. Execution continues for one CPU instruction from the
point it was halted. This command is similar to the Single Step
command, but executes one machine instruction rather than a high
level language statement.
Shortcut: CTRL + F11 keys
Assembly Similar to the Step Over command, but steps over subroutine call
Step Over instructions.
Shortcut: CRTL + F10 keys
Control Points Opens the Controlpoints Configuration Window that contains tabs that
allow you to control Breakpoints, Watchpoints and Markpoints (refer to
Control Points chapter).
You can provide shortcuts for some of these functions using the toolbar. Refer to the
Debugger Main Window Toolbar and Customizing the Toolbar sections for details.
You can also set breakpoints and watchpoints from within the Source and Assembly
component windows.
NOTE For more information about breakpoints and watchpoints, refer to the Control
Points chapter.
Connection Menu
This menu entry (Figure 2.17) appears between the Run and Component menus when no
connection is specified in the PROJECT.INI file and no connection has been set. The
Connection name is replaced by an actual connection name when the connection is set. If
a connection has been set, the number of menu entries is expanded, depending on the
connection. To set the connection, select Component > Set Connection. Refer to the
Component Menu section for details.
Open Button
Pressing this button loads the application code and symbols.
The command file in the edit box is executed when the corresponding event occurs. Click
the Browse button to set the path and name of the command file.
The Enable Command File check box allows you to enable/disable a command file on an
event. By default, all command files are enabled:
• The default Startup command file is STARTUP.CMD
• The default Reset command file is RESET.CMD
• The default Preload command file is PRELOAD.CMD
• The default Postload command file is POSTLOAD.CMD
NOTE Startup settings performed in this dialog box are stored for subsequent
debugging sessions in the [Simulator] section of the PROJECT file using the
variable CMDFILE0.
NOTE When a CPU is set, the settings performed in this dialog box are stored for
subsequent debugging sessions in the [Simulator XXX] (where XXX is the
processor) section of the PROJECT file using variables CMDFILE0,
CMDFILE1 ... CMDFILEn.
The default settings enable the STARTUP.CMD file located in the current project directory
as the current Startup command file.
Component Menu
The Component menu is shown in Figure 2.20.
Open Loads an extra component window that has not been loaded by
the Debugger at startup. The context-sensitive dialog box
presents a set of different components that are introduced in the
Typical Component Window Display section.
Fonts Opens a standard Font Selection dialog box, where you can set
the font used by Debugger components.
Background Color Opens a standard Color Selection dialog box, where you can
set the background color used by the Debugger component
windows.
NOTE For a readable display, we recommend using a proportional font (e.g., Courier,
Terminal, etc.).
Select Component > Open to load an extra component window that has not been loaded by
the Debugger at startup. The context-sensitive dialog box presents a set of different
components that are introduced in Debugger Components.
Select Component > Set Connection and the Set Connection dialog box shown in Figure
2.21 is opened.
NOTE When a connection cannot be loaded, the combo box displays the correct path
for you to install the missing DLL.
NOTE For more information about which connection to load and how to set/reset a
connection, refer to the other sections of this manual.
Window Menu
In this menu, shown in Figure 2.22, you can set the component windows general
arrangement. The Submenu Window > Options is shown in Figure 2.23 and the Submenu
Window > Layout in Figure 2.24.
Options - Autosize Component windows always fit into the debugger window
whenever you modify the debugger window size.
Layout - Load/Store Option to Load / Store your arrangements from a .HWL file.
Help Menu
This is the Debugger Main window Help menu (Figure 2.25). Table 2.8 shows menu
entries.
Help Topics Choose Help Topics in the menu for online help or if you need
specific information about a topic.
About Box
Select Help > About to display the About box. The about box lists directories for the
current project, system information, program information, version number and copyright.
It contains information to send for Registration. You can copy this information and send to
license@freescale.com.
For more information on all components, click on the Extended Information button.
Two hypertext links allow you to send an E-mail for a license request or information, and
open the Freescale internet home page.
Click on OK to close this dialog box.
Component Files
Each component is a windows file with a .wnd extension
For example, if you click the mouse on a breakpoint, menu options allow you to delete,
enable, or disable the breakpoint.
When the dragged item is not allowed in the destination to which you are dragging the
item, the following cursor symbol is displayed:
Example:
You can activate the display of coverage information on assembler and C statements by
dragging the chosen procedure name from the Coverage component to the Source and
Assembly components (Figure 2.30).
Figure 2.30 Dragging Procedure Name from Coverage to Source Component Window
You can display the memory layout corresponding to the address held in a register by
dragging the address from the Register Component to the Memory Component.
Destination Action
Component Window
Destination Action
Component Window
Command Line Dragging the name appends the address range of the
variable to the current command in the Command Line
Window. Dragging the value appends the variable value
to the current command in the Command Line Window.
Register Dragging the name loads the destination register with the
address of the selected variable. Dragging the value
loads the destination register with the value of the
variable.
NOTE It is not possible to drag an expression defined with the Expression Editor. The
“forbidden” cursor is displayed.
Destination Action
Component Window
Register Loads the destination register with the start address of the
selected memory block.
Destination Action
Component Window
Data > Local Displays local variables from the selected procedure in
the data component.
Destination Action
Component Window
Destination Action
Component Window
Data > Global Displays global variables from the selected module in the
data component.
Component Introduction
The Debugger kernel includes various components.
CPU Components
CPU components handle processor-specific properties such as register naming, instruction
decoding (disassembling), and stack tracing. A specific implementation of the CPU
module must be provided for each processor type that is supported in the debugger. The
CPU-related component is not introduced in this section. However, the Register
component, Memory component, and all other Connection-dependent components reflect
this system component. The appropriate CPU component loads automatically when
loading an application or executable file (.ABS file), therefore it is possible to mix
applications for different MCUs. The Debugger automatically detects the MCU type and
loads the appropriate CPU component, if available on your environment.
Window Components
The Debugger main window components are small applications loaded into the debugger
framework at run-time. Window components can access all global facilities of the
debugger engine, such as the connection (to communicate with different connections), and
the symbol table. The Debugger window components are implemented as dynamic link
libraries (DLLs) with extension .WND. These components are introduced in this section.
Connection Components
Different debugger connections are available. For example, you can set a CPU awareness
to simulate your .ABS application files, and also set a background debugger.
Different connections are available to connect the target system (hardware) to the
debugger. For example, the connection may be connected using a Full Chip Simulator, an
Emulator, a ROM monitor, a BDM pod cable, or any other supported device.
To open the window that lets you choose one or more components:
1. Choose Component > Open
2. In the Open Window Component window shown in Figure 3.2, select the desired
component.
3. In the Open Window Component window, use the mouse to select a component.
4. Click the OK button to open the selected component.
There are three tabs in the Open Window Component window:
• The Icon tab shows components with large icons.
• The List tab shows components with small icons.
• The Details tab shows components with their description.
Assembly Component
The Assembly window, shown in Figure 3.3, displays program code in disassembled
form. It has a function very similar to that of the Source component window but on a much
lower abstraction level. Thus it is therefore possible to view, change, monitor and control
the current location of execution in a program.
This window contains all on-line disassembled instructions generated by the loaded
application. Each displayed disassembled line in the window can show the following
information: the address, machine code, instruction and absolute address in case of a
branch instruction. By default, the user can see the instruction and absolute address.
If breakpoints have been set in the application, they are marked in the Assembly
component with a special symbol, depending on the kind of breakpoint.
If execution has stopped, the current position is marked in the Assembly component by
highlighting the corresponding instruction.
The Object Info Bar of the component window contains the procedure name, which
contains the currently selected instruction. When a procedure is double clicked in the
Procedure component, the current assembly statement inside this procedure is highlighted
in the Assembly component.
Assembly Menu
The Assembly menu shown in Figure 3.4 contains all functions associated with the
assembly component. Table 3.1 describes these menu entries.
Display
Freeze Both the Assembly and Source components can be frozon. These
components usually display the code execution from the current PC.
When you freeze these components, they no longer follow the current
PC but are frozen to their current displays.
Setting Breakpoints
Breakpoints can be set, edited and deleted when using the context menu. Right-click on
any statement in the Source component window, then choose Set Breakpoint, Delete
Breakpoint, etc.
Show Location When selected, highlights the source statement that generated
the pointed to assembler instruction. The assembler instruction
is also highlighted. The memory range corresponding to this
assembler instruction is also highlighted in the memory
component.
Set Markpoint When selected, enables you to set a markpoint at this location.
Delete Markpoint Appears in the Context Menu only if a markpoint is set at the
nearest code position (visible with marks). When selected,
disables this markpoint.
Drag Out
Table 3.3 shows the drag actions possible from the Assembly component.
Drop Into
Table 3.4 shows the drop actions possible in the Assembly component
Associated Commands
Following commands are associated with the Assembly component:
ATTRIBUTES, SMEM, SPC.
Keying In Commands
You can type Debugger commands after the in> terminal prompt in the Command Line
Component window.
Command Interpretation
The component executes the command entered and displays results or error messages, if
any. Ten previous commands can be recalled using the up arrow key to scroll up or the
down arrow key to scroll down. Commands are displayed in blue. Prompts and command
responses are displayed in black. Error messages are displayed in red.
When a command is executed and running from the Command Line component, the
component cannot be closed. In this case, if the Command Line component is closed with
the window close button (X) or with the Close entry of the system menu, the following
message is displayed:
Command Component is busy. Closing will be delayed
The Command Line component is closed as soon as command execution is complete. If
the CLOSE command is applied to this Command Line component (for example, from
another Command Line component), the component is closed as soon as command
execution is finished.
Command Menu
Figure 3.8 shows the Command menu, which is identical to the Command Context menu.
Clicking Execute File opens a dialog box where you can select a file containing Debugger
commands to be executed. These files generally have a .cmd extension by default.
Selected text in the Command Line window can be copied to the clipboard by:
• Selecting the menu entry Command > Copy.
• Pressing the CTRL + C key.
Cache Size
Select Cache Size in the menu to bring up the Size of the Cache dialog box and set the
cache size in lines for the Command Line window, as shown in Figure 3.9.
This Cache Size dialog box is the same for the Terminal Component and the TestTerm
Component.
Drag Out
Nothing can be dragged out.
Drop Into
Memory range, address, and value can be dropped into the Command Line Component
window, as described in Table 3.5. The command line component appends corresponding
items of the current command.
Associated Commands
BD, CF, E, HELP, NB, LS, SREC, SAVE.
NOTE For more details about commands, refer to Debugger Engine Commands.
Coverage Component
The Coverage window, shown in Figure 3.10 contains source modules and procedure
names as well as percentage values representing the proportion of executed code in a
given source module or procedure.
The Coverage window contains percentage numbers and graphic bars. From this
component, you can split views in the Source window and Assembly window, as shown in
Figure 3.11. A red check mark is displayed in front of each source or assembler instruction
that has been executed. Split views are removed when the Coverage window is closed or
by selecting Delete in the split view context menu.
Coverage Operations
Click the folded/unfolded icons to unfold/fold the source module and display/hide
the functions defined.
Coverage Menu
The Coverage menu and submenus are shown in Figure 3.12.
Timer Update Switches the periodic update on/off. If activated, statistics are
updated each second.
Output File
You can redirect Coverage component results to an output file by selecting Output File >
Save As in the menu or context menu.
------------------------------------------------------------
Coverage: Item:
------------------------------------------------------------
94.4 % Application
FULL fibo.c
FULL Fibonacci()
FULL main()
86.0 % startup.c
80.5 % Init()
FULL _Startup()
Drag Out
All displayed items can be dragged into a Source or Assembly component. Destination
component displays marks in front of the executed source or assembler instruction.
Drop Into
Nothing can be dropped into the Coverage Component window.
Associated Commands
DETAILS, FILTER, GRAPHICS, OUTPUT, RESET, TUPDATE
NOTE For related information refer to the Chapter Synchronized Debugging Through
DA-C IDE.
The DA-C debugger name must be the same as the one selected in the DA-C IDE. Check
the Show Protocol checkbox to display the communication protocol in the Command
component of the Debugger. To validate the settings, click the OK button. A new
connection is established and the Connection Specification is saved in the current
Project.ini file. The HELP button opens the help topic for this dialog box.
Drag Out
Nothing can be dragged out.
Drop Into
Nothing can be dropped into the DAC Component window.
Data Component
The Data window shown in Figure 3.18 contains the names, values and types of global or
local variables.
The Data window shows all variables present in the current source module or procedure.
Changed values are in red.
The Component Windows Object Info Bar contains the address and size of the selected
variable. It also contains the module name or procedure name where the displayed
variables are defined, the display mode (automatic, locked, etc.), the display format
(symbolic, hex, bin, etc.), and current scope (global, local or user variables).
Various display formats, such as symbolic representation (depending on variable types),
and hexadecimal, octal, binary, signed and unsigned formats may be selected.
Structures can be expanded to display their member fields and pointers can be traversed to
display data they are pointing to.
Watchpoints can be set in this component. Refer to Control Points chapter.
Data Operations
• Double-click a variable line to edit the value.
• Select a variable in the Data component, and left mouse button + W key to set a
Write watchpoint on the selected variable. A red vertical bar is displayed on the left
side of the variables on which a write watchpoint has been defined. If write access is
detected on the variable during execution, the program is halted and the current
program state is displayed in all window components.
• Select a variable in the Data component, and left mouse button + B key to set a Read/
Write watchpoint on the selected variable. A yellow vertical bar is displayed for the
variables on which a read/write watchpoint has been defined. If the variable is
accessed during execution, the program is halted and the current program state is
displayed in all window components.
• Select a variable on which a watchpoint was previously defined in the Data
component, and left mouse button + D key to delete the watchpoint on the selected
variable. The vertical bar previously displayed for the variables is removed.
• Select a variable in the Data component, and left mouse button + S key to set a
watchpoint on the selected variable. The Watchpoints Setting dialog box opens. A
gray vertical bar displays for the variables on which an watchpoint has been defined.
Expression Editor
To add your own expression (in EBNF notation) double-click a blank line in the Data
component window to open the Edit Expression dialog box shown in Figure 3.19, or
point to a blank line as shown below and right-click to select Add Expression in the
context menu shown in the figure below.
You may enter a logical or numerical expression in the edit box, using the Ansi-C syntax.
In general, this expression is a function of one or several variables from the current Data
component window.
Example:
With two variables variable_1, variable_2;
expression entered: (variable_1<<variable_2)+ 0xFF) <= 0x1000 results in a boolean
type.
expression entered: (variable_1>>~variable_2)* 0x1000 results in an integer type.
NOTE It is not possible to drag an expression defined with the Expression Editor. The
forbidden cursor is displayed.
Data Menu
Figure 3.20 shows the Data component menu, the Zoom submenu is shown in Figure 3.29,
the Scope submenu is shown in Figure 3.21, the Format submenu in Figure 3.22, the Mode
submenu in Figure 3.24, the Options submenu in Figure 3.26 and the Zoom and Sort
submenus in Figure 3.29. Table 3.8 describes the Data Menu entries.
Format Symb, Hex (hexadecimal), Oct (octal), Bin (binary), Dec (signed
decimal), UDec (unsigned decimal) display format.
Options Opens an options menu for data, for example, Pointer as Array
facility.
Scope Submenu
The Scope Submenu is activated by highlighting the Scope entry on the Data menu:
NOTE If the data component mode is not automatic, entries are grayed (because it is
not allowed to change the scope).
In Local Scope, if the Data component is in Locked or Periodical mode, values of the
displayed local variables may be invalid (since these variables are no longer defined in the
stack).
Format Submenu
The Format Submenu is activated by highlighting the format entry on the Data menu:
Table 3.11 describes the Format Selected Mode and Format All Mode Submenu entries.
Bit Reverse Select the bit reverse data display format (each bit is reversed).
Mode Submenu
The Mode Submenu is activated by highlighting the Mode entry on the Data menu:
NOTE In Locked and Frozen mode, variables from a specific module are displayed in
the data component. The same variables are always displayed in the data
component.
Options Submenu
The Options submenu is activated by highlighting the Options entry on the Data menu:
Within this dialog box, you can display pointers as arrays, assuming that the pointer points
to the first item (pointer[0]). Note that this setup is valid for all pointers displayed in the
Data window. Check the Display Pointer as Array checkbox and set the number of items
that you want to be displayed as array items.
This dialog box allows you to adjust the width of the variable name displayed in the Data
window. This string is cut off if longer than 16 characters. Thus, by enlarging the value
you can adapt the window to longer names.
Disable Appears only in the context menu if a breakpoint is set on the pointed to
Breakpoint instruction. When selected, disables this watchpoint.
Show Opens the Watchpoints Setting dialog box and allows you to view the
Watchpoints list of watchpoints defined in the application. (Refer to Control Points.)
Show Forces all open components to display information about the pointed to
location variable (e.g., the Memory component selects the memory range where
the variable is located).
Drag Out
Table 3.14 describes the drag actions possible from the Data component.
Destination Action
Component Window
Command Line Dragging the name appends the address of the variable to
the current command in the Command Line Window.
Dragging the value appends the variable value to the
current command in the Command Line Window.
Destination Action
Component Window
Register Dragging the name loads the destination register with the
address of the selected variable. Dragging the value loads
the destination register with the value of the variable.
NOTE Expressions are evaluated at run time. They do not have a location address, so
you cannot drag an expression name into another component. Values of
expressions can be dragged to other components.
Drop Into
Table 3.15 describes the drop actions possible in the Data component.
Associated Commands
ADDXPR, ATTRIBUTES, DUMP, PTRARRAY, SMOD, SPROC, UPDATERATE,
ZOOM.
Memory Component
The Memory window shown in Figure 3.32 displays unstructured memory content or
memory dump, that is continuous memory words without distinction between variables.
Various data formats (byte, word, double) and data displays (hexadecimal, binary, octal,
decimal, unsigned decimal) can be specified for display and editing of memory content.
Watchpoints can be defined in this component.
Memory areas can be initialized with a fill pattern using the Fill Memory box.
An ASCII dump can be added/removed on the right side of the numerical dump when
checking/unchecking ASCII in the Display menu entry.
The location address may also be added/removed on the left side of the numerical dump
when checking/unchecking Address in the Display menu entry.
To specify the start address for the memory dump use the Address menu entry.
The Component Windows Object Info Bar contains the procedure or variable name,
structure field and memory range matching the first selected memory word.
"uu" memory value means: not initialized.
"pp" memory value means: protected from being read, or protected from being read and
written.
"rr" memory value means: not accessible because the hardware is running.
"--" memory values mean: not configured (no memory available)
NOTE Memory values that have changed since the last refresh status are displayed in
red. However, if a memory item is edited or rewritten with the same value, the
display for this memory item remains black.
TIP HCS08 devices with Memory Management Unit (MMU) have two address spaces.
The Paged address space covers regular, that is, physical/local and logical displays
(see Banked/Window Paged Memory: Physical/Local vs. Logical display for
further details). The Flash address space covers the Extended Address range
(covering the Flash memory as one single linear range), as accessed by the Linear
Address Space Pointer of the chip MMU.
Memory Operations
• Double-click a memory position to edit it. If the memory is not initialized, this
operation is not possible.
• Drag the mouse in the memory dump to select a memory range.
• Hold down the left mouse button + A key to jump to a memory address. The pointed
to value is interpreted as an address and the memory component dumps memory
starting at this address.
• Select a memory range, and hold down the left mouse button + R key to set a Read
watchpoint for the selected memory area. Memory ranges where a read watchpoint
has been defined are underlined in green. If read access on the memory area is
detected during execution, the program is halted and the current program state is
displayed in all window components.
• Select a memory range, and hold down the left mouse button + W key to set a Write
watchpoint on the selected memory area. Memory ranges where a write watchpoint
has been defined are underlined in red. If write access on the memory area is detected
during execution, the program is halted and the current program state is displayed in
all window components.
• Select a memory range, and hold down the left mouse button + B key to set a Read/
Write watchpoint on the selected memory area. Memory ranges where a read/write
watchpoint has been defined are underlined in black. If the memory area is exceeded
during execution, the program is halted and the current program state is displayed in
all window components.
• Select a memory range on which a watchpoint was previously defined, and hold
down the left mouse button + D key to delete the watchpoint on the selected memory
area. The memory area is no longer underlined.
• Select a memory range, and hold down the left mouse button + S key to set a
watchpoint on the selected memory area. The Watchpoints Setting dialog box is
opened. Memory ranges where a watchpoint has been defined are underlined in
black.
Memory Menu
The Memory Menu shown in Figure 3.34 provides access to memory commands. Table
3.16 describes the menu entries.
Fill Opens the Fill Memory to fill a memory range with a bit pattern.
Address Opens the memory dialog box and prompts for an address.
CopyMem Opens the CopyMem dialog box that allows you to copy memory
range values to a specific location.
Format Submenu
With the Format Submenu shown in Figure 3.36, you can set the memory display format.
Table 3.18 describes the menu entries.
Bit Reverse Selects the bit reverse memory display format (each bit is reversed).
Mode Submenu
With the Mode submenu shown in Figure 3.37, you can set the memory mode format.
Table 3.19 describes the menu entries.
Frozen Selects the Frozen mode, memory dump displayed in the memory
component is not updated when the connection is stopped.
Display Submenu
With the Display submenu shown in Figure 3.38, you can set the memory display
(address/ASCII). Table 3.20 describes the menu entries.
Fill Memory
The Fill Memory dialog box shown in Figure 3.39 allows you to fill a memory range
(from Address edit box and to Address edit box) with a bit pattern (value edit box).
NOTE If Hex Format is checked, numbers and letters are interpreted as hexadecimal
numbers. Otherwise, type expressions and prefix Hex numbers with 0x or $.
Display Address
With the Display Address dialog box, shown in Figure 3.40, the memory component
dumps memory starting at the specified address.
NOTE The Show PC dialog box is the same as the Display Address dialog box. In this
dialog box, the Assembly component dumps assembly code starting at the
specified address.
CopyMem Submenu
The CopyMem dialog box shown in Figure 3.41 allows you to copy a memory range to a
specific address.
To copy a memory range to a specific address, enter the source range and the destination
address. Press the OK button to copy the specified memory range. Press the Cancel
button to close the dialog box without changes. Press the Help button to open the help file
associated with this dialog box.
If Hex Format is checked, all given values are in Hexadecimal Format. You don't need to
add 0x. For instance, type 1000 instead of 0x1000.
NOTE If you try to read or write to an unauthorized memory address, an error dialog
box appears.
Search Pattern
The Search Pattern dialog box shown in Figure 3.42 allows you to search memory or a
memory range for a specific expression.
Refresh
Select the Refresh menu entry to refresh the Memory window current data cache. The
debugger refreshes the data cache as if the debugger was halted or stepped.
Note that only memory ranges defined with the Refresh memory when halting option in
the Debugging Memory Map (DMM) interface are refreshed. The Refresh menu entry
addresses, by DMM factory setup, the volatile memory, i.e. the RAM and on-chip I/O
Registers.
TIP To refresh other memory ranges, either set the Refresh memory when halting
option for wanted ranges in the DMM dialog, or type/enter the DMM
RELEASECACHES command in the Command window. You can disable caching
for the debug session when typing/entering the DMM CACHINGOFF command in
the Command window.
Update Rate
This dialog box, shown in Figure 3.43, allows you to modify the update rate in steps of
100ms.
NOTE Periodical mode is not available for all hardware connections or some
additional configuration may be required in order to make it work.
When you check the Refresh memory periodically when halted checkbox, the debugger
keeps on refreshing caches even when it is not running. This allows you to see I/O
Register changes even if the CPU is not running.
Table 3.21 explains the menu entries in the Memory Context menu.
Set Watchpoint Appears in the context menu only if no watchpoint is set or disabled
on the selected memory range. When selected, sets a Read/Write
watchpoint at this memory area. Memory ranges where a read/write
watchpoint has been defined are underlined in yellow. If the memory
area is accessed during execution of the application, the program is
halted and the current program state is displayed in all window
components.
Set Markpoint Appears in the context menu only if no watchpoint is set or disabled
on the selected memory range. When selected, sets a Read/Write
watchpoint at this memory area.
Show Location Forces all opened windows to display information about the
selected memory area.
Drag Out
Table 3.22 describes the drag actions possible from the Memory component.
Destination Action
Component Window
Command Line Appends the selected memory range to the Command Line
window.
Register Loads the destination register with the start address of the
selected memory block.
Source Displays high level language source code starting at the first
address selected. Instructions corresponding to the
selected memory area are grayed in the source component.
Drop Into
Table 3.23 shows the drop actions possible in the Memory component.
Associated Commands
ATTRIBUTES, FILL, SMEM, SMOD, SPC, UPDATERATE.
Module Component
The Module window shown in Figure 3.45 gives an overview of source modules building
the application.
The Module component displays all source files (source modules) bound to the
application. The Module window displays all modules in the order they appear in the
absolute file.
Module Operations
Double-clicking a module name forces all open windows to display information about the
module: the Source Component window shows the module's source and the global Data
Component window displays the module's global variables.
Module Menu
The Module Component window has no menu.
Drag Out
Table 3.24 shows the drag actions possible from the Module component.
.
Destination Action
Component Window
Data > Global Displays the global variables from the selected module in
the data component
Drop Into
Nothing can be dropped into the Module Component window.
Procedure Component
The Procedure window shown in Figure 3.46 displays the list of procedure or function
calls that have been made up to the moment the program was halted. This list is known as
the procedure chain or the call chain.
In the Procedure Component window, entries in the call chain are displayed in reverse
order from the last call (most recent on top) to the first call (initial on bottom). Types of
procedure parameters are also displayed.
The Object Info bar of the component window contains the source module and address of
the selected procedure.
Procedure Operations
Double-clicking on a procedure name forces all open windows to display information
about that procedure. The Source Component window shows the procedure's source. The
local Data Component window displays the local variables and parameters of the selected
procedure. The current assembly statement inside this procedure is highlighted in the
Assembly component.
NOTE When a procedure of a level greater than 0 (the top most) is double clicked in
the Procedure Component, the statement corresponding to the call of the lower
procedure is selected in the Source Window and Assembly Window.
Procedure Menu
Figure 3.47 shows the Procedure menu and its entries are described in Table 3.25.
Drag Out
Table 3.26 shows the drag actions possible from the Procedure component.
Destination Action
Component Window
Data > Local Displays the local variables from the selected procedure in
the data component.
Drop Into
Nothing can be dropped into the Procedure component.
Associated Commands
ATTRIBUTES, FINDPROC
Profiler Component
The Profiler window shown in Figure 3.48 provides information on the application profile.
The Profiler window contains source module and procedure names and percentage values
representing the time spent in each source module or procedure. The Profiler component
window contains percentages and also graphic bars.
The Profiler window can set a split view in the Source and Assembly windows, as shown
in Figure 3.49. To obtain a split view in either the Source or Assembly windows, select:
Details > Source or Details > Assembly or both from the Profiler menu and submenu. The
split windows collapse when the Profiler window is closed.
Percentage values representing the time spent in each source or assembler instruction are
displayed on the left side of the instruction. The split view can also display graphic bars.
Split views are removed when the Coverage component is closed or if you open the split
view Context Menu and select Delete.
The value displayed may reflect percentages from total code or percentages from module
code.
Profiler Operations
Click the fold/unfold icon to unfold/fold the source module.
Profiler Menu
Figure 3.50 shows the Profiler Menu entries, with the Details submenu and the Base
submenu. Figure 3.51 shows the Profiler Output File submenu. Entries are described in
Table 3.27.
Drag Out
All displayed items can be dragged out. Destination windows may display information
about the time spent in code in a split view.
Drop Into
Nothing can be dropped into the Profiler Component window.
Associated Commands
GRAPHICS, TUPDATE, DETAILS, RESET, BASE.
Recorder Component
The Recorder window shown in Figure 3.54 provides record and replay facilities for
debug sessions.
The Recorder window enables the user to record and replay command files. The recorded
file may also contain the time at which the command is executed.
Click the buttons shown below to record, play, pause and stop.
Play. Record. Stop. Pause.
Recorder Operations
When there is no record or play session (e.g., when the window is open), only the record
and play buttons are enabled.
When you click the record button, the debugger prompts you to enter a file name. Then a
record session starts and the stop button is enabled. Click the stop button to end the record
session.
Clicking the replay button prompts for a file name. Command files have a .rec default
extension and can be edited. A replay session starts and only the stop and pause buttons
are enabled. When the pause button is clicked, file execution stops and the play and stop
buttons are enabled. When the play button is clicked, file execution continues from the
point it has been stopped. When the stop button is clicked, the replay session stops.
Recorder Menu
The Recorder menu shown in Figure 3.55 changes according to the current session. The
menu items are described in Table 3.29.
Record Time If set, the evolution time is also recorded. Instant 0 corresponds
to the beginning of the recording.
In Listing 3.2, an .abs file is loaded, a breakpoint is set, the assembly component is
configured to display the code and addresses. The Data1 component display is switched to
local variables, and the application starts and stops at the breakpoint.
Drag Out
Nothing can be dragged out.
Drop Into
Nothing can be dropped in.
Register Component
The Register window, shown in Figure 3.56, displays the content of registers and status
register bits of the target processor.
Register values can be displayed in binary or hexadecimal format. These values are
editable.
TIP Many more registers and registers information might by provided by the Inspector
Component, in the IO Registers field.
Editing Registers
Double-click on a register to open an edit box over the register, so that the value can be
modified.
Press the ESC key to ignore changes and retain previous content of the register.
If the Enter key is pressed outside the edited register, the new value is validated and the
register content is changed.
If the Tab key is pressed, the new value is validated and the register content is changed.
The next register value is selected and may be modified.
Double-clicking a status register bit toggles it.
Holding down the left mouse button and pressing the A key changes the contents of
Source, Assembly and Memory component windows. The Source window shows the
source code located at the address stored in the register. The Assembly window shows the
disassembled code starting at the address stored in the register. The Memory window
dumps memory starting at the address stored in the register.
Float Selects the float register display format (all 32/64 bit registers are
displayed as floats, all others as hex)
Auto Selects the auto register display format (all floating point 32/64 bit
registers are displayed as floats, all others as hex)
Bit Reverse Selects the bit reverse data display format (Each bit is reversed).
Drag Out
Table 3.31 contains the drag actions possible from the Register window.
Destination Action
Component Window
Drop Into
Table 3.32 shows the drop actions possible into the Register component.
Data Dragging the name loads the destination register with the
start address of the selected variable. Dragging the value
loads the destination register with the value of the variable.
Memory Loads the destination register with the start address of the
selected memory block.
Associated Commands
ATTRIBUTES.
Source Component
The Source window shown in Figure 3.58 displays the source code of your program, i.e.
your application file.
The Source window allows you to view, change, monitor and control the current execution
location in the program. The text displayed in the Source Component window is chroma-
coded, i.e. language keywords, comments and strings are emphasized with different colors
(respectively blue, green, red). A word can be selected by double-clicking it. A section of
code can be selected by holding down the left mouse button and dragging the mouse.
The object info bar displays the line number in the source file of the first visible line that is
at the top of the source.
Source code can be folded and unfolded. Marks (places where breakpoints may be set) can
be displayed.
When the source statement matching the current PC is selected in this window,
(e.g., in a C source: ), the matching assembler instruction in the
Assembler component window is also selected. This instruction is the next instruction to
be executed by the CPU.
If breakpoints have been set in the program, they are marked in the program source with a
special symbol depending on the kind of breakpoint. For information on breakpoints refer
to the Control Points chapter. If execution stops, the current position is marked in the
source component by highlighting the corresponding statement.
The complete path of the displayed source file is written in the Object Info bar of this
window.
NOTE You cannot edit the visible text in the Source window. This is a file viewer
only.
Select ToolTips > Enable from the source menu entry to enable or disable the tool tips
feature.
Select ToolTips > Mode from the source menu entry to select normal or details mode,
which provides more information on a selected procedure.
Select ToolTips > Format from the source menu entry to select the tool tip display format
(Decimal, Hexadecimal, Octal, Binary or ASCII).
On-Line Disassembling
For information about performing on-line disassembly, refer to section How to Consult
Assembler Instructions Generated by a Source Statement.
• Select a range of instructions in the source component and drag it into the assembly
component. The corresponding range of code is highlighted in the Assembly
component window, as shown in Figure 3.60.
• Holding down the left mouse button and pressing the T key: Highlights a code range
in the Assembly component window corresponding to the first line of code selected
in the Source component window where the operation is performed. This line or code
range is also highlighted.
• Double-click an unfolding mark to unfold the text that is hidden behind the
mark.
Source Menus
The Source Menu is shown in Figure 3.62 and Figure 3.63 shows the functions associated
with the Source Context Menu. Table 3.33 describes these functions. Menu content varies
if the DBG module is available.
Set Breakpoint Appears only in the Context Menu if no breakpoint is set or disabled
at the nearest code position (visible with marks). When selected, sets
a permanent breakpoint at this position. If program execution reaches
this statement, the program is halted and the current program state is
displayed in all window components.
Disable Appears only in the Context Menu if a breakpoint is set at the nearest
Breakpoint code position (visible with marks). When selected, disables this
breakpoint.
Run To Cursor When selected, sets a temporary breakpoint at the nearest code
position and continues program execution immediately. Disabling a
permanent breakpoint at this position disables the temporary
breakpoint and prevents the program from halting. Temporary
breakpoints are automatically removed when they are reached.
Set Markpoint Appears only in the Context Menu if a markpoint is disabled at the
nearest code position (visible with marks). When selected, enables
this markpoint.
Delete Appears only in the Context Menu if a markpoint is set at the nearest
Markpoint code position (visible with marks). When selected, disables this
markpoint.
Set Program The Program Counter is set to the address of the selected source
Counter code.
Open Source Opens the Source File dialog box if a CPU is loaded (see chapter
File below).
Copy Copies the selected area of the source component into the clipboard.
(CTRL+C) You can select a word by double-clicking it. You can select a text area
with the mouse by moving the pointer to the left of the lines until it
changes to a right-pointing arrow, and then drag up or down;
automatic scrolling is activated when the text is not visible in the
windows.
Go to Line Opens a dialog box to scroll the window to a number line (see chapter
(CTRL+G) below).
Find (CTRL+F) Opens a dialog box prompting for a string and then searches the file
displayed in the source component. To start searching, click Find
Next, the search is started at the current selection or at the first line
visible in the source component.
ToolTips Allows you to enable or disable the source tool tips feature, to set up
the tool tip mode, and tool tip format.
NOTE If some statements do not show marks although the mark display is switched
on, the following reasons may be the cause:
- The statement did not produce any code due to optimizations done by the
compiler.
- The entire procedure was not linked in the application, because it is never
used.
Go to Line
This menu entry is only enabled if a source file is loaded. It opens the dialog box shown in
Figure 3.65. In this dialog box, enter the line number you want to go to in the source
component, and the selected line appears at the top of the source window. If the number is
incorrect, a message appears.
When this dialog box is open, the line number of the first visible line in the source is
displayed and selected in the Enter Line Number edit box.
Find Operations
The Find dialog box, shown in Figure 3.66 is used to perform find operations for text in
the Source component. Enter the string you want to search for in the Find what edit box.
To start searching, click Find Next, the search starts at the current selection or first line
visible in the source component, when nothing is selected.
Use the Up / Down buttons to search backward or forward. If the string is found, the
source component selection is positioned at the string. If the string is not found, a message
is displayed.
NOTE If an item (single word or source section) has been selected in the Source
component window before opening the Find dialog box, the first line of the
selection is copied into the Find what edit box.
Find Procedure
The Find Procedure dialog box, shown in Figure 3.67 is used to find the procedure name
in the currently loaded application. Enter the procedure name you want to search for in the
Find Procedure edit box. To start searching, click OK, the search starts at the current
selection or at the first line visible in the source component, when nothing is selected.
If a valid procedure name is given as a parameter, the source file where the procedure is
defined is opened in the Source Component. The procedure’s definition is displayed and
the procedure’s title is highlighted.
The drop-down list allows you to access the last searched items (classified from first to
older input). Recent search items are stored in the current project file.
Folding Menu
The Folding Menu shown in Figure 3.68 allows you to select the Fold functions described
in Table 3.34.
All Text Folded At Loading Folds all source code at load time
Drag Out
Table 3.35 shows the drag actions possible from the Source component.
Destination Action
Component Window
Drop Into
Table 3.36 shows the drop actions possible into the Source component.
Memory Displays high level language source code starting at the first
address selected. Instructions corresponding to the selected
memory area are grayed in the source component.
Associated Commands
ATTRIBUTES, FIND, FOLD, FINDPROC, SPROC, SMOD, SPC, SMEM, UNFOLD.
Terminal Component
The Terminal Component window shown in Figure 3.69 can be used to simulate input and
output. It can receive characters from several input devices and send them to other
devices.
You can use a virtual SCI (Serial Communication Interface) port provided by the
framework for communication with the target, but it is also possible to use the keyboard,
the display, some files or even the serial port of your computer as I/O-devices.
To control and configure a terminal component use the Terminal menu of the terminal
shown in Figure 3.70.
You can simply choose one of the default configurations in the Default Configuration
combo box. In the Connections section all active connections are listed in a list box.
There you can customize input to output device redirection by adding and removing
connections.
To add a connection specify the source and target devices using the From and To combo
boxes and then press the Add button. The new connection then appears in the list below,
which shows all active connections.
To remove connections, select them in the list of active connections and press the Remove
button.
In the Serial Port section you can specify which serial port to use and its properties. This
is only possible if there is at least one connection from or to the serial port.
If you select a connection from or to the virtual SCI port you can also specify which ports
to take as virtual SCI ports in the Virtual SCI section. This enables you to make a
connection to any port in the FCS framework.
ESC “h” “3” filename Open output file and suppress output to terminal display.
ESC “h” “7” filename Append to existing output file and suppress output to terminal
display.
NOTE Only some specific Full Chip Simulation components currently have a Sci0
object. For all other Full Chip Simulation components the default virtual SCI
port does not work unless a user defined Sci0 object with the specified register
name is loaded.
Write access to the target application is done with the Object Pool function OP_SetValue
at the address Sci0.SerialInput.
Input from the target application is handled with a subscription to an Object Pool register
with the name Sci0.SerialOutput. When this register changes (sends a notification), a
new value is received.
For implementations of this register with help of the IOBase class, use the
IOB_NotifyAnyChanges flag. Otherwise only the first of two identical characters are
received.
It is also possible to configure the terminal to use another object in the Object Pool instead
of Sci0 with which to communicate. Refer to Configure Terminal Connections for
information about where you can do this.
Cache Size
The item Cache Size in the context menu allows you to set the number of lines in the
terminal window with the dialog shown in Figure 3.72.
Trace Component
The Trace window shown in Figure 3.73 records and displays instruction frames and time
or cycles.
Trace Operations
Pointing at a frame and dragging the mouse forces all open windows to show the
corresponding code or location. Time and cycles of all other frames are evaluated relative
to this base.
Holding down the left mouse button and pressing the Z key sets the zero base frame to the
pointed frame.
Holding down the left mouse button and pressing the D key forces all open component
windows to show the code matching the pointed to frame.
Trace Menu
The Trace Menu shown in Figure 3.74 contains the functions described in Table 3.38.
Trace menu entries vary depending on the connection.
Search Trace Use to specify search conditions (see Associated Context Menu).
Search Trace Select this menu entry to activate the Trace Search Setup dialog box
Setup (see Figure 3.76). Specify either the frame or a condition for which to
search. (Not available with all connections.)
Next Steps to the next occurrence of the condition. Pressing the N key has
the same effect.
Previous Steps back to the previous occurrence of the condition. Pressing the
P key has the same effect.
Drag Out
Nothing can be dragged out.
Drop Into
Nothing can be dropped in.
Associated Commands
CLOCK, CYCLE, FRAMES, RECORD, RESET.
Visualization Utilities
Besides components that provide the Debugger engine a well-defined service dedicated to
the task of application development, the debugger component family includes utility
components that extend to the productive phase of applications, such as, the host
application builder components, process visualization components, etc.
Among these components, there are visualization utilities that graphically display values,
registers, memory cells, etc., or provide an advanced graphical user interface to simulated
I/O devices, program variables, and so forth.
The following components of the continuously growing set of visualization utilities
belong to the standard Debugger installation.
Inspector Component
The Inspector window shown in Figure 3.77 displays information about several topics. It
displays loaded components, the visible stack, pending events, pending exceptions and
loaded I/O devices.
The hierarchical content of the items is displayed in a tree structure. If any item is selected
on the left side, then additional information is displayed on the right side.
In the figure above, for example, the Object Pool is expanded. The Object Pool contains
the TargetObject, which contains the Leds and Swap peripheral devices. The Swap
peripheral device is selected and registers of the Swap device are displayed.
Components Icon
When the components icon is selected in the Inspect window, as shown in Figure 3.78, the
right side displays various information about all loaded components. A Component is the
“unit of dynamic loading”, therefore all windows, the CPU, the connection and perhaps
the connection-simulator are listed.
Stack Icon
The Stack icon shown in Figure 3.79 displays the current stack trace. Every function on
the stack has a separate icon on the trace. In the stack-trace, the content of a local variable
is accessible.
Symbol Table
The symbol table shown in Figure 3.80 displays all loaded symbol table information in
raw format. There are no stack frames associated with functions. Therefore the content of
local variables is not displayed. Global variables and their types are displayed.
Events Icon
The Inspect window Events icon shown in Figure 3.81 shows all currently installed
events. Events are handled by peripheral devices, and notified at a given time. The Event
display shows the name of the event and remaining time until the event occurs.
Events are only used in the HC(S)08 Freescale Full Chip Simulator. This information is
used for simulation I/O device development.
When simulating a watchdog/COP, an event with the remaining time is displayed in the
Event View.
Exceptions Icon
The Inspector window Exceptions icon shown in Figure 3.82 shows all currently raised
exceptions. Exceptions are pending interrupts.
Events are only used in the HC(S)08 Freescale Full Chip Simulator. This information is
used for simulation I/O device development.
Since interrupts are usually simulated immediately when they are raised, the Exceptions
are usually empty. Only when interrupts are disabled or an interrupt is handled, something
is visible in this item.
When simulating a watchdog/COP, an Exception is raised as soon as the watchdog time
elapses.
Object Pool
The Object Pool shown in Figure 3.83 is a pool of objects. It can contain any number of
Objects, which can communicate together and also with other parts of the Debugger.
The most common use of Objects is to simulate special hardware with the I/O
development package, however, other connections also use the Object Pool. For example,
the Terminal Component exchanges its input and output by the Object Pool. The Terminal
Component also operates with some hardware connections.
For the HC(S)08 Freescale Full Chip Simulator, the Object Pool usually contains the
TargetObject, which represents the address space. All Objects that are loaded are
displayed in the Object Pool. The TargetObject additionally shows the objects that are
mapped to the address space.
IO Registers
The IO Registers icon shown in Figure 3.84 shows all the IO Registers and Core Registers
referenced by the debugger database. The Inspector can therefore provide many more
registers information than the regular Register window.
Each group of registers can be expanded, and registers can be directly edited in the Value
column when double-clicking directly on the value. Register names are provided in the
Name column, an access result diagnostic is given in the AccessResult column, the
register size is given in bits in the size column, the kind of access (read, read/write, write is
given in the Access column, and finally the Type column indicates if the register is
memory mapped or is a special purpose register (core).
Inspector Operations
Click the folded/unfolded icons to unfold/fold the tree and display/hide additional
information.
Click on any icon or name to see the corresponding information displayed on the right
side.
On the right side, some value fields can be edited by double clicking on them. Only values
that are accessible can be edited. Usually, if a value is displayed, it can be changed. I/O
Devices in the Object Pool do not accept all new values, depending on the I/O Device.
Values can be entered in hexadecimal (with preceding 0x), in decimal, in octal (with
preceding 0), or in binary (with preceding &).
To see the IO_Led in the Inspector, as shown in Figure 3.85, open the IO_Led with the
context menu Component-Open and then open the Inspector. If the Inspector is already
loaded, select Update from the context menu in the Inspector. Then click on the
Components icon to see the Component list, which now includes the “IO_Led”
component.
Expand Object Pool, to see the Leds icon. Click on the Leds icon. On the right side, the
Port_Register and Data_Direction_Register are displayed with their current value. Double
click on the values to change them (Figure 3.86).
Inspector Menu
The Inspector menu contains entries described in Table 3.40.
Max. Elements All items To display large arrays element by element, the
maximum number can be configured. It is also
possible to display a dialog box that prompts the
user.
Drag Out
Items that can be dragged, depends on which icon is selected. Table 3.42 gives a brief
description.
Drop Into
Nothing can be dropped in.
Instrument Selection
You can select a single instrument by left clicking the mouse on it, and change the
selection by pressing the tab-key.
To make multiple selections, hold down the control key and left-click on the desired
instruments. You can also left click, hold and move to create a selection rectangle.
Move Instruments
There are two ways to move instruments. First, make your desired selection. You can then
use the mouse to drag the instruments, or use the cursor keys to move them step by step
(hold down the control key to move the instrument in steps of ten). The move process
performed with the mouse can be broken off by pressing the escape key.
Resize Instruments
When you select a instrument, sizing handles appear at the corners and along the edges of
the selection rectangle. You can resize an object by dragging its sizing handles, or by
using the cursor keys while holding down the shift key. The resize process performed with
the mouse can be broken off by pressing the escape key. Only one instrument can be
resized at a time. Furthermore, each instruments has its own size minimum.
VisualizationTool Menu
Once the Visualization Tool component has been launched, its menu appears in the
debugger menu bar. The menu contains the entries described in Table 3.43.
Add New Enables to choose an instrument from the list and add it to the view.
Instrument
Edit mode Switches between Display mode and Edit mode. In Edit mode, this
entry is checked.
Shortcut: <Ctrl+E>
Edit mode Always Switches between Display mode and Edit mode. In
Edit mode, this entry is checked.
Add New Edit mode Shows a new context menu with all available
Instrument instruments.
Properties Only one Shows property dialog box for the currently selected
instrument instrument.
selected
Shortcut: Ctrl + P
Copy At least one Copies data of the currently selected instruments into
selection the clipboard.
Shortcut: Ctrl + C
Cut At least one Cuts currently selected instruments into the clipboard.
selection Shortcut: Ctrl + X
Paste Edit mode Adds instruments, which are temporary stored in the
clipboard, to the workspace.
Shortcut: Ctrl + V
Send to Back At least one Sends current instrument to the back of the Z-order.
selection
Send to Front At least one Brings current instrument to the front of the Z-order.
selection
Top Align Aligns instruments to the top line of the last selected
instrument.
Left Align Aligns instruments to the left line of the last selected
instrument.
Right Align Aligns instruments to the right line of the last selected
instrument.
Size Align Makes size of all selected instruments the same as the
last selected.
Vertical Size Align Makes vertical size of all selected instruments the
same as the last selected.
VisualizationTool Properties
Like other instruments, the VisualizationTool itself has Properties. There are several
configuration possibilities for the VisualizationTool, shown in Table 3.45. To view the
property dialog box of the VisualizationTool, use the shortcut <CTRL-P> or double click
on the background.
Display Scrollbars Switches the scrollbars on, off, or sets it to automatic mode.
Grid Mode Specifies the grid mode. There are four possibilities: Off, Show
grid but no snap, Snap to grid without showing the grid, or Show
the grid and snap on it.
Grid Size Specifies the distance between two grid points (vertical,
horizontal).
Refresh Mode Specifies window refresh mode. You may choose between:
Automatic, Periodical, Each access, CPU Cycles.
Instruments
When you first add an instrument, it is in “move mode”. Place it at the desired location on
the workspace. All new instruments are set to their default attributes. To configure an
instrument, right-click on an instrument and choose Properties, or double click on it. All
instruments have the common attributes shown in Table 3.46.
:
Attribute Description
Background Defines the color of the instrument’s background. The checkbox enables
color to set a color or let the instrument be transparent.
Kind of Port Specifies the kind of port to be used to get the value to display. The
location must be specified in the Port to Display field.
Port to Defines the location of the value be used for the instrument’s
Display visualization.
Here are some Examples:
Substitute: TargetObject.#210
Subscribe: TargetObject.#210
Subscribe: PORTB.PORTB (check exact spelling using Inspector)
Variable: counter
Register: SP
Memory: 0x210
Size of Port If you use the Memory Port, you can also specify the width of memory to
display (up to 4 Bytes).
Analog Instrument
The Analog instrument (Figure 3.89) represents the classical pointer instrument, also
known as speedometer or voltage meter.
Attribute Description
Low Display Value Defines zero point of the indicator. Values below this definition
are not displayed.
High Display Value Defines highest position of the indicator. Defines the value at
which the indicator reads 100%.
Indicatorlength Defines length of the small indicator. Minimal value is set to 20.
Bar Instrument
Using the Bar instrument, values are displayed by a bar strip. This instrument (see Figure
3.90) may be used as a position state of a water tank.
Attribute Description
Low Display Value Defines zero point of the indicator. Values below this definition
are not displayed.
High Display Value Defines highest position of the indicator. Defines the value on
which the indicator reads 100%.
Bardirection Sets desired direction of the bar that displays the value.
Bitmap Instrument
You can use the Bitmap instrument to give a special look to your visualization, or to
display a warning picture.
Additionally, it can also be used as a bitmap animation. Its attributes are shown in Table
3.49.
Attribute Description
Filename Specifies the location of the bitmap. With the button behind, you
can browse for files.
AND Mask Performs a bitwise-AND operation with this value. AND the
value of the selected port. Default value is 0.
EQUAL Mask This value is compared to the result of the AND operation. The
bitmap is displayed only if both values are the same. Default
value is 0.
In general, for showing the bitmap, the following condition has to be true:
(port_memory & ANDmask) == EQUALmask
Following is a practical example about using the AND and EQUAL masks
You want to show in the visualization a tail light of a car. For this you need bitmaps (e.g.
from a digital camera) of all possible states of the tail light (e.g. flasher on, brake light on,
etc.). Usually the status of all lamps are encoded into a port or memory cell in your
application, and each bit in this cell describes whether a lamp is on (e.g., bit 0 says that the
flasher is on, while bit 1 says that the brake light is on. So for your simple application you
need the following bitmaps with their settings:
• No light on bitmap: AND mask 3, EQUAL mask 0
• Flasher on bitmap: AND mask 3, EQUAL mask 1
• Brake light on bitmap: AND mask 3, EQUAL mask 2
• Brake and flasher light on: AND mask 3, EQUAL mask 3
DILSwitch Instrument
The DILSwitch instrument is also known as Dual-in-Line Switch (Figure 3.91). It is
mainly used for configuration purposes. You can use it for viewing or setting bits of one to
four bytes.
Attribute Description
Display 0/1 When enabled, displays the value of the bit under each plot of
the DILSwitch instrument.
Knob Instrument
The Knob instrument is normally known as an adjustment instrument. For example, it can
simulate the volume control of a radio (Figure 3.92).
Attribute Description
Low Display Value Defines the zero point of the indicator. The values below this
definition are not displayed.
High Display Value Defines the highest position of the indicator. It defines the value
on which the indicator reads 100%.
Indicator Color Defines the color and the width of the pen used to draw the
indicator.
LED Instrument
The LED instrument is used for observing one definite bit of one byte (Figure 3.93). There
are only two states: On and Off.
Attribute Description
Color if Bit = = 0 Defines the color if the given bit is not set.
Attribute Description
Decimalmode Displays the first four or the second four bits of one byte in
hexadecimal mode. When it is switched off, each segment
represents one bit of one byte.
Display Version Selects the appearance of the instrument. Two versions are
available.
Color if Bit = = 1 Defines the color of an activated segment. You may also set the
color to transparent.
Color if Bit = = 0 Defines the color of a deactivated segment. You may also set
the color to transparent.
Outlinecolor Defines the color of the segment outlines. You may also set the
color to transparent.
Switch Instrument
Use the Switch instrument to set or view a definite bit (Figure 3.95). The Switch
instrument also provides an interesting debugging feature; you can let it simulate bounces,
and thus check whether your algorithm is robust enough. Four different looks of the
switch are available: slide switch, toggle switch, jumper or push button.
Attribute Description
Display 0/1 Enables ability to display the value of the bit in its upper left corner.
Attribute Description
Top Position is Specifies if the 'up' position is either zero or one. Especially useful to
easily transform the push button into a reset button.
Kind of Switch Changes the look of the instrument. Following kinds of switches are
available: Slide Switch, Toggle Switch, Jumper, Push Button.
The behavior of the Push Button slightly differs from the others, since it
returns to its initial state as soon as it has been released.
Bounces on Specifies whether the switch bounces on falling, rising or both edges.
Edge
Type of Unit Synchronizes the frequency of the bouncing either on the timer of your
host machine, or on CPU cycles.
Pulse Width Defines the duration of one bounce. Fill in this attribute if you chose
(100ms) “Host Periodical” in the “Type of Unit” attribute.
CPU Count This attribute represents the number of CPU cycles to reach before
the switch changes its state. Fill in this attribute if you chose “CPU
Cycles” in the “Type of Unit” attribute.
Text Instrument
The Text instrument has several functions: Static Text, Value, Relative Value, and
Command (Figure 3.96).
Use Text Mode to switch between the five available modes. Text instrument common
attributes are shown in the Table 3.55
Attribute Description
Text Mode Specifies the mode. Choose among four modes: Static Text,
Value, Relative Value, and Command
Displayfont Defines the desired font. All installed Windows fonts are
available.
Horiz. Text Specifies the desired horizontal alignment of the text in the
Alignment given bounding box.
Vert. Text Alignment Specifies the desired vertical alignment of the text in the given
bounding box.
Static Text is used for adding descriptions on the workspace. Its attributes are shown in
Table 3.56.
Attribute Description
Value is used for displaying a value in different ways (decimal, hexadecimal, octal, or
binary). Its attributes are shown in Table 3.57.
Attribute Description
Field Description Contains the additional description that appears in front of the
value. Add a colon and/or space as you wish. The default
setting is Value:
Format mode Defines the format. Choose among this list: Decimal,
Hexadecimal, Octal, and Binary formats.
Relative Value is used for showing a value in a range of 0 up to 100% or 1000‰. Its
attributes are shown in Table 3.58
Attribute Description
Field Description Add the additional description text to be displayed in front of the
value. Add a colon and/or space if desired. The default setting is
Value:
Low Display Value Fixes the minimal value that represents 0%. Values below this
definition appear as an error: #ERROR.
High Display Value Fixes the maximal value that represent 100%. Values above this
definition appear as an error: #ERROR.
Command: Use this instrument mode to specify a command to execute by clicking on this
field. For more information about commands, read Debugger Engine Commands. Table
3.59 shows Command mode attributes.
Attribute Description
CMD Callback mode is the same as Command, but with one difference: The returned
value appears as text instead of Field Description. Table 3.60 shows CMD Callback
mode attributes.
Attribute Description
Field Description Warning: Executing the specified command overwrites the text
in this field.
Drop Into
In Edit mode, the drag and drop functionality supplies a very easy way to automatically
configure an instrument.
To assign a variable, simply drag it from the Data Window onto the instrument.
The kind of Port is immediately set on “Memory” and the “Port to Display” field
contains the address of the variable. Now repeat the drag-and-drop on a bare portion of the
VisualizationTool window: a new text instrument is created, with correct port
configuration.
Some other components allow this operation:
• The memory window: select bytes and drag-and-drop them onto the instrument.
• The Inspector component: pick an object from the object pool.
Introduction
There are three kinds of control points:
• Breakpoints (also called data breakpoints): Breakpoints are located at an address.
They can be temporary or permanent.
• Watchpoints: Watchpoints are located at a memory range. They start from an
address, have a range, and a read and/or write state.
• Markpoints: Are marked points of observation that can be jumped to by the
programmer. They can be located in data, source or memory.
In the context menu of the Source, Memory or Assembly window you can set or disable a
control point, set a condition and an optional command, and set the current count and
counting interval.
You can edit control point characteristics in the three tabs of the Control Points
Configuration Window: Breakpoints, Watchpoints and Markpoints tab. These three tabs
have common properties that allow you to perform the following operations on control
points:
• Select a single control point from a list box and click Delete.
• Select multiple control points from a list box and click Delete.
Breakpoints
Breakpoints are control points associated with a PC value. That is, program execution is
stopped as soon as the PC reaches the value defined in a breakpoint. The debugger
supports four different types of breakpoints:
• Temporary breakpoints, which are activated next time the instruction is executed.
• Permanent breakpoints, which are activated each time the instruction is executed.
• Counting breakpoints, which are activated after the instruction has been executed a
certain number of times.
• Conditional breakpoints, which are activated when a given condition is TRUE.
Breakpoints are controlled through the Breakpoints tab of the Controlpoints Configuration
window. This window can be opened through the Source Window Context menu, as
described below:
1. Point at a C statement in the Source window, and click the right mouse button.
2. Select Show Breakpoints from this menu.
The Controlpoints Configuration Window (Breakpoints Tab) is opened. The Breakpoints
tab of this window is shown in Figure 4.2.
Breakpoints Tab
The Controlpoints Configuration Window (Breakpoints Tab) contains:
• List box that displays the list of currently defined breakpoints
• Breakpoint: group box that displays the address of the currently selected breakpoint,
name of procedure in which the breakpoint has been set, state of the breakpoint
(disabled or not), and type of breakpoint (temporary or permanent).
• Condition: group box that displays the condition string to evaluate, and the state of
the condition (disabled or not).
• Command: group box that displays the command string to execute and the state of
the command (disable or continue after command execution).
• Counter: group box that displays the current value of the counter and interval value
of the counter.
NOTE Current and Interval values are limited to 2,147,483,647. If entering a number
greater than this value, a beep occurs and the character is not appended. When
the Interval value is changed, the Counter value is automatically set to the
Interval value.
Checking Expressions
You can enter an expression in the Condition: group edit box. The syntax of the
expression is checked when you select another breakpoint in the list box or click OK. The
syntax is parameters = = expression. For a register condition the syntax is
$RegisterName = = expression.
If a syntax error has been detected, a message box is displayed:
Incorrect Condition. Do you want to correct it?.
If you click OK, correct the error in the condition edit box.
If you click Cancel, the Condition: edit box is cleared.
Saving Breakpoints
The Debugger provides a way to store all defined breakpoints of the currently loaded
application (.ABS file) into the matching breakpoints file. The matching file has the
same name as the loaded .ABS file but its extension is .BPT (for example, the
FIBO.ABS file has a breakpoint file called FIBO.BPT). This file is generated in the
same directory as the .ABS file. This is a text file, in which a sequence of commands is
stored. This file contains the following information.
• The Save & Restore on load flag (Save & Restore on load checkbox in the
Controlpoints Configuration Window (Breakpoints Tab)). The SAVEBP command
is used: SAVEBP on when checked, SAVEBP off when unchecked.
NOTE For more information about this, see the SAVEBP command.
Listing 4.2 Breakpoint File with Save & Restore on load Checked
savebp on
BS &fibo.c:Fibonacci+19 P E; cond = "fibo > 10" E; cdSz = 47 srSz = 0
BS &fibo.c:Fibonacci+31 P E; cdSz = 47 srSz = 0
BS &fibo.c:main+12 P E; cdSz = 42 srSz = 0
BS &fibo.c:main+21 P E; cond = "fiboCount==5" E; cmd = "Assembly < spc
0x800" E; cdSz = 42 srSz = 0
Case 2: If FIBO.ABS is loaded, and Save & Restore on load was unchecked in a
previous session of the same.ABS file and breakpoints have been defined, the FIBO.BPT
looks as shown below:
savebp on
Only the flag has been saved and breakpoints have been removed.
NOTE If only one or few functions differ after a recompile, not all breakpoints are
lost. Breakpoints are disabled only if the size of a function changes. The size of
a function is evaluated in bytes (when it is compiled) and in characters (number
of characters contained in the function source text). When an .ABS file is
loaded and the matching .BPT file exists, for each BS command, the debugger
checks if the code size (in bytes) and the source size (in characters) are
different in the matching function (given by the symbol table). If there is a
difference, the debugger sets and disables the breakpoint. If there is no
difference, the debugger sets and enables the breakpoint.
NOTE For more information about this syntax, see BS and SAVEBP commands.
Setting Breakpoints
Breakpoints may be set in a Source or Assembly component window.
The debugger helps you detect all positions where you can set a breakpoint.
1. Right-click in the Source component. The Source Context Menu is displayed on the
screen.
2. Choose Marks from the Context Menu. All statements where a breakpoint can be set
are identified by a special red inverted check mark:
To remove the breakpoint marks, right-click in the Source component and choose Marks
again.
Temporary Breakpoints
Temporary breakpoints are activated next time the instruction is executed. A temporary
breakpoint is recognized by the following icon:
Holding down the left mouse button and pressing the T key:
1. Point at a C statement in the Source window, hold down the left mouse button and
press the T key.
2. A temporary breakpoint is defined.
3. Choose Run To Cursor from the Context Menu. The application continues execution
and stops before executing the statement.
Temporary breakpoints are automatically deleted once they have been activated. If you
continue program execution, it no longer stops on the statement that contained the
temporary breakpoint.
Permanent Breakpoints
Permanent breakpoints are activated each time the instruction is executed. A permanent
breakpoint is recognized by the following icon:
Holding down the left mouse button and pressing the P key:
1. Point at a C statement in the Source window, hold down the left mouse button and
press the P key.
2. A permanent breakpoint mark is displayed in front of the selected statement.
Once a permanent breakpoint has been defined, you can continue program execution. The
application stops before executing the statement. Permanent breakpoints remain active
until they are disabled or deleted.
Counting Breakpoints
Counting breakpoints are activated after the instruction has been executed a certain
number of times. A Counting breakpoint is recognized by the following icon:
Holding down the left mouse button and pressing the S key:
1. Point at a C statement in the Source window, hold down the left mouse button and
press the S key.
2. The Controlpoints Configuration window with the Breakpoints tab is opened.
3. A new breakpoint is inserted in the list of breakpoints defined in the application.
4. Select the breakpoint you want to modify by clicking on the corresponding entry in the
list of defined breakpoints at the top of the tab.
5. In the Counter: group of this tab specify the interval for the breakpoint detection in
the Interval: field.
6. Then close the window by clicking the OK button.
5. Select the breakpoint you want to modify by clicking on the corresponding entry in the
list of defined breakpoints at the top of the tab.
6. In the Counter: group of this tab specify the interval for the breakpoint detection in
the Interval: field.
7. Then close the window by clicking the OK button.
If you continue program execution, the content of the Current: field is decremented each
time the instruction containing the breakpoint is reached. When Current is equal to 0, the
application stops. If the checkbox Temporary is unchecked (not a temporary breakpoint),
Current is reloaded with the value stored in Interval: in order to enable the counting
breakpoint again.
Conditional Breakpoints
Conditional breakpoints are activated when a given condition is TRUE. A conditional
breakpoint is recognized by the following icon:
Holding down the left mouse button and pressing the S key:
1. Point at a C statement in the Source Component window, hold down the left mouse
button and press the S key.
2. The Controlpoints Configuration Window (Breakpoints Tab) is opened and a new
breakpoint is inserted in the list of breakpoints defined in the application.
3. Select the breakpoint you want to modify by clicking on the corresponding entry in the
list of defined breakpoints.
4. Specify the condition for breakpoint activation in the Condition: group Condition box.
The condition must be specified using the ANSI C syntax (Example counter = = 7).
You can use register values in the breakpoint condition field with the following syntax:
$RegisterName (Example $RX = = 0x10)
5. Close the window by clicking OK.
Deleting Breakpoints
The debugger provides three ways to delete a breakpoint:
Holding down the left mouse button and pressing the D key:
1. Point at a C statement in the Source Component window where a breakpoint has
previously been defined, hold down the left mouse button and press the D key.
2. The breakpoint is deleted.
Watchpoints
Watchpoints are control points associated with a memory range. Program execution stops
when the memory range defined by the watchpoint has been accessed. The debugger
supports different types of watchpoints:
• Read Access Watchpoints, which are activated when a read access occurs inside the
specified memory range.
• Write Access Watchpoints, which are activated when a write access occurs inside the
specified memory range.
• Read/Write Access Watchpoints, activated when a read or write access occurs inside
the specified memory range.
• Counting Watchpoints, activated after a specified number of accesses occur inside
the memory range.
• Conditional Watchpoints, activated when an access occurs inside the memory range
and a given condition is TRUE.
Watchpoints are controlled through the Controlpoints Configuration Window
(Watchpoints Tab). This window can be opened through the Memory or Data component
window context menu, as described below:
To open the Controlpoints Configuration window with the Watchpoints tab exposed:
1. Position your cursor in either the Memory or Data component window.
2. Press the right mouse button.
3. Select Show Watchpoints from either menu.
4. Click the left mouse button.
The ControlPoints Configuration window appears. The Watchpoints tab of this window is
shown in Figure 4.6.
Watchpoints Tab
The Watchpoints tab of the Controlpoints Configuration window contains:
• List box that displays the list of currently defined watchpoints.
• Watchpoint: group box that displays the address of the currently selected
watchpoint, size of the watchpoint, name of the procedure or variable on which the
watchpoint has been set, state of the watchpoint (disabled or not), read access of the
watchpoint (enabled or not) and write access of the watchpoint (enabled or not).
• Condition: group box that displays the condition string to evaluate and the state of
the condition (disabled or not).
• Update button to Update all modifications in the dialog box.
• Command: group box that displays the command string to execute and state of the
command (disabled or continue after command execution).
• Delete button to remove currently selected watchpoint and select the watchpoint that
is below the removed watchpoint.
• OK: button to validate all modifications.
• Add button to add new watchpoints. Specify the Address in hexadecimal when Hex
format is checked or as an expression when Hex format is unchecked.
• Counter: group box that displays the current value of the counter and interval value
of the counter.
NOTE Current and Interval values are limited to 2,147,483,647. A beep occurs and the
character is not appended, if a number greater than this value is entered.
NOTE When the Interval value is changed, the Counter value is automatically set to
the Interval value.
Multiple Selections
For watchpoints, you can do multiple selections in the Watchpoints tab of the
Controlpoints Configuration window using the Shift and Ctrl keys.
When multiple watchpoints in the list box are selected, the name of the group box
Watchpoint: is changed to Selected Watchpoints:.
When multiple watchpoints are selected, the Address (hex), Size, Name, Condition,
Disable for condition, Command, Current, and Interval controls are disabled.
When multiple watchpoints are selected in the list box, the Disable, Read and Write
controls in the Selected watchpoints: group box are enabled.
When multiple watchpoints are selected, Disable in the Command: group box is enabled.
Click Delete when multiple watchpoints are selected to remove watchpoints from the list
box.
Checking Syntax
You can enter an expression in the Condition group edit box. Check the syntax of the
expression by selecting another watchpoint in the list box or by clicking OK.
If a syntax error is detected, a message box appears:
Incorrect Condition. Do you want to correct it?
Click OK to correct the error in the condition edit box.
Click Cancel to clear the condition edit box.
Setting Watchpoints
Watchpoints may be set in a Data or Memory window.
stops. Current is reloaded with the value stored in the interval field to enable the counting
watchpoint again.
Deleting a Watchpoint
The Debugger provides three ways to delete a watchpoint:
4. You can enter the command in the Command field. The command is a single
debugger command. At this level, the commands G, GO and STOP are not allowed.
A command file can be associated with a watchpoint using the commands CALL or
CF (Example CF breakCmd.cmd).
5. Click OK to close the window.
6. When the watchpoint is detected, the command execute and the application stops at
this point. The Continue check button allows the application to continue after
command execution.
Markpoints
Watchpoints are control points associated with a source line, memory or data range. They
provide the programmer with accessible program markers.
Program execution does NOT stop when the Source line, data or memory range defined by
the markpoint has been accessed.
Markpoints are controlled through the Markpoint tab of the Controlpoints Configuration
Window (Markpoints Tab). This window can be opened through the Source, Memory or
Data window context menu, as described below:
To open the Controlpoints Configuration window with the Markpoints tab displayed:
1. Position your cursor in either the Source, Memory or Data window.
2. Press the right mouse button.
3. Select Show Watchpoints from the window’s context menu.
4. Click the left mouse button.
The ControlPoints Configuration window appears with the Markpoints tab of this window
displayed.
Markpoints Tab
The Markpoints tab of the Controlpoints Configuration window contains:
• List box that displays the list of currently defined markpoints.
• Markpoint: group box that displays the address of the currently selected markpoint,
size of the markpoint, name of the procedure or variable on which the markpoint has
been set, and type of the markpoint.
• General group box that contains a checkbox that allows you to save and restore the
markpoint selected.
• Add button to add new markpoints. Specify the Address in hexadecimal when Hex
format is checked or as an expression when Hex format is unchecked.
• Delete button to remove currently selected markpoint and select the markpoint that is
below the removed markpoint.
• Update button to update all modifications in the window.
• OK: button to validate all modifications.
• Cancel button to ignore all modifications.
• Help: button to display help file and related help information.
Setting Markpoints
Markpoints may be set in a Source, Data or Memory window.
Deleting a Markpoint
To delete a markpoint:
Introduction
Often operating systems (Real Time Kernels) are used to coordinate the different tasks in
more complex systems. This chapter describes how applications built of several tasks can
be handled with the Debugger. There are two main topics to be considered:
• Debugging of any task in the system (e.g., viewing the state of any task in the
system). When using the original basic versions of the Debugger, only the current
task can be inspected. Due to this extension, it is possible to switch the debugging
context from the current task to any other task in the system.
• Real time kernels use data structures to describe the state of the system (scheduling
information, queues, timers, etc.). Some of these data structures are described in this
chapter.
RTK Interface
When the application is halted, the debugger displays the state of the current task. To
identify the task to be inspected, the user has to follow these steps.
Make the task descriptor or a pointer to it visible in any of the debugger's data windows.
Press the P key while holding down the left mouse button on a variable of type "pointer to
task descriptor".
Now the current state of the selected task and procedure chain of that task is displayed in
the 'Procedure Chain' window. By clicking on the procedures in the call chain list, the
local data of that function is displayed in the Data1 window. All the usual debugging
functions are also available to inspect this task (including displaying the register contents).
Application Example
Listing 5.1 shows an example of a OSPARAM.PRM file for SOOM System/REM.
typedef struct PD {
int status;
struct PD *next;
long regs[6];
} PD;
Define this structure so that it fits the same layout as the operating system. It might be
necessary to introduce filler variables to get the correct alignment.
The linker must place this segment to the correct address by using the PRM file shown in
Listing 5.4:
END
PLACEMENT
...
OS_DATA INTO RTK_SEC;
...
END
The source file (for example: rtk.c) has to be compiled and listed in the NAMES
section of the linker parameter file. To force linking, the name of the object file has to be
immediately followed by a '+'. In this example the variable is linked to the address
0x1040.
If an application is prepared in this way, all declared variables may be inspected in the
data windows of the Debugger. There is no restriction in the complexity of the structures
to describe the global data of the kernel.
NOTE Do not open the terminal window during testing. Errors detected during
reading of a PRM file are written to this window.
Two types of data are made available to the CodeWarrior IDE debug tool. One type
describes static configuration data that remains unchanged during program execution. The
second type of data is dynamic and this data is re-evaluated each time by the CodeWarrior
IDE. The static information is useful for display of general information and in
combination with the dynamic data. The dynamic data gives information about the current
status of the system.
The information given to the CodeWarrior IDE is represented in a text file (ORTI-File).
The file describes the different objects configured in the OS and their properties. The
information is represented in direct text, enumerated values, Symbolic names, or an
equation that may be used for evaluating the attribute.
The ORTI File is generated when building the project through the OSEK System
Generator. The generated file has the same name and the same location as the executable
file but its extension is .ort.
The OSEK RTK Inspect Window provides access to all this information. As defined in the
ORTI file, objects of the same type are grouped and can be viewed together.
• Task
• Stack
• SystemTimer
• Alarm
• Message
The following sections offer a description of typical objects along with their attributes and
how they are presented.
NOTE Objects and their attributes depend on the OSEK implementation and OSEK
configuration, and therefore may differ from this description.
Inspector Task
The Task shown in Figure 5.3 displays the current state of the OSEK task trace.
When selecting Task in the hierarchical tree on the left side of the Inspect window,
additional information concerning tasks is displayed on the right side of the window under
the following headings:
• Name: displays the name of the task
• Task Priority: displays the priority of the task.
• Task State: describes the current state of the task. Possible values are READY,
SUPENDED, WAITING, RUNNING or INVALID_TASK. The ORTI file defines
the different states.
• Events State: the event is represented by its mask. The event mask is the number
whose range is from 1 to 0xFFFFFFFF. When the event mask value is set to 1, the
event is activated. When it is set to 0, the event is disabled.
• Waited Events: when the bit is set to 0, the event is not expected. When the bit is set
to 1, the event is expected.
• Task Event Masks: describes the current task event mask.
• Current Task Stack: displays the name of the current stack used by the task.
• Task Properties: describes task properties. Possible value are BASIC/EXTENDED,
NONPREMPT/FULLPREMPT, Priority value, AUTO. The ORTI file defines the
possible values.
Inspector Stack
The Stack shown in Figure 5.4 displays the current state of OSEK stack trace.
Select Stack in the hierarchical tree on the left side to display additional information
concerning the stack on the right side of the window under the following headings:
• Name: displays the name of the stack.
• Stack Start Address: displays the start address of the stack.
• Stack End Address: displays the end address of the stack.
• Stack Size: displays the size of the stack.
Inspector SystemTimer
The SystemTimer shown in Figure 5.5 displays the current state of OSEK SystemTimer
trace.
Select SystemTimer in the hierarchical tree on the left side to display additional
information concerning the timer on the right side of the window under the following
headings:
• Name: displays name of the system timer.
• MAXALLOWEDVALUE: displays the maximum allowed counter value. When the
counter reaches this value it rolls over and starts again from zero.
• TICKSPERBASE: displays the number of ticks required to reach a counter-specific
value.
• MINCYCLE: displays the minimum allowed number of counter ticks for a cyclic
alarm linked to the counter.
Inspector Alarm
The Alarm shown in Figure 5.6 displays the current state of OSEK alarm trace.
Select Alarm in the hierarchical tree on the left side to display additional information
concerning the alarm on the right side of the window under the following headings:
• Name: displays the name of the alarm.
• Alarm State: displays the current state of the alarm. Possible values are
ALARMRUN and ALARMSTOP.
• Assigned Counter: based on counters, the OSEK OS offers an alarm mechanism for
the application software. Assigned Counter is the name of the counter used by the
alarm.
• Notified Task: alarm management allows the user to link task activation to a certain
counter value, assign an alarm to a counter, and define the action to be performed
when an alarm expires. Notified Task defines the task to be notified (by activation or
event setting) when the alarm expires.
• Event to Set: alarm management allows the user to link event setting to a certain
counter value, assign an alarm to a counter, and define the action to be performed
when an alarm expires. Event to set specifies the event mask to be set when the alarm
expires.
• Time to expire: displays time remaining before the time expires and the event is set.
• Cycle period: displays period of a tick.
Inspector Message
The Message shown in Figure 5.7 displays the current state of OSEK message trace.
Select Message in the hierarchical tree on the left side to display additional information
concerning task on the right side:
• Name: displays the name of the message.
• Message Type: displays message type. Possible values are: UNQUEUED/
QUEUED.
• Notified Task: displays the task that shall be activated when the message is sent.
• Event to be set: displays the event to be set when the message is sent.
READY displayed in the status bar indicates that the simulator is ready.
load fibo.abs
bs &main t
g
This file first loads an application, then sets a temporary breakpoint at the start of the
function main and start the application. The application then stops on entering main (after
executing the startup and initialization code).
There are several ways to execute this command file:
• Specify the command file on the command line using the command line option -c.
Do this in the application that starts the Debugger (for example, Editor, Explorer, or
Make utility).
Example:
\Freescale\CodeWarrior for Microcontrollers
V6.1\PROG\HIWAVE.EXE -c init.cmd
When you start the Debugger with this command line, it executes the command specified
in the file init.cmd, after loading the layout (or project file).
• Calling the command file from the project file (Listing 6.2). The project file in which
you save the layout and connection component (File > Save) is a normal text file that
contains command line commands to restore the context of a project. Once you
create this file using the save command, you can extend it by a call to the command
file (CALL INIT.CMD). Loading this project using the File > Open command or
the corresponding entry in the Project file executes the commands in this file.
set Sim
CLOSE *
call \Freescale\DEMO\test.hwl
call init.cmd
• Calling the command file when the Connection Component is loaded. Most
connection components execute the command file STARTUP.CMD once the
connection component is loaded and initialized. By adding the call command file in
this file (for example, CALL INIT.CMD), it automatically executes when the
connection component is loaded.
• Click the Start > Continue icon in the debugger tool bar
HALTED in the status line indicates that execution has been stopped.
The blue highlighted line in the source component is the source statement at which the
program was stopped (next statement to be executed).
The blue highlighted line in the Assembly component is the assembler statement at which
the program was stopped (next assembler instruction to be executed).
Data window with attribute Global displays the name and values of the global variables
defined in the module where the currently executed procedure is implemented. The name
of the module is specified in the Data info bar.
Data window with attribute Local displays the name and values of the local variables
defined in the current procedure. The name of the procedure is specified in the Data info
bar.
On Source Level
Figure 6.2 Stepping at Source Level
• Click the Single Step icon from the Debugger tool bar
STEPPED in the status line indicates that the application is stopped by a step function.
If the application was previously stopped on a subroutine call instruction, a Single Step
stops the application at the beginning of the invoked function.
The display in the Assembly component is always synchronized with the display in the
Source component. The highlighted instruction in the Assembly component is the first
assembler instruction generated by the highlighted instruction in the Source component.
Elements from Register, Memory or Data components that are displayed in red are the
register, memory position, local or global variables, and which values have changed
during execution of the source statement.
• Click the Step Over icon from the Debugger tool bar
STEPPED OVER (STEPOVER) or STOPPED (STOP) in the status line indicates that the
application is stopped by a step over function.
If the application was previously stopped on a function invocation, a Step Over stops the
application on the source instruction following the function invocation.
The display in the Assembly component is always synchronized with the display in the
Source component. The highlighted instruction in the Assembly component is the first
assembler instruction generated by the highlighted instruction in the Source component.
Elements from Register, Memory or Data components that are displayed in red are the
register, memory position, local or global variables, and which values have changed
during execution of the invoked function.
• Click the Step Out icon from the debugger tool bar
STOPPED (STOP) in the status line indicates that the application is stopped by a step out
function.
If the application was previously stopped in a function, a Step Out stops the application
on the source instruction following the function invocation.
The display in the Assembly component is always synchronized with the display in the
Source component. The highlighted instruction in the Assembly component is the first
assembler instruction generated by the highlighted instruction in the Source component.
Elements from Register, Memory or Data components that are displayed in red are the
register, memory position, local or global variables, and which values have changed since
the Step Out was executed.
• Click the Assembly Step icon from the debugger tool bar
TRACED in the status line indicates that the application is stopped by an assembly step
function.
The application stops at the next assembler instruction.
The display in the Source component is always synchronized with the display in the
Assembly component. The highlighted instruction in the Source Component is the source
instruction that has generated the highlighted instruction in the Assembly component.
Elements from Register, Memory or Data components that are displayed in red are the
register, memory position, local or global variables, and which values have changed
during execution of the assembler instruction.
• Double-click
Double-click a function name in the Procedure component.
The Data component (for local that is neither frozen or locked) displays the list of
variables defined in the selected function with their values and type.
Double-click on a variable. The current variable value is highlighted and can be edited.
1. Formats for the input value follow the rule from ANSI C constant values (prefixed by
0x for hexadecimal value, prefixed by 0 for octal values, otherwise considered as
decimal value). For example, if the data component is in decimal format and if a
variable input value is 0x20, the variable is initialized with 32. If a variable input value
is 020, the variable is initialized with 16.
2. To validate the input value you can either press the Enter or Tab key.
3. If an input value has been validated by the Tab key, the value of the next variable in
the component is automatically highlighted (this value can also be edited).
4. To restore the previous variable value, press the Esc key or select another variable.
A local variable can be modified when the application is stopped. Since these variables are
located on the stack, they do not exist as long as the function where they are defined is not
active.
1. The format of the input value depends on the format selected for the data component.
If the format of the component is Hex, the input value is treated as a Hex value. If the
input value is 10 the variable is set to 0x10 = 16.
2. To validate the input value, either press the Enter or Tab key, or select another
register.
3. Validating an input value using the Tab key automatically highlights the content of the
next register in the component. You can edit this register also.
4. To restore the previous register content, press the Esc key.
Choose Address
Figure 6.5 Memory menu Display Address
Debugger Configuration
The New Project Wizard in the CodeWarrior IDE has default debugger settings that are
correct for most projects, and no changes are necessary for normal use. At times, however,
you may wish to make some configuration changes.
CAUTION Changing the configuration from within the debugger may affect your
project adversely. Under normal circumstances make all configuration
changes in the CodeWarrior IDE.
To change the configuration the Real Time Debugger and True Time Simulator, follow
these steps:
1. Start the IDE.
2. From the CodeWarrior IDE, open the Target Settings Panel by clicking on the
Targets panel of the IDE main window.
3. Double click on the name of your target in the list displayed in this panel.
4. Select Build Extras as shown in (Figure 7.1).
5. In the Build Extras pane check the Use External Debugger checkbox.
6. In the Application field, type the Debugger path, (or select from the Open window by
clicking the Browse button) for example: {Compiler}prog\hiwave.exe.
7. In the Arguments field, type the arguments, for example, %targetFilePath -
Target=sim.
8. Click on Apply to validate these changes.
Introduction
The DDE is a form of interprocess communication that uses shared memory to exchange
data between applications. Applications can use DDE for one-time data transfers and for
ongoing exchanges in applications that send updates to one another as new data becomes
available.
NOTE The DDE capabilities of the Debugger are deprecated. Future versions of
the Debugger will have no DDE capabilities. You can use the Component
Object Model (COM) Interface.
DDE Implementation
The Debugger integrates a DDE server and DDE client implementation in the KERNEL.
The DDE application name of the IDF server is "HI-WAVE".
The Debugger DDE support allows you to execute almost any command from the
Command line, that is available within the debugger. There are also special DDE items for
more commonly performed tasks.
This section describes topics and DDE items available to CodeWright clients. In addition
to the required System topic, CurrentBuffer and the names of all CodeWright non-system
buffers (documents) are available as topics.
3. Push the Connect button of the DDEClient. The following message appears in
DDECLient: Connected to HI-WAVE|Command.
4. In the Exec field of DDECLient type a Debugger command, for example open
recorder and click the Exec button. The command is executed by way of DDE and
a new recorder component appears in the Debugger.
NOTE You can disconnect the DDE in the Debugger. The Debugger can be started
without DDE (this is saved in the project file). To view the current state, open a
command line component and type the following command: DDEPROTOCOL
STATUS. The state must be: DDEPROTOCOL ON to ensure the DDE works
properly.
current installation. An example configuration for the M68k CPU is provided, which can
be adapted to each CPU supported by Freescale.
Database Directory
This text box determines the directory in which to save the symbols and software metrics
database. This directory can be absolute or relative to the Project Root Directory. Leave
this field empty.
Source
The supported C dialects of the C language used in the current project can be selected in
this text field. In our example we chose the Freescale M68k language (adapt it to your
needs).
In the same way, select fibo.prm file and add it to this project.
You can also add a directory to the project in the following way:
• Select Explorer View Tab in Project Window.
• In the left section, select the directory with files to be added to the project (files from
subdirectories may also be added to the project).
• From context menu choose Add to project.
This operation may also be performed from Folder view, if the directory is in the left
section.
NOTE When adding an entire directory to the project, only files with extensions
defined in Options > Project > File types (as described in the section
Configure File Types) are added.
After the analysis of all project files, the new database file containing information about
global symbols is constructed. Refer to the DA-C manual for more information on how
symbol information can be used.
In the Project Manager's window of DA-C, select the Logical View Tab shown in Figure
9.6 and unfold all fields. The project overview appears.
Compiler Configuration
In Menu "Start" Actions, click on new and fill in the New Action box with "C&ompile",
then press ENTER (Figure 9.7). In the Toolbar field, you can associate a bitmap with
each tool, for example click on the Picture radio button and browse to the \Bitmap
directory of your current DA-C installation and choose Compiler.bmp. This is a default
bitmap delivered with the DA-C IDE. Here you are able to add your own bitmap.
Now fill in the Action Script field in order to associate related compiler actions. Copy the
following lines shown in Listing 9.1 in the Action Script field and change the directory to
where the compiler is located.
Click on OK to validate these settings. Select the Fibo.c file. Click on the Compiler
button (or from the main menu of DA-C select Start > Compile). This file is now
compiled and the corresponding object file (Fibo.o) is generated.
Linker Configuration
In the same way, you can now configure the linker as illustrated in Figure 9.8. In the
Menu "Start" Actions, click on new and fill in the created New Action box with
"&Link", then validate with ENTER. After setting the corresponding bitmap, copy the
following lines shown in Listing 9.2 in the Action Script field and change the directory to
where the linker is located.
+c:\Freescale\prog\linker.exe fibo.prm
.%if(%Exist(edout),,%Message(No Messages found!)%Cancel)
.%ErrClr()
.%ErrGet(edout)
Maker Configuration
In the same way, you can now configure the maker as illustrated in Figure 9.9. In the
Menu "Start" Actions, click on new and fill in the created New Action box with "
&Make", then press ENTER. After setting the corresponding bitmap, copy the lines from
Listing 9.3 in the Action Script field and change the directory to where the maker is
located.
+c:\Freescale\prog\maker.exe fibo.mak
.%if(%Exist(edout),,%Message(No Messages found!)%Cancel)
.%ErrClr()
.%ErrGet(edout)
Debugger Interface
DA-C v3.5 currently integrates a DAPI interface (Debugging support Application
Programming Interface). Through this interface DA-C is enabled to exchange messages
with the Debugger. The advantages of this connection allow you to set or delete break
points from within DA-C (in an editor, flow chart, graph, browser) and to execute other
debugger operations. DA-C follows the debugger in its operation, since it is always in the
same file and on the same line as the debugger. Thus, usability of both the DA-C and
Debugger is increased. Some configurations are required in order to make efficient use of
this Debugger Interface:
• Installation of communication DLL
• Configuration of Debugger properties
• Configuration of the Debugger project file
In the Debugger combo-box, select the corresponding debugger: HI-WAVE 6.0. Now
specify the binary file to be opened: in our example we want to debug the fibo.abs file.
Then click on the Setup button. The dialog box shown in Figure 9.12 is opened.
Specify the path to the hiwave.exe file or use the Browse button, then click on OK.
The Debugger DAC window, which is needed for communication with the DA-C IDE is
now opened (Figure 9.14).
You must save this configuration by selecting File > Save Configuration from the main
menu of the Debugger. This component loads automatically the next time this project is
called. Close the Debugger.
Synchronized Debugging
We can now test the synchronization between the DA-C IDE and Debugger. Run
DA-C.exe and open the project previously created. Open Fibo.c if it's not already
open. Right-click mouse button on Fibo.c source window and select main in the context
menu. The cursor points to the void main(void) { statement. In the main menu
from DA-C, select Debug > Set Breakpoint (or click on the corresponding button on the
debug toolbar), the selected line is highlighted in red, indicating that a breakpoint has been
set. Then select Debug > Run, the Debugger is now started and after a while stops on the
specified breakpoint. Up to now, you can debug from the DA-C IDE with the toolbar, as
shown in Figure 9.15, or from the Debugger.
NOTE If changes are made to your source code, don't forget to rebuild the Database
when generating new binary files to avoid misalignment between the Debugger
and DA-C source positions.
Troubleshooting
This section describes possible trouble when trying to connect the Debugger with the DA-
C IDE.
When loading the DAC component into the Debugger, if the message box shown in Figure
9.16 is displayed, ensure that Ndapi.dll is in the \prog directory of your current
Freescale installation. If not, copy the specified DLL into this directory.
If the message box shown in Figure 9.17 is displayed in the DA-C IDE, then the current
name specified in the Options > Debugger main menu of DA-C doesn't match the
debugger name specified in the Debugger.
Open the setup dialog box in the Debugger by clicking on the DA-C Link component and
choose DA-C Link > Setup from the main menu. The Connection Specification dialog box
opens (Figure 9.18).
Compare the Debugger Name from this dialog box with the selected Debugger in the DA-
C IDE (Options > Debugger), as shown in Figure 9.19. Both must be the same.
If the names are not the same, change the name in the Debugger "Connection
Specification" and click OK. This establishes a new connection and saves the "Connection
Specification" in the current Project.ini file in the section shown in Listing 9.4.
[DA-C]
DEBUGGER_NAME=HI-WAVE 6.0
SHOWPROT=1
Book II Contents
Each section of the Debugger manual includes information to help you become more
familiar with the Debugger, to use all its functions and help you understand how to use the
environment. This book, the HC08 Debug Connections, defines the connections available
for debugging code written for HC08 CPUs.
This book consists of the following sections:
• Microcontroller Debugging First Steps
• HC08 Full Chip Simulation
• MON08 Interface Connection
• ICS MON08 Interface Connection
• HC08 P&E Multilink/Cyclone Pro Connection
• HC08 ICS P&E Multilink/Cyclone Pro Connections
• SofTec HC08 Connection
• HC08 FSICEBASE Emulator
NOTE The initial project creation steps for RS08 Connections mentioned in Book IV -
RS08 Debug Connections are similar to the first steps mentioned in Debugging
First Steps Using the Wizard.
Technical Considerations
While they can be used to debug code, some of these connections have special technical
considerations, as discussed in the following paragraphs.
has a totally different simulation engine to accurately simulate the memory ranges, I/O,
and peripherals for any given derivative.
3. Expand the list and select the CPU derivative for your new project
4. After selecting derivative, choose connection from list that appears.
5. Click the Next button to proceed.
13. Depending on CPU derivative selected, additional screens may appear; select startup
code, memory model, and floating point format.
• Minimal startup code - This startup code initializes the stack pointer and calls the
main function. No initialization of global variables is done, giving the user the best
speed/code density and a fast startup time. But, the application code has to care about
variable initialization. This makes this option not ANSI compliant, since ANSI
requires variable initialization.
• ANSI startup code - This performs an ANSI-compliant startup code that initializes
global variables/objects and calls the application main routine.
• Small - The Small memory model is best used if both the code and the data fit into
the 64kB address space. By default all variables and functions are accessed with 16-
bit addresses. the compiler does support banked functions or paged variables in this
memory model, but all accesses have to be explicitly handled.
• None - Do not use floating point for the HC08.
• Float is IEEE32, double is IEEE32 - All float and double variables are 32-bit IEEE32
for the HC08.
• Float is IEEE32, double is IEEE64 - Float variables are 32-bit IEEE32. Double
variables are 64-bit IEEE64 for the HC08.
14. Click Next button to proceed
15. Depending on CPU derivative selected, choose whether or not to use PC-lint.
16. Click the Finish button.
17. In the IDE main window toolbar Project menu, choose Project > Make.
18. Now choose Project > Debug to start the debugger.
Switching Connections
It is possible to switch connections from within an existing debugging project. To switch
connections, select Set Connection from the Component menu. The following information
provides three examples of switching a connection.
CAUTION Normally, use the New Project or Change wizard to change the
connections. This information is provided for advanced users only.
1. From the Debugger main menu, select Component | Set Connection, as shown below.
2. Select the Processor, for example, HC08 and the Connection as Full Chip Simulation.
3. Press the OK button. The Debugger main menu entry bar for the connection now
changes to HC08FCS.
You have successfully switched connections to the FCS connection. The values and use of
each HC08FCS menu entry is explained in the Full Chip Simulation chapter of this
manual.
2. Within the Set Connection dialog box, press the Down Arrow button next to the
Connection list box to display the list of available connections.
3. Select P&E Multilink/Cyclone Pro.
The Connection menu selection P&E Multilink/Cyclone Pro loads the proper drivers, etc.
for the connection.
4. In the Debugger Main window, the Connection heading has been renamed
MultilinkCyclonePro. Click on this heading to display its menu and list of selections.
The menu selection MultilinkCyclonePro > Load loads an executable (.abs) file into
connection memory. The file’s program counter points to the first instruction of the startup
section.
The menu selection MultilinkCyclonePro > Reset triggers a reset of the connection and
executes the command file reset.cmd.
The menu selection MultilinkCyclonePro > Connect takes you to the P&E ICD
connection manager dialog box.
The menu selection MultilinkCyclonePro > Command Files takes you to the Command
Files dialog box.
2. Select the Processor and Connection, for example, RS08 and RS08 Open Source
BDM.
NOTE Select HC08 as the Processor to select HC08 Open Source BDM as the
Connection.
Configuration Procedure
Choose the Full Chip Simulation option from the Set Connection dialog box. See Figure
11.1.
Figure 11.1 Set Connection Dialog Box - Full Chip Simulation Option
When you have selected this option, the Connection list menu becomes the HCS08FCS
Menu, and appears as shown in Figure 11.2.
This command is extremely useful for verifying specific timings of a given event, running
until a given event is complete, or just before it completes to enable stepping through the
event or any application where cycle-timed execution is desired.
If register files have been installed on the host computer, selecting a block brings up the
Register Block register listing in the Timer Interface Module dialog box (see Figure 11.5),
which shows a list of the associated registers, their addresses, and their descriptions. This
begins interactive setup of system registers such as I/O, timer, and COP watchdog.
Selecting a file in this dialog box brings up the Register Window (see Figure 11.6), which
displays the values and significance for each bit in the register. The registers can be
viewed and their values modified, and the values can be stored back into debugger
memory.
Placing your mouse over a peripheral opens an extended menu which lists its associated
commands. Click on a command to execute that command.
At any point, the ADCLR command can be used to flush the input buffer for the ADC
simulation.
After the conversion is complete, the first queued value is passed from the data buffer into
the ADC data register. It can be observed in the memory window by displaying the
memory location corresponding to the ADC data register.
Conversion completion sets the appropriate flag. If you enable interrupts, the Program
Counter changes flow to the interrupt routine (as defined in the vector space of the MCU).
For more information on ADC configuration, refer to the Freescale Manual for your
microprocessor.
ADDI Command
The ADDI command allows the user to input the data into the ADC converter. If a data
parameter is given, the value is placed into the next slot in the input buffer. Otherwise, if
no parameter is given, a window appears with the input buffer values. Input values can be
entered while the window is open. An arrow points to the next value to be sent to the
ADC. The maximum number of input values is 256 bytes.
Syntax
>ADDI [<n>]
Where:
<n> The value to be entered into the next location in the input buffer.
Example
>ADDI $55
Set the next input value to the ADDI to $55
>ADDI
Pull up the data window with all the input values.
ADCLR Command
Use the ADCLR command to flush the input buffer for ADC simulation. This resets the
input data buffer and clears out all values. Notice that if the ADC is currently using a
value, this command does not prevent the ADC from using it. See ADDI Command for
information on how to access the input buffer of the ADC interface.
Syntax
>ADCLR
Example
>ADCLR
Clear the input buffer for ADC simulation.
Once you select the MCU Clocks Menu, the Cycles window containing all of the above-
mentioned Clock Frequencies appears.
Once the CGM is properly configured, the user can monitor the status of the PLL by
polling the corresponding flag. If PLL interrupt is enabled, FCS jumps to an appropriate
subroutine as long as the interrupt vector is properly defined. To observe the flag going up
as a result of the corresponding CPU event, situate your Memory Window on the memory
location of the CGM Status and Control register.
For more information on how to properly configure Clock Generation, refer to the
reference manual corresponding to the microprocessor that you are using.
CGM Commands
The following Clock Generation commands are available on the HC08 processor.
XTAL Command
Use the XTAL command to change the value of the simulated external oscillator. This in
turn affects the input to the PLL/DCO, and therefore the bus frequency. The P&E
simulator is a cycle-based simulator, so changing the XTAL value does not affect the
speed of simulation; it does, however, affect the ratio in which peripherals receive cycles.
Certain peripherals that run directly from the XTAL run at different speeds than those that
run from the bus clock.
Syntax
>XTAL <n>
Where:
n, by default, is a hexadecimal number, representing the simulated frequency of an
external oscillator. Adding the suffix “t” to the n parameter forces the input value
to be interpreted as base 10.
Example
>XTAL
Brings up an input window. The default base for this input value is 10. However,
this value can be forced to a hexadecimal format by adding the suffix “h”.
If you enable the Shutdown pin on the HRP module, you can observe the SHTIF Flag via
the Memory window once the Shutdown event takes place. If you enable the HRP
interrupt, the FCS jumps to an appropriate subroutine as long as the HRP interrupt vector
is properly defined. To observe the SHTDWN Interrupt Flag going up as a result of the
corresponding CPU event, situate your Memory Window on the memory location of the
HRP Control register.
To observe the accuracy of the HRP module operation, the user can observe the number of
CPU cycles that it takes for the event to occur. The cycle counter is only incremented as
the user steps through the code. To determine the exact amount of cycles over which the
event occurs, one can either observe the cycle display in the Register Window or use the
built in simulation commands. To display the current number of cycles in the Command
window, use the CYCLES command. To change the number of cycles in the cycle counter,
use CYCLES <n>, where <n> is the new cycle value. If the number of cycles has been
pre-calculated, use CYCLE 00 to reset the number of cycles and GOTOCYCLE <n> to
run through the code until the place where the expected event occurs.
CYCLES Command
The CYCLES command changes the value of the cycles counter. The cycles counter
counts the number of processor cycles that have passed during execution. The Cycles
Window shows the cycle counter. The cycle count can be useful for timing procedures.
Syntax
>Cycles <n>
Where:
<n> Integer value for the cycles counter
Examples
>CYCLES 0
Reset cycles counter
>CYCLES 1000
Set cycle counter to 1000.
GOTOCYCLE Command
The GOTOCYCLE command executes the program in the simulator beginning at the
address in the program counter (PC). Execution continues until the cycle counter is equal
to or greater than the specified value, until a key or the Stop button on the toolbar is
pressed, until it reaches a break point, or until an error occurs.
Syntax
>GOTOCYCLE <n>
Where:
<n> Cycle-counter value at which the execution stops
Example
>GOTOCYCLE 100
Execute the program until the cycle counter equals 100.
SHTDWN Command
When you enable the Shutdown pin in the High Resolution PWM Control Register
(HRPCTRL), you can use this command to change the state of the SHTDWN pin. The
Shutdown pin then takes on this state after the simulator executes the next step. If
interrupts are enabled, issuing a SHTDWN 0 command triggers an interrupt that is cleared
until the SHTIF bit is cleared in the HRPCTRL and a SHUTDWN 1 command is issued.
Note that this interrupt is both edge and level sensitive.
If the SHTDWN pin is not enabled in the HRPCTRL, this command has no effect.
Syntax
>SHTDWN <n>
Where:
<n> = 1 or 0, representing the state of the SHTDWN pin on the next simulated
clock cycle.
Example
>SHTDWN 0
Change the state of the SHTDWN pin to 0.
Using the Simulated Port Inputs dialog box, the input value to any I/O port can be
reconfigured. The INPUTS command can be used to reconfigure the output values on any
relevant I/O port. The manipulation of I/O port pins can be observed in the Memory
Window.
Note that if the regular I/O pins are multiplexed to be used by a different MCU Module,
they might not be available for general I/O functionality. For more information on how to
properly configure I/O pins, refer to the Freescale user manual corresponding to the
microprocessor that you are using.
INPUT<x> Command
The INPUT<x> command sets the simulated inputs to port <x>. The CPU reads this input
value when port <x> is set as an input port.
Syntax
>INPUT<x> <n>
Where:
<x> is the letter representing corresponding port
<n> Eight-bit simulated value for port <x>
Example
>INPUTA AA
Simulate the input AA on port A.
INPUTS Command
In Full Chip Simulation and CPU-Only Simulation mode, the INPUTS command opens
the Simulated Port Inputs dialog box shown in Figure 11.17 below. The user may then use
this box to specify the input states of port pins and IRQ.
When using In-Circuit Simulation mode, the INPUTS command shows the simulated
input values to any applicable port.
Syntax
>INPUTS
Example
>INPUTS
Show I/O port input values.
IRQ Commands
The following interrupt request commands are available in FCS mode on the HC08
processor.
INPUTS Command
In Full Chip Simulation and CPU-Only Simulation mode, the INPUTS command opens
the Simulated Port Inputs dialog box shown in Figure 11.19. The user may then use this
box to specify the input states of port pins and IRQ.
When using In-Circuit Simulation mode, the INPUTS command shows the simulated
input values to any applicable port.
Syntax
>INPUTS
Example
>INPUTS
Show I/O port input values.
NOTE The IRQ pin state can be directly manipulated with the IRQ command. For
example, IRQ 1 simulates a high state on the IRQ pin; likewise, IRQ 0
simulates a logic-low state on the IRQ pin.
the INPUTS command to bring up the Simulated Port Inputs for all general I/O ports. It
displays the current simulated values to all applicable input ports. See FCS Timer
Interface Module Commands for more information about the various forms of this
command.
Use the Simulated Port Inputs dialog box to reconfigure the input value to any I/O port. To
trigger the event, manipulate the inputs to the port in the appropriate manner, depending
on whether the KBI is configured for edge-only or edge and level. Once the KBI event
takes place, the KEYF Flag bit, which is a part of the Keyboard Status and Control
register, can be observed in the Memory Window.
The user is able to poll the KBI Interrupt Pending flag if the polling Mode is simulated. In
Interrupt Mode, the simulator branches to an appropriate interrupt subroutine as long as
the KBI interrupt vector is properly configured. For more information on KBI
configuration, refer to the Freescale user manual for your microprocessor.
INPUT<x> Command
The INPUT<x> command sets the simulated inputs to port <x>. The CPU reads this input
value when port <x> is set as an input port.
Syntax
>INPUT<x> <n>
Where:
<x> is the letter representing corresponding port
<n> Eight-bit simulated value for port <x>
Example
>INPUTA AA
Simulate the input AA on port A.
INPUTS Command
In Full Chip Simulation and CPU-Only Simulation mode, the INPUTS command opens
the Simulated Port Inputs dialog box shown in Figure 11.22. You may then use this box to
specify the input states of port pins and IRQ.
When using In-Circuit Simulation mode, the INPUTS command shows the simulated
input values to any applicable port.
Syntax
>INPUTS
Example
>INPUTS
Show I/O port input values.
The MMIIC data input/output log buffer simulation allows the user to gain access to the
past 256 MMIIC data bytes that have been shifted in and out of the module. To bring up
the IIC IN/OUT LOG buffer dialog box, use the IICDO command.
At any point, the IICCLR command can flush the input as well as input/output log MMIIC
buffers.
After the MMIIC simulated input is received, the first queued in data byte is passed from
the data buffer into the corresponding MMIIC module registers. It can be observed in the
Memory Window by displaying the appropriate register location there.
The user can also observe different MMIIC flags in the Memory Window. If the module is
run in Flag Polling mode, poll the flag corresponding to the expected MMIIC event. If the
MMIIC interrupts are enabled, the FCS jumps to an appropriate subroutine as long as the
MMIIC interrupt vectors are properly defined.
For more information on how to configure the MMIIC module for desired operation, refer
to the Freescale user manual corresponding to your microprocessor.
IICDI Command
The IICDI command allows the user to input data into a buffer of data which is shifted into
the MMIIC module when it receives data from an external device. If a data parameter is
given, the value is placed into the next slot in the input buffer. If no parameter is given, a
window appears displaying the input buffer values. You can enter input values while the
window is open. The maximum number of input values is 256.
This command is useful for either inputting response data from a slave target or for
inputting data packets from an external master. Note that when the microprocessor
attempts to read an acknowledge from an external device, and the next value in the buffer
is neither ACK nor NACK, the microprocessor automatically receives an ACK signal (i.e.
assumes ACK unless NACK is specified).
Syntax:
>IICDI [<n>][START][STOP][ACK][NACK]
Where:
<n> The value to be entered into the next location in the input buffer
START indicates the incoming START signal
STOP indicates the incoming STOP signal
ACK corresponds to ACK signal
NACK corresponds to NACK signal
For a detailed description of the IIC protocol and the proper way to configure the
IIC module, refer to the Freescale user manual for your microprocessor.
Example:
>IICDI
Pulls up the data window with all the input values
>IICDI 22 33
This is an example of data being returned from a slave device. Once the MCU
transmits a start signal and the target address, it receives an ACK from the slave
device. An ACK is implied unless a NACK is specified via the IICDI command.
The next two data bytes read are 22 and 23. If the microprocessor attempts to read
another byte, it gets an $FF value followed by a NACK signal (NACK because
nothing remains in the input buffer). The receiving device then generates a STOP
signal. A more exact input from a device designed to return two bytes is:
>IICDI ACK 22 ACK 23 NACK
MMIIC in master mode transmits to a slave. If the slave device acknowledges all
output bytes of the transmitting device, there is no need to specify an input packet.
If the master device is going to transmit an address and two bytes, the following
packet is equivalent to no packet:
>IICDI ACK ACK ACK
If, however, the slave receiver is designed to generate a NACK signal after the
second received data byte, the proper response packet is:
>IICDI ACK ACK NACK
The address result being the first ACK, the first data result being the second ACK,
and the second data byte being the NACK.
MMIIC in MASTER mode is not acknowledged by any Slave:
>IICDI NACK
If the NACK signal is entered before our master device transmits a START signal,
then the master device receives a NACK signal when it tries to read an
acknowledge after the address is output. The master device then generates a STOP
signal and releases the BUS.
MMIIC in SLAVE mode receives a Write from an external Master:
This example is for an external master which is writing to the microprocessor
configured to simulate the slave mode operation. The packet contains both START
and STOP signals which put the simulated device into the slave mode.
>IICDI START 55 AA 22 STOP
This input adds five values to the input queue, which is a packet from an external
master, including the following values:
• A start signal comes in.
• The address $55 comes in specifying a write (slave receive). The Address
Register of the current simulated device was previously set to $55.
• The data byte $AA comes in.
• The data byte $22 comes in.
• A STOP signal comes in.
IICDO
The IICDO command displays a window, which shows data shifted in as well as shifted
out of the IIC peripheral. An arrow is used to point to the last output value transmitted/
received. The maximum number of output values that the buffer can hold is 256.
Syntax
>IICDO
Example
IICDO
View data from the input/output log buffer for IIC simulation.
IICCLR
Use the IICCLR command to flush the input and output buffers for MMIIC simulation.
This resets the buffers and clears all values. Notice that if the MMIIC is currently shifting
a value, this command allows the MMIIC to finish the transfer.
Syntax
>IICCLR
Example
>IICCLR
Clear input and output buffers for IIC simulation.
$pagewidth 120t
$Include 'az60regs.inc'
org RamStart
buffptr ds 2 ; pointer into the local data buffer
dataptr ds 2 ; pointer into the CAN receiver data buffer
datacount ds 1 ; holds the number of bytes in messages
PacketData ds $100 ; buffer for data from received packets
PacketDataEnd:
org RomStart
* Transmission Message Descriptors
* All messages are extended data types
* Format is Address, Priority, Length, Data
Msg1_Desc:
dw $0001 ; Message 1 Address
dw $2345 ; Message 1 Address
db $03 ; Message 1 Priority
db $08 ; Message 1 Length
db $11 ; Data Byte 1
db $22 ; Data Byte 2
db $33 ; Data Byte 3
db $44 ; Data Byte 4
db $55 ; Data Byte 5
db $66 ; Data Byte 6
db $77 ; Data Byte 7
db $88 ; Data Byte 8
M1Desc_End:
Msg2_Desc:
dw $0002 ; Message 2 Address
dw $3456 ; Message 2 Address
db $02 ; Message 2 Priority
db $04 ; Message 2 Length
db $12 ; Data Byte 1
db $34 ; Data Byte 2
db $56 ; Data Byte 3
db $78 ; Data Byte 4
M2Desc_End:
Msg3_Desc:
dw $0003 ; Message 3 Address
dw $4567 ; Message 3 Address
db $01 ; Message 3 Priority
***************************************************************
* Init_CAN - The CAN is placed into the soft reset state, *
* where the control and timing registers can be *
* set and the identifier and mask registers can be *
* configured. After this, the module is placed in *
* normal mode in order to synchronize with the CAN *
* bus. *
***************************************************************
Init_CAN:
lda #$01
sta CMCR0 ; place MSCAN08 into soft reset state
lda #$01
sta CMCR1 ; CAN clock source = CGMOUT*2
lda #$01
sta CBTR0 ; set SJW=0, baud rate prescalar=div by 2
lda #$27
sta CBTR1 ; set TSEG1=7 (8Tq), TSEG2=2 (3Tq), one
; sample per bit
lda #{(CANAddress>21t) & $FF} ; set identifier acceptance
; register to CAN address
sta CIDAR0
lda #{(CANAddress & $38000)>15t}
ora #{(CANAddress & $1C0000)>13t}
ora #$18
sta CIDAR1
lda #{(CANAddress & $7F80)>7t}
sta CIDAR2
lda #{(CANAddress & $7F)<1t}
sta CIDAR3
lda #$00
sta CIDMR0 ; set identifier mask register to exact match
sta CIDMR1
sta CIDMR2
sta CIDMR3
lda #00
sta CIDAC ; set identifier acceptance for single
; 32-bit filter
ldhx #Msg1_Desc ; set up transmission message 1
lda 0,x ; get message address
lsla
lsla
lsla
sta CT0IDR0
and #$7F
lsla
sta CT1IDR2
lda 3,x ; get next byte in message address
and #$80
rola
rola
ora CT1IDR2
sta CT1IDR2
lda 3,x ; get next byte in message address
and #$7F
lsla
sta CT1IDR3
lda 4,x ; get the message priority
sta CT1TBPR
lda 5,x ; get the message length
sta CT1DLR
sta datacount
lda 6,x ; get the message data
sta CT1DSR0
lda 7,x ; get the message data
sta CT1DSR1
lda 8,x ; get the message data
sta CT1DSR2
lda 9,x ; get the message data
sta CT1DSR3
ldhx #Msg3_Desc ; set up transmission message 3
lda 0,x ; get message address
lsla
lsla
lsla
sta CT2IDR0
lda 1,x ; get next byte in message address
and #$E0
lsra
lsra
lsra
lsra
lsra
ora CT2IDR0
sta CT2IDR0
lda 1,x ; get next byte in message address
and #$1C
lsla
lsla
lsla
ora #$18
sta CT2IDR1
****************************************************************
* MAIN_INIT - This is the point where code starts executing *
* after a RESET. *
****************************************************************
MAIN_INIT:
rsp
ldhx #PacketData ; initialize buffer pointer to start of
; buffer
sthx buffptr
lda #01
sta CONFIG1 ; disable COP watchdog
lda #01
sta CONFIG2 ; MSCAND=0 (enable MSCAN module)
jsr Init_CAN ; Initialize CAN peripheral
cli ; Allow interrupts to happen
main_loop:
nop ; do nothing in main loop
bra main_loop
**************************************************************
* CAN_ISR - CAN Interrupt Service Routine. *
* Interrupts here if CAN packet is received that *
* has the address of this CAN module. *
**************************************************************
CAN_ISR:
lda CRDLR ; get length of data in message
cbeqa #0,DATADONE ; if no data in message then done
sta datacount
ldhx #CRDSR0 ; initialize data pointer to first data
; segment
sthx dataptr
STOREDATA:
ldhx dataptr ; get data pointer to data in received
; message
lda 0,x ; load data from data segment
aix #1 ; index pointer to next segment
sthx dataptr ; save data pointer
ldhx buffptr ; get pointer to local circular buffer
sta 0,x ; store data in next location
aix #1 ; index pointer to next location
cphx #PacketDataEnd ; if end of circular buffer
bne CHECKDATAEND ; then reset pointer to start of
; circular buffer
ldhx #PacketData
CHECKDATAEND:
sthx buffptr
dbnz datacount,STOREDATA ;if no more data in message then done
DATADONE:
lda #01
**************************************************************
* DUMMY_ISR - Dummy Interrupt Service Routine. *
* Just does a return from interrupt. *
**************************************************************
DUMMY_ISR:
rti ; simple return
**************************************************************
* Vectors - Specifying Reset and MSCAN Interrupt Routines *
**************************************************************
org VectorStart
So how is the code laid out in order to handle this? The beginning of the code shows
symbol defines for addresses within memory for RAM, Flash, and interrupt vectors. The
CAN address is specified here as well. Also included are the register file definitions,
which give the addresses of peripheral registers on the microcontroller. Following this
comes the variable declarations for pointers, counters, and buffers for the received data.
In the Flash ROM, the message descriptions are given, which indicate the destination
address, message priority, message length, and the actual data. Note that the number of
data bytes can be variable sizes from 0-8. The information needed in these descriptions
can be found in the CAN specification and the 68HC908AZ60A datasheet.
After the message descriptions come the actual code, where there are some procedures for
handling different tasks. The first is the initialization procedure, which sets up the registers
in the CAN peripheral for the intended operation. The CAN peripheral is also enabled at
the end of the routine. After this comes the start of the application in the MAIN_INIT
procedure, where we call the initialization routines, initialize the pointers and counters,
and wait for an interrupt to occur. There is one interrupt service routines for the CAN
peripheral in this code which is triggered when the peripheral receives CAN messages
specifically intended for it. Note that this application is totally interrupt driven, where the
code is driven by any events that take place through the CAN peripheral.
The end of the code shows the interrupt vectors for the microcontroller, where the CAN
interrupts and the RESET vector are included. All other vectors are pointed to a dummy
interrupt service routine that simply returns from the interrupt.
Once the above mentioned assembly code is compiled as a part of the Freescale project,
one can step through it in the Full Chip Simulation mode. The execution starts
automatically at the reset location within the code. We are now ready to start debugging
the code.
First, we need to step through the beginning of the code in the simulator in order to allow
the code to initialize the microcontroller and the CAN peripheral and get ready to start
receiving CAN packets from the network. So, the user needs to step through the beginning
of the code until they get to the main loop with the t command.
At this point we are ready for CAN packets to come into the device. There are three
specific commands in the simulator for testing the CAN peripheral: CANIN, CANOUT,
and CANCLR (see detailed MSCAN commands description below). The CANIN
command allows a user to specify messages coming into the CAN peripheral. The
CANOUT command allows a user to see the packets that were sent out from the CAN
peripheral. The CANCLR command allows the user to clear all input and output buffers of
CAN packets.
Now we can use the CANIN command to specify CAN packets that come from the
network to our device. When a user types this command in the simulator, the CAN IN
window appears as shown in Figure 11.26. There are no CAN packets specified yet in the
window, so we will enter some into it.
Input packets can be added by double-clicking in the window where the packet is to go or
by selecting the row for the packet and clicking the OK button. At this point a new
window comes up as shown in Figure 11.27. It is in this window that the user can specify
the parameters of the message. The Packet Type list menu allows the user to select the
type of CAN packet, that is, a DATA, REMOTE, ERROR, or OVERLOAD packet. The
CAN address for the input can be entered in the CAN Address edit box. The address
format can be set to be standard (11 bits) or extended (29 bits). Note that if you select an
ERROR or OVERLOAD packet, then the DATA field and CAN Address fields are
unused and are grayed out. For DATA and REMOTE packets, the DATA field must be
filled with the appropriate data. Let’s demonstrate how to fill these fields for a data packet
coming in to the device from the network.
As an example, let us assume that another node in the network wanted to send a packet
containing 8 bytes (0,1,2,3,4,5,6,7) to our device at address $01234567. In this case we
want to set the packet type to DATA, the CAN address to $01234567, the address format
to Extended, and the data field for the given 8 bytes. This is shown in Figure 11.28
through the CANIN command.
Once the DATA packet information is entered, the CANIN window looks as shown in
Figure 11.29. The user can then set a breakpoint in the interrupt service routine that
handles CAN packets and execute the code by typing GO in the simulator. The user is
now at the CAN ISR. By entering the t command and single stepping through the code,
the user exits the ISR and return to the main loop. The user can then see the resulting data
in the memory window pointed to by the buffptr variable, which is the
0,1,2,3,4,5,6,7 placed in the data packet. Figure 11.30 shows the memory window.
Now, for the output packets that were setup in the initialization routine, we can see that the
code sends them out from the simulator by using the CANOUT command. The user can
type the command GO in the simulator and let the simulation run for a while. Hit the Enter
key to break the execution. Now type the CANOUT command. Figure 11.31 shows the
result, where all three output packets are seen. Select the first packet by double clicking on
it. Figure 11.32 shows the first CAN packet sent out. Note that the first packet sent out was
the packet with the highest priority. You can now select the other packets in the CAN
OUT window to open them up and see which data packet they were in.
It is possible that a user does not want to enter all of these simulator commands manually.
In this case, use macro files for automated code testing. A macro file permits a user to set
up a sequence of simulator commands to run one after the other within the simulator. So,
the CANIN command can include parameters that specify the type of packet, CAN
address, and data. See the CANIN command in the help file for more details.
FCSMSCAN Commands
You can use the following FCSMSCAN commands with the HC08 processor.
CANCLR Command
You can use the CANCLR command to flush the input and output buffers for CAN
simulation. This resets the buffers and clears out all values. Notice that if the CAN is
currently shifting a value, this command does not prevent the CAN from finishing the
transfer. See CANIN command and CANOUT command for accessing the input and
output buffers of the CAN interface.
Syntax
>CANCLR
Example
>CANCLR
Clear input and output buffers for CAN simulation
CANIN Command
The CANIN command allows the user to input data into the CAN. If a data parameter is
given, the value is placed into the next slot in the input buffer. Otherwise, if no parameter
is given, a window is displayed with the input buffer values. Input values can be entered
while the window is open.
An arrow points to the next input value to the CAN. The maximum number of input
packets is 256.
Syntax
>CANIN [<n>]
Where <n> is the value to be entered into the next location in the input buffer.
Example
>CANIN $55
Set the next input CAN value to $55
>CAN
Pull up the data window with all the input packets.
CANOUT Command
The CANOUT command displays the output of the buffer from the CANOUT. A window
is opened that shows all the data that the CAN has shifted out. An arrow is used to point to
the last output value transmitted. The maximum number of output packets that the buffer
holds is 256 bytes.
Syntax
CANOUT
Example
>CANOUT
View data from the output buffer for CAN simulation
If the PIT interrupt is enabled, the FCS jumps to an appropriate subroutine as long as the
PIT interrupt vector is properly defined.
SCI Data Output Buffer simulation allows the user to gain access to the past 256 SCI data
values transmitted out of the module. To bring up the SCI OUT buffer dialog box, use the
SCDO command.
At any point, the SCCLR command can flush the input and output SCI buffers.
After the SCI simulated input is received, the first queued value is passed from the data
buffer into the SCI data register. It can be observed in the memory window by displaying
the memory location corresponding to the SCI data register.
The user can also observe different SCI flags in the Memory window. If the module is run
in Flag Polling mode, poll the flag corresponding to the expected SCI event. If the SCI
interrupts are enabled, the FCS jumps to an appropriate subroutine, as long as the SCI
interrupt vectors are properly defined.
For more information on how to configure the SCI module for desired operation, refer to
the Freescale user manual for your microprocessor.
FCSSCI Commands
The following FCSSCI commands are available for use with the HC08 processor.
SCCLR Command
Use the SCCLR command to flush the input and output buffers for SCI simulation. This
resets the buffers and clears out all values. Notice that if the SCI is in the process of
shifting a value, this command allows the SCI to finish the transfer. See SCDI command
and SCDO command for accessing the input and output buffers of the SCI interface.
Syntax
>SCCLR
Example
>SCCLR
Clear input and output buffer for SCI simulation
SCDI Command
The SCDI command allows the user to input data into the SCI. If a data parameter is
given, the value is placed into the next slot in the SCI input buffer. If no parameter is
given, a window displays the input buffer values. You can enter input values while the
window is open. An arrow points to the next input value to the SCI. The maximum
number of input values is 256 bytes.
Syntax
>SCDI [<n>]
Where:
<n> The value to be entered into the next location in the input buffer
Example
>SCDI $55
Set the next input value to the SCI to $55
>SCDI
Pull up the data window with all the input values.
SCDO Command
The SCDO command displays the output buffer from the SCI. A window is opened that
shows all the data that the SCI has shifted out. An arrow is used to point to the last output
value transmitted. The maximum number of output values that the buffer holds is 256
bytes.
Syntax
>SCDO
Example
>SCDO
View data from the output buffer for the SCI simulation.
The SLIC data output buffer simulation allows the user to gain access to the past 256 SLIC
data bytes transmitted out of the module. To bring up the SLIC OUT buffer dialog box,
use the SLCOUT command.
At any point, use the SLCCLR command to flush the input and output SLIC buffers.
After the simulated SLIC input is received, the first queued-in packet is passed from the
data buffer into the corresponding SLIC module registers. It can be observed in the
Memory Window by displaying the appropriate register location there.
The user can also observe different SLIC flags in the Memory window. If the module is
run in Flag Polling mode, poll the flag corresponding to the expected SLIC event. If the
SLIC interrupts are enabled, the FCS jumps to an appropriate subroutine, as long as the
SLIC interrupt vectors are properly defined. Note that the SLIC State Vector Register
reflects the specific SLIC interrupt that was triggered. CPU overhead for servicing
different LIN interrupts can be significantly decreased by monitoring the state of this
register from within the interrupt subroutine.
For more information on how to configure SLIC module for desired operation, refer to the
Freescale manual for your microprocessor.
FCSSLIC Commands
The following FCSSLIC commands are available for use with the M68HC08 processor.
SLCCLR Command
The SLCLR command can be used to flush the input and output buffers for SLIC
simulation. This resets the buffers and clear out all packets. Notice that if the SLIC is
currently shifting a value, this command allows the SLIC to finish the transfer. See
SLCDI command and SLCDOUT command for accessing the input and output buffers of
the SLIC interface.
Syntax
>SLCCLR
Example
>SLCCLR
Clear input and output buffer for SLC simulation
SLCDI Command
The SLCDI command is used to simulate SLIC input packets. The first input must be of
type “identifier.” Subsequent bytes may either be “data” or “identifier.” After the SLIC
Data IN buffer is filled with some data, the SLIC simulation module begins reception of
the data packet as soon as it is properly configured and turned on within the user’s
firmware. In Byte Transfer Mode, the designation of a byte as either “data” or “identifier”
has no effect. The SLIC data input buffer can store up to 256 bytes.
Syntax
SLCDI
Example
SLCDI
Bring up the SLIC IN buffer.
SLCOUT Command
The SLCOUT command displays the output buffer from the SLIC. A window is opened
that shows all the data that the SLIC has shifted out, in either Byte Transfer or SLIC
Mode. An arrow is used to point to the last output packet transmitted. The maximum
number of output packets that the buffer holds is 256 bytes.
Syntax
>SLCOUT
Example
>SLCOUT
View packets from the output buffer for SLIC simulation.
SPI data output buffer simulation allows the user to gain access to the past 256 SPI data
values transmitted out of the module. To bring up the SPI OUT buffer dialog box, use the
SPDO command.
At any point, SPCLR command can flush the input as well as output SPI buffers.
After the SPI simulated input is received, the first queued value is passed from the data
buffer into the SPI data register. It can be observed in the Memory Window by displaying
the memory location corresponding to the SPI data register.
The user can also observe different SPI flags in the Memory window. If the module is run
in the Flag Polling mode, poll the flag corresponding to the expected SPI event. If the SPI
interrupts are enabled, the FCS jumps to an appropriate subroutine as long as the SPI
channel interrupt vectors are properly defined.
To simulate the frequency of the SPI slave input clock, use the SPFREQ <n> command.
If the SPI is configured for slave mode, this command allows the user to enter the number
of cycles <n> in the period of the input clock. If the SPFREQ command is not used, then
clocking is set by the SPI control register.
For more information on how to configure the SPI module for desired operation, refer to
the Freescale manual for your microprocessor.
FCSSPI Commands
The following FCSSPI commands are available for use with the M68HC08 processor.
SPCLR Command
Use the SPCLR command can be used to flush the input and output buffers for SPI
simulation. This resets the buffers and clear out all values. Notice that if the SPI is
currently shifting a value, this command allows the SPI to finish the transfer. See SPDI
command and SPDO command for accessing the input and output buffers of the SPI
interface.
Syntax
>SPCLR
Example
>SPCLR
Clear input and output buffer for SPI simulation
SPDI Command
The SPDI command allows the user to input data into the SPI. If a data parameter is given,
the value is placed into the next slot in the SPI input buffer. Otherwise, if no parameter is
given, a window is displayed with the input buffer values. Input values can be entered
while the window is open. An arrow points to the next value to be used as input to the SPI.
The maximum number of input values is 256 bytes.
Syntax
>SPDI [<n>]
Where:
<n> The value to be entered into the next location in the input buffer
Example
>SPDI $55
Set the next input value to the SPI to $55
>SPDI
Pull up the data window with all the input values.
SPDO Command
The SPDO command displays the output buffer from the SPI. A window is opened that
shows all the data that the SPI has shifted out. An arrow is used to point to the last output
value transmitted. The maximum number of output values that the buffer holds is 256
bytes.
Syntax
>SPDO
Example
>SPDO
View data from the output buffer for the SPI simulation.
SPFREQ Command
The SPFREQ command lets the user set the frequency of the SPI slave input clock. If the
SPI is configured for the slave mode, this command allows the user to enter the number of
cycles <n> per one input clock period. If no value is given, a window appears and the user
is prompted for a value. If this command is not used, then the clocking is assumed to be set
by the SPI control register.
Syntax
>SPFREQ [<n>]
Where:
<n> The number of cycles for the period of the input clock.
Example
>SPFREQ 8
Set the period of the input slave clock to 8 cycles (total shift = 8*8 cycles per bit =
64 cycles)
• Flag polling
• Interrupt enabled mode of operation.
FCS mode uses the simulated port inputs to trigger the input capture on a given timer
channel. To define an input state of the specific port, use the INPUT<x> <n> command
in the Command line window. The <x> represents the corresponding I/O port, while <n>
stands for the input value to write to this port. At the same time, use the INPUTS
command to display the Simulated Port Inputs for all general I/O ports. It displays the
current simulated values for all applicable input ports. See the documentation for the
command INPUT<x>/INPUTS for more information about the various forms of this
command.
Use the Simulated Port Inputs dialog box to reconfigure the input value to any I/O port.
Depending on whether the input capture is set for rising/falling edge, to trigger the event,
first set the port inputs to high or low and then invert the inputs to an opposite value. Once
the Input Capture event takes place, the CHxF can be observed in the Channel Status and
Control register in the Memory window.
If the Timer module is configured for an Output Compare event, once the event takes
place the same CHxF Flag can be observed via the Memory window. If the timer channel
interrupt is enabled, the FCS jumps to an appropriate subroutine as long as the Timer
channel interrupt vector is properly defined. To observe the Timer Overflow Flag (TOF)
increasing as a result of the corresponding CPU event, situate your Memory window on
the memory location of the Timer Status and Control register.
To observe the Pulse Width Modulation (PWM) operation, properly configure the Timer
to operate in the Modulo up count mode, and choose the toggle-on-overflow or clear/set
output on compare events to create a desired duty cycle wave. Once a PWM event takes
place, pin toggle/clear/set behavior corresponding to the Timer configuration can be
observed in the Memory window displaying the IO port associated with a given timer
channel.
To observe the accuracy of the Timer module operation, the user can observe the number
of CPU cycles that it takes for the event to occur. The cycle counter is only incremented as
the user steps through the code. To determine the exact amount of cycles over which the
event occurs, one can either observe the cycle display in the Register window or use the
built in simulation commands. To display the current number of cycles in the Command
window, use the CYCLES command. To change the number of cycles in the cycle counter,
use CYCLES <n>, where <n> is the new cycle value. If an event has a pre-calculated
number of cycles, use CYCLE 00 to reset the number of cycles and GOTOCYCLE <n> to
run through the code until it arrives at the expected event.
CYCLES Command
The CYCLES command changes the value of the cycles counter. The cycles counter
counts the number of the processor cycles that have passed during execution. The Cycles
Window shows the cycle counter. The cycle count can be useful for timing procedures.
Syntax
>CYCLES <n>
Where:
<n> Integer value for the cycles counter
Examples
>CYCLES 0
Reset cycles counter
>CYCLES 1000
Set cycle counter to 1000.
GOTOCYCLE Command
The GOTOCYCLE command executes the program in the simulator beginning at the
address in the program counter (PC). Execution continues until the cycle counter is equal
to or greater than the specified value, until a key or the Stop button on the toolbar is
pressed, until it reaches a break point, or until an error occurs.
Syntax
GOTOCYCLE <n>
Where:
<n> Cycle-counter value at which the execution stops
Example
>GOTOCYCLE 100
Execute the program until the cycle counter equals 100.
INPUT<x> Command
The INPUT<x> command sets the simulated inputs to port <x>. The CPU reads this input
value when port <x> is set as an input port.
Syntax
INPUT<x> <n>
Where:
<x> is the letter representing corresponding port
<n> Eight-bit simulated value for port <x>
Example
>INPUTA AA
Simulate the input AA on port A.
INPUTS Command
In Full Chip Simulation and CPU-Only Simulation mode, the INPUTS command opens
the Simulated Port Inputs dialog box shown in Figure 11.54. Use this box to specify the
input states of port pins and IRQ.
When using In-Circuit Simulation mode, the INPUTS command shows the simulated
input values to any applicable port.
Syntax
>INPUTS
Example
>INPUTS
Show I/O port input values.
$Include 'JW32regs.inc'
org RamStart
Setup_Packet ds 8 ; array for SETUP packet
bmReqType equ Setup_packet ; Characteristic of Request
bRequest equ {Setup_packet+1} ; Request Code
wValueL equ {Setup_packet+2} ; Low byte Value Field
wValueH equ {Setup_packet+3} ; High byte Value Field
wIndexL equ {Setup_packet+4} ; Low byte Index Field
wIndexH equ {Setup_packet+5} ; High byte Index Field
wLengthL equ {Setup_packet+6} ; Low byte Length Field
wLengthH equ {Setup_packet+7} ; High byte Length Field
org RomStart
* Note that the Vendor and Product IDs specified in this demo are
* invalid USB IDs and are given for demonstration purposes only!
*
* Device Descriptor
Dev_Desc:
db {DDesc_End-Dev_Desc} ; Descriptor Length
db $01 ; Descriptor Type (Device)
db $00,$02 ; USB specification Release (2.00)
db $00 ; Class Code
db $00 ; Subclass Code
db $00 ; Protocol Code
db $08 ; Maximum Packet Size for EP0 (8 bytes)
db $00,$00 ; Vendor ID=none
db $00,$00 ; Product ID=none
db $01,$00 ; Device Release Number (1.00)
db $01 ; Index to Manufacturer String Descriptor
db $02 ; Index to Product String Descriptor
db $00 ; Index to Device Serial Number String
; Descriptor
db $01 ; Number of possible configurations (1)
DDesc_End:
* Configuration Descriptor
Con_Desc:
db {CDesc_End-Con_Desc} ; Descriptor Length
db $02 ; Descriptor Type (Configuration)
db {E2Desc_End-Con_Desc},$00 ; Total data length (Config-
; Interface-EP)
db $01 ; Interfaces supported
db $01 ; Configuration Value
db $00 ; Index to String Descriptor
db $C0 ; Self powered
db $00 ; Maximum power consumption=0mA
; (not applicable)
CDesc_End:
* Interface Descriptor
Int_Desc:
db {IDesc_End-Int_Desc} ; Descriptor Length
db $04 ; Descriptor Type (Interface)
db $00 ; Number of Interface
db $00 ; No alternate setting
db $02 ; Number of endpoints
* HID Descriptor
HID_Desc:
db {HDesc_End-HID_Desc} ; Descriptor Length
db $21 ; Descriptor Type (HID)
db $00,$01 ; HID Class Release (1.00)
db $00 ; Country Code=$00
db $01 ; number of HID class descriptors
db $22 ; Class Descriptor Type (REPORT)
db {RDesc_End-Rep_Desc},$00 ; length of report descriptor
HDesc_End:
* Endpoint 1 Descriptor
Endp1_Desc:
db {E1Desc_End-Endp1_Desc} ; Descriptor Length
db $05 ; Descriptor Type (Endpoint)
db $81 ; Endpoint Number and Direction (#1,IN)
db $03 ; Endpoint Attribute (Interrupt)
db $01,$00 ; Maximum Packet Size for EP1 (1 byte)
db $FF ; Polling Interval=255[ms]
E1Desc_End:
* Endpoint 2 Descriptor
Endp2_Desc:
db {E2Desc_End-Endp2_Desc} ; Descriptor Length
db $05 ; Descriptor Type (Endpoint)
db $02 ; Endpoint Number and Direction (#2,OUT)
db $02 ; Endpoint Attribute (Bulk)
db $08,$00 ; Maximum Packet Size for EP2 (8 bytes)
db $FF ; Polling Interval=255[ms]
E2Desc_End:
* Report Descriptor
Rep_Desc:
db $06,$00,$FF ; Usage Page (vendor defined)
db $09,$01 ; Usage (vendor defined)
; Input report
db $09,$03 ; Usage (vendor defined)
db $15,$00 ; Logical Minimum ($00)
***************************************************************
* Init_USB - Disables receive and transmit for all endpoints. *
* The USB state is set to powered, where the part *
* is waiting for an USB reset and for it to be *
* addressed and configured. *
***************************************************************
Init_USB:
clr control ; waiting for control packets
mov #$00,USBSR ; Reset all USB flags
mov #$2d,USIMR ; Enable interrupts for config change,
; setup, reset, and suspend events
mov #$d0,UEP1CSR ; enable EP1 as interrupt, IN direction,
; buffer size of 8
mov #$80,UEP2CSR ; enable EP2 as bulk, OUT direction,
; buffer size of 8
mov #$20,UEP12BPR ; set base address pointer for EP1 to
; $1000, EP2 to $1010
mov #$00,UINTFCR ; set interface number for EP1,EP2 to 0
mov #$4e,USBCR ; turn on USB clocking, enable
; interrupts for endpoint 0,1,2 transfers
mov #$ce,USBCR ; enable USB module
rts
****************************************************************
* FORCE_STALL - A packet is received in the control stage that *
* is not supported. So the device stalls until *
* new SETUP packet arrives at endpoint 0. *
****************************************************************
FORCE_STALL:
lda USIMR ; request not handled
ora #40 ; set EP0_STALL
sta USIMR ; new SETUP packet clears STALL
rts ; bits automatically
****************************************************************
* GETDESC_PROC - This procedure handles the standard request *
* to get the device's descriptors. *
****************************************************************
GETDESC_PROC:
GETDEVDESC:
lda Dev_Desc,x ; take device descriptor information
sta UE0D0,x ; store in USB endpoint 0 data buffer
incx
cpx #8 ; all descriptors more than 8 bytes
bne GETDEVDESC
ldhx #DDesc_End ; store end location of the descriptor
sthx descendptr
ldhx #Dev_Desc ; store pointer to next byte in
; descriptor
bra GETDESC_END
GETCONDESC:
lda Con_Desc,x ; take configuration descriptor
; information
sta UE0D0,x ; store in USB endpoint 0 data buffer
incx
cpx #8 ; all descriptors more than 8 bytes
bne GETCONDESC
ldhx #E2Desc_End ; store end location of the descriptor
sthx descendptr
ldhx #Con_Desc ; store pointer to next byte in
; descriptor
bra GETDESC_END
GETHIDDESC:
lda HID_Desc,x ; take HID descriptor information
sta UE0D0,x ; store in USB endpoint 0 data buffer
incx
cpx #8 ; all descriptors more than 8 bytes
bne GETHIDDESC
ldhx #HDesc_End ; store end location of the descriptor
sthx descendptr
ldhx #HID_Desc ; store pointer to next byte in descriptor
bra GETDESC_END
GETREPDESC:
lda REP_Desc,x ; take report descriptor information
sta UE0D0,x ; store in USB endpoint 0 data buffer
incx
GETDESC_END:
sthx descptr
lda descptr+1 ; add length specified in setup packet
add wLengthL ; and store in tptr
sta tptr+1
lda descptr
adc wLengthH
sta tptr
ldhx tptr ; is calculated pointer >= end of descriptor?
cphx descendptr ; if so then end_pointer = end of descriptor
bge GETDESC_END2 ; else, end_pointer= calculated pointer
sthx descendptr
GETDESC_END2:
ldhx descptr ; get pointer to start of descriptor
aix #8 ; eight bytes sent already
sthx descptr ; store current pointer
mov #$88,UEP0CSR ; SIZE=8 bytes, IN packet data ready
mov #GET_DESC,control ; set flag for control transfer type
bra GETDESC_EXIT
GETDESC_STALL:
jsr FORCE_STALL
GETDESC_EXIT:
rts
****************************************************************
* SETUP_PROC - This procedure handles the SETUP packets that *
* come into the USB peripheral. The only standard *
* device requests handled are SYNC_FRAME, *
* GET_DESCRIPTOR, and vendor-specific requests. *
****************************************************************
SETUP_PROC:
clr control ; clear flag for control transfer
lda UEP0CSR ; check size of SETUP packet
lsra
lsra
lsra
lsra
cmp #8 ; is SIZE=8?
bne SETUP_EXIT ; if not then exit
ldhx #8
SAVE_SETUP:
lda {UE0D0-1},x ; save data to array
sta {Setup_packet-1},x ; Setup_packet holds info
dbnzx SAVE_SETUP
lda bmReqType ; if request type is standard
and #$60 ; then go handle standard request
bne SETUP_STALL ; otherwise, force stall
STANDARD:
lda bRequest ; get request type
cbeqa #GET_DESC,GET_DESCR ; if getting descriptors then
; ready the next IN packets for
; the descriptor information
bra SETUP_STALL ; otherwise, force stall
GET_DESCR:
jsr GETDESC_PROC ; packet received was GET_DESCRIPTOR
bra SETUP_EXIT ; go exit
SETUP_STALL:
jsr FORCE_STALL ; error, force stall on endpoint 0
SETUP_EXIT:
lda UEP0CSR ; setup endpoint 0 for more packets
and #$fc
sta UEP0CSR
bclr 5,USBSR ; clear setup flags
rts
****************************************************************
* IN_PROC - This procedure handles the IN packets that come *
* into the USB peripheral through endpoint 0. *
****************************************************************
IN_PROC:
lda control ; is this IN packet for data stage
cmp #GET_DESC ; of GET_DESCRIPTOR?
bne IN_PROC2
ldhx #0 ; clear index into data buffer
sthx buffptr
IN_SEND_DATA:
ldhx descptr ; get pointer to descriptor
lda 0,x ; get descriptor byte
aix #1
sthx descptr ; save pointer to descriptor
ldhx buffptr ; get index to data buffer
sta UE0D0,x ; place byte in buffer
aix #1
LAST_DESC:
clr control ; if so then end of data transfer
DATAFILLED:
lda buffptr+1 ; set the size of the buffer
asla ; shift to upper nibble
asla
asla
asla
ora #$08 ; set DVALID_IN bit that data is ready
sta UEP0CSR
rts
IN_PROC2:
bclr 2,UEP0CSR ; clear the TFRC_IN bit for further
packets
rts
****************************************************************
* OUT_PROC - This procedure handles the OUT packets that are *
* sent by the USB peripheral through endpoint 0. *
****************************************************************
OUT_PROC:
lda UEP0CSR ; setup endpoint 0 for more packets
and #$fc ; all OUT packets received for endpoint 0
sta UEP0CSR ; should be for status stage of requests
rts
**************************************************************
* MAIN_INIT - This is the point where code starts executing *
* after a RESET. *
**************************************************************
MAIN_INIT:
rsp
clra
clrx
mov #$01,CONFIG ; URSTD=1 (USB reset=interrupt),
; disable COP watchdog
mov #$FF,PULLCR ; enable pullups for port B
jsr Init_USB ; Initialize USB peripheral
main_loop:
bra main_loop
**************************************************************
* USB_ENDP_ISR - USB Endpoint Interrupt Service Routine. *
* Interrupts here if packets are received or *
* transmitted on any endpoint. *
**************************************************************
USB_ENDP_ISR:
brclr 0,UEP0CSR,USB_ENDP_ISR2 ; Is it an OUT packet received?
brclr 1,UEP0CSR,USB_ENDP_ISR2
jsr OUT_PROC ; handle OUT packet for EP0
rti ; exit interrupt
USB_ENDP_ISR2:
brclr 2,UEP0CSR,USB_ENDP_ISR3 ; Is packet sent from IN packet
; for endpoint 0?
jsr IN_PROC ; handle IN packet for endpoint 0
rti ; exit interrupt
USB_ENDP_ISR3:
brclr 0,UEP1CSR,USB_ENDP_ISR4 ; Is packet sent from IN packet
; for endpoint 1?
lda ptb ; get Port B value
sta EP1BuffStart ; place in endpoint 1 data buffer
mov #01,UEP1DSR ; set data size for endpoint 1
; to 1
bclr 0,UEP1CSR ; clear the TFRC flag
bset 1,UEP1CSR ; set the DVALID flag
USB_ENDP_ISR4:
brclr 0,UEP2CSR,USB_ENDP_EXIT ; is it a packet for endpoint 2?
brclr 1,UEP2CSR,USB_ENDP_EXIT ; is it an OUT packet?
ldhx #0
USB_ISR4_LOOP:
lda EP2BuffStart,x ; get data received in endpoint buffer
sta EP2Data,x ; and transfer to local data buffer
aix #1
cpx UEP2DSR
bne USB_ISR4_LOOP
lda UEP2CSR ; clear the TFRC/DVALID flag
and #$fc
sta UEP2CSR
rti ; exit interrupt
USB_ENDP_EXIT:
rti
**************************************************************
* USB_SYS_ISR - USB System Interrupt Service Routine. *
* Interrupts here if USB suspend, resume, reset, *
* config_chg, start of frame, or setup event *
* occurs. *
**************************************************************
USB_SYS_ISR:
brclr 2,USBSR,USB_SYS_ISR2 ; Is it USB reset?
bclr 2,USBSR ; reset USB reset flag
rti ; exit interrupt
USB_SYS_ISR2:
brclr 3,USBSR,USB_SYS_ISR3 ; Is there a change in
; configuration?
brclr 7,USBSR,USB_CONFIG_CLR
lda ptb ; get Port B value
sta EP1BuffStart ; place in endpoint 1 data buffer
mov #01,UEP1DSR ; set data size for endpoint 1 to 1
bclr 0,UEP1CSR ; clear the TFRC flag
bset 1,UEP1CSR ; set the DVALID flag
bclr 3,USBSR ; clear the CONFIG_CHG flag
rti ; exit interrupt
USB_CONFIG_CLR:
bclr 3,USBSR ; clear CONFIG_CHG bit
rti ; exit interrupt
USB_SYS_ISR3:
brclr 5,USBSR,USB_SYS_ISR4 ; is it SETUP packet?
jsr SETUP_PROC ; handle SETUP packet
rti ; exit interrupt
USB_SYS_ISR4:
brclr 0,USBSR,USB_SYS_EXIT ; is it a SUSPEND event?
bclr 0,USBSR ; reset suspend flag
rti ; exit interrupt
USB_SYS_EXIT:
rti
**************************************************************
* DUMMY_ISR - Dummy Interrupt Service Routine. *
* Just does a return from interrupt. *
**************************************************************
DUMMY_ISR:
rti ; simple return
**************************************************************
This code utilizes three endpoints in the USB peripheral: endpoints 0, 1, and 2. As always,
all control transactions occur through endpoint 0. The other endpoints can be set up for
data transfer in the input or output direction, depending on whether data needs to be sent
or received to/from the host. Here, endpoint 1 is setup as an input pipe and endpoint 2 is
setup as an output pipe. The host becomes aware of whether an endpoint is an input or
output through the descriptor tables that are exchanged at the beginning of device
discovery.
It is necessary for the host and the slave to keep retention of the USB state of the device.
There are multiple states for the USB device. The module starts in the POWERED state.
When a USB reset is detected, the module is placed into the DEFAULT state. When the
device receives a SET_ADDRESS standard device request with a valid address, the
device is placed into the ADDRESSED state. Finally, when a SET_CONFIGURATION
standard device request is sent, the device is placed into the CONFIGURED state.
After the device is configured, endpoint 1 is enabled for interrupt transfers from the host.
Endpoint 1 is only capable of sending information out from it. Therefore, only IN packets
are accepted at the endpoint. The report descriptor sets up the endpoint to transfer only 1
byte of data. So when an IN packet comes from the host, the device sends out the data read
from the Port B input pins. Note that the internal pull-ups are enabled for PORTB in the
code (PULLCR), so the default input value sent through endpoint 1 is $FF.
After the device is configured, endpoint 2 is enabled for bulk transfers. Endpoint 2 is only
capable of reading information into it. Therefore, only OUT packets are accepted at the
endpoint. The report descriptor sets up the endpoint to read, at most, 8 bytes of data. So
when an OUT packet comes from the PC, the device reads the data from the packet into a
local buffer.
So, how is the code laid out in order to handle this? The beginning of the code shows
symbol defines for addresses within memory for RAM, Flash, interrupt vectors, and
buffers for USB endpoints. Also included are the register file definitions, which give the
addresses of peripheral registers on the microcontroller. Following this comes the variable
declarations for control packets, pointers, and received data.
In the FLASH, the descriptor tables are created, which describe the type of USB device,
the configuration, the interface, HID specific information, the endpoints, and reporting
information. All information needed in these descriptors, can be found in the Freescale
documentation describing USB module specifications for the microprocessor that you are
using.
After the descriptors comes the actual code, where numerous procedures are described,
meant to handle different tasks. The first is the initialization procedure, which sets up the
registers for the USB peripheral for the intended operation. The USB peripheral is also
enabled at the end of the routine. The next several procedures are specifically for USB
operation, such as: forcing a device stall, sending the device descriptors to the host,
handling SETUP packets, handling IN packets, and processing OUT packets. After this
comes the start of the application in the MAIN_INIT procedure, where we call the
initialization routines and wait for an interrupt to occur. There are two interrupt service
routines for the USB peripheral in this code: one for endpoint events that occur, and the
other for USB system events such as setups, stalls, and resets. Note that this application is
totally interrupt driven, where the code is driven by any events that take place in the USB
peripheral.
The end of the code shows the interrupt vectors for the microcontroller, where the USB
interrupts and the RESET vector are included. All other vectors are pointed to a dummy
interrupt service routine that simply just returns from the interrupt.
Once the mentioned above assembly code is compiled as a part of the Freescale project,
one can step through in the Full Chip Simulation mode. The execution starts automatically
at the reset location within the code. We are now ready to start debugging the code.
First, we need to step through the beginning of the code in the simulator in order to allow
the code to initialize the microcontroller and the USB peripheral and get ready to start
receiving USB packets from the host. So, the user needs to step through the beginning of
the code until they get to the main loop with the ’t’ command.
At this point we are ready for USB packets to come into the device. There are four specific
commands in the FCS for simulating external input/output as well as reset and clear
functionality of the USB peripheral: USBRESET, USBIN, USBOUT, and USBCLR (for
more detailed information, refer to the USB commands section). The USBRESET
command causes a USB reset, which is identical to a host trying to reset a slave USB
device once it connects to the bus. The USBIN command allows a user to specify packets
coming into the USB peripheral. The USBOUT command allows a user to see the packets
that were sent out from the USB peripheral. The USBCLR command allows the user to
clear all input and output buffers of USB packets. The first command to use for testing the
USB peripheral is the USBRESET command, which places the USB peripheral in the
RESET state. After the USBRESET command, step through the code with a t command to
enter the system interrupt service routine. Enter the t command a few more times to exit
the ISR and return to the main loop.
Now we can use the USBIN command to specify USB packets that come across the USB
bus from the host. When a user types this command in the simulator, the USB IN window
appears as shown in Figure 11.55. There are no USB packets specified yet in the window.
The GET DEVICE DESCRIPTOR request between a host and a slave USB device has
three different stages to it, as defined by the USB standard: the setup stage, the data stage,
and the status stage. Figure 11.57 shows the flow of packets between the USB host and
slave devices for a GET DEVICE DESCRIPTOR request as well as the stages. The setup
stage simply consists of a SETUP packet from the host, then a DATA0 packet with the
byte codes that indicate that this is a GET DESCRIPTOR, and the acknowledge (ACK)
packet from the slave.
To replicate this stage in the simulator, enter the SETUP packet as shown in Figure 11.56
and the DATA0 packet as shown in Figure 11.58, using the USBIN command. The USB
peripheral automatically sends out the ACK after the code services the other packets,
which are received in the simulator. Once the SETUP and DATA0 packets are entered, the
USBIN window looks as shown in Figure 11.59. The user can then step through the setup
stage by typing t in the simulator. At this point, use the USBOUT command to see that the
ACK packet was sent out by the device, as shown in Figure 11.60. This completes the
setup stage.
We can utilize the same commands for the data stage, using the USBIN command to
create IN and ACK packets. Once the code receives the IN packet, it sends out the
descriptor information with data packets through endpoint 0. The ACK packet then is
needed to end that data stage transfer. Several data stage transfers are needed to send out
all of the device descriptor information. Each data packet can hold only eight bytes, so we
need three transfers in this case. Figure 11.61 shows the USB IN window. Figure 11.62
shows the current appearance of the USB OUT window.
Notice in Figure 11.63 the DATA0 packet output during the data stage. This packet
contains the data found in the device descriptor table in the code. This shows exactly what
USB packet information was sent out from the device.
Once we get through the status stage, which requires an OUT packet along with an empty
DATA0 packet from the host to be received, we get the USB IN window to look like that
shown in Figure 11.64 and the USB out window to look like that shown in Figure 11.65
Now that we have gone through this device descriptor exchange, the host has an idea of
what type of USB slave device it is, and next needs to give it an address. We can go
through the same process for the SET ADDRESS request from the host. Once the device
is addressed, you must use this address in the SETUP packets sent to the device.
USB Commands
The following USB commands are available for use with the HC08 processor.
USBCLR Command
Use the USBCLR command to flush the input and output buffers for USB simulation. This
resets the buffers and clears out all packets. If the USB is currently shifting a value, this
command allows the USB to finish the transfer. See USBIN command and USBOUT
command for accessing the input and output buffers of the USB interface.
Syntax
>USBCLR
Example
>USBCLR
Clear input and output buffer for USB simulation
USBIN Command
The USBIN command allows the user to create packets for input into the USB. If you
specify packet parameters, this command places the packet into the next slot in the USB
input buffer. If no parameter is given, this command displays a pick window with the input
buffer packets. Enter the packets while the window is open. An arrow points to the next
input packet to the USB. The maximum number of input packets is 256.
Syntax
USBIN [SETUP | IN | OUT <address> <endpoint>]
USBIN [DATA0 | DATA1 <n1>…<n2>…<n3>]
USBIN [ACK/NAK/STALL]
Where:
<n1>…<n2>…<n3>… are the values for the data packet.
<address> is the USB address for the packet.
<endpoint> is the endpoint number for the packet.
Example
>USB SETUP $5A $0
Set the next input packet as a SETUP packet for address $5A at the endpoint 0.
>USBIN DATA1 $10 $A4 $52
Set the next packet as a DATA1 packet with 3 data bytes $10, $A4, $52
>USBIN ACK
Set the next input packet as an ACK packet.
>USBIN
Open the pick window with all the input packets.
Where:
<n> The value to be entered into the next location in the input buffer.
Example
>USBIN $55
Set the next input value to the USB to $55
>USBIN
Pull up the data window with all the input values.
USBOUT Command
The USBOUT command displays the output buffer from the USB. A window is opened
that shows all the data that the USB has shifted out. An arrow is used to point to the last
output packet transmitted. The maximum number of output packets that the buffer holds is
256 bytes.
Syntax
>USBOUT
Example
>USBOUT
View packets from the output buffer for USB simulation.
USBRESET Command
The USB RESET command simulates a USB reset from the USB connection. If the
URSTD bit is clear in the CONFIG register, then a reset of the MCU occurs just as with a
RESET command. If the URSTD bit is set, then a USB interrupt occurs. See the technical
description of the USB peripheral in the Freescale Manual for more information.
Syntax
>USBRESET
Example
>USBRESET
Simulate USB reset of the MCU.
Connection Procedure
To make the MON08 Interface debugger connection:
1. Choose the MON08 Interface option from the Set Connection dialog box
2. Click the OK button - The P&E Connection Manager window opens with its Connect
Target tab selected.
3. Access the Interface Selection dialog box by clicking the Add A Connection button in
the Connection Manager window’s - Connect Target Tab. Choose a device class
corresponding to the type of interface that you are using.
4. Define the proper communication port and baud rate setting in the Connection
Manager.
5. To remove a pre-configured MON08 Interface connection, proceed to the Remove
section of the connection manager. Select the interface to be removed and click on
Remove Selected Interface.
for a short time after the supply has been switched off, but the supply voltage must reach
less than 0.1v before it is turned back on if a Power-On reset is to occur.
Whenever power is automatically or manually switched on, the software waits for an
amount of time equal to the Tpu delay time before attempting to contact the 68HC08
processor. This is to allow time not only for power to be fully available, but to wait until
any reset driver has finally released the RESET line.
3. Software automatically powers up the ICS, which configures the processor’s MON08
configuration pins.
4. Software asks the user to power up the board as follows:
3. Software automatically powers up the ICS, which configures the processor’s MON08
configuration pins.
Figure 12.8 P&E Connection Manager Window - MON08 16-Pin Header Signals Tab
The MON08 16-Pin Header Signals tab of the P&E Connections Manager window can be
used by the user to manually enter the proper security bytes via the USER setting, or to
load the security bytes from the same .S19 file which was programmed. The bytes are
loaded from a .S19 file by clicking the Load from S19 button.
NOTE If a connection is not established for any reason other than security failure, the
connection dialog box always appears.
STATUS Area
The status area of the MON08 16-Pin Header Signals tab consists of one status string
following the Status: label, and seven items which list the state of the last attempt to
connect to a target and pass security. The description for these items is as follows:
• 0 – ICS Hardware loopback detected:
Every ICS or board which supports MON08 has a serial loopback in hardware
which, by connecting the transmit and receive lines, automatically echoes characters
from the PC. A valid character transmitted from the PC is echoed once by the
loopback circuitry on the board and once by the monitor of the target processor itself.
This status indicates whether the first echoed character from the hardware loopback
was received when one of the security bytes was transmitted. If the status is ‘N’,
which indicates that the character was not received, it is most likely due to one of the
following reasons:
– Wrong Com Port specified.
– The baud rate specified was incorrect (probably too low).
– The ICS/Target is not connected.
– No Power to the ICS.
If this status bit is ‘N’, you must correct this before analyzing the rest of the status
bits.
• 1 – Device echoed some security bytes:
The monitor resident in a 68HC08 device automatically echoes every incoming
character when it is in monitor mode. A valid character transmitted from the PC is
echoed once by the loopback circuitry on the board and once by the monitor of the
target processor itself. This status indicates whether or not the second echoed
character from the monitor response was received when one of the security bytes was
transmitted. If the status is ‘N’, which indicates that the character was not received,
or not received properly, it is most likely due to one of the following reasons:
– The baud rate specified was incorrect.
– The part did not start the monitor mode security check on reset. Signals to force
monitor mode may be incorrect.
– No Power to the ICS.
If this status bit is ‘N’, you must correct this before analyzing the rest of the status
bits.
• 2 – Device echoed all security bytes:
To pass security, the software must send 8 security bytes to the processor. The
processor echoes each of these eight bytes twice. If all 8 bytes did not get the proper
two-byte echo, this flag reads ‘N’. Reasons for this include:
– The part did not start the monitor mode security check on reset. Signals to force
monitor mode may be incorrect.
– The baud rate specified was incorrect.
– The processor was not reset properly. Check the Target Hardware Type and, if
you are connecting to a class II board, check the MON08 cable communication
connections type in the Advanced Settings dialog box.
• 3 – Device signaled monitor mode with a break:
Once the processor has properly received the 8 bytes from the PC software to
complete its security check, it transmits a break character to the PC signaling entry
into monitor mode. This break character is sent regardless of whether the security
check was successfully passed. If a break is not received from the processor, this flag
reads ‘N’. Reasons for this include:
– The baud rate specified was incorrect.
– The processor was not reset properly. Check the Target Hardware Type. If you
are connecting to a class II board, check the MON08 cable communication
connections type in the Advanced Settings dialog box.
• 4 – Device entered monitor mode:
Once the software has received, or failed to receive, a break from the processor, it
attempts to communicate with the monitor running on the M68HC08 processor. It
tries to read the monitor version number by issuing a monitor mode read. If the
processor fails to respond properly to this command, this flag reads ‘N’.
• 5 – Reset was Power-On Reset:
If the device properly entered monitor mode (4), the software reads the reset status
register (RSR). This read does not affect the security sequence, and occurs purely for
diagnostic reasons. The RSR indicates the conditions under which the processor
underwent the last reset. For the software to pass the security check properly, it
MUST first cause the processor to undergo a Power-On Reset. The software reads
the RSR to determine if the last reset was indeed caused by power-on. The result of
the RSR read is indicated in parentheses after the flag value. If the highest bit is not
set then the reset was not a power-on reset, and the flag reads ‘N’. Reasons for this
include:
– The processor did not power all the way down because power was being supplied
to the processor through either the port pins, IRQ line, RESET line, or power
pins.
– The voltage driven on the power pin of the processor did not go below 0.1 volts.
– The processor was not reset properly. Check the Target Hardware Type. If you
are connecting to a class II board, check the MON08 cable communication
connections type in the Advanced Settings dialog box.
Trim Options
The Calculate Trim and Program the Non-Volatile Trim Register checkbox enables
automatic calculation and programming of the trim value in a designated Non-Volatile
memory location.
NOTE The Non-Volatile Memory Preservation and Custom Trim functionality are
only available for the M68HCS08 devices, and as such these options are
disabled for all M68HC08 devices.
If register files are installed on the host computer, selecting a block brings up the Register
Block register listing (see Figure 12.13), which shows a list of the associated registers,
their addresses, and their descriptions. This begins interactive setup of system registers
such as I/O, timer, and COP watchdog.
Selecting a file brings up the Register Window (see Figure 12.14), which displays the
values and significance for each bit in the register. The registers can be viewed and their
values modified, and the values can be stored back into debugger memory.
Class 1 Device
ICS Board with processor installed. This is the standard and most common configuration
of the ICS08 boards. In this configuration, the processor is resident in one of the sockets
on the ICS board itself. The processor can be debugged and programmed in this
configuration, and an emulation cable containing all the processor I/O signals can be
connected to the user's MCU development board. In this configuration, the ICS board
hardware can automatically power up and down the processor in order to pass security in
the simplest fashion. The user must be sure not to provide power from the MCU
development board, up through the emulation cable, to the processor pins themselves,
when this dialog box appears. This is so that the software, when attempting to establish
communications, can fully power the processor down. The software running on the PC
controls power to the user’s MCU development board via the serial port DTR line.
Class 2 Device
ICS Board without processor, connected to the user’s microprocessor system via MON08
Cable. In this configuration, there is no processor resident in any of the sockets of the ICS
board itself. The processor is mounted down in the user’s MCU system. The connection
from the ICS board to the user’s MCU system is accomplished via the 16-pin MON08
connector. In this configuration, since the ICS does not control power to the processor, the
user is prompted to turn the processor's power supply on and off. Turning off the power
supply is necessary to pass the initial security mode check and access the Flash on the
processor. A simple reset is not enough; to pass the security check, you must first force the
processor to encounter a POR (power-on reset) which requires that the processor's voltage
dip below 0.1v. Once security is passed, resetting the device or re-entering the software is
easier.
Class 3 Device
Custom Board (no ICS) with MON08 serial port circuitry built in. In this configuration,
the ICS board is not used at all. The user must provide a serial port connection from the
PC, and provide all hardware configurations necessary to force the processor into MON08
mode upon reset. This includes resets both internal and external to the processor. In this
configuration, because the software does not directly control power to the processor, the
user is prompted to turn the processor's power supply on and off. The user is be prompted
to turn power on and off to reset the microprocessor, as the PC doesn't have control of the
microprocessor reset. Turning off the power supply is necessary to pass the initial security
mode check and access the Flash on the processor. A simple reset is not enough; to pass
the security check, you must first force the processor to encounter a POR (power-on reset)
which requires that the processor's voltage dip below 0.1v. Once security is passed,
resetting the device or re-entering the software is easier. Class 3 selection also applies to
use of the ICS board with the two-pin blank part programming connector.
Class 4 Device
Custom Board (no ICS) with MON08 serial port circuitry and additional auto-reset circuit
built in. In this configuration, the ICS board is not used at all. The user must provide a
serial port connection from the PC and all hardware configuration necessary to force the
processor into MON08 mode upon reset. In addition, the user must include an extra circuit
which allows the reset line of the processor to be driven low from the DTR line of the
serial port connector (Pin 4 on a DB9). The following diagram shows the additional
connection needed to reset from a DB9 serial connector.
Figure 12.15 Reset Connection
In this configuration, because the software does not directly control power to the
processor, the user is prompted to turn the processor's power supply on and off. Turning
off the power supply is necessary to pass the initial security mode check and access the
Flash on the processor. A simple reset is not enough; to pass the security check, you must
first force the processor to encounter a POR (power-on reset) which requires the
processor's voltage to dip below 0.1v. Once security is passed, resetting the device is
facilitated by the above circuitry.
ICS Mode
In-Circuit Simulation (ICS) Mode is a P&E Microcomputer Systems mode of operation
that is a hybrid between In-Circuit Debugging, and Full Chip simulation. P&E has
combined the benefits of each of these modes, while minimizing their respective
deficiencies.
ICS mode simulates the CPU core instructions on the user's PC. However, Inputs/Outputs
are read directly from the user's development device, and certain modules are run on the
actual device. Any instructions that affect an I/O location, for example, lda PORTA or
sta PORTA, also use data from the real device. This allows for all the benefits of full
chip simulation (Cycle by Cycle accuracy, unlimited breakpoints, and speed, to name just
a few), while allowing the obvious benefit of garnering relevant signals from actual
hardware.
In-Circuit simulation requires a user to have a connected MCU Device, be it a
development board, prototype hardware, or simply a device placed in a simple circuit on a
breadboard. Once connection is established, the P&E Interface loads a .MON file to the
microcontroller itself. This .MON file is the ICS-Kernel: it constantly runs on the device,
and interacts with the P&E software to provide information about changing I/O and any
peripherals that are running on the device itself.
The following modules are run on the actual device when in ICS mode, and as such their
Simulation commands become unnecessary, and therefore do not function:
I/O ports, SCI, SPI, IRQ, ADC, LCD, KBI.
All other modules function as fully simulated modules. For information about relevant
simulation commands, see the HC08 Full Chip Simulation section.
Connection Procedure
To select the ICS MON08 Interface connection:
1. Choose the ICS MON08 Interface option from the set connection dialog box, as shown
in Figure 13.1.
2. Click the OK button to open the P&E Connection Manager Window.
4. Define the proper communication port and baud rate setting in the Connection
Manager. See Figure 13.3.
5. To remove a pre-configured ICS MON08 Interface, go to the Remove section of the
connection manager. Select the interface to be removed and click on Remove Selected
Interface.
3. Software automatically powers up the ICS, which configures the processor’s MON08
configuration pins.
4. Software asks the user to power up the board as follows:
3. Software automatically powers up the ICS, which configures the processors MON08
configuration pins.
NOTE If a connection is not established for any reason other than security failure, the
connection dialog box always appears.
STATUS Area
The status area of the P&E Connections Manager window consists of one status string
following the Status: label, and seven items which list the state of the last attempt to
connect to a target and pass security. The description for these items is as follows:
• 0 – ICS Hardware loopback detected:
Every ICS or board which supports MON08 has a serial loopback in hardware
which, by connecting the transmit and receive lines, automatically echoes characters
from the PC. A valid character transmitted from the PC is echoed once by the
loopback circuitry on the board and once by the monitor of the target processor itself.
This status indicates whether or not the first echoed character from the hardware
loopback was received when one of the security bytes was transmitted. If the status is
‘N’, which indicates that the character was not received, it is most likely due to one
of the following reasons:
– Wrong Com Port specified.
– The baud rate specified was incorrect (probably too low).
– The ICS/Target is not connected.
– No Power to the ICS.
If this status bit returns an ‘N’, you must correct this before analyzing the reset of the
status bits.
• 1 – Device echoed some security bytes:
The monitor resident in a M68HC08 device automatically echoes every incoming
character when it is in monitor mode. A valid character transmitted from the PC is
echoed once by the loopback circuitry on the board and once by the monitor of the
target processor itself. This status indicates whether or not the second echoed
character from the monitor response was received when one of the security bytes was
transmitted. If the status is ‘N’, which indicates that the character was not received,
or not received properly, it is most likely due to one of the following reasons:
– The baud rate specified was incorrect.
– The part did not start the monitor mode security check on reset. Signals to force
monitor mode may be incorrect.
– No Power to the ICS.
If this status bit returns an ‘N’, you must correct this before analyzing the reset of the
status bits.
• 2 – Device echoed all security bytes:
To pass security, the software must send eight security bytes to the processor. The
processor echoes each of these eight bytes twice. If all eight bytes did not get the
proper two-byte echo, this flag returns an ‘N’. Reasons for this include:
– The part did not start the monitor mode security check on reset. Signals to force
monitor mode may be incorrect.
– The baud rate specified was incorrect.
– The processor was not reset properly. Check the Target Hardware Type and if
you are connecting to a class II board, check the MON08 cable communication
connections type in the Advanced Settings dialog box.
• 3 – Device signaled monitor mode with a break:
Once the processor has properly received the eight bytes from the PC software to
complete its security check, it transmits a break character to the PC signaling entry
into monitor mode. This break character is sent regardless of whether the security
check was successfully passed. If a break character is not received from the
processor, this flag returns an ‘N’. Reasons for this include:
– The baud rate specified was incorrect.
– The processor was not reset properly. Check the Target Hardware Type. If you
are connecting to a class II board, check the MON08 cable communication
connections type in the Advanced Settings dialog box.
• 4 – Device entered monitor mode:
Once the software receives, or fails to receive, a break character from the processor,
it attempts to communicate with the monitor running on the M68HC08 processor. It
tries to read the monitor version number by issuing a monitor mode read. If the
processor fails to respond properly to this command, this flag returns an ‘N’.
• 5 – Reset was Power-On Reset:
If the device properly entered monitor mode (4), the software reads the reset status
register (RSR). This read does not affect the security sequence, and occurs purely for
diagnostic reasons. The RSR indicates the conditions under which the processor
underwent the last reset. For the software to pass the security check properly, it
MUST first cause the processor to undergo a Power-On Reset. The software reads
the RSR to determine if the last reset was indeed caused by power-on. The result of
the RSR read is indicated in parentheses after the flag value. If the highest bit is not
set then the reset was not a power-on reset, and the flag indicates an ‘N’. Reasons for
this include:
– The processor did not power all the way down because power was being supplied
to the processor through either the port pins, IRQ line, RESET line, or power
pins.
– The voltage driven on the power pin of the processor did not go below 0.1 volts.
– The processor was not reset properly. Check the Target Hardware Type. If you
are connecting to a class II board, check the MON08 cable communication
connections type in the Advanced Settings dialog box.
• 6 – ROM is accessible (un-secured):
If the device properly entered monitor mode (4), the software reads locations $FFF6-
$FFFF to determine if the processor passes the security check. Memory locations
which are invalid or protected read back from the device as $AD. If all bytes from
$FFF6-$FFFF read a value of $AD, it is assumed the device is secure, and the flag
value is an ‘N’. If all flags 0-5 register a value of ‘Y’ and flag 6 register a value of
‘N,’ then the reset process has gone correctly except that the security code used to
pass security was incorrect. Specify the correct security code and try again, or
IGNORE the security failure and erase the device. Once you erase a secured device,
you must exit the software and restart it in order to pass security.
Trim Options
The Calculate Trim and Program the Non-Volatile Trim Register checkbox enables
automatic calculation and programming of the trim value in a designated non-volatile
memory location.
NOTE The Non-Volatile Memory Preservation and Custom Trim functionality are
only available for the M68HCS08 devices, and as such these options are
disabled for all M68HC08 devices.
If register files are installed on the host computer, selecting a block brings up the Register
Block register listing (see Figure 13.12), which shows a list of the associated registers,
their addresses, and their descriptions. This begins interactive setup of system registers
such as I/O, timer, and COP watchdog.
Selecting a file brings up the Register Window (see Figure 13.13), which displays the
values and significance for each bit in the register. The registers can be viewed and their
values modified, and the values can be stored back into debugger memory.
Class 1 Device
ICS Board with processor installed. This is the standard and most common configuration
of the ICS08 boards. In this configuration, the processor is resident in one of the sockets
on the ICS board itself. The processor can be debugged and programmed in this
configuration, and an emulation cable containing all the processor I/O signals can be
connected to the user's MCU development board. In this configuration, the ICS board
hardware can automatically power up and down the processor in order to pass security in
the simplest fashion. The user has to be sure not to provide power from the MCU
development board, up through the emulation cable, to the processor pins themselves,
when this dialog box appears. This is so that the software, when attempting to establish
communications, can fully power the processor down. The software running on the PC
controls power to the user’s MCU development board via the serial port DTR line.
Class 2 Device
ICS Board without processor, connected to the user’s microprocessor system via MON08
Cable. In this configuration, there is no processor resident in any of the sockets of the ICS
board itself. The processor is mounted down in the user’s MCU system. The connection
from the ICS board to the user’s MCU system is accomplished via the 16-pin MON08
connector. In this configuration, since the ICS does not control power to the processor, the
user is prompted to turn the processor's power supply on and off. Turning off the power
supply is necessary to pass the initial security mode check and access the Flash on the
processor. A simple reset is not enough; to pass the security check, you must first force the
processor to encounter a POR (power-on reset) which requires that the processor's voltage
dip below 0.1v. Once security is passed, resetting the device or re-entering the software is
easier.
Class 3 Device
Custom Board (no ICS) with MON08 serial port circuitry built in. In this configuration,
the ICS board is not used at all. The user must provide a serial port connection from the
PC, and provide all hardware configuration necessary to force the processor into MON08
mode upon reset. This includes resets both internal and external to the processor. In this
configuration, because the software does not directly control power to the processor, the
user is prompted to turn the processor's power supply on and off. The user is also
prompted to turn power on and off to reset the microprocessor, as the PC has no control of
the microprocessor reset. Turning off the power supply is necessary to pass the initial
security mode check and access the Flash on the processor. A simple reset is not enough;
to pass the security check, you must first force the processor to encounter a POR (power-
on reset) which requires that the processor's voltage dip below 0.1v. Once security is
passed, resetting the device or re-entering the software is easier. Class 3 selection also
applies to use of the ICS board with the two-pin blank part programming connector.
Class 4 Device
Custom Board (no ICS) with MON08 serial port circuitry and additional auto-reset circuit
built in. In this configuration, the ICS board is not used at all. The user must provide a
serial port connection from the PC and all hardware configuration necessary to force the
processor into MON08 mode upon reset. In addition, the user must include an extra circuit
which allows the reset line of the processor to be driven low from the DTR line of the
serial port connector (Pin 4 on a DB9). The following diagram shows the additional
connection needed to reset from a DB9 serial connector.
In this configuration, because the software does not directly control power to the
processor, the user is prompted to turn the processor's power supply on and off. Turning
off the power supply is necessary to pass the initial security mode check and access the
Flash on the processor. A simple reset is not enough; to pass the security check, you must
first force the processor to encounter a POR (power-on reset) which requires the
processor's voltage to dip below 0.1v. Once security is passed, resetting the device is
facilitated by the above circuitry.
Connection Procedure
To select the P&E Multilink/Cyclone Pro connection:
1. Select the Component > Set Connection menu command.
2. Choose the P&E Multilink/Cyclone Pro option from the Set Connection dialog box, as
shown in Figure 14.1.
Figure 14.1 Set Connections Dialog Box - P&E Multilink/Cyclone Pro Selected
3. Click the OK button - The Connection Manager Window opens with the Connect to
Target Tab exposed, as shown in Figure 14.2.
4. The device power selection allows the user to specify whether the target is 2, 3, or 5
Volts, and whether this power is switched/generated by the P&E interface or if it is
separately supplied to the target and under user control. If it is under user control, the
software uses dialog boxes to ask the user to power the target up and down when
necessary (similar to Class II-IV). See Figure 14.3.
5. The device clock menu allows two options, as shown in Figure 14.4.
• P&E provides clock to target
• The device has its own clock
6. Click on Refresh, which displays all P&E devices that are automatically detected, such
as Cyclone Pro USB, Cyclone Pro Ethernet and USB-ML-MON08 Multilink. See
Figure 14.2.
7. To add a serial/parallel port P&E device such as Cyclone Pro Serial, MON08
Multilink and Cyclone Pro Ethernet (IP outside of subnet mask), proceed to the
Interface Selection Window by pressing the Add A Connection button on this tab of
the Connection Manager window. See Figure 14.5. For more information about
configuring Cyclone Pro for ethernet operation, refer to the Cyclone Pro User's
Manual.
Figure 14.6 Connection Manager Dialog Box - Remove A Manually Configured Multilink/
Cyclone Pro Interface
3. Software automatically powers up the ICS, which configures the processor’s MON08
configuration pins.
4. Software asks the user to power up the board as follows:
3. Software automatically powers up the ICS, which configures the processor’s MON08
configuration pins.
Figure 14.11 P&E Connection Manager Window - P&E Multilink on LPT1 Interface
This window can be used to manually enter the proper security bytes via the USER
setting, or to load the security bytes from the same .S19 file which was programmed. The
bytes are loaded from a .S19 file by clicking the Load from S19 button.
monitor mode communications regardless of the security status. As long as the Baud and
Port are correct, and the device has been properly powered, monitor mode entry is
allowed. By ignoring the security check failure you can still use monitor mode, but the
ROM/Flash are not accessible.
NOTE If a connection is not established for any reason other than security failure, the
connection dialog box always appears.
STATUS Area
The status area of the P&E Connections Manager window consists of one status string
following the Status: label, and seven items which list the state of the last attempt to
connect to a target and pass security. The description for these items is as follows:
• 0 – ICS Hardware loopback detected:
Every ICS or board which supports MON08 has a serial loopback in hardware
which, by connecting the transmit and receive lines, automatically echoes characters
from the PC. A valid character transmitted from the PC is echoed once by the
loopback circuitry on the board and once by the monitor of the target processor itself.
This status indicates whether the first echoed character from the hardware loopback
was received when one of the security bytes was transmitted. If the status is ‘N’,
which indicates that the character was not received, it is most likely due to one of the
following reasons:
– Wrong Com Port specified.
– The baud rate specified was incorrect (probably too low).
– The ICS/Target is not connected.
– No Power to the ICS.
If this status bit returns an ‘N’, you must correct this before analyzing the rest of the
status bits.
• 1 – Device echoed some security bytes:
The monitor resident in a M68HC08 device automatically echoes every incoming
character when it is in monitor mode. A valid character transmitted from the PC is
echoed once by the loopback circuitry on the board and once by the monitor of the
target processor itself. This status indicates whether the second echoed character
from the monitor response was received when one of the security bytes was
transmitted. If the status is ‘N’, which indicates that the character was not received,
or not received properly, it is most likely due to one of the following reasons:
– The baud rate specified was incorrect.
– The part did not start the monitor mode security check on reset. Signals to force
monitor mode may be incorrect.
– The processor did not power all the way down because power was being supplied
to the processor through either the port pins, IRQ line, RESET line, or power
pins.
– The voltage driven on the power pin of the processor did not go below 0.1 volts.
– The processor was not reset properly. Check the Target Hardware Type. If you
are connecting to a class II board, check the MON08 cable communication
connections type in the Advanced Settings dialog box.
• 6 – ROM is accessible (un-secured):
If the device properly entered monitor mode (4), the software reads locations $FFF6-
$FFFF to determine if the processor passes the security check. Memory locations
which are invalid or protected read back from the device as $AD. If all bytes from
$FFF6-$FFFF read a value of $AD, it is assumed the device is secure, and the flag
value is an ‘N’. If all flags 0-5 register a value of ‘Y’ and flag 6 registers a value of
‘N,’ then the reset process has occurred correctly except that the security code used
to pass security was incorrect. Specify the correct security code and try again, or
IGNORE the security failure and erase the device. Once you erase a secured device,
you must exit the software and restart it in order to pass security.
Device Option
The Device option in the MultilinkCyclonePro menu allows the user to select the
particular Freescale processor that they wish to use. When choosing Device from the
MultilinkCyclonePro menu, extended menus open that allow you to select the family (e.g.
AB Family), and device type of the MCU that you are using.
Connect Option
The Connect option initiates an attempt to communicate with the device chosen under the
device section of the menu.
Trim Options
The Calculate Trim and Program the Non-Volatile Trim Register checkbox enables
automatic calculation and programming of the trim value in a designated Non-Volatile
memory location.
NOTE The Non-Volatile Memory Preservation and Custom Trim functionality are
only available for the M68HCS08 devices, and as such these options are
disabled for all M68HC08 devices.
If register files have been installed on the host computer, selecting a block brings up the
Register Block register listing (see Figure 14.18), which shows a list of the associated
registers, their addresses, and their descriptions. This begins interactive setup of system
registers such as I/O, timer, and COP watchdog.
Selecting a file brings up the Register Window (see Figure 14.19), which displays the
values and significance for each bit in the register. The registers can be viewed and their
values modified, and the values can be stored back into debugger memory.
Debugging Limitations
The following limitations are inherent in MON08 debugging. Observe these restrictions
carefully.
1. Do not step a command that branches to itself.
2. Do not step a software interrupt (SWI) command.
3. The hardware breakpoint registers are reserved for use by the debugger. Attempting to
use these registers for other purposes may not work.
4. Be careful about showing peripheral status and data registers in the memory or
variables window. A refresh of the window reads these registers and may cause the
clearing of flags.
5. The debug monitor built into CPU08 processors uses up to 13 bytes of the stack. Do
not write to these addresses from (SP-13) to SP. To load a program into RAM, move
the stack to the end of RAM.
6. If interrupts are turned on during stepping, the debugger does not step into the
interrupt. Instead, it executes the whole interrupt and stops on the command following
the interrupt.
7. Do not set hardware breakpoints within the monitor ROM area itself. Hardware
breakpoints set in this area do not function properly.
Debugging Tips
The following tips may prove useful:
1. Single stepping is allowed in both RAM or ROM.
2. The first breakpoint set is always a hardware breakpoint, and any additional
breakpoints set are software breakpoints. To make sure that a hardware breakpoint is
being set, make sure only one breakpoint is being used.
3. Hardware breakpoints can stop execution in ROM or RAM. Software breakpoints can
stop execution only in RAM.
4. Experiment with the register interpreter. Use the View Register Files option in the
MultilinkCyclonePro menu.
5. Executing an SWI instruction while running is functionally equivalent to hitting a
breakpoint, except that execution stops at the instruction following the SWI.
6. A hardware breakpoint may be used to trap a data read/write to anywhere in the
memory map. The debugger stops at the instruction after the one that accesses the data
location.
7. When the target board is reset by the debugger, power to the microcontroller may be
turned off for a short duration. Although much of RAM may look the same, some
values may have changed.
Class 5 Device
P&E’s MON08 Cyclone Device connects to a PC via the serial port. The Cyclone-to-
MCU connection occurs via a standard 16-pin MON08 ribbon cable. The MON08
Cyclone Device allows the user to auto-detect the baud rate as well as auto-cycle the
power through the MCU system.
Class 7 Device
P&E MON08 Multilink and USB MON08 Multilink cables connect to the user’s MCU
system via a standard 16-pin MON08 ribbon cable. MON08 Multilink and USB MON08
Multilink allow one to auto-detect the baud rate as well as auto-cycle the power through
the microprocessor system.
Class 8 Device
P&E’s Cyclone Pro communicates with the PC through a Serial, Ethernet or USB port.
The Cyclone Pro can be used to debug and program the firmware inside of Freescale
HC08 microprocessors via a standard 16-pin MON08 ribbon cable. The Cyclone Pro can
provide its own power and clock signals to the microprocessor, as long as proper signals
are connected to the corresponding pins of the 16-pin MON08 header. In addition the
Cyclone Pro can be used for programming and debugging the HC08/HC12/HCS12
Freescale microprocessors via a standard 6-pin ribbon cable. To take advantage of this
functionality, connect proper signals to the standard 6-pin Background Debug Module
header.
Connection Procedure
1. Choose the ICS P&E Multilink/Cyclone Pro option from the set connection dialog
box, as shown in Figure 15.1.
3. The device power selection in the Power/Clock Details area allows the user to specify
whether the target is 2, 3, or 5 Volts, and whether this power is switched/generated by
the P&E interface or if it is separately supplied to the target and under user control. If it
is under user control, the software uses dialog boxes to prompt the user to power the
target up and down when necessary (similar to Class II-IV). See Figure 15.3.
4. The device clock menu allows two options. See Figure 15.4.
• P&E provides clock to target
• The device has its own clock
5. Click on Refresh, which detects all P&E devices that are automatically detected, such
as Cyclone Pro USB, Cyclone Pro Ethernet and USB ML MON08 Multilink. See
Figure 15.2.
6. To add a serial/parallel port P&E device such as Cyclone Pro Serial, MON08
Multilink and Cyclone Pro Ethernet (IP outside of subnet mask), proceed to Interface
Selection Manager by pressing the Add A Connection button. For more information
about configuring Cyclone Pro for ethernet operation, see the Cyclone Pro User's
Manual.
7. To remove a manually configured interface, click on Remove Connection button and
choose the interface to be deleted. See Figure 15.5.
3. Software automatically powers up the ICS, which configures the processor’s MON08
configuration pins.
4. Software prompts the user to power up the board as follows:
3. Software automatically powers up the ICS, which configures the processors MON08
configuration pins.
STATUS Area
The status area of the P&E Connection Manager window consists of one status string
following the Status: label, and seven items which list the state of the last attempt to
connect to a target and pass security. The description for these items is as follows:
• 0 – ICS Hardware loopback detected:
Every ICS or board which supports MON08 has a serial loopback in hardware
which, by connecting the transmit and receive lines, automatically echoes characters
from the PC. A valid character transmitted from the PC is echoed once by the
loopback circuitry on the board and once by the monitor of the target processor itself.
This status indicates whether or not the first echoed character from the hardware
loopback was received when one of the security bytes was transmitted. If the status is
‘N’, which indicates that the character was not received, it is most likely due to one
of the following reasons:
– Wrong Com Port specified.
– The baud rate specified was incorrect (probably too low).
– The ICS/Target is not connected.
– No Power to the ICS.
If this status bit returns an ‘N’, you must correct this before analyzing the rest of the
status bits.
• 1 – Device echoed some security bytes:
The monitor resident in an M68HC08 device automatically echoes every incoming
character when it is in monitor mode. A valid character transmitted from the PC is
echoed once by the loopback circuitry on the board and once by the monitor of the
target processor itself. This status indicates whether or not the second echoed
character from the monitor response was received when one of the security bytes was
transmitted. If the status is ‘N’, which indicates that the character was not received,
or not received properly, it is most likely due to one of the following reasons:
– The baud rate specified was incorrect.
– The part did not start the monitor mode security check on reset. Signals to force
monitor mode may be incorrect.
– No Power to the ICS.
If this status bit returns an ‘N’, you must correct this before analyzing the rest of the
status bits.
• 2 – Device echoed all security bytes:
In order to pass security, the software must send eight security bytes to the processor.
The processor echoes each of these eight bytes twice. If all eight bytes did not get the
proper two-byte echo, this flag returns an ‘N’. Reasons for this include:
– The part did not start the monitor mode security check on reset. Signals to force
monitor mode may be incorrect.
– The baud rate specified was incorrect.
– The processor was not reset properly. Check the Target Hardware Type and if
you are connecting to a class II board, check the MON08 cable communication
connections type in the Advanced Settings dialog box.
• 3 – Device signaled monitor mode with a break:
Once the processor has properly received the eight bytes from the PC software to
complete its security check, it transmits a break character to the PC signaling entry
into monitor mode. This break character is sent regardless of whether the security
check was successfully passed. If a break character is not received from the
processor, this flag returns an ‘N’. Reasons for this include:
– The baud rate specified was incorrect.
– The processor was not reset properly. Check the Target Hardware Type. If you
are connecting to a class II board, check the MON08 cable communication
connections type in the Advanced Settings dialog box.
• 4 – Device entered monitor mode:
Once the software has received, or failed to receive, a break from the processor, it
attempts to communicate with the monitor running on the M68HC08 processor. It
tries to read the monitor version number by issuing a monitor mode read. If the
processor fails to respond properly to this command, this flag returns an ‘N’.
• 5 – Reset was Power-On Reset:
If the device properly entered monitor mode (4), the software reads the reset status
register (RSR). This read does not affect the security sequence, and occurs purely for
diagnostic reasons. The RSR indicates the conditions under which the processor
underwent the last reset. For the software to pass the security check properly, it
MUST first cause the processor to undergo a Power-On Reset. The software reads
the RSR to determine if the last reset was indeed caused by power-on. The result of
the RSR read is indicated in parentheses after the flag value. If the highest bit is not
set then the reset was not a power on reset, and the flag indicates an ‘N’. Reasons for
this include:
– The processor did not power all the way down because power was being supplied
to the processor through either the port pins, IRQ line, RESET line, or power
pins.
– The voltage driven on the power pin of the processor did not go below 0.1 volts.
– The processor was not reset properly. Check the Target Hardware Type. If you
are connecting to a class II board, check the MON08 cable communication
connections type in the Advanced Settings dialog box.
• 6 – ROM is accessible (un-secured):
If the device properly entered monitor mode (4), the software reads locations $FFF6-
$FFFF to determine if the processor passes the security check. Memory locations
which are invalid or protected read back from the device as $AD. If all bytes from
$FFF6-$FFFF read a value of $AD, it is assumed the device is secure, and the flag
value is an ‘N’. If all flags 0-5 register a value of ‘Y’ and flag 6 register a value of
‘N,’ then the reset process has gone correctly except that the security code used to
pass security was incorrect. Specify the correct security code and try again, or
IGNORE the security failure and erase the device. Once you erase a secured device,
you must exit the software and restart it in order to pass security.
Trim Options
The Calculate Trim and Program the Non-Volatile Trim Register checkbox enables
automatic calculation and programming of the trim value in a designated Non-Volatile
memory location.
NOTE The Non-Volatile Memory Preservation and Custom Trim functionality are
only available for the M68HCS08 devices, and as such these options are
disabled for all M68HC08 devices.
If register files have been installed on the host computer, selecting a block brings up the
Register Block register listing (see Figure 15.14), which shows a list of the associated
registers, their addresses, and their descriptions. This begins interactive setup of system
registers such as I/O, timer, and COP watchdog.
Selecting a file brings up the Register Window (see Figure 15.15), which displays the
values and significance for each bit in the register. The registers can be viewed and their
values modified, and the values can be stored back into debugger memory.
Class 5 Device
P&E MON08 Cyclone Device connects to PC via a serial port. The Cyclone to target
connection takes place via a standard 16 pin MON08 ribbon cable. MON08 Cyclone
Device allows one to auto detect the baud rate as well as auto cycle the power through the
target.
Class 7 Device
P&E MON08 Multilink and USB MON08 Multilink cables connect to the target via a
standard 16 pin MON08 ribbon cable. MON08 Multilink and USB MON08 Multilink
allow one to auto detect the baud rate as well as auto cycle the power through the target.
Class 8 Device
P&E’s Cyclone Pro communicates with the PC through a Serial, Ethernet or USB port.
One can use the Cyclone Pro to debug and program the firmware inside of Freescale
M68HC08 microprocessors via a standard 16-pin MON08 ribbon cable. The Cyclone Pro
can provide its own power and clock signals to the target, as long as proper signals are
connected to the corresponding pins of the 16-pin MON08 header.
In addition, the Cyclone Pro can be used for programming and debugging the M68HC12/
M68HCS12/M68HCS08 Freescale microprocessors via a standard 6-pin ribbon cable. To
take advantage of this functionality, connect proper signals to the standard 6-pin
Background Debug Module header.
7. In the MCU Configuration dialog box, choose the correct target processor.
About Option
Select the inDART-HC08 > About option to display the About Dialog Box.
Pressing the Communication Settings button opens the Communication Settings Dialog
Box.
NOTE If your hardware supports stopping the application while running, an additional
interrupt service routine is required for the IRQ vector. See Stop Command
Handling section in inDART®-HC08 In-Circuit Debugger/Programmer for
Motorola HC08 Family FLASH Devices User’s Manual from SofTec for
further details.
FSICEBASE Overview
This overview section contains the following topics:
• System Requirements
• System Features
• System Components
The CodeWarrior IDE software provides an integrated development environment that
includes an editor, assembler, and a user interface to the FSICEBASE system.
The environment allows you to perform source-level debugging. The CodeWarrior IDE
software also simplifies the process of managing and building a software project, and
debugging code for an embedded MCU system. The benefit to you is reduced
development time.
System Requirements
The FSICEBASE system requires a host computer with the following minimum
specifications:
• Processor: 200 MHz Pentium® II processor or AMD-K6® class processor
• Operating System: Microsoft® Windows® 2000, Windows® XP, or Windows
Vista™
• RAM: 128 MB
• Hard drive space: Compact software installation: 232 MB
Full software installation: 344 MB
• USB port or Ethernet port to connect host computer to the FSICEBASE
System Features
The Freescale In-Circuit Emulator Base (FSICEBASE) is a full-featured development
system that provides in-circuit emulation. Features include:
• Real-time, non-intrusive, in-circuit emulation
• Real-time bus state analysis
• Meets ECC92 European electromagnetic compatibility standards
• Allows you to set four complex data or instruction breakpoints; a breakpoint can be
qualified by an address, an address range, data, or externally connected logic clips.
• Up to 128k real-time variables (any ROM or RAM memory area)
• Up to 128 Kilobytes of emulation memory to accommodate the largest available
ROM size of current HC08 MCU
• Unlimited hardware instruction breakpoints over the 64-K memory map
• Built-in bus state analyzer:
– 1.33Mb x 96 real-time trace buffer
– Four hardware triggers to control real-time bus analysis and provide breakpoints
– Nine triggering modes
– Display of real-time trace data as raw data, disassembled instructions, raw data
and disassembled instructions, or assembly-language source code
– As many as 1.33M pre- or post-trigger points
– Trace buffer can be filled while single-stepping through user software
– 32-bit time tag
– Custom clock from 4100Hz to 40MHz in 5kHz steps, permitting wide time
variance between analyzer events
– 24 general-purpose logic clips, five of which can be used to trigger the bus state
analyzer sequencer
• Four software-selectable internally generated oscillator clock sources
• Command and response logging to disk files
• Assembly-language source-level debugging
• On-screen, context-sensitive help via pop-up menus and windows
• Emulation that allows multiple types of reset
System Components
The FSICEBASE system includes the basic components that you need to connect to an
emulation module (EM). You can also separately purchase additional components that can
enhance debugging and emulation.
Basic Components
The Freescale In-Circuit Emulator Base includes the following components
• Base station
The connectors on the top of the box let you connect an emulation module (EM).
• Cables, connectors, and adapters:
– crossover ethernet cable (connects directly to an Ethernet Network Interface Card
(NIC) on a PC)
– straight-through ethernet cable (connects to a hub or switch)
– Universal Serial Bus (USB) cable
– MON08 debug port (built into base station)
– external universal power supply and power supply cable
• System software
CodeWarrior IDE software, featuring an editor, assembler, and assembly source
level debugger
• Documentation:
– Freescale In-Circuit Emulator Base User Manual (this manual)
– CodeWarrior IDE User’s Manual
– Freescale In-Circuit Emulator Base Quick Start
– Online Help and PDFs
• Two logic clip cable assemblies: twisted-pair cables that connect the station module
to your target system. You can also use the cable assembly to connect a test fixture, a
clock, an oscillator, or any other circuitry that you might use to perform analysis.
One end of each cable assembly has a molded connector, which fits into the
FSICEBASE. Leads at the other end of each cable terminate in female probe tips.
Ball clips come with the cables.
Additional Components
You can purchase other components to enhance your development efforts. You can
purchase these components separately:
• Host computer
You must provide an IBM-compatible personal computer to run the development
software.
• An emulation module (EM)
An emulation module (EM) is a printed circuit board that emulates the features of a
specific set of microcontroller units (MCUs). An EM completes the functionality of
the FSICEBASE for a particular MCU or MCU family. The FSICEBASE works
with a variety of EMs. You can purchase EMs separately from the FSICEBASE.
The two DIN connectors on the bottom of the EM fit into connectors on the top of the
FSICEBASE box. The target provides power and signal targets.
Connection to your target system is then made through a separately purchased target
cable and target head adapter that attaches to a target connector located on the top of
the EM board.
• Optional target cable
You can separately purchase a target cable that is part of a cable assembly, which is
used to connect a target system to the FSICEBASE.
• Optional target head adapter
You can separately purchase a target head adapter that is part of a cable assembly,
which is used to connect a target system to the FSICEBASE.
• Optional Bus State Analyzer (BSA) cables
The base station contains ports for three BSA pods. You can purchase BSA cables in
addition to those supplied with the FSICEBASE system.
NOTE To complete the connection through a LAN, obtain the IP address, subnet
mask, and default gateway information from your network administrator. This
information is used in a later step.
2. If you are using an ethernet connection to connect your host computer directly to the
FSICEBASE (not through a LAN):
a. Make sure power supply is not connected to board
b. Connect one end of ethernet cable to ethernet port of FSICEBASE (make sure to
use the cross-over ethernet cable when connecting directly to a Network Interlace
Card (NIC))
NOTE The host computer (PC) must have an assigned IP address and subnet mask that
matches the FSICEBASE.
3. If you are using a USB connection to connect your host computer directly to the
FSICEBASE:
a. Make sure power supply is not connected to board
b. Connect U-shaped end of USB cable to FSICEBASE
c. Connect other end of USB cable to host computer
Once you have connected the host computer to the FSCIBASE, connect Power supply to
FSICEBASE
1. Connect round end of 5-volt power cord to barrel connector on FSICEBASE
2. Plug power supply into surge-protected strip
3. Connect surge-protected strip to AC outlet
4. Switch FSICEBASE Power switch to ON
LED lights after the base station finishes boot sequence.
There are three status LEDs on the box: busy, ready, and error. The FSICEBASE base
station takes about 5 seconds to boot. After powering the unit, you must wait for the ready
LED before attempting to connect.
The FSICEBASE is now ready to accept communication with a host computer. Install the
CodeWarrior IDE software, create a project, and start the debugger to establish
communication between your host computer and the FSICEBASE.
Establishing Communication
The Freescale In-Circuit Emulator Base (FSICEBASE) allows you to connect to a host
computer in two ways:
• Through an ethernet port
• Through a USB port
7. Select TCP/IP
8. In the text box, type the IP Address that your network administrator assigned to the
FSICEBASE
NOTE For more information on the IP address of the FSICEBASE, see “Assigning an
IP Address to FSICEBASE” .
9. Click OK
The debugger connects to the FSICEBASE through the ethernet port.
NOTE If you have started the debugger from your project previously, when you select
Debug in the IDE, the Debugger attempts to connect to the FSICE with the last
known settings. If the Debugger connects, you do not need to perform the
following steps.
Specifying A Connection
To specify the connection, including the specific derivative:
1. Start the debugger — the True-time Simulator & Real-time Debugger window
appears.
2. From debugger main menu, select Component
3. Select Set Connection from the Component menu — Set Connection dialog box
opens
NOTE The network administrator of your Local Area Network (LAN) needs to assign
the IP address of the FSICEBASE on the network. You can use the default IP
address, and give this address to your network administrator. Or, your network
administrator might choose to create a different IP address. If the network
administrator chooses the IP address, you need to assign the IP address to the
FSICEBASE. For more information see Assigning an IP Address to
FSICEBASE.
b. If you use an ethernet connection to connect your host computer directly to the
FSICEBASE (not through a LAN):
• In the Communication dialog box, select TCP/IP, and
• In the text box of the Communication dialog box, type the IP address of the
FSICEBASE
NOTE Make sure that the cable between the host computer and the FSICEBASE is a
cross-over ethernet cable.
NOTE Make sure that the host computer uses a static IP address. (The FSICEBASE
does not assign an IP address to the host computer.) If you use the default IP
address of the FSICEBASE (192.168.0.1), we recommend that you assign the
following IP address to the host computer: 192.168.0.2.
NOTE Make sure that the host computer and FSICEBASE both use the same subnet
mask.
c. If you use a USB cable to connect your host computer directly to the FSICEBASE
station, select USB,
5. Click OK
The debugger attempts to connect to the FSICEBASE. An information box shows the
progress. You can click Cancel in the information box if you do not want to
immediately connect to the FSICEBASE.
The debugger saves the communication information that you specified. It uses the
communication information the next time that it connects to the FSICEBASE.
NOTE You can also use the default IP address to connect through TCP/IP.
NOTE All hosts on a network must have a unique IP address. If you are connecting the
FSICEBASE to a Local Area Network (LAN), consult with your network
administrator to obtain a valid IP address.
8. From Mask combo box, select the subnet mask that you want to assign to the
FSICEBASE
NOTE All the hosts in a sub-network must have the same subnet mask. For that
reason, if you connect the host computer directly to the FSICEBASE (not
through a LAN), you must ensure that the host computer uses the same subnet
mask as the FSICEBASE.
9. If applicable, in Default Gateway text box, type the IP address that you want the
FSICEBASE to use as the gateway to connect to a network.
10. If applicable, in Broadcast Address text box, type the IP address that you want the
FSICEBASE to use as the broadcast address on the network
NOTE The broadcast IP address is the last IP address in the range of IP addresses on a
network. The broadcast address is reserved by the network to allow a single
host to make an announcement to all hosts on the network. Consult your
network administrator for more information.
4. Specify clock source. From MCU Clock section of dialog box, select whether the
clock is connected externally, on a connected emulator module (EM), or FSICE
Generated.
5. Specify clock speed if internally generated
a. If you selected FSICE Generated, select the clock speed to be emulated
b. If you selected Custom, type clock speed in Custom text box
NOTE If you specify a custom clock speed, be aware that the FSICEBASE can
provide clock speeds from 4100Hz to 40MHz in steps of 5kHz. The
FSICEBASE uses a clock synthesis chip to generate the clock speed. This
method is not as accurate as a crystal: only within about 0.75% absolute
frequency with about 5% jitter. If you choose a clock value (either from one of
the radio buttons or by typing it in) that is an integer divisor of 32MHz or
9.8304MHz, you get an accurate crystal-sourced clock.
6. Click OK
The debugger instructs the FSICEBASE to use new clock information. The Command
window (Figure 17.9) of the debugger shows confirmation message.
NOTE If you check both Reset IN and Reset Out the internal resets of the emulator
system are not sent to the target system.
e. Click OK
2. From debugger main menu, select FSCICEBASE-HC08
3. Select Reset
The debugger sends a reset signal to the FSICEBASE.
use this source, make the desired clock connection to the white probe tip and use the OSC
command to select an external source.
Pod B pin 17 is the external timetag input for the bus state analyzer. To use this source,
make the desired clock connection to the white probe tip and use the TIMETAG command
to select an external time tag source for the analyzer.
2 GND GND
4 GND GND
6 GND GND
8 GND GND
10 GND GND
12 GND GND
14 GND GND
16 GND GND
18 GND GND
20 GND GND
NOTE This analyzer is a bus state analyzer. It does not show signal hold or setup
times.
To start using the BSA, you need to define patterns of logical states as events (or terms).
You also need to specify the analyzer mode: continuous, counted, or any of five sequential
modes. This determines which cycles the analyzer stores.
Data collection (cycle storage) begins when you arm the analyzer and start program
execution. Data collection continues until execution stops, through a specified number of
events, or through a defined sequence of events.
Using BSA
To use the bus state analyzer (BSA) to produce useful data that you can view and analyze,
you must:
1. Define events (terms).
2. Arm the BSA.
Defining Events
You define an event by specifying a combination of criteria. You can define the criteria to
be particular values in certain addresses, read or write access on an instruction or on data,
extended address access, or signals sent through one of the five logic clips that you can
connect to Pod A of the FSICEBASE.
The Bus State Analyzer uses the criteria that you specify to create an event, and labels the
event A, B, C, or D. When the BSA determines that the criteria of a certain event has been
met, depending on the triggering mode, it records the data that is in the bus of the MCU at
that particular clock cycle. It also records the data that is in the lines of Pods A, B, and C.
You can control the way that the BSA records this information by specifying a recording
mode.
To define an event:
1. Start the debugger
2. Load the program to debug
a. If you launched the debugger from a project in the CodeWarrior IDE, the debugger
automatically loads the program (.abs or .elf file)
b. If the debugger has not loaded the program that you want to debug:
• From the debugger main menu, select File > Load Application
• Specify the location of the executable program file (.abs or .s19 file)
• Click Open — debugger loads the application you specified
3. From debugger main menu, select FSCICEBASE-HC08
The FSICEBASE-HC08 menu is between the Run menu and the Component menu. If
you do not see the FSICEBASE-HC08 menu, you need to specify the connection. For
more information on specifying a connection see Specifying A Connection.
4. Select Bus Analyzer Configuration — Bus Analyzer Configuration dialog box opens
(Figure 17.10)
NOTE You can use five of the pod A logic clips to define an event. The other signals
of Pod A, and the signals of Pods B and C cannot be used to define an event.
The Bus Analyzer Configuration dialog box shows the five clips that you can
use to trigger an event. The choice of these five signals is hard-set in the
FSICEBASE; you cannot choose other signals to be used as event criteria.
However, the BSA does capture data from all 24 lines of Pods A, B, and C.
11. If you want the term to also act as a breakpoint, check the Breakpoint checkbox.
12. Specify the Recording Mode
• For information about the recording mode, see Recording Modes.
• If you check the Stop when recording completes checkbox, the debugger stops
program execution when bus state analyzer recording is done.
13. Specify the Time Tag Clock Frequency
14. Click Save to apply the event information to the current debug session and close the
dialog box. The BSA uses the terms when you arm the BSA.
15. Click Save to save the event information to a file.
16. Click Arm to ready the BSA to collect data.
The BSA does not start collecting data until execution begins. The debugger indicates
that the BSA is armed by showing the word Armed in the status bar.
Recording Modes
When you define an event, you can specify the recording mode that the Bus State
Analyzer uses to collect data. This section explains how the different modes work.
A+B+C+D
After execution begins, the trace buffer begins storing data from the first cycle run. This
continues through the occurrence of event A, B, C, or D (whichever is enabled); data
storage ends after the specified number of post-trigger cycles.
A -> B -> C !D
After execution begins, the trace buffer begins storing data from all cycles. This continues
through the occurrence of three events, A, B, and C, in order, if event D does not occur. (If
D occurs, the sequencer starts again looking for event A.) Data storage ends after the
specified number of post-trigger cycles.
If you select this mode, you must enable events A, B, and C. Otherwise, the bus state
analyzer cannot be triggered. If you disable event D, you convert this mode to a simple,
three-event sequence.
NOTE The terminal count or post trigger cycles are valid only for counted or
sequential modes. For a counted mode, this field specifies the number of cycles
to be stored. For a sequential mode, this field specifies the number of cycles to
be stored after the trigger sequence occurs.
NOTE If you specify a custom clock speed, be aware that the FSICEBASE can
provide clock speeds from 4100Hz to 40MHz in steps of 5kHz. The
FSICEBASE uses a clock synthesis chip to generate the clock speed. This
method is not as accurate as a crystal: only within about 0.75% absolute
frequency with about 5% jitter. If you choose a clock value (either from one of
the radio buttons or by typing it in) that is an integer divisor of 32MHz, you get
an accurate crystal-sourced clock.
Viewing Data
You can view the data collected by the BSA in several formats. You can view: raw data,
disassembled instructions, mixed raw data and disassembled instructions, and source
code.
To view data:
1. From debugger main menu, select FSCICEBASE-HC08
2. Select Trace — the Trace window opens (Figure 17.11)
3. To change the kinds of data and the way that data is displayed:
a. Place mouse cursor over Trace window
b. Right-click mouse — Menu appears allowing you to change various aspects of the
Trace window
The Trace window can display trace buffer contents as raw bus cycles, as disassembled
instructions, as mixed instructions and raw bus cycles, or as source code.
Configuration Procedure
To select Full Chip Simulation as the debugger connection:
1. Choose the Full Chip Simulation option from the set connection dialog box. See
Figure 18.1.
2. Click the OK button.
Device Option
The Device selection of the HCS08FCS menu allows the user to select the particular
Freescale processor that they wish to use. When choosing the Device option from the
HCS08FCS menu, extended menus open which allow you to select the family (e.g. GB
Family), and device type (e.g. 9S08GB60) of the MCU that you are using.
initialization does not apply to a reset command. When you change this option, the new
state takes effect the next time you start HiWave (or switch Device Mode/Debug Target).
If register files have been installed on the host computer, selecting a block brings up the
Register Block register listing (see Figure 18.5), which shows a list of the files, their
addresses, and their descriptions. This begins interactive setup of system registers such as
I/O, timer, and COP watchdog.
Selecting a file brings up the Register Window (see Figure 18.6), which displays the
values and significance for each bit in the register. The registers can be viewed and their
values modified, and the values can be stored back into debugger memory.
Placing your mouse over a peripheral opens a box which lists its associated commands.
Click on a command in order to execute that command.
ADC Module
In Full Chip Simulation (FCS), this module simulates all functionality of the Analog to
Digital Conversion (ADC) module including data input on all ADC channels, flag polling,
interrupt operation as well as the bus and CGMXCLK reference clock sources. FCS mode
uses the buffered input structure to simulate the ADC inputs. The user can queue up to 256
data values. To queue the ADC Input Data, use the ADDI command in the command
prompt. If the data parameter is given, the value is placed into the next slot in the input
buffer. Otherwise, if no parameter is provided, a window is displayed with the input buffer
values. Input values can be entered while the window is open. An arrow points to the next
value to be used as input to the ADC. The conversion takes place after a proper value is
written to the ADC Status and Control register. Once the conversion occurs, the arrow
moves to the next value in the ADC Buffer.
At any point, use the ADCLR command to flush the input buffer for the ADC simulation.
After the conversion is complete, the first queued value is passed from the data buffer into
the ADC data register. It can be observed in the memory window by displaying the
memory location corresponding to the ADC data register.
When the conversion is complete, the FCS sets the appropriate flag. If interrupts are
enabled, the Program Counter changes flow to the interrupt routine (as defined in the
vector space of the MCU). For more information on ADC configuration, refer to the
Freescale user manual for your microprocessor.
ADDI Command
The ADDI command allows the user to input the data into the ADC converter. If a data
parameter is given, the value is placed into the next slot in the input buffer. Otherwise, if
no parameter is given, a window is displayed with the input buffer values. Input values can
be entered while the window is open. An arrow points to the next value to be used by the
ADC. The maximum number of input values is 256 bytes.
Syntax
>ADDI [<n>]
Where:
<n> The value to be entered into the next location in the input buffer.
Example
>ADDI $55
Set the next input value to the ADDI to $55
>ADDI
Pull up the data window with all the input values.
ADCLR
Use the ADCLR command to flush the input buffer for ADC simulation. This resets the
input data buffer and clears out all values. Notice that if the ADC is currently using a
value, this command does not prevent the ADC from using it. See ADDI command for
information on how to access the input buffer of the ADC interface.
Syntax
>ADCLR
Example
>ADCLR
Clear the input buffer for ADC simulation.
Once you select the MCU Clocks Menu, the Cycles Window displays all of the above-
mentioned Clock Frequencies.
Once the ICG is properly configured, the user can monitor the status of the PLL by polling
the corresponding flag. If PLL interrupt is enabled, FCS jumps to an appropriate
subroutine, as long as the interrupt vector is properly defined. To observe the flag going up
as a result of the corresponding CPU event, situate your Memory Window on the memory
location of the ICG Status and Control register.
For more information on how to properly configure Clock Generation, refer to the
Freescale reference manual for your microprocessor.
XTAL Command
Use the XTAL command to change the value of the simulated external oscillator. This in
turn affects the input to the PLL/DCO, and therefore the bus frequency. The P&E
simulator is a cycle-based simulator, so changing the XTAL value does not affect the
speed of simulation; it does, however, affect the ratio in which peripherals receive cycles.
Certain peripherals which run directly from the XTAL run at different speeds than those
that run from the bus clock.
Syntax
>XTAL <n>
Where:
• <n>, by default, is a hexadecimal number, representing the simulated frequency
of an external oscillator. Adding the suffix t to the n parameter forces the input
value to be interpreted as base 10.
Example
>XTAL
Brings up an input window. The default base for this input value is 10. However,
this value can be forced to a hexadecimal format through use of the suffix h.
The IIC data input/output log buffer simulation allows the user to gain access to the past
256 IIC data bytes that have been shifted in and out of the module. To bring up the IIC IN/
OUT LOG buffer dialog box, use the IICDO command.
At any point, use the IICCLR command to flush the input as well as input/output log IIC
buffers.
After the IIC simulated input is received, the first queued-in data byte is passed from the
data buffer into the corresponding IIC module registers. It can be observed in the Memory
Window by displaying the appropriate register location there.
The user can also observe different IIC flags in the Memory Window. If you run the
module in Flag Polling mode, poll the flag corresponding to the expected IIC event. If the
IIC interrupts are enabled, the FCS jumps to an appropriate subroutine as long as the IIC
interrupt vectors are properly defined.
For more information on how to configure IIC module for desired operation, refer to the
Freescale user manual for your microprocessor.
IICDI Command
The IICDI command allows the user to input data into a buffer of data to shift into the IIC
module when it receives data from an external device. If a data parameter is given, the
value is placed into the next slot in the input buffer. Otherwise, if no parameter is given, a
window is displayed with the input buffer values. Input values can be entered while the
window is open. The maximum number of input values is 256.
This command is useful for either inputting response data from a slave target or for
inputting data packets from an external master. Note that when the microprocessor
attempts to read an acknowledge from an external device, and the next value in the buffer
is neither ACK nor NACK, the microprocessor automatically receives an ACK signal (i.e.
assumes ACK unless NACK is specified).
Syntax
>IICDI [<n>][START][STOP][ACK][NACK]
Where:
• <n> indicates the value to be entered into the next location in the input buffer
• START indicates the incoming START signal
• STOP indicates the incoming STOP signal
• ACK corresponds to ACK signal
• NACK corresponds to NACK signal
For a detailed description of the IIC protocol and a proper way to configure the IIC
module, refer to the Freescale user manual for your microprocessor.
Example
>IICDI
IICDO Command
The IICDO command displays a window, which shows data shifted in as well as shifted
out of the IIC peripheral. An arrow points to the last output value transmitted/received.
The maximum number of output values that the buffer can hold is 256.
Syntax
>IICDO
Example
IICDO
View data from the input/output log buffer for IIC simulation.
IICCLR Command
Use the IICCLR command to flush the input and output buffers for IIC simulation. This
resets the buffers and clears all values. Notice that if the IIC is currently shifting a value,
this command does not prevent the IIC from finishing the transfer.
Syntax
>IICCLR
Example
>IICCLR
Clear input and output buffers for IIC simulation.
the same time, you can use the INPUTS command to bring up the Simulated Port Inputs
for all general I/O ports. It displays the current simulated values to all applicable input
ports. See the Input/Output Ports User Commands and Input/Output Ports User
Commands for more information about the various forms of this command.
Use the Simulated Port Inputs dialog box to reconfigure the input value to any I/O port.
Use the INPUTS command to reconfigure the output values on any relevant I/O port. You
can observe the manipulation of I/O port pins in the Memory Window.
Note that if the regular I/O pins are multiplexed to be used by a different MCU Module,
they might not be available for general I/O functionality. For more information on how to
properly configure I/O pins, refer to the Freescale user manual for your microprocessor.
INPUT<x> Command
The INPUT<x> command sets the simulated inputs to port <x>. The CPU reads this
input value when port <x> is set as an input port.
Syntax
>INPUT<x> <n>
Where:
<x> is the letter representing corresponding port
<n> Eight-bit simulated value for port <x>
Example
>INPUTA AA
Simulate the input AA on port A.
INPUTS Command
In FCS and CPU-Only Simulation mode, the INPUTS command opens the Simulated Port
Inputs dialog box shown in Figure 18.18. The user may then use this box to specify the
input states of port pins and IRQ.
When using In-Circuit Simulation mode, the INPUTS command shows the simulated
input values to any applicable port.
Syntax
>INPUTS
Example
>INPUTS
Show I/O port input values.
An IRQ event occurrence sets the appropriate flag in the corresponding IRQ register. The
user can poll the IRQ flag if the Polling Mode is simulated. In the Interrupt Mode, the
simulator branches to an appropriate interrupt subroutine as long as the IRQ interrupt
vector is properly configured. For more information on IRQ configuration, refer to the
Freescale user manual for your microprocessor.
Following the IRQ event, you can observe the IRQ Flag being set in the IRQ Status and
Control register.
IRQ Commands
The following interrupt request command is available for the HCS08.
INPUTS Command
In FCS and CPU-Only Simulation mode, the INPUTS command opens the Simulated Port
Inputs dialog box shown in Figure 18.21. The user may then use this box to specify the
input states of port pins and IRQ.
When using In-Circuit Simulation mode, the INPUTS command shows the simulated
input values to any applicable port.
Syntax
>INPUTS
Example
>INPUTS
Show I/O port input values.
NOTE The IRQ pin state can be directly manipulated with the IRQ command. For
example, IRQ 1 simulates a high state on the IRQ pin; likewise, IRQ 0
simulates a logic-low state on the IRQ pin.
Use the Simulated Port Inputs dialog box to reconfigure the input value to any I/O port. To
trigger the event, manipulate the inputs to the port in the appropriate manner, depending
on whether the KBI is configured for edge-only or edge and level. Once the KBI event
takes place, you can observe the KEYF Flag bit, which is a part of the Keyboard Status
and Control register, in the Memory Window.
The user can poll the KBI Interrupt Pending flag if the Polling Mode is simulated. In
Interrupt Mode, the simulator branches to an appropriate interrupt subroutine as long as
the KBI interrupt vector is properly configured. For more information on KBI
configuration, refer to the Freescale user manual for your microprocessor.
INPUT<x> Command
The INPUT<x> command sets the simulated inputs to port <x>. The CPU reads this
input value when port <x> is set as an input port.
Syntax
>INPUT<x> <n>
Where:
<x> is the letter representing corresponding port
<n> is an eight-bit simulated value for port <x>
Example
>INPUTA AA
Simulate the input AA on port A.
INPUTS Command
In FCS and CPU-Only Simulation mode, the INPUTS command opens the Simulated Port
Inputs dialog box shown in Figure 18.24. The user may then use this box to specify the
input states of port pins and IRQ.
When using In-Circuit Simulation mode, the INPUTS command shows the simulated
input values to any applicable port.
Syntax
>INPUTS
Example
>INPUTS
Show I/O port input values.
If the MTIM interrupt is enabled, the FCS jumps to an appropriate subroutine as long as
the MTIM interrupt vector is properly defined.
SCI Data Output Buffer simulation allows the user to gain access to the past 256 SCI data
values transmitted out of the module. To bring up the SCI OUT buffer dialog box, use the
SCDO command.
At any point, use the SCCLR command to flush the input and output SCI buffers.
After the SCI simulated input is received, the first queued value is passed from the data
buffer into the SCI data register. It can be observed in the memory window by displaying
the memory location corresponding to the SCI data register.
The user can also observe different SCI flags in the Memory window. If the module is run
in Flag Polling mode, poll the flag corresponding to the expected SCI event. If the SCI
interrupts are enabled, the FCS jumps to an appropriate subroutine as long as the SCI
interrupt vectors are properly defined.
For more information on how to configure SCI module for desired operation, refer to the
Freescale user manual for your microprocessor.
SCI Commands
The following serial communication interface commands are available for the HCS08.
SCCLR Command
Use the SCCLR command to flush the input and output buffers for SCI simulation. This
resets the buffers and clear out all values. Notice that if the SCI is in the process of shifting
a value, this command does not prevent the SCI from finishing the transfer. See SCDI
command and SCDO command for accessing the input and output buffers of the SCI
interface.
Syntax
>SCCLR
Example
>SCCLR
Clear input and output buffer for SCI simulation
SCDI Command
The SCDI command allows the user to input data into the SCI. If a data parameter is
given, the value is placed into the next slot in the SCI input buffer. Otherwise a window is
displayed with the input buffer values. Input values can be entered while the window is
open. An arrow points to the next value to be used as input to the SCI. The maximum
number of input values is 256 bytes.
Syntax
>SCDI [<n>]
Where:
><n> The value to be entered into the next location in the input buffer
Example
>SCDI $55
Set the next input value to the SCI to $55
>SCDI
Pull up the data window with all the input values.
SCDO Command
The SCDO command displays the output buffer from the SCI. A window is opened that
shows all the data that the SCI has shifted out. An arrow is used to point to the last output
value transmitted. The maximum number of output values that the buffer holds is 256
bytes.
Syntax
>SCDO
Example
>SCDO
View data from the output buffer for the SCI simulation.
SPI data output buffer simulation allows the user to gain access to the past 256 SPI data
values transmitted out of the module. To bring up the SPI OUT buffer dialog box, use the
SPDO command.
At any point, you can use the SPCLR command to flush the input and output SPI buffers.
After the SPI simulated input is received, the first queued value is passed from the data
buffer into the SPI data register. It can be observed in the Memory Window by displaying
the memory location corresponding to the SPI data register.
The user can also observe different SPI flags, in the Memory window. If the module is run
in the Flag Polling mode, poll the flag corresponding to the expected SPI event. If the SPI
interrupts are enabled, the FCS jumps to an appropriate subroutine as long as the SPI
channel interrupt vectors are properly defined.
To simulate the frequency of the SPI slave input clock, use the SPFREQ <n> command.
If the SPI is configured for slave mode, this command allows the user to enter the number
of cycles <n> in the period of the input clock. If the SPFREQ command is not used, then
clocking is set by the SPI control register.
For more information on how to configure the SPI module for desired operation, refer to
the Freescale user manual for your microprocessor.
SPI Commands
The following serial peripheral interface commands are available for the HCS08.
SPCLR Command
Use the SPCLR command to flush the input and output buffers for SPI simulation. This
resets the buffers and clears out all values. Notice that if the SPI is currently shifting a
value, this command does not prevent the SPI from finishing the transfer. See SPDI
command and SPDO command for accessing the input and output buffers of the SPI
interface.
Syntax
>SPCLR
Example
>SPCLR
Clear input and output buffer for SPI simulation
SPDI Command
The SPDI command allows the user to input data into the SPI. If a data parameter is given,
the value is placed into the next slot in the SPI input buffer. Otherwise, if no parameter is
given, a window is displayed with the input buffer values. Input values can be entered
while the window is open. An arrow points to the next input value to the SPI. The
maximum number of input values is 256 bytes.
Syntax
>SPDI [<n>]
Where:
<n> The value to be entered into the next location in the input buffer
Example
>SPDI $55
Set the next input value to the SPI to $55
>SPDI
Pull up the data window with all the input values.
SPDO Command
The SPDO command displays the output buffer from the SPI. A window is opened that
shows all the data that the SPI has shifted out. An arrow is used to point to the last output
value transmitted. The maximum number of output values that the buffer holds is 256
bytes.
Syntax
>SPDO
Example
>SPDO
View data from the output buffer for the SPI simulation.
SPFREQ Command
The SPFREQ command lets the user set the frequency of the SPI slave input clock. If the
SPI is configured for the slave mode, this command allows the user to enter the number of
cycles <n> per one input clock period. If no value is given, a window appears and the user
is prompted for a value. If this command is not used, then the clocking is assumed to be set
by the SPI control register.
Syntax
>SPFREQ [<n>]
Where:
<n> The number of cycles for the period of the input clock.
Example
>SPFREQ 8
Set the period of the input slave clock to 8 cycles (total shift = 8*8 cycles per bit =
64 cycles)
Use the Simulated Port Inputs dialog box to reconfigure the input value to any I/O port.
Depending on whether the input capture is set for rising/falling edge, to trigger the event,
first set the port inputs high or low and then invert them to an opposite value. Once the
Input Capture event takes place, you can observe the CHxF in the Channel Status and
Control register in the Memory window.
If the Timer module is configured for an Output Compare event, then once the event takes
place you can observe the same CHxF Flag via the Memory window. If the timer channel
interrupt is enabled, the FCS jumps to an appropriate subroutine as long as the Timer
channel interrupt vector is properly defined. To observe the Timer Overflow Flag (TOF)
flag being set as a result of the corresponding CPU event, situate your Memory window on
the memory location of the Timer Status and Control register.
To observe the Pulse Width Modulation (PWM) operation, properly configure the Timer
to operate in the Modulo up count mode, choose the toggle-on-overflow or clear/set output
on compare events to create the desired duty cycle wave. Once a PWM event takes place,
you can observe pin toggle/clear/set behavior corresponding to the Timer configuration in
the Memory window displaying the IO port associated with a given timer channel.
To observe the accuracy of the Timer module operation, the user can observe the number
of CPU cycles that it takes for the event to occur. The cycle counter is only incremented as
the user steps through the code. To determine the exact amount of cycles over which the
event occurs, one can either observe the cycle display in the Register window or use the
built in simulation commands. To display the current number of cycles in the Command
window, use the CYCLES command. To change the number of cycles in the cycle counter,
use CYCLES <n>, where <n> is the new cycle value. If the event has a pre-calculated
number of cycles, use CYCLE 00 to reset the number of cycles and GOTOCYCLE <n> to
run through the code until you reach the expected event.
CYCLES Command
The CYCLES command changes the value of the cycles counter. The cycles counter
counts the number of the processor cycles that have passed during execution. The Cycles
Window shows the cycle counter. The cycle count can be useful for timing procedures.
Syntax
>CYCLES <n>
Where:
<n> Integer value for the cycles counter
Examples
>CYCLES 0
Reset cycles counter
>CYCLES 1000
Set cycle counter to 1000.
GOTOCYCLE Command
The GOTOCYCLE command executes the program in the simulator beginning at the
address in the program counter (PC). Execution continues until the cycle counter is equal
to or greater than the specified value, until a key or the Stop button on the toolbar is
pressed, until it reaches a break point, or until an error occurs.
Syntax
GOTOCYCLE <n>
Where:
<n> Cycle-counter value at which the execution stops
Example
>GOTOCYCLE 100
Execute the program until the cycle counter equals 100.
INPUT<x> Command
The INPUT<x> command sets the simulated inputs to port <x>. The CPU reads this
input value when port <x> is set as an input port.
Syntax
INPUT<x> <n>
Where:
<x> is the letter representing corresponding port
<n> Eight-bit simulated value for port <x>
Example
>INPUTA AA
Simulate the input AA on port A.
INPUTS Command
In FCS and CPU-Only Simulation mode, the INPUTS command opens the Simulated Port
Inputs dialog box shown in Figure 18.39. The user may then use this box to specify the
input states of port pins and IRQ.
When using In-Circuit Simulation mode, the INPUTS command shows the simulated
input values to any applicable port.
Syntax
>INPUTS
Example
>INPUTS
Show I/O port input values.
Connection Procedure
To select the P&E Multilink/Cyclone Pro as your debugger connection:
1. Choose the P&E Multilink/Cyclone Pro option from the set connection dialog box as
shown in Figure 19.1.
2. Click the OK button.
3. Choose the P&E device that you are using from the Connection drop-down menu and
click on Refresh. See Figure 19.2 and Figure 19.3.
Trim Control
The Use custom trim reference frequency option allows the user to select a custom trim
value for the target device (valid only for devices with an Internal Clock). The allowable
trim value is only limited by the device itself; the user can input any value within the valid
internal clock frequency range. Note that the valid internal clock frequency range and the
default trim value for the currently selected device/algorithm are displayed as well. For
more information about the specific functionality of the internal clock source, see the
Freescale Data Sheet for your specific device.
Hotsync Button
The Hotsync button in the Connection Assistant (see Figure 19.3) allows the user to
connect to an already running target.
Device Option
The Device option in the MultilinkCyclonePro menu allows the user to select the
particular Freescale processor that they wish to use. When choosing Device from the
MultilinkCyclonePro menu, extended menus open which allow you to select the family
(e.g. GB Family), and device type (e.g. 9S0GB60) of the MCU that you are using.
Connect Option
The Connect option initiates an attempt to communicate with the device selected under
the device section of the menu.
Trim Options
The Calculate Trim and Program the Non-Volatile Trim Register checkbox enables
automatic calculation and programming of the trim value in a designated Non-Volatile
memory location.
If register files have been installed on the host computer, selecting a block brings up the
Register Block register listing (see Figure 19.10), which shows a list of the associated
registers, their addresses, and their descriptions. This begins interactive setup of system
registers such as I/O, timer, and COP watchdog.
Selecting a file brings up the Register Window (see Figure 19.11), which displays the
values and significance for each bit in the register. The registers can be viewed and their
values modified, and the values can be stored back into debugger memory.
5. From the Default Connection list box, choose the connection HCS08 Open Source
BDM to create a new project from this stationery.
6. Click the Finish button - the CodeWarrior IDE opens.
7. Choose the menu option Project > Make.
8. Choose the menu option Project > Debug to start the debugger.
9. Start debugging.
To take the first steps toward debugging with CodeWarrior IDE and setting the HCS08
Open Source BDM connection from within an existing debugging project:
1. Run the CodeWarrior IDE.
2. Open the project.
3. Choose Project > Debug to start the debugger.
4. In the debugger main window, choose Component > Set Connection to select another
connection.
5. Select HCS08 as the processor then HCS08 Open Source BDM as the connection.
Figure 20.2 Set Connection Dialog Box - HCS08 Open Source BDM Selection
6. Click the OK button - Set Derivative dialog box typically opens (if not, you can start
debugging immediately).
7. In the Set Derivative dialog box, select your target processor.
Setup Option
Select HCS08 Open Source BDM > Setup to display the HCS08 Open Source BDM Setup
Dialog Box.
NOTE If the debugger recognizes only one derivative, this menu entry is not available.
Unsecure Option
Select HCS08 Open Source BDM > Unsecure to unsecure the device when necessary.
This leads to the Information Required to Unsecure the Device dialog box.
Bus Trace
Select HCS08 Open Source BDM > Bus Trace to open the Trace component window
within the debugger main window. For more information see HCS08 On-Chip DBG
Module.
Flash Option
Select HCS08 Open Source BDM > Flash to open the Non-Volatile Memory Control
dialog box. For more information see Flash Programming.
Select the desired cable as your communication device, then click the OK button to start
debugging.
The Show Protocol checkbox option is only for support usage. Select this checkbox, when
you want the debugger’s internal information reported in the Command window.
TIP Cables are numbered #1, #2, etc. in the order they have been plugged into the
computer USB hub.
Select your target hardware derivative, then click the OK button to start debugging.
When FCDIV is correctly set, select the OK button in this window to run the Unsecure
command file script.
5. From the Default Connection list box, choose the connection HCS08 Serial Monitor
to create a new project from this stationery.
6. Click the Finish button - the IDE opens.
7. Choose the menu option Project > Make.
8. Choose the menu option Project > Debug to start the debugger.
9. Start debugging.
Figure 21.2 Set Connection Dialog Box - HCS08 Serial Monitor Selection
5. Select HCS08 as the Processor then HCS08 Serial Monitor as the connection in the
Set Connection dialog box.
6. Click the OK button.
7. Now in the Monitor Setup window, Monitor Communication tab, choose the correct
Host serial communication port if necessary.
8. Press the OK button. The HCS08 Serial Monitor connection reads the device silicon
ID. This ID can match several derivatives.
9. Set the correct derivative matching your hardware in the Derivative Selection dialog
box.
10. Press the OK button. The Monitor Setup window is opened again, to propose to use
the “mirrored vector table” feature. See Vector Redirection in the Serial Monitor for
MC9S08GB/GT Application Note AN2140/D for all details. We recommend that you
use the Vector Table Mirroring feature. Otherwise, vectors cannot be programmed as
captured and protected from erasing or overwriting by the HCS08 Serial Monitor.
11. To enable this feature, check the Enable Vector Table Mirroring checkbox.
12. Press the Auto Detect button to make the debugger search for the vector table address
and vectors reserved by the HCS08 Serial Monitor.
13. Once the auto detection succeeds, press the OK button to start debugging.
Monitor Communication
Select the MONITOR-HCS08 > Monitor Communications option to display the Monitor
Setup Window - Monitor Communication Tab.
Erase Flash
Select the MONITOR-HCS08 > Erase Flash option to immediately erase the target
processor Flash.
Bus Trace
Select the MONITOR-HCS08 > Bus Trace option to open the Trace component window
within the debugger main window. Refer to the Debugger HCS08 On-chip DBG Module
User Interface manual for all related information.
Select Derivative
Select the MONITOR-HCS08 > Select Derivative option to open the Derivative Selection
Dialog Box.
NOTE In the Vectors reserved by Monitor list box above, the number “1” matches the
RESET vector, “2” is the SWI vector, “5” is the ICG vector, etc.
Vector table mirroring allows you to access chip vectors transparently. Indeed, the HCS08
Serial Monitor also uses some vectors, and the vector area is protected from erasing and
overwriting. We recommend that you use this feature. Otherwise, user application vectors
cannot be programmed as captured and are not protected from erasing/overwriting by the
HCS08 Serial Monitor.
To enable this feature, check the Enable Vector Table Mirroring checkbox, then press the
Auto Detect button to make the debugger search for the vector table address and vectors
reserved by the HCS08 Serial Monitor. Once auto detection has succeeded, you can press
the OK button to save and quit this window.
As several silicon devices might return the same value, a selection list is available to select
the debugged derivative; according to reference text written on the top of the silicon.
5. From the Default Connection list box, choose the connection SofTec HCS08 to create
a new project from this stationery.
6. Click the Finish button - the CodeWarrior IDE opens.
7. Choose the menu option Project > Make.
8. Choose the menu option Project > Debug to start the debugger.
9. Start debugging.
About Option
Select SofTec-HCS08 > About to display the About Dialog Box.
Bus Trace
Select SofTec-HCS08 > Bus Trace to open the Trace component window within the
debugger main window. Refer to the HCS08 On-Chip DBG Module section for related
information.
Press the Communication Settings button in this window to open the Communication
Settings Dialog Box.
specific HCS08 derivative. In the case of the MC9S08GB60, for example, this constant
clock source is an 8 MHz internal clock. Other derivatives may use the external crystal
frequency.
Refer to the inDART®-HCS08 In-Circuit Debugger/Programmer for Motorola HCS08
Family FLASH Devices User’s Manual from SofTec for further details.
Reference Document
The HCS08 on-chip DBG module described in this chapter is also described in the
HCS08RMv1/D, Rev. 1, 6/2003 Freescale document.
DBG Features
The debugger covers all features available within the on-chip DBG module:
• Regular hardware breakpoints and watchpoints
• Predefined preset Instruction Triggers, Memory Access Triggers or Capture
Triggers, a wide set of complex hardware breakpoints (triggers on program code
instructions) and watchpoints (triggers on device memory access) and data bus
recording
• Expert Triggers, as powerful as predefined preset triggers
• Code program flow rebuild from DBG data capture within the Trace window
component (open the Trace component to display the code program flow rebuild).
• Real time program code profiling and coverage within the Profiler and Coverage
window components (open the Profiler and/or the Coverage components to display
code profiling and code coverage).
Choose Trigger Module Settings to open the Trigger Module Settings Window.
Choose Bus Trace to open the Trace Component Window.
Instead of setting a breakpoint, a trigger can be set. Note that only 2 triggers can be set:
Trigger A and Trigger B. In a general way, the on-chip DBG module provides
combinations of trigger A and trigger B conditions, and according to the number of
triggers defined (one or two), different triggers DBG Module Mode Setup can be chosen.
To set a trigger, select a Set Trigger Address entry at the selected source location/
address.
The trigger is displayed in the Source window and at the corresponding address in the
Assembly window, just like a breakpoint icon. To distinguish from breakpoints, trigger A
is marked with a red A icon and trigger B with a red B icon.
Once a trigger is set, it can be deleted by opening any context sensitive menu that contains
the Delete Trigger Address option.
Selecting the Show Markpoints option from the Source window causes the Controlpoints
Configuration window to open with its Markpoints tab displayed.
In the Data window, instead of setting a watchpoint, a trigger can be set. Note that only 2
triggers can be set: Trigger A and trigger B. In a general way, the on-chip DBG module
provides combinations of trigger A and trigger B conditions, and according to the number
of triggers defined (one or two), a different trigger DBG Module Mode Setup can be
chosen.
To set a trigger, choose a Set Trigger Address entry and the kind of access - Read, Write,
Read/Write. This sets a trigger at the selected place.
The trigger is displayed in the Data window and at the corresponding address in the
Memory window like a watchpoint icon. To be distinguished from watchpoints, the trigger
A is marked with a red dotted vertical line and trigger B with a blue dotted vertical line.
Expert Triggers
The Expert Mode has a different set of triggers and trigger designs. Indeed, to completely
separate the Expert mode from the Automatic mode, the debugger provides a second set of
triggers for the Expert mode. Expert Triggers are independent from the regular triggers
described previously.
Context sensitive context menu entries are slightly different, basically replacing the Set
Trigger Address A entry by a Set DBGCA entry and the Set Trigger Address B entry by a
Set DBGCB entry. The renaming is due to a more physical DBG registers approach in
Expert mode and in the Expert Mode Tab.
As shown in the next picture, Expert triggers are displayed in Source and Assembly
windows with a small additional “e” character and different colors in the Memory
component.
NOTE When the Expert mode is set, preset Instruction Triggers, Memory Access
Triggers or Capture Triggers designs are grayed out. When the automatic mode
is set or a predefined preset trigger is set, the Expert mode trigger designs are
grayed out.
Figure 23.10 Expert Triggers in Source, Assembly, Memory and Data Windows
As shown above, expert triggers are stored in the Markpoints tab of the Controlpoints
Configuration window as DBGCA and DBGCB markpoints. These markpoint names are
therefore reserved by the debugger.
The markpoint type INSTRUCTION is automatically selected when the trigger was set
from the Source or the Assembly window.
As for regular triggers, the markpoint types READACCESS, WRITEACCESS or
READWRITEACCESS are automatically selected when the trigger was set from the
Data or the Memory window.
Just as with regular triggers, editing expert triggers through the Markpoints tab in the
Controlpoints Configuration window is not user friendly. However, the Save and
Restore on load option (also available with breakpoints and watchpoints) can be very
useful to automatically save the application with the current DBG module setup and
trigger positions just as they were used in the application.
Trigger Settings
The Trigger Settings option of a context menu can be chosen to set all kinds of triggers
without opening the Trigger Module Settings Window. However, the amount of trigger
types is dynamic, depending if no triggers are defined, if only Trigger A is defined, if only
trigger B is defined if both triggers are defined, and also depending on the trigger type
(Instruction, Read Access, Read/Write Access, Write Access. Only possible
combinations are displayed.
Also DBG Module Options can be directly edited.
The status bar displays the current DBG Module Mode Setup (as shown above) or the
current preset Instruction Triggers, Memory Access Triggers or Capture Triggers used or
the current DBG Module Mode Setup.
Expert Mode
The User needs to know the on-chip DBG module really well to use this mode. It can be
seen as a “Do It Yourself” way to set the DBG module. The HCS08 core manual is needed
to understand the meaning of the registers and flags.
The triggers comparator addresses can be set from the debugger Source, Assembly,
Memory and Data windows using Set DBGCA or Set DBGCB. The DBG module is set by
the debugger. DBG module enabling and arming depend on the selected flags set within
the DBG register control registers (through the Expert triggers tab property page). The
settings are written to the hardware right before the application is run. The DBG module is
reset when the application stops.
To set Expert triggers, the Trigger Module Settings window Expert triggers tab must be
used. Select the Expert mode in the list menu to enable the Expert Mode Tab.
Disabled Mode
The user needs to know the on-chip DBG module to use this mode. It can be seen as a “Do
It Yourself” way to set hardware breakpoints, watchpoints, and triggers. Consult the
Reference Document section and documents to get all information about the HCS08 on-
chip DBG module before attempting to use this mode.
There is no dedicated graphical user interface to access the DBG module register. The
triggers comparator addresses and DBG control registers are handled by the user through
the debugger Memory component or using command line commands. The DBG module is
NOT set by the debugger. DBG module enabling and arming depend on the selected flags
set within the DBG register control registers. The DBG module is NOT reset when the
application stops. By default, the FIFO content is protected from unexpected reads, the
DBG module is automatically disarmed and the FIFO is analyzed when the debugger
stops. This can be optionally disabled by the user.
Figure 23.20 Memory Access at Address A and Value on Data Bus Match Dialog Box
The Trigger Editing dialog box is not available for trigger B. Special Match value edit
boxes are displayed instead of Address B edit box.
The code program flow rebuild is displayed in the Trace Component Window
automatically switched to Instructions Display mode.
Figure 23.22 Memory Access at Address A and Value on Data Bus Mismatch Dialog Box
The Trigger Editing dialog box is not available for the trigger B. Special Match value edit
boxes are displayed instead of Address B edit box.
The code program flow rebuild is displayed in the Trace Component Window
automatically switched to Instructions Display mode.
Instruction Triggers
This section describes triggers associated with specific instructions.
NOTE IMPORTANT: With the HCS08 Serial Monitor via GDI connection, this
trigger type might be interfered with by the monitor code itself and therefore
the debugger might break for executed code not belonging to the user
application.
The code program flow rebuild is displayed in the Trace Component Window
automatically switched to Instructions Display mode.
Figure 23.24 Memory Access at Address A and Value on Data Bus Match Dialog Box
The Trigger Editing dialog box is not available for the trigger B. Special Match value edit
boxes are displayed instead of Address B edit box.
The code program flow rebuild is displayed in the Trace Component Window
automatically switched to Instructions Display mode.
Figure 23.26 Memory Access at Address A and Value on Data Bus Mismatch Dialog Box
The Trigger Editing dialog box is not available for the trigger B. Special Match value edit
boxes are displayed instead of Address B edit box.
The code program flow rebuild is displayed in the Trace Component Window
automatically switched to Instructions Display mode.
Capture Triggers
Capture Read/Write Values at Address B
This mode is used to capture the data involved in a read and/or write access to the address
specified by the trigger B, such as the address of a particular control register or program
variable.
Captured byte data are displayed in the Trace Component Window automatically switched
to Recorded Data Display mode.
The trigger address is typically not a program code address (program counter), but rather a
data/memory address.
The trigger addresses is typically not a program code address (program counter), but
rather data/memory addresses.
Captured byte data is displayed in the Trace Component Window and automatically
switched to Recorded Data Display mode.
• Record continuously and halt on trigger hit: The DBG module starts recording
program flow information immediately after run. The DBG module halts the
processor/debugger on trigger condition match.
• Record continuously and DO NOT halt on trigger hit: The DBG module starts
recording program flow information immediately after run. The DBG module does
not halt the processor/debugger on trigger condition match.
• Start recording after trigger hit and halt when the fifo is full: The DBG module
starts recording program flow information on trigger condition match and halts the
processor/debugger when the capture buffer is full.
• Start recording after trigger hit and DO NOT halt when the fifo is full: The DBG
module starts recording program flow information on trigger condition match. The
DBG module does not halt the processor/debugger on trigger condition match.
Data Recording
The data recording options are available for Capture Triggers only and are selected from
the list box in the Trigger Settings tab of the Trigger Module Settings window.
• Halt when the fifo is full: The DBG module records data accesses continuously and
halts the processor/debugger when the capture buffer is full.
• Do not halt when the fifo is full: The DBG module records data accesses
continuously but does not halt the processor/debugger when the capture buffer is full.
Trigger Editing
Typically trigger addresses and/or type can be set using context sensitive context menus. It
is also possible to modify trigger addresses and type within the Trigger Module Settings
Window. Pressing Modify Trigger buttons opens a trigger editor dialog box.
NOTE Pressing the OK button does NOT update the trigger database. The Modify
Trigger button in the Trigger Module Settings window must be explicitly
pressed before closing the dialog box to update the trigger database.
• Pressing Delete Trigger in the dialog box removes the trigger in the trigger database
(Trigger Stored as Markpoints). This trigger address is then considered undefined.
• The Show Location button shows the location of the trigger (as program code
location or program data) in the Source, Data, Assembly and Memory windows.
The left side of the tree is a user-friendly way to find a trigger address in the debugger
symbol database by selecting a variable (the address of the variable is taken and copied in
the Address edit box) or a function (the entry point of the function is taken and copied in
the Address edit box), and also regular markpoints (the address of the markpoint is taken
and copied in the Address edit box) from the markpoint list.
• Automatically analyze the FIFO content: When the Trace Component Window is
open, after the debugger is halted by the user or a breakpoint, watchpoint or a trigger,
DBG module results are automatically analyzed then displayed in the Trace window.
If the Trace window is closed, the DBG user interface does not perform any result
analysis except trigger flags reported in the status bar. Unchecking this check box
does the same, with the Trace window open.
• Disarm the module automatically when the debugger stops: By default, halting the
debugger target processor with a user break (not a trigger) does not disarm the on-
chip DGB module. If you leave this option selected (the default) the debugger
disarms it to retrieve data from the DBG Fifo. If not selected, the DBG Fifo/buffer
information cannot be retrieved until the module is disarmed.
• Protect DBG FIFO content from unexpected reads: The DBG Fifo data are
retrieved from DBGFH-DBGFL registers (address 0x1814-0x1815 in register block
at reset location). Several reads are performed to retrieve the entire shifting buffer.
However, when the debugger is halted, while refreshing Data and Assembly
windows, it might read also the debugger target processor memory at the same
location, reading the first DBG Fifo data, shifting the buffer, and therefore corrupt
the DBG user interface DBG Fifo data retrieving. This option hides to the debugger
and also user (see blue “-- --” designs in the Memory window at address 0x1814-
0x1815) the DBG Fifo buffer location.
• When starting, automatically step if a trigger is set at PC address (otherwise:
warn): To run again the application, the debugger usually needs to exit the trigger
current match condition and avoid being stuck/halted/locked by the trigger. A single
step is usually required to “escape” from Instruction Triggers. When this option is
disabled, the debugger prompts the following dialog box to validate this choice.
It is not necessary to open the Trace window/component to make use of the DBG user
interface triggers. However, several triggers are used to collect code program flow
information or access data information. The Trace window can be opened from Specific
Connection Menu Options, from Context Menu Entries in Source, Data, Assembly and
Memory Windows, and from the DBG Support Status Bar Item. The window can by saved
in the debugger layout when pressing the debugger Save icon.
NOTE When the Trace component/window is closed, the debugger might be faster, as
code program flow rebuild is discarded, this last disassembling back the
assembly data from the connection CPU’s memory.
Instructions Display
This display mode is automatically set when Instruction Triggers and Memory Access
Triggers are used. It is also the default display in Automatic Mode (Default).
Displayed columns:
• Frame: A number representing an information item stored in the Trace component
database.
• Address: instruction program counter.
• Instruction: code program flow instruction disassembly.
• FIFO Analyze remark: debugger information: DBG FIFO data means that this data
was recorded by the on-chip DBG module. Traced means an item/instruction
obtained by debugger/user single step or assembly step. Program flow rebuild gap
means that the debugger was unable to completely track the code program flow
between two frames.
Selecting Show Location in the Trace window causes a context sensitive menu to appear
in Source and Assembly window the frame matching source and assembly code.
Graphical Display
You can select this display mode when selecting Graphical in the Trace window context
sensitive menu. It provides a graphical representation of the same information.
Textual Display
This display mode can be select when selecting Textual in the Trace window context
sensitive context menu, when using Instruction Triggers and Memory Access Triggers are
used. This display mode is rather useless for the DBG user interface, as no read/write
accesses are recorded at the same time than program change of flow information by the
on-chip DBG module. By consequence, the Textual display mode simply expands
instruction assembly code in the Trace window.
Goto Frame
Selecting Go to Frame in the Trace window context sensitive context menu opens a small
dialog box to go to a frame in the Trace window.
Clearing Frames
Selecting Clear in the Trace window context sensitive menu flushes the frames in the
Trace window (flushing in background the database).
Displayed columns:
• FIFO Depth: A number representing the depth in the DBG/Fifo of the word data
value. The first frame (Depth 1) is the oldest value in the time.
• DBG FIFO Data: the word value retrieved from the DBG Fifo/buffer from DBGFH
and DBGFL DBG on-chip module registers.
Limitations
The following limitations apply in demo/unregistered debugger mode:
• In demo/unregistered debugger mode, code program reconstruction has a limited
number of frames displayed in the Trace window.
• Real time code Profiling and code Coverage are disabled.
• No preset/predefined Instruction Triggers, Memory Access Triggers or Capture
Triggers are provided. Only Expert Triggers can be set.
LOOP1 mode
The on-chip DBG V3 module (available for example on MC9S08QE128 devices)
provides some new features, like an additional comparator that is typically used as a third
hardware breakpoint, that is not involved in the trigger logic except in a new recording
mode call LOOP1. In LOOP1 mode, the DBG module verifies if the last captured change
of flow is already recorded in the DBG fifo database, and if it is the case, the fifo database
is not changed and the capture discarded. This avoids recording short loop changes of flow
that can quickly fill completely the database without providing relevant debug
information. For example, this improves efficiency when executing a DBNZ instruction
by recording instruction branching only once.
Select the LOOP1 module in the Trigger Module Settings dialog by selecting FIFO
LOOP1 mode in a list menu. The genuine mode is called FIFO Normal mode.
CAUTION After interpreting the Trace window recorded information, reset the
debugger and hardware (press the debugger Reset button) to clear the SRS
register. This ensures a correct debugger analysis from the next reset
capture.
CAUTION After interpreting the Trace window recorded information, reset the
debugger and hardware (pressing the debugger Reset button) to clear the
SRS register. This ensures a correct debugger analysis from the next reset
capture.
Book IV Contents
Each section of the Debugger manual includes information to help you become more
familiar with the Debugger, to use all its functions and help you understand how to use the
environment. This book, the RS08 Debugger Connections, defines the connections
available for debugging code written for RS08 CPUs.
This book consists of the following sections:
• RS08 Full Chip Simulation
• RS08 P&E Multilink/Cyclone Pro Connection
• RS08 Open Source BDM Connection
• SofTec RS08 Connection
Configuration Procedure
To select Full Chip Simulation as the debugger connection:
1. Choose the Full Chip Simulation option from the set connection dialog box. See
Figure 24.1.
2. Click the OK button.
Device Option
The Device selection of the RS08FCS menu allows the user to select the particular
Freescale processor that they wish to use. When choosing the Device option from the
RS08FCS menu, extended menus open which allow you to select the family (e.g. KA
Family), and device type (e.g. MC9RS08KA2) of the MCU that you are using.
The port pins module menu contains the option to show the input pin levels dialog box
(this corresponds to the INPUTS command). The dialog box graphically displays the
current value of the inputs buffers for all available I/O ports on the device (note that this
may not reflect the value shown in the memory window, depending on the current state of
a given port’s data direction register).
The input buffer can be directly modified from this dialog box.
This dialog box allows the user to set the frequency of the TCLK signal for the MTIM
peripheral. In order for this value to have any effect, the TCLK must be selected as the
clock source for the MTIM.
Below the graphical processor representation are several buttons, each corresponding to a
processor peripheral. Pressing the button of a given peripheral brings up the appropriate
register files (see below), allowing for easy and informative manipulation of all status,
control, and data bits associated with a peripheral.
At the bottom of the dialog box are two additional buttons. The Show Clocks button
brings up the simulated clock frequencies. The Set Inputs button brings up the Inputs
dialog box, which allows the user to set the simulated input buffers to any valid value.
If register files have been installed on the host computer, selecting a block brings up the
Register Block register listing (see Figure 24.9), which shows a list of the files, their
addresses, and their descriptions. This begins interactive setup of system registers such as
I/O, timer, and COP watchdog.
Selecting a file brings up the Register Window (see Figure 24.10), which displays the
value and significance of each bit in the register. The registers can be viewed and their
values modified, and the values can be stored back into debugger memory.
Connection Procedure
To select the P&E Multilink/Cyclone Pro as your debugger connection:
1. Choose the P&E Multilink/Cyclone Pro option from the Set Connection dialog box as
shown in Figure 25.1.
2. Click the OK button.
3. Choose the P&E device that you are using from the Interface list menu and click on
Refresh List. See Figure 25.2 and Figure 25.3.
Hotsync Button
The Hotsync button in the Connection Assistant (see Figure 25.3) allows the user to
connect to an already running target.
Device Option
The Device option in the MultilinkCyclonePro menu allows the user to select the
particular Freescale processor that they wish to use. Select Device from the
MultilinkCyclonePro menu to display a submenu that allows you to select the family (e.g.
KA Family), and device type (e.g. MC9RS08KA2) of the MCU that you are using.
Connect Option
The Connect option initiates an attempt to communicate with the device chosen under the
Device section of the menu.
Below the graphical processor representation are several buttons, each corresponding to a
processor peripheral. Pressing the button of a given peripheral brings up the appropriate
register files (see below), allowing for easy and informative manipulation of all status,
control, and data bits associated with a peripheral.
At the bottom of the dialog box is a reading of the current processor speed. This is
measured on the device itself, and is a real-time indication of the current bus speed of the
processor.
If register files have been installed on the host computer, selecting a block brings up the
Register Block register listing (see Figure 25.11), which shows a list of the associated
registers, their addresses, and their descriptions. This begins the interactive setup of
system registers such as I/O, timer, and COP watchdog.
Selecting a file brings up the Register Window (see Figure 25.12), which displays the
values and significance for each bit in the register. The registers can be viewed and their
values modified, and the values can be stored back into debugger memory.
5. From the Default Connection list box, choose the connection RS08 Open Source
BDM to create a new project from this stationery.
6. Click the Finish button - the CodeWarrior IDE opens.
7. Choose the menu option Project > Make.
8. Choose the menu option Project > Debug to start the debugger.
9. Start debugging.
Figure 26.2 Set Connection Dialog Box - RS08 Open Source BDM Selection
6. Click the OK button - Set Derivative dialog box typically opens (if not, you can start
debugging immediately).
7. In the Set Derivative dialog box, select your target processor.
Setup Option
Select RS08 Open Source BDM > Setup to display the RS08 Open Source BDM Setup
Dialog Box.
NOTE If there is only one derivative recognized by the debugger, this menu entry is
not available.
Select the OSBDM cable, then click the OK button to start debugging.
The Show Protocol checkbox and option is for Support usage only. When enabled,
debugger internal information is reported in the Command window.
TIP Cables are enumerated #1, #2, etc. in the order they have been plugged into the
computer USB hub.
Select the correct target hardware derivative then select the OK button to start debugging.
5. From the Default Connection list box, choose the connection SofTec RS08 to create a
new project from this stationery.
6. Click the Finish button - IDE opens as shown in Figure 27.2 on page 569.
About Option
Select the SofTec-RS08 > About option to display the About dialog box.
Pressing the Communication Settings button in this window opens the Communication
Settings dialog box.
Book V Contents
Each section of the Debugger manual includes information to help you become more
familiar with the Debugger, to use all its functions and help you understand how to use the
environment.
Book 5 is divided into the following chapters:
• ColdFire V1 Full Chip Simulation Connection
• ColdFire P&E Multilink/Cyclone Pro Connection
• SofTec ColdFire Connection
• ColdFire On-Chip DBG Module
Clock Frequency Opens the Clock Frequency Setup dialog box to set the Real
Time clock.
Bus Trace Opens the Bus Trace dialog box to enable instructions and
memory access recording and to display recording captures.
The status bars show the selected simulated derivative or simulated CORE or core
SAMPLE and the current derivative CPU frequency in MHz.
NOTE Clicking on the CPU frequency opens the Clock Frequency Setup.
NOTE Double-clicking on the CPU cycles or true time resets the value.
NOTE Clicking on the displayed derivative, CORE, or core SAMPLE opens the Set
Derivative dialog box.
NOTE I/O simulation components are either designed by Freescale and delivered with
the tool-kit installation or designed by the user with the Peripheral Builder, a
separate product.
Memory Configuration
The memory configuration interface is an FCS advanced configuration feature. The FCS
divides the emulated memory into blocks. A memory manager handles the list of memory
blocks. The memory configuration facility offers you some degree of automation, but does
not restrict the flexibility of manual adjustment. The memory configuration facility lets
you specify types and properties of memory blocks, such as RAM and ROM.
The memory configuration facility uses a binary file format to read and set the FCS
configuration. The extension for binary files is .mem; the default memory file is
default.mem. (The subsection TestTerm Component includes Listing 28.2, the EBNF-
syntax definition of the file format.)
Mode Description
Auto Configuration on Access Defines the FCS memory as RAM of unlimited size.
(Standard Configuration) The Mode combo box displays auto on access.
Auto Configuration on Load Defines the FCS memory as RAM and ROM,
(default) according to the code and data area defined in a
loaded absolute file. Defines code segments as ROM.
Defines data segments as RAM. (Memory outside
these segments is not implemented; access to
unimplemented locations result in error messages.)
The Mode combo box displays auto on load.
Manual Configuration (User Defines the FCS memory as RAM, ROM, or non-
Defined) volatile RAM, depending on your configuration. You
construct this definition interactively with the Memory
Configuration dialog box, or read it in from a file. The
Mode combo box displays user defined.
Manual Configuration: The Memory Configuration dialog box lists an entry for each
memory block. You can modify such entries without restriction.
NOTE To simulate an absolute file generated in Freescale object file format, you must
open the Memory Configuration dialog box, set the auto on load mode, then
add a new RAM segment. The start and end addresses of this segment must
match the associated .prm file. Once you close the dialog box, you can load
your application and start a simulation.
Item Description
Wait state Time used for reading or writing a specific number of bytes
Read access Table that defines read-access details on Byte, Word, Word
misaligned, Long, and Long misaligned
Write access Table that defines write-access details on Byte, Word, Word
misaligned, Long, and Long misaligned
Auto configure Flag that directs automatic computation of read and write
accesses
Allow misaligned access Flag that allows Word misaligned and Long misaligned
Figure 28.7 Memory Configuration Dialog Box - Access Details Dialog Box
• To modify the value of each read or write type, change the value of the associated
spin box.
• The lowest possible value is 0.
• The highest possible value is 127.
• To store changes into the currently selected memory block, click the OK button. The
Access Details dialog box disappears, and the system clears the Auto Configure
checkbox.
• To abandon your changes, click the Cancel button. The Access Details dialog box
disappears and the system discards your changes.
• To bring up appropriate help information, click the Help button.
Output
You can save the current memory configuration into the file you defined at the outset.
frequency is always the oscillator frequency. Two radio buttons allow you to choose
between cycles or true-time display in debugger status bar.
Clearing Reset cycles/time makes the debugger accumulate cycles/time other than CPU
reset. The true-time unit is the microsecond. The TRUETIME debugger command line
command gives the time as a number in microseconds. The OSCFREQUENCY variable
displays or sets the oscillator frequency.
Bus Trace
The FCS can record all executed instructions and memory accesses in the Trace
component, up to one million frames. Enable recording in the Trace menu or context-
sensitive menu after opening the Trace component.
NOTE Refer to the ColdFire On-Chip DBG Module manual for the Trace Component
Window common functionality and common menu entries.
By default, FCS records instructions only (faster). Check Record memory accesses and
choose Textual mode in the Trace menu or context-sensitive menu to record memory
accesses as well.
You can retrieve the following types of information from the Trace window:
• Instructions and instruction addresses,
• Data address, data value and read/write access type,
• True time, cycles and total simulation cycles for each instruction,
• Function name and module name for each instruction,
• Variable name and module name for each global variable data access.
...
...
...
FCS Warning (ID 12): reading from unimplemented register at pc =
0x400a'L. Value: 0x0, Memory Address: 0x106. Flash CONTROL module not
implemented
Warning message IDs usually belong to a group of registers from the same simulated
block (the messages above are from the Flash CONTROL registers block). Therefore, any
access to an unimplemented Flash CONTROL register generates the same kind of
message.
The debugger provides a set of commands to hide specific ID messages, to stop the FCS
automatically, or to display a warning message box. You can executes these commands
from a POSTLOAD command file. These commands are volatile and not saved in current
project.
WARNING_SETUP Command
The WARNING_SETUP command sets the level of debugger warning to inform the user
about the usage of a not simulated register.
Components
Debugger engine.
Usage
WARNING_SETUP <HALT|CLMSG|MSGBOX|NONE|STATUS>
WARNING_SETUP STATUS: displays the current warning setup status.
Example:
in>warning_setup status
WARNING_SETUP STATUS: CLMSG
WARNING_SETUP HALT: The FCS stops the debugger when a warning
message occurs.
Example:
in>warning_setup none
in>warning_setup halt
in>warning_setup status
WARNING_SETUP STATUS: HALT
WARNING_SETUP CLMSG: Warning messages appear in the Command window
(debugger default).
Example:
in>warning_setup none
in>warning_setup clmsg
in>warning_setup status
WARNING_SETUP STATUS: CLMSG
WARNING_SETUP MSGBOX: A message box appears on warning. Pressing
Cancel stops the FCS. Pressing OK resumes the FCS.
Example:
in>warning_setup none
in>warning_setup msgbox
in>warning_setup status
WARNING_SETUP STATUS: MSGBOX
WARNING_SETUP NONE: clears all kinds of warning messages.
in>warning_setup none
in>warning_setup status
WARNING_SETUP STATUS: No warning messages
NOTE With HALT, CLMSG and MSGBOX options, executing the command several
times toggles the setup on and off.
MESSAGE_HIDE_ID Command
The MESSAGE_HIDE_ID command hides a message of a specific ID.
Components
Debugger engine.
Usage
MESSAGE_HIDE_ID <message number(ID)>
Example:
in>MESSAGE_HIDE_ID 1
in>warning_setup status
WARNING_SETUP STATUS: CLMSG
Hidden message ID: 1
MESSAGE_SHOW_ID Command
The MESSAGE_SHOW_ID shows back the hidden message of a specific ID.
Components
Debugger engine.
Usage
MESSAGE_SHOW_ID <message number(ID)>
Example:
in>MESSAGE_SHOW_ID 1
MESSAGE_HIDE_RESET Command
The MESSAGE_HIDE_RESET commands resets all hidden messages to display them
again.
Components
Debugger engine.
Usage
MESSAGE_HIDE_RESET
Example:
in>MESSAGE_HIDE_RESET
Displays all previously hidden messages again.
You can see the current mode of Simulation (SAMPLE, CORE or MCU derivative) in the
status bar. You can access the Set Derivative dialog box by double clicking on the FCS
support entry in the status bar. See Debugger Status Bar with Full Chip Simulation.
WARNING! The following visualization components can only be used with the Full
Chip Simulation connection.
NOTE For legacy reasons, the Analog Meter component is called Template.
The Analog Meter contains four controls: an analog gauge in the middle, a vertical level
bar to the left, a horizontal level bar on top, and a turning ‘knob’ in the top left corner.
Click in any of these controls to adjust the value of the meter. The Analog Meter is
assigned to address 0x210.
IO_LED Component
The IO_LED window shown in Figure 28.14 contains eight LEDs used to manipulate and
display the values of memory at an address specified in the related dialog box. LED colors
are set at the PORT address (red or green) and the LED states are switched on or off at the
DDR address (symbolic values).
When you change the state of LEDs in this window, the value of the corresponding bit at
the DDR address changes in the Memory component window.
IO_LED Operations
Clicking and changing the state of one LED changes the value of the byte at the DDR
address.
To change the color of the LEDs, you must change the value of the byte at the PORT
address in the Memory Component window.
Specify the location with a string in the form object.value. Possible objects and their
values can be listed in the Inspector component.
IO_LED Menu
The IO LED Menu contains a single item, Setup, that opens the IO_LED Setup dialog box
shown in Figure 28.15. Use this dialog box to specify the PORT and DDR addresses.
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dropped in.
LED Component
The LED window shown in Figure 28.16 is a visual utility that displays an arbitrary 8-bit
value using an LED bar.
The LED component displays the value in a bit-wise manner with the most significant bit
to the left and the least significant bit to the right. Bits with value 0 are shown using a
green LED, and bits with value 1 use a red LED. Click an LED to toggle its state. The
underlying value changes accordingly.
LED Operations
If you click an LED, its state toggles between green (0) and red (1). The corresponding bit
in the underlying value changes as well.
When you right-click within the component window, a context menu appears with the
same menu entries as listed in the LED menu in the main menu bar.
LED Menu
The LED menu contains a single item, Setup, that opens the dialog box shown in Figure
28.17.
In the text field, the user can specify which value the LED bar displays. Specify the
location with a string in the form object.value. Possible objects and their values can be
listed in the Inspector component.
Click OK to accept the specified location. Click Cancel to discard changes and retain the
previous location.
Example:
If the specified location is TargetObject.#210, the LED bar displays the memory
byte at address 0x210.
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dropped in.
Phone Component
The Phone window shown in Figure 28.18 is an input utility that provides a graphical
keyboard pad that allows you to interactively modify the value of a memory cell.
The phone component displays the front panel of a cellular phone with a numeric keypad
and LCD display. Click the keys on the keypad to store the corresponding value into the
configured memory location. If the mouse is on top of an active key, the arrow shape of
the cursor changes to a pointing hand. Currently, the LCD component is not operational.
Phone Operations
Click a phone key and the matching ASCII character of the label on the key is stored at the
configured memory cell.
Right-click within the component to display a context menu with the same menu entries as
the Phone menu in the main debugger menu.
Phone Menu
The Phone menu contains the Address command, which opens the Phone Address dialog
shown in Figure 28.19. In the text field of this dialog box, the user can specify the address
of the memory cell where keypad characters will be stored. Specify the location with a
hexadecimal number.
Click OK to accept the specified address. Click Cancel to discard changes and retain the
previous address.
Example:
Specifying the address 210 associates the Phone component keypad with the memory byte
at address 0x210.
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dropped in.
ADC/DAC Component
The ADC_DAC window shown in Figure 28.20 consists of an Analog to Digital (ADC)
and a Digital to Analog (DAC) converter.
Description
The ADC/DAC component consists of four units as shown in Figure 28.21:
• A signal generator
• An analog to digital converter (ADC)
• A digital to analog converter (DAC)
• A visualization unit
The fourth unit shows the value of the initial analog signal and value of the DAC output
analog signal.
This component communicates with the mainframe through three parallel ports of eight
bits:
• A port with 1 significant bit to indicate the conversion state.
• An input port to recover the ADC values
• An output port to send values to the DAC in order to visualize them
Signal Generator
The signal generator only generates a sinus signal. The generator output connects to the
ADC visualization screen.
Visualization Screen
The visualization screen is a 200-point horizontal resolution screen. The sinus signal
period deploys in red by default, shown in the upper part of the screen in Figure 28.20, and
the signal generated by the DAC appears in blue in the lower part.
ADC
The ADC is an 8-bit resolution converter generating unsigned values. Figure 28.21 shows
that its entry is directly connected to the signal generator. The conversion order is given by
a timer that is not connected to the data bus, therefore it cannot be set by software.
At the end of a conversion, the ADC sets the state bit. This bit automatically resets after
read.
DAC
The DAC is an 8-bit resolution converter whose output connects to the visualization
screen.
It is only necessary to send a byte into its data port to have its conversion displayed on the
visualization screen. This screen only has a 200-point resolution. Sending more than 200
bytes to the converter has no effect.
ADC/DAC Menu
The ADC/DAC menu shown in Figure 28.22 contains all functions associated with the
ADC-DAC component. Table 28.4 describes these entries.
Setup Opens the ADC/DAC Setup dialog box, allowing you to set the
port addresses.
Display Properties Opens the Display Properties dialog box allowing you to set the
display properties
Now you can start the conversion with Start conversion menu entries.
ADC/DAC Operations
To convert a signal from an example application:
1. Load the application and the ADC/DAC component.
2. Choose the ports address
3. Define the input signal frequency
4. Define the sampling frequency
5. Start the application
6. Choose Start Conversion
Drag Out:
Nothing can be dragged out.
Drag Into:
Nothing can be dragged in.
IT_Keyboard Component
The 20-key IT_Keyboard shown in Figure 28.26 generates an interruption when a key is
pressed.
These 20 keys are positioned at the intersection of the five lines, X0 to X4, and the four
columns, Y0 to Y3. The resistor R connected to the positive supply gives a logical level 1
when there is no connection (key not pressed). The activation of a line (or column) gives a
logical level 0, and a key pressed on this line (or column) places the column (or the line)
corresponding on the low level. For example, if you activate line X2, column Y3
decreases from logical level 1 to logical level 0 when the « B » key is pressed.
An interruption is raised when an active key (line or column activated) is pressed.
Scanning is one method to read such keyboards. Typically, we can proceed as follows (the
line being in output and the column in input):
• Put a 0 at line X4 (X3, X2, X1, X0 being at 1).
• Read the column successively, from Y3 to Y0.
• Put a 0 at line X3 (X4, X2, X1, X0 being at 1).
• Read the column again from Y3 to Y0.
• Continue till the last column of the last line, and restart at the beginning
All keyboard keys are scanned until we find one that is activated. During the scanning
process, it is easy to update a counter representing the number of the key pressed. Raising
an interruption when a key is pressed allows you to scan only when a key is activated
rather than constantly.
IT_Keyboard Menu
Figure 28.28 shows the IT_Keyboard menu. Table 28.5 describes the menu entries.
In the Port address section, for each two ports you can insert an address (in hexadecimal)
in the Lines field or select one of the five ports listed in the Columns field. These are used
when the component works with the Programmable IO_Ports Component.
The Vector number filed allows you to specify an interruption vector number (in
hexadecimal).
The Keys label buttons permit you to change the symbols displayed on the keyboard keys.
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dropped into the IT_Keyboard Component window.
LCD Component
The LCD Display component message box shown in Figure 28.30 is the LCD utility,
which can display one or two lines of 16 characters and show or hide the position cursor.
The display module consists of two 8-bit-wide parallel couplers: a data port and a control
port, as shown in Figure 28.31. These ports communicate with the mainframe.
The bits d7-d0 represent an ASCII code to display characters or an instruction code. The
RS bit defines the status of bits d7-d0.
LCD Operation
The LCD Display device can display one or two lines of 16 characters and show or hide
the position cursor.
To manage the display, this device contains a controller: the DDRAM (Display Data
RAM). The DDRAM stores the ASCII codes of characters written during a write
operation. Only two lines of 16 characters each can be displayed but up to 64 characters
can be stored.
This RAM can be seen as organized in two lines: the first one starts at address 00h and
ends at 1Fh, and the second one starts at 40h and ends at 5Fh. Figure 28.32 illustrates this
arrangement.
The Address Counter (AC) is an internal register of the display controller which points at
the current address. In the default configuration AC is initialized at 00h and increases
when an ASCII character is stored at the address to which AC points. When AC is equal to
1Fh, the next increased value is not 20h, but 40h.
For example, if we send a 48-character string after initialization, the AC stores the bytes at
addresses 00h to 1Fh and 40h to 4Fh.
NOTE Only characters having their ASCII codes in the visible interval of the 16
characters (positions 1 to 16) of RAM appear.
Instruction Listing
Figure 28.33 lists the instructions available for the LCD component.
Clear Display
• Completely fills the DDRAM with the code 20h (space character)
• Puts the address 00h into AC (address counter)
• Re-initializes the display if shifts occurred.
• Puts the cursor in position 1 on the display first line.
Return Home
• Sets AC = 00h and re-initializes the display.
• Puts the cursor in position 1 on the display first line.
• Leaves the DDRAM unchanged.
Function Set
• If DL = 1, the data exchange is 8 bits wide.
• If N = 0, the display takes place on one line. If N = 1, the display takes place on two
lines.
LCD Menus
Figure 28.36 shows the LCD menu, which is identical to the context menu. Table 28.6
describes the entry.
LCD Display
The LCD Display dialog box shown in Figure 28.37 allows you to set the address of the
lines port and columns port.
In the Ports address section, for each two ports, you can insert an address (in
hexadecimal) in the Lines field or select one of the five ports listed in the Columns field.
These are used when the component works with Programmable IO_Ports Component.
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dropped into the LCD display Component.
Monitor Component
The Monitor window shown in Figure 28.38 is a basic oscilloscope that displays the result
of debugger objects.
The purpose of this component is to display the results of debugger objects observation in
a graphical format (similar to an oscilloscope). The monitor component can save the list of
state modifications and associated time in a file.
Monitor Menu
Figure 28.39 shows the Monitor menu and Table 28.7 describes its entries.
Add Channel Opens the dialog box to create a new Channel in the Monitor.
Delete Channel Deletes the Selected Monitor Channel (click on it in the monitor
view)
Show Control Opens the Settings dialog box to change the time base.
Add Channel
The Add Channel dialog box shown in Figure 28.40 allows you to create a new Channel in
the monitor.
In the text area Object to monitor, enter the object name and bit (e.g., TIM12.PORTT bit
0) and click OK to validate or Cancel to exit.
Monitor Settings
The Monitor Settings dialog box shown in Figure 28.41 allows you to change the time
base.
Select the object name in the list, enter a CPU timer proportional value in the Ticks field
and a number of pixels in the Pixels field to define the horizontal scale. Click OK to
validate or Cancel to exit.
Change Colors
The Change Colors dialog box shown in Figure 28.42 allows you to change the colors
from the selected Channel.
Select the intended element in the categories field and click Change to open the standard
color selection dialog. Click OK to validate or Cancel to exit.
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dropped in.
Sending a value of 1 for a bit lights on the corresponding LED on the LEDs device. For
example, if you press button 3, a read access at the address of the component port returns
the value 00001000b (08h).
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dropped in.
The debugger uses circuits called «input / output couplers » to complete the data exchange
between the processor and peripherals. The peripherals are connected to the data bus in
parallel. The appropriate output circuit catches information on the data bus and saves it (in
a latch) until the next data reception.
The processor perceives the input/output couplers as memory cases with a wired fixed
address. The capability exists to do input/output actions at a known address. In C, access is
accomplished using forced pointers to these addresses.
A read operation when the coupler is in input mode activates this input during all the read
steps. A write operation when the coupler is in output mode activates the output latch
during all write steps.
The programmable IO_Ports allows you to define the coupler in input and output. You
can modify this configuration during program execution. The first step in the test program
is to configure the appropriate couplers.
Port Address
The Port Address dialog box shown in Figure 28.49 allows you to set the port address and
control port address.
You can enter the address for the five ports A, B, C, D, and E, and the address for the
Control port. Click OK to validate.
The Control register coupler allows you to configure the port type: for each port, set a bit
to 1 to configure the port as output and clear to 0 to configure the port as input, as shown
in Figure 28.50.
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dropped in.
In the Select a display section, you can insert an address (in hexadecimal) to select the
display. In the Segment Activation field, you can set the value of this display. The
predefined port is the one used when this component works with the Programmable
IO_Ports Component.
NOTE The 7-segments display component in FCS is much slower than its real
equivalent. In simulation it is not necessary to insert delays between each
display scan (for segments light on and observer eye perception).
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dropped in.
Stimulation Component
The Debugger also supports I/O Stimulation. Using this feature you can generate
(stimulate) interrupts or memory access generated by an external I/O device.
NOTE The True Time I/O Stimulation section describes using this feature in detail,
with accompanying examples.
The Stimulation window component shown in Figure 28.56 provides the basic
functionality of the Full Chip Simulation. It serves to execute timed action and raise
exception events. The Stimulation component displays and executes I/O stimulation
described in a text file.
Cache Size
The Size of the Cache dialog box, shown in Figure 28.58, allows you to define the number
of lines displayed in the Stimulation component. If the Limited Size of Cache checkbox
is clear, the number of lines is unlimited. If the Limited Size of Cache checkbox is
checked, the number of lines is limited to the value displayed in the edit box. Specify a
value between 10 and 1,000,000. By default, the number of lines is 1000.
def a = TargetObject.#210.B;
END
10000000 a = 0;
The first line defines the stimulated object. This object is located at address 0x210 and is 1
byte wide.
Once 200,000 cycles have executed, debugger accesses the memory location 0x210
periodically 50 times (line 3). First the memory location is set to 128, and then 100000
cycles later, it is set to 4.
NOTE The True Time I/O Stimulation section describes using this component in
detail, with examples.
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dragged in.
TestTerm Component
The TestTerm window shown in Figure 28.59 is a user-friendly terminal input/output. It
provides a simple SCI (Serial Communication Interface) interface, which is independent
of Full Chip Simulation.
The TestTerm component emulates a serial communication interface based at the address
200 (hexadecimal), thus providing five simulated memory mapped registers described in
Table 28.12.
Table 28.13 describes the bits used in the Serial Communication Status Register.
Reading and writing in the BAUD, SCCR1, SCCR2 or SCSR registers has no effect in the
TestTerm component, but are required to make the component compatible with specific
SCI interfaces.
Simulated I/Os of the TestTerm component do not need initialization. In the terminal
interface file termio.c, BAUD and SCSR registers are initialized to be compatible with
real SCI interfaces.
The SCDR register is valid for reading or writing data. Reading a value from the SCDR
register clears the RDRF flag in the SCSR register. Entering a character on the keyboard
while TestTerm is active sets the RDRF flag in the SCSR register and puts the ASCII code
of the typed key into the SCDR register.
Conceptually, writing a new value in the SCDR register by the target application clears the
TDRE flag in SCSR. Transmission completion sets the TDRE flag again. As TestTerm is
only an I/O emulation, no delay is simulated and writing into SCDR sets the TDRE flag in
the SCSR register.
Output Redirection
Output can be redirected to a TestTerm window, a file, or to both at the same time. File
output is monitored by the target system and cannot be specified interactively.
Use Escape sequences to handle redirection of the output data stream. Table 28.14
illustrates the different possible redirections and associated escape sequences where
filename is a sequence of characters terminated by a control character (e.g., CR) and is
a valid filename.
ESC “h” “2” filename Output to both Terminal window and file.
ESC “h” “6” filename Output to Terminal window and append to file
How to Redirect
By default, an output redirection is set to the TestTerm component window.
The debugger uses the Term_Direct function declared in terminal.h to redirect an
output. Listing 28.2 gives the source code in terminal.c.
Using TestTerm
Listing 28.3 shows the functions defined in termport.h that can be called to access the
TestTerm component:
char GetChar(void);
void PutChar(char ch);
void PutString(char *str);
void InitTermIO(void);
Listing 28.4 gives the source code for the functions in termport.c.
typedef struct {
unsigned char BAUD;
unsigned char SCCR1;
unsigned char SCCR2;
unsigned char SCSR;
unsigned char SCDR;
} SCIStruct;
empty */
SCI.SCDR = ch;
}
void InitTermIO(void)
{
SCI.BAUD = 0x30; /* baud rate 9600 at 8 MHz */
SCI.SCCR2 = 0x0C; /* 8 bit, TE and RE set */
}
TestTerm Menu
The TestTerm component menu shown in Figure 28.60 lets you set the Cache Size in
lines. Selecting this menu entry accesses the dialog box shown in Figure 28.61.
Drag Out:
Nothing can be dragged out.
Drop Into:
Nothing can be dropped in.
Terminal Component
Use the Terminal window shown in Figure 28.62 to simulate input and output. It can
receive characters from several input devices and send them to other devices.
You can use a virtual SCI (Serial Communication Interface) port provided by the
framework for communication with the target, but it is also possible to use the keyboard,
the display, some files or even the serial port of your computer as I/O devices.
To control and configure a terminal component use the Terminal menu of the terminal
shown in Figure 28.63.
You can choose one of the default configurations in the Default Configuration combo
box. The Connections section lists all active connections in a list box. There you can
customize which input devices to redirect to which output devices by adding and
removing connections.
To add a connection, specify the source and target devices using the From and To combo
boxes and then press the Add button. The new connection appears in the active connection
list below.
To remove connections, select them in the list of active connections and press the Remove
button.
In the Serial Port section you can specify which serial port to use and its properties. This
is only possible if at least one connection from or to the serial port exists.
If you have chosen a connection from or to the virtual SCI port, you can also specify, in
the Virtual SCI section, which ports to use as virtual SCI ports. This enables you to make
a connection to any port in the FCS framework.
ESC “h” “3” filename Open output file and suppress output to terminal display.
ESC “h” “7” filename Append to existing output file and suppress output to terminal
display.
NOTE Only some specific FCS components currently have an Sci0 object. For all
other FCS components the default virtual SCI port does not work, unless you
load a user-defined Sci0 object with the specified register name.
Write access to the target application is done with the Object Pool function OP_SetValue
at the address Sci0.SerialInput.
A subscription to an Object Pool register with the name Sci0.SerialOutput handles input
from the target application. When this register changes (sends a notification), a new value
is received.
For implementations of this register with help of the IOBase class, use the
IOB_NotifyAnyChanges flag. Otherwise only the first of two identical characters are
received.
It is also possible to configure the terminal to use another object in the Object Pool instead
of Sci0 with which to communicate. Refer to Configure Terminal Connections for
information about where you can do this.
Cache Size
The item Cache Size in the context menu allows you to set the number of lines in the
terminal window, using the dialog shown in Figure 28.65.
Wagon Component
The Wagon window shown in Figure 28.66 simulates a tool machine wagon functionality.
At first, the wagon is at the left border position. When you click the RUN button, the
wagon goes to the right side. Upon arriving at the right border, the wagon returns to the
left side. The RESET button positions the wagon at the left border. The STOP button
stops the wagon at the current position.
Wagon Menu
Figure 28.67 shows the Wagon menu. Table 28.16 describes its entry.
Setup Opens the Wagon setup dialog box shown in Figure 28.68.
Wagon Setup
When you select Setup from the Wagon Menu, the Ports Address Selection dialog box
appears. This is the Wagon component Setup window.
In the Motor Port section, you can insert an address (in hexadecimal) to select the Wagon
direction. In the Sensor Port field you can insert an address (in hexadecimal) to select the
Wagon position. Predefined ports are fixed when the component operates with the
Programmable IO_Ports Component.
To move the wagon to the right, set bit r. To move the wagon to the left, set bit l. The
sensor port sets the bl bit when the wagon is at the left border, sets bit br when the wagon
is at the right border, sets bit st when you click the START button with the left mouse
button, and sets stp when you click the STOP button.
The Template component polls this value and displays it in a speedometer-like outlook.
The procedure IO_Show in io_demo.c, shown in Listing 28.6, increments or
decrements this value, depending on the raise direction. The raise direction depends on a
global variable dir that is turned back when the top or bottom value is reached.
First, the simulated object is defined. This object is located at address 0x210 and is 1 byte
wide. Once 200,000 cycles have been executed, the memory location 0x210 is accessed
periodically 50 times. First the memory location is set to 128, then 100,000 cycles later, it
is set to 4.
def a = TargetObject.#210.B;
In the first line, the stimulated object is defined. The interrupt is raised periodically ten
times. The RAISE command takes the number of the interrupt in the interrupt vector map
as the first argument. This number 7 in our example is arbitrarily chosen. To export this
example to a different target processor, look at the interrupt vector map in the technical
data manual of the matching MCU. Using an editor, open the io_demo.prm file in the
same demo directory. You can see at the end of this file how to set the interrupt vector
(adapt it to your needs).
If the prm file does not specify the interrupt vector address, the FCS stops when
interruption is generated. The exception mnemonic (matching the interrupt vector number)
appears in the FCS status bar.
The second argument specifies the interrupt priority and the third argument is a free
chosen name of the interrupt.
The file io_int.txt is used to generate 11 interrupts. Ten periodical interrupts are
generated every 100,000 CPU cycles from 200,000 + 100,000 = 300,000 to 1,200,000
CPU cycles. A final interrupt is generated when the number of CPU cycles reaches
10,000,000.
def a = TargetObject.#210.B;
def x = TargetObject.#212;
def b = TargetObject.#216.W;
def c = TargetObject.#220.L;
def pbits = Leds.Port_Register.B[7:3];
#10000 pbits = 3;
20000 a = 0;
+20000 b = pbits + 1;
Detailed Explanation
def a = TargetObject.#210.B;
def x = TargetObject.#212;
This line of code defines x as byte mapped at address 0x212 in TargetObject. Size can be
omitted. .B for byte is default.
def b = TargetObject.#216.W;
This line of code defines b as word (.W) mapped at address 0x216 in TargetObject.
def c = TargetObject.#220.L;
This line of code defines c as long (.L) mapped at address 0x220 in TargetObject.
This line of code defines pbits as bits 5, 6 and 7 in the byte (.B) register named
Port_Register in LEDs. (You can specify names of target objects when using FCS. In our
example, it is the name of the port register defined by the IO-LED component).
#10000 pbits = 3;
This line of code sets the three bits of LEDs. Port_Register accessed with pbits to binary
011. Other bits are unaffected. The new value of Port_Register is 0x75 if the initial value
was 0x55. Values outside the valid BitRange of pbits are truncated (in this example
only values from 0 to 7 are allowed for pbits). The # means that the time of execution of
the instruction is 10000 cycles after the start of the simulation.
20000 a = 0;
This line of code sets a to 0. Without # or + in front of the time marker, the time refers to
the absolute time after starting execution of the Stimulation file.
+20000 b = pbits + 1;
This line of code reads pbits (three bits in Leds. Port_Register), increments this
value and writes it to b. The + in front of the time marker refers to the time relative to the
last encountered time value in the Stimulation file.
10000 a = 128;
30000 RAISE 7, 3, "test_interrupt";
This starts execution 100,000 cycles after the start of the simulation.
10000 a = 128;
This line of code assigns 128 to a, 10000 cycles after each start of the periodic event.
This line of code raises an interrupt with priority 3 with vector number 7, 40000 cycles
after each start of the periodic event. The time specification in the PERIODICAL loop is
always relative, so 30000 means +30000. The raised interrupt has the name
test_interrupt. This name is not important for the interrupt functionality.
END
This line of code is the end of the periodic block. The block loops again after finishing, so
the loop restarts after 10000 + 30000 = 40000 cycles.
This line of code raises the interrupt for the last time. This instruction marks the
terminating point of the Stimulation, if there are no pending periodical events left.
Exception = “RAISE” Vector “,” Priority [“,” ArbPrio] [“,” Name] “;” .
Assignment = ( ObjectId | ObjectField ) “=” Expression “;”.
Remarks
• Omitting bitRange affects all bits of the object register. Specifying bitRange applies
the mask defined by this bitRange to the value calculated with the Expression. This
value only affects the bits of the object register defined in the bitRange.
• Bits are numbered from right to left (in a byte, bit 7 is the left-most bit). In bitRange,
noOfBits is always less than or equal to StartBit +1.
• The requirement specification defines ObjectSpec for Object Pool as shown below:
• The identifiers declared in IdDeclaration are stored in a table of identifiers and can
be also used in Expression.
• If “#” is specified, the time is absolute: it is the number of cycles since the Full Chip
Simulation was started.
• If “+” is specified, the time is relative to the previous time specification.
• If nothing is specified, time is the number of cycles since execution of the
Stimulation file.
• If size is omitted, the default size is byte (B).
• The periodical event is sent for the first time at initial time + start + time specified in
periodical timed event.
• In the PerTimedEvent declaration, the “+” is optional. If specified or not, the
following time is interpreted exactly the same way.
• The periodical events are not displayed in the stimulation screen.
File Example 1
FILELOOP=INF
LOOP=4
TIMEUNIT=SECONDS
TIMEFACTOR=0.5
GAIN=1
DCOFFSET=0
OPTION=NORMAL
0.000000e+000 3.051758e-005
3.051758e-005 3.051758e-005
6.103516e-005 3.051758e-005
9.155273e-005 3.051758e-005
1.220703e-004 3.051758e-005
1.525879e-004 3.051758e-005
1.831055e-004 3.051758e-005
LOOP=16
TIMEUNIT=SECONDS
TIMEFACTOR=3.6
GAIN=-4.2
DCOFFSET=2.5
OPTION=NORMAL
2.136230e-004 3.051758e-005
2.441406e-004 3.051758e-005
2.746582e-004 3.051758e-005
3.051758e-004 3.051758e-005
3.356934e-004 3.051758e-005
3.662109e-004 3.051758e-005
EOF
File Example 2
FILELOOP=INF
LOOP=INF
TIMEUNIT=NONE
TIMEFACTOR=0.5
GAIN=1
DCOFFSET=0
OPTION=NORMAL
-5
5
2
8
-0.4e-3
300
123
EOF
File Parameters
The following parameters apply to the previous code examples.
• LOOP/FILELOOP
INF means infinite loop. If a block is INF, scanning stays in this block till the IO is
closed or CLOSESIGNALFILE command is executed. If a number is specified,
loops that number of times.
• TIMEUNIT
– CYCLES means that the second data field are cycles.
– SECONDS means that the second data field are seconds.
– -NONE means that the second data field does not exist and the data time unit is
forced to 1 second. Then data time unit can then be adjust by the TIMEFACTOR
parameter.
• TIMEFACTOR
At event programming, multiplies the number of cycles or time duration by this
factor.
• GAIN
At Pin level setup, multiply the level by this gain.
• DCOFFSET
At Pin level setup, level offset applied after gain is applied.
• OPTION
– NORMAL: do nothing.
– ONLYPOSITIVE: at Pin level setup, after gain and offset, cleared to 0 if signal
level < 0.
– ONLYNEGATIVE: at Pin level setup, after gain and offset, cleared to 0 if signal
level > 0.
– ABSOLUTE: at Pin level setup, after gain and offset, set |signal level|.
Signal IO Usage
The Signal IO can handle 16 signals at the same time. Each signal block is independent in
parameters and options from other blocks. You can open the Signal component within
Open I/O Component Dialog Box or with the openio signal command. Release it
within the same dialog or with the close signal command.
Signal Commands
The following signal commands are available in FCS:
SETSIGNALFILE Command
SETSIGNALFILE specifies the signal file to use.
The SETSIGNALFILE X command creates a virtual SignalGeneratorX module
having a SignalPin.
The file name can include the path of the file. If no path is given, the Signal
component will first search in the current project folder, then in the prog\FCSsignals
folder of the debugger installation path.
Syntax
SETSIGNALFILE <value (0-15)> <"file name">
Example
To create three generators:
setsignalfile 0 "sinus_11bit_0_5v_1Hz.txt"
setsignalfile 1 "saw_11bit_0_5v_1Hz.txt"
setsignalfile 2 "square_1_5v_1Hz.txt"
Then, perform virtual pin connections with the Pinconn IO CONNECT command:
connect "SignalGenerator0.SignalPin","Atd0.PAD0"
connect "SignalGenerator1.SignalPin","Atd0.PAD1"
connect "SignalGenerator2.SignalPin","Atd0.PAD2"
TIP Commands to create a signal generators can be placed in a command file like a
Postload command file.
CLOSESIGNALFILE Command
CLOSESIGNALFILE closes the current signal file and generator.
Syntax
CLOSESIGNALFILE <value (0-15)>
Example
CLOSESIGNALFILE 1
Remarks
A message box appears showing the line error in the case of a signal file scripting
error.
The Signal component is compatible with cycle time duration modification (bus
speed change via PLL) and the True Time feature, and automatically reprograms
level duration (when duration in seconds is provided or no duration information is
provided).
Currently, all header parameters are mandatory, as well as EOF, in the same order
as described in EBNF above, without spacing between words.
Pinconn IO
Use the Pinconn IO component to create virtual links or shortcuts between processor
device pins, like a simple wire. Open the Pinconn component within Open I/O Component
Dialog Box or with the openio pinconn command. Release it within the same dialog
or with the close pinconn command.
Pinconn Commands
CONNECT
Connects output pin to input.
Syntax
CONNECT "<OutputPin>", "<InputPin>"
Example
CONNECT "Pim.PORTHPin0", "Pim.PORTPPin3"
DISCONNECT
Removes connection between pins.
Syntax
DISCONNECT "<OutputPin>", "<InputPin>"
Example
DISCONNECT "Pim.PORTHPin0", "Pim.PORTPPin3"
CONNECT_STATE
Displays the list of active connections.
NOTE The Inspect component provides this list of simulated pins for a derivative
FCS under the Object Pool key.
FCS Tutorials
This section contains tutorials using the Full Chip Simulation. The tutorial is divided into
small steps. Completing the last step creates a fully functional example.
This section contains the following subsections:
• Guess the Number
• PWM Sample
Optional:
• Place the cursor of the mouse on the pins to see a description of their functions.
• Enlarge the Target CPU window to see different on-chip modules.
Standard and Professional Editions offer a wider range of hardware and software beans
than the Special Edition.
• Select Bean Categories > CPU internal peripherals > Communication >
AsynchroSerial
• In the context menu select Add Bean to the Current Project to add an instance of
the AsynchroSerial bean to the project.
Under Beans you can find the previously created bean with the name
AS1:AsynchroSerial.
#include <stdlib.h>
void PutChar(unsigned char c) {
while (AS1_SendChar(c) == ERR_TXFULL) {
// could wait a bit here
}
}
void PutString(const char* str) {
while (str[0] != '\0') {
PutChar(str[0]);
str++;
}
}
void GuessTheNumber(void) {
int ran = rand() / (RAND_MAX / 9);
AS1_Init();
void main(void) {
/*** Processor Expert internal initialization. DON'T REMOVE THIS
CODE! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
Step 10 - Run
The application is now complete and we can launch it. Make sure you have chosen the
Full Chip Simulation connection.
1. Select the Debug icon in the Project Manager window (or the menu bar Project >
Debug or [F5]).
If there are compilation errors, correct your source code and try again.
2. In the Debugger, select Component > Open in the debugger and open the Terminal
component.
3. From the context menu of the Terminal window select Configure Connections and
change the name of the SCI peripheral to SCI1 (the SCI you chose in the previous
Processor Expert bean configuration).
4. Select the Save icon in the debugger (or the menu bar File > Save Configuration) to
save the window layout.
5. Select the Run icon in the debugger (or the menu bar Run > Start/Continue or [F5]).
6. Enter numbers in the terminal window to guess the right number.
PWM Sample
This application uses the PWM. With the final application you will be able to change the
period and duty time of the PWM and see the changes displayed in a chart.
void main(void) {
Step 10 - Run
The application is now finished and we can launch it. Make sure you have chosen the Full
Chip Simulation connection.
1. Select the Debug icon in the Project Manager window (or the menu bar Project >
Debug or [F5]).
2. Select Component > Open in the debugger and open the VisualizationTool
component.
VisualizationTool Properties
In this tutorial we will create a visualization using the VisualizationTool window. Make
sure that you are in the Edit mode (Right mouse click > Edit Mode or [Ctrl-E]).
1. Select Right mouse click > Properties
2. For Refresh Mode, select CPU Cycles
3. For Cycle Refresh Count, select 10000
Chart Properties
Now add a chart, where we can see the changing value of the channel in a graphic.
1. Right mouse click > Add New Instrument > Chart
2. Double click on the Chart to see the Chart Properties.
3. Select Subscribe for Kind of Port
4. Use PIM.PTA0 for Port to Display (this is the simulated pin of the device)
5. Select 2 for High Display Value
NOTE The BDM Multilink (parallel port) and USB-ML-12 Rev. A are no longer
supported in ColdFire V1.
5. From the Default Connection list box, choose the connection P&E Multilink/Cyclone
Pro to create a new project from this stationery.
6. Click the Finish button - the CodeWarrior IDE opens.
7. Choose the menu option Project > Make.
8. Choose the menu option Project > Debug to start the debugger.
9. Start debugging.
Figure 29.2 Set Connection Dialog Box - P&E Multilink/Cyclone Pro Selection
Setup
Select MultilinkCyclonePro > Setup to display the P&E Multilink/Cyclone Pro Setup
Dialog Box.
Connect/Communication
Select MultilinkCyclonePro > Connect or Communication to display the Connection
Manager Dialog Box.
Select Derivative
Select MultilinkCyclonePro > Select Derivative to display the Set Derivative Dialog Box.
Bus Trace
Select MultilinkCyclonePro > Bus Trace to open the Trace component window within the
debugger main window. Refer to the Debugger ColdFire On-chip DBG Module User
Interface manual for all related information.
Flash
Select MultilinkCyclonePro > Flash to open the Non-Volatile Memory Control dialog
box. For more information see Flash Programming.
Figure 29.6 P&E Multilink/Cyclone Pro Setup Dialog Box - Communication Tab
In the communication tab, checking Disable maskable ISR’s when stepping option
provides a way to debug without diving in pending program ISR’s. When this option is
set, interrupts are masked before stepping as if changing directly the interrupt level in the
SR core register. When the step is performed, the interrupt level is reverted to previous
state, and if necessary, adjusted according to last executed instruction (when the stepped
instruction affects the interrupt level).
When checking “Program trim data open application loading”, the P&E driver calculates
the data to be Flashed to trim the device according to trimming information provided in
the Communication Settings dialog. The debugger programs automatically this data to the
device Flash when an application is loaded.
When checking “Enable Terminal Printf Support”, the debugger handles hardware
background breaks and checks if the application is broadcasting a message to the
debugger. In this case, the debugger forwards the message to the Terminal window, and
the debugger runs again the target application. When not checked, the debugger remains
halted and reports an unknown hardware break status. To emulate a Terminal
communications, use the special libraries delivered with the CodeWarrior IDE.
Figure 29.7 P&E Multilink/Cyclone Pro Setup Dialog Box - Debug Options Tab
5. From the Default Connection list box, choose the connection SofTec ColdFire to
create a new project from this stationery.
6. Click the Finish button - the CodeWarrior IDE opens.
7. Choose the menu option Project > Make.
8. Choose the menu option Project > Debug to start the debugger.
9. Start debugging.
Setup
Select SofTec-MCF51 > Setup to display the SofTec Coldfire Setup Dialog Box.
Communication
Select SofTec-MCF51 > Communication to display the Target Connection Dialog Box.
Select Derivative
Select SofTec-MCF51 > Select Derivative to display the Set Derivative Dialog Box.
Flash
Select SofTec-MCF51 > Flash to open the Non-Volatile Memory Control dialog box. For
more information see Flash Programming.
About Option
Select SofTec-MCF51 > About to display the About Dialog Box.
Bus Trace
Select SofTec-MCF51 > Bus Trace to open the Trace component window within the
debugger main window. Refer to the Debugger ColdFire On-chip DBG Module User
Interface manual for all related information.
In the Debug Options tab, checking “Disable maskable ISR’s when stepping” option
provides a way to debug without diving in pending program ISR’s. When this option is
set, interrupts are masked before stepping as if changing directly the interrupt level in the
SR core register. When the step is performed, the interrupt level is reverted to previous
state, and if necessary, adjusted according to last executed instruction (when the stepped
instruction affects the interrupt level).
When checking “Program trim data open application loading”, the SofTec driver
calculates the data to be Flashed to trim the device according to trimming information
Figure 30.7 SofTec ColdFire Setup Dialog Box - Debug Options Tab
Press the Communication Settings button in this window to open the Communication
Settings Dialog Box.
The dialog may slightly differ according to cable model. For additional options set up
within this dialog, refer to the inDART®-ColdFire In-Circuit Debugger/Programmer for
Freescale ColdFire Family FLASH Devices User’s Manual from SofTec.
TIP Refer to HCS08 On-Chip DBG Module for general information. This section
gives details of specific setup for the ColdFire debug module.
DBG Features
The debugger covers all features available within the on-chip DBG module:
• Regular hardware breakpoints and watchpoints,
• Predefined preset Instruction Triggers or Memory Access Triggers, a wide set of
complex hardware breakpoints (triggers on program code instructions) and
watchpoints (triggers on device memory access) and data bus recording,
• Expert Triggers, as powerful as predefined preset triggers, “Do It Yourself” way,
• Code program flow rebuild from Real Time Trace PST/DATA output signals within
the Trace window component (open the Trace component to display the code
program flow rebuild),
Typically, the debugger provides four instruction hardware breakpoints, and one
watchpoint. When setting triggers (A or/and B or/and C), the debugger still allows to set
two instruction hardware breakpoints.
Triggers A and B relate to the program counter, whereas Trigger C relates to memory
operations.
• A User Triggers mode, which provides two complex breakpoints, triggers A and B,
one complex watchpoint, trigger C, and two spares classic hardware breakpoints that
can bet as usual (not in the dialog).
• A Profile and Coverage mode, which provides code profiling and coverage
information when opening the Profiler and Coverage components. Note that these
features are not real time. The debugger can only access the DBG on-chip trace
buffer/FIFO when the device is halted. Therefore, in background, the debugger
regularly halts the device, retrieves debug information, then restarts the device, to
build a statistic program counter database. Refer to Profiling and Coverage Mode.
Automatic Mode
Automatic provides only two behaviors for the Trace window in the Trace Settings list
menu:
• Disabled: not recording any data and not displaying anything in the Trace window,
• Enabled: recording continuously. Each time the debugger is halted, the Trace
window is refreshed with the latest program flow recorded.
NOTE Engaging the Sync PC feature forces the on-chip DBG module to fill its
capture buffer/FIFO with data that is usually not necessary. Using this feature
automatically reduces the amount of change of flow information in the DBG
buffer/FIFO, and restricts program flow rebuild code range in the Trace
window.
TIP Trigger A (only) can be adjusted with a mask on the address, that can be set in the
Mask field when the Enable Mask checkbox is set.
The Trace Settings list menu gives a set of options to choose the way the module is going
to start and to stop recording.
The Trigger Stop Condition list menu allows you to specify basic sequences and triggers
to pass to break the debugger.
The trigger C provides specific data access options. When setting the Enable Data
Compare edit box, additional fields are accessible to specify the data to compare, the
mask, and the bus information to check for compare in the Compare Mode list menu.
The watchpoint size can be edited within the Set Trigger/Browse for Trigger interface.
Expert Mode
The Expert mode is a “Do It Yourself” interface to set the on-chip DBG module. In that
case, the debugger does not use any on-chip module resources. Refer to silicon
specifications to correctly set up the DBG module. The debugger still provides the Trace
rebuild window and support to display, when available, the results of the captured data.
Enhanced setup
The ABxR (hex) edit box setup combines ABHR and ABLR registers setup.
Set the CSR2 register using the Mode and Start/Stop list menu, or by using the Select
button.
Figure 31.9 Expert Trigger Settings: CSR2 interactive translation of recording mode
Setting CSR2 by using the Select button automatically updates the Mode and Start/Stop
list menu selection, and vice versa.
Figure 31.10 Expert Trigger Settings: CSR2 interactive translation of start/stop condition
General Settings
Automatically analyze the FIFO content: When the debugger halts for any reason with
the Trace window open, the DBG module results are automatically analyzed and
displayed in the Trace window. If the Trace window is closed, the DBG user interface
performs no result analysis except trigger flags reported in the status bar. Clearing this
check box restricts result analysis even with the Trace window open.
When starting, automatically step if a trigger is set at PC address (otherwise: warn): To
run the application again, the debugger usually needs to exit the trigger current match
condition and avoid being stuck/halted/locked by the trigger. This usually requires a single
step to “escape” from a hardware breakpoint.
Issue warning on attempt to execute with incorrect Sequencer settings: When the on-
chip DBG module sequencer is set up incorrectly, the debugger displays an informative
error message when started.
Book VI Contents
Each section of the Debugger manual includes information to help you become more
familiar with the Debugger, to use all its functions and help you understand how to use the
environment.
Book 6 is divided into the following chapters:
• Flash Programming
• Debugging Memory Map
Select the OK button to launch background Flash commands. These commands arm
programming, load/program an application file, then disarm programming, and are
described later in this chapter.
Check the Do not display this message anymore for this project checkbox to remove
the Warning message for the current project. The setting is saved in the project under the
project variable: AEFWarningdialog box=FALSE.
Setup
Choose the Load menu entry in the connection debugger menu (for example, HCS08
Open Source BDM) to open the Load Executable File dialog box.
Check the above option to automatically mass erase the device and program the
application into non-volatile memory (FLASH and/or EEPROM).
To permanently set this option, a check box is available in the Load tab of the debugger
Preferences dialog box, as shown in Figure 32.3. Select the File > Configuration menu
command to display this dialog box.
The dialog box lists all the non-volatile memory modules registered by the debugger for
the currently selected processor device.
Click once on a line to select an item (highlighted in blue) and click again on a selected
item to deselect it.
Erasing is skipped for all selected modules. If you select all modules, the debugger
programs the application without erasing any non-volatile memory on the device.
TIP When available on-chip, EEPROM type modules are by default not selected for
automatic erasing.
The selection dialog box does not give many details about the listed blocks. More
information can be displayed by typing the FLASH command in the Command window, or
by opening the Non-Volatile Memory Control dialog box.
The NVM Programming Selection dialog box is tightly associated with the FLASH
AEFSKIPERASING command of the debugger.
NOTE Refer to Hardware Considerations for more information about the Flash
modules of your CPU derivative.
NOTE The dialog box does not have a Select or Deselect button, since you simply
click on a module in the list to select it. But selecting and deselecting are not
automatic from the command line. Before you use the command line to
perform any operation on a module, you must use the SELECT command to
select the module. Also see the FLASH SELECT and FLASH UNSELECT
commands in this chapter.
For each block, the dialog box has a line composed of the following fields:
• Name — the module name
• Start — the module start address
• End — the module end address
• State — the modules states, such as disabled, enabled, blank, programmed,
protected, unprotected
Possible state combinations are:
• Bad Device (the interface was unable to detect a correct device)
• Disabled (one or all modules are disabled)
• [Enabled] / <Blank | Programmed> / [Unprotected | Protected]
The NVMC dialog box displays only meaningful states. For example, it displays Enabled
only if it is possible to disable a module. It displays Unprotected only if it is possible to
protect a module.
The Configuration group identifies the current.FPP parameter file. This group also
includes the Auto select according to MCUID checkbox. The Configuration: FPP
loading section explains this option.
The second checkbox of the Configuration group is Save and restore workspace
content. If this checkbox is clear, Flash programming applications overwrite any data in
RAM. Check this box to save the current RAM data. Saving RAM data slows down the
NVMC. Checking this checkbox is equivalent to entering the SAVECONTEXT and
LOADCONTEXT commands.
NOTE For some MCUs, protection is possible only for the Boot section and boot
routines, not for the entire module. Refer to Hardware Considerations for
protection information about your CPU derivative.
• Erase — The Erase button removes any programming from all selected Flash
modules. That is, it assigns the value 0xFF or 0x00 to each byte. Erasure changes the
module status to Blank. If all the selected modules already are blank, the Erase
button is disabled.
• Load — The Load button arms all selected modules, executes a LOAD command,
then disarms the modules. If you click the Load button without selecting any Flash
modules, the NVMC utility selects and loads all modules.
NOTE You simply click on a module in the list to select and/or use Select All/
Unselect All buttons to adjust your selection. But selecting and unselecting are
not automatic from the command line. Before you use the command line to
perform any operation on a module, you must use the SELECT command to
select the module. Also see the FLASH SELECT and FLASH UNSELECT
commands in this chapter.
Another way to load an .FPP parameter file is by clicking the Browse button. This brings
up a standard Open dialog box, which you can use to select the file. When you do so, the
Open dialog box disappears, and the NVMC utility loads the file, automatically clearing
the Auto select according to MCUID: checkbox. In case of an error during loading, the
utility displays an appropriate message.
If you check the Auto select according to MCUID: checkbox, the NVMC utility
searches for and loads the corresponding .FPP parameter file.
Click the OK button to close the NVMC dialog box. If the Auto select according to
MCUID: checkbox is clear, the NVMC utility saves the name of the selected
configuration file under the NV_PARAMETER_FILE entry of the project.ini file. If
you check this checkbox, the utility does not save the .FPP in the project file.
Click the Cancel button to close the dialog box without saving changes.
If a problem occurs during application loading into Flash, the NVMC utility displays an
error message.
This means that you tried to load a program into an unselected section. The NVMC
utility’s selecting/unselecting feature reduces the risk of overwriting, erasing, or
unprotecting valuable data.
Hardware Considerations
This section consists of hardware-specific information about current .FPP files. New
.FPP file features are explained in release notes.
NOTE The Flash programming release note, in the toolkit installation documentation,
contains the latest information about .FPP files.
TIP When available on-chip, EEPROM type modules are by default not selected for
automatic erasing. Refer to Advanced Options: Erase Prevention section.
NVMC Commands
The following Flash commands can be issued through the debugger Command component
window, as shown in the figure below.
FLASH
Short Description
Displays Flash modules, loads .fpp file, or performs Flash operations.
Syntax
FLASH [(SELECT|UNSELECT|ERASE|ENABLE|DISABLE|PROTECT|
UNPROTECT|AEFSKIPERASING) [<blockNo>]]
|[ARM|DISARM|SAVECONTEXT|LOADCONTEXT|MEMMAP|MEMUNMAP|RELEASE
|OVLBACKUP|OVLRESTORE|PROTOCOLON|PROTOCOLOFF|SKIPSTATUS
ON|SKIPSTATUSOFF|NOUNSECURE|UNSECURE]
|[NVMFREQUENCY <frequency in Hz>]
|[NVMIF2RELOCATE <address>]
|[NVMIF2WORKSPACE <address> <address>]
|[INIT <fileName> | AUTOID]
Description
The FLASH command displays names, locations, and states of all available modules;
provided that a parameter (.fpp) file is already loaded. If no parameter file is loaded, this
command loads either the .fpp file for the current MCUID or the last-used .fpp file.
FLASH UNPROTECT unprotects the specified modules. If no modules are specified, all
available blocks are unprotected. This command ignores modules that cannot be
unprotected.
FLASH PROTECT protects the specified modules. If no modules are specified, all
available blocks are protected. This command ignores modules that cannot be protected.
FLASH SELECT selects the specified modules for Flash programming. If no modules are
specified, all available blocks for Flash programming are selected.
FLASH UNSELECT deselects the specified modules. If no modules are specified, all
available blocks are unselected. The unselected state protects against accidental Flash
programming.
FLASH ARM prepares the NMVC utility for loading; as does a normal LOAD command.
The system executes the VPPON.CMD file specified in the Command Files user interface.
This command is required before loading FLASH.
FLASH DISARM ends a load process. The system executes the VPPOFF.CMD file
specified in the Command Files user interface.
FLASH SAVECONTEX backs up current SRAM content into a buffer.
FLASH LOADCONTEX restores current buffer content into the MCU SRAM.
FLASH OVLBACKUP backups application code overlap with programming runtime/
algorithm (RAM preset for debugging). Execute the command before loading the
application/file.
FLASH OVLRESTORE restores/installs (writes in RAM) the application code overlap
with programming runtime/algorithm. Execute the command after the last FLASH
command.
FLASH PROTOCOLON displays the Flash programmer debug protocol.
FLASH PROTOCOLOFF stops displaying the Flash programmer debug protocol.
FLASH SKIPSTATUSON skips the Flash programmer device Non-Volatile Memory
blocks diagnostic. You can use this command to speed up project application loading and
programming from the IDE debug run. The Flash programmer does NOT verify that
blocks are programmed or erased.
FLASH SKIPSTATUSOFF removes the SKIPSTATUSON mode and therefore
diagnostics are performed again.
FLASH NVMFREQUENCY <frequency in Hz> specifies the Non-Volatile Memory
programming frequency in Hertz; typically the device bus speed after reset. When used,
the Flash programmer does not try to evaluate this speed and the debugger gains 2-3
seconds at application loading time. A value of “0” enables the speed detection.
FLASH NVMIF2RELOCATE Command not relevant for HCS08 devices.
FLASH NVMIF2WORKSPACE Command not relevant for HCS08 devices.
FLASH UNSECURE After device mass erasing, the Flash programmer automatically
programs the device security byte to the “Unsecure” state to enable code debugging
(default behavior).
FLASH NOUNSECURE After device mass erasing, the Flash programmer does not
program the device security byte to the “Unsecured” state. The command must be placed
in a Startup command file, to be executed before any erase operation.
TIP Use this command when the user application contains the code to program the
device security byte. This guarantees that no over-programming is performed on
the Flash security byte cell.
CAUTION If the device security byte is not programmed to the “Unsecured” state,
after the device is reset, debugging is no longer possible until the next
mass erase and security byte is programmed to “Unsecured” state.
[<blockNo>]
blockNo is a list of Flash block/module numbers, according to this syntax:
blockNo = {number["-"number][","]}
Examples
FLASH ERASE 2,7
This erases memory blocks 2 and 7.
FLASH ERASE 2,4-6 8
This erases memory blocks 2, 4, 5, 6, and 8.
FLASH ERASE
This erases all available memory blocks.
While Flash modules are armed, execution of user code is not possible. If you enter a
command such as run, step, or so forth, a message box prompts you to disarm the
modules or cancel the command. If you click the OK button, the system disarms all Flash
modules, then executes your command. If you click the CANCEL button, the system
cancels the command and leaves the Flash modules armed.
Introduction
The Debugging Memory Map (DMM) is a software Manager handling all debugger
accesses to device/chip memory and also handling memory data caching.
The DMM provides a global approach for all different CPU families/cores, each family
having its own method for memory access and its own memory on-chip layout and
memory address range priorities.
The DMM gets all memory read and write calls from the debugger. On the other side, the
DMM has the very low level function read/write primitives to call third party cable drivers
of BDM pods, Monitors, etc.
For each CPU core, the debugger provides the DMM with core-specific read/write access
methods that are called Types within the DMM Graphical User Interface (GUI), and core-
specific priority rules that are called Priority within the DMM GUI.
Indeed, the DMM has a GUI, therefore providing to the user a way to change memory
access methods at any time.
The DMM GUI shows a list of memory address ranges (called Modules in this manual)
defined to access the device/chip memory.
The Type column tells the type of memory for the defined memory address range given in
the Range column. The Active column indicates whether the defined range is active or
mapped by the DMM. If No, the DMM treats the range as if it is not defined at all.
The Comment column contains a text information comment about the defined memory
address range.
The Information scrollable window gives a general diagnostic of the DMM: This
diagnostic has less information than the edition mode diagnostic.
Pressing the New button opens the edition dialog to create a new memory address range.
Pressing the Modify/Details button opens the edition dialog of the selected memory
address range to modify it or to see more setup details. More memory range information is
displayed in the edition dialog, and an enhanced diagnostic is also displayed.
Pressing the Delete button removes the memory range, after a warning dialog.
Pressing the Revert to Default button removes (after a warning dialog) the current setup
(usually saved in the current project) and retrieves the default (factory) setup from an
internal database.
The Enable memory module option checkbox maps the module/memory range in the
debugger. Unchecking this option makes the module completely transparent for the DMM
and the debugger.
The Start edit box contains the first address of a memory range and the End edit box
contains the last address of a memory range.
Range boundaries are always limited to an overlapped range with a bigger priority.
For example, if 2 bytes are defined in a range which overlaps another range, accessing
these 2 bytes is performed using the type and rules of this 2-byte range. The memory on
both sides of these 2 bytes is accessed using the type and rules of the overlapped range.
NOTE The Start–End range is a range address for a Type and for a Priority.
Internally, ranges can overlap only if they are of the same type and of the same
priority. The debugger always reads with rules of the range with the highest
priority.
Access kind
The Access Kind list menu provides a way to indicate that the memory range is read/write
(R/W), read only, write only or none of these.
When defined as read only, the range is never written by the debugger.
When defined as write only, the range is never read by the debugger.
When defined as none, the range is never read or written by the debugger. This is internal
equivalent as not defining the range in the DMM dialog.
Access Size
When available, the Access Size list menu provides a way to define if the memory range is
accessed as byte (1), short (2) or long (4).
NOTE The memory range must be size aligned. For example, a module defined with
access size 2 must start with an even address and finish on an odd address. A
module defined with access size 4 must start with an address with the least
significant byte in 0, 4, 8, C, and finish with an address with the least
significant byte in 3, 7, B, F.
NOTE A memory range overlapping (in priority) another memory range can only have
the same or a higher access size.
Types
The Type list menu provides all kinds of memory types available for the processor
displayed in the title bar of the dialog. For some connections, the CPU core might be
displayed instead of the processor name.
Types are internal rules to read and write a kind of memory. For examples, the HCS08
banked type requires first setting a register called PPAGE to read the memory, then
restoring this value as it was before reading. Also this banked type does not physically
provide a memory access while running. Memory access while running is possible in
physical memory (RAM, registers).
NOTE CPU core-specific memory types and Priorities are listed at the end of this
section.
Priorities
The Priority list menu provides all types of memory overlap priorities available for a
processor core. The debugger can have a bigger priority (highest (debugger)) to set an
upper address range that can overlap an on-chip address range. This makes a debugger
display filter (for a Memory window), e.g. when creating a No read access while running
memory address range.
A Flat memory architecture (i.e., without memory blocks moving feature) provides the
following Priority list menu (e.g. HCS08 and ColdFire cores):
When left at the default setting, the CPU treats all memory block with the same priority.
NOTE Each declared memory address range in the GUI has its own private code cache
monitored by the DMM.
TIP The DMM CACHINGOFF command can fully disable the caching feature for the
entire DMM, that is, for all defined memory ranges. The DMM CACHINGON
command re-enables the caching feature.
Remarks
It is possible to create as many memory ranges as wanted, down to a single byte.
Deleting Default/Factory ranges generates warning dialogs. Some settings are required for
the debugger to debug and removing ranges leads to erroneous debugging information.
All GUI settings can be done by debugger commands.
Settings and DMM changes are saved in the current user project. The user can always
restart from draft pressing the Revert to Default button.
Automatic DMM range remapping can be disabled by a debugger command.
The default settings are retrieved from a complete database describing each derivative, or,
in some cases, describing the CPU core (when not necessary to go to derivative level).
HCS08 CPU
The following types and priorities are available for the HCS08 CPU.
Priorities:
• highest (debugger): a high debugger priority that can be used by the user or defined
for the debugger, typically to protect a memory area from being read.
• default (device): default CPU visibility of the entire device/memory with the same
priority, so no memory range can be moved to overlap another memory range.
• lowest (debugger): a low debugger priority that can be used by the user or defined
for the debugger typically to protect a memory area from being read. This priority is
of poor usage but can still be used for display purposes on chip unimplemented
memory range.
Types:
• LAP Registers: This mode is only available for HCS08 devices with an on-chip
MMU. This sets the memory range as special on-chip LAP registers. Typically, a
specific range is already preset with this type so you do not need to use this type.
• linear: This mode is only available for HCS08 devices with an on-chip MMU. This
sets the memory as linear address space (also called Extended Address); range
typically addressed by the on-chip linear address pointer.
• physical: this sets the memory range as physical, i.e. with local 16-bit address bus
access as performed by the CPU when reading and writing the on-chip memory.
• banked: This mode is only available for HCS08 devices with an on-chip MMU. This
sets the memory as banked (i.e., accessed in the PPAGE window ($8000-$BFFF)
with PPAGE register handling). The banked type provides the debugger logical
display of the memory. A range defined as banked is displayed in the Memory
window with a physical/local address in addition to PPAGE << 16. This logical
address is therefore only valid in the $8000-$BFFF window. For example, an
instruction address at $8050 in PPAGE $03 is visible in the Memory window at
$038050.
• EEPROM banked: This mode is only available for HCS08 devices with an on-chip
EEPROM module having several pages. A range defined as EEPROM banked is
displayed in the Memory window with a physical/local address in addition to the
bit(s) to switch EEPROM pages << 16. This logical address is therefore only valid
in the EEPROM range window.
NOTE By factory/default setup, HCS08 DBG08 Fifo Registers have been protected to
reserve the DBG08 Fifo Reading for the debugger DBG interface. Removing
this protection leads to incorrect program flow rebuild.
ColdFire CPU
The following types and priorities are available for the ColdFire CPU.
Priorities:
• highest (debugger): a high debugger priority that can be used by the user or defined
for the debugger; typically used to protect a memory area from being read.
• default (device): default CPU visibility of the entire device/memory with the same
priority, so no memory range can be moved to overlap another memory range.
• lowest (debugger): a low debugger priority that can be used by the user or defined
for the debugger typically to protect a memory area from being read. This priority is
of poor usage but can still be used for display purposes on chip unimplemented
memory range.
Types:
• physical: this sets the memory range as physical, i.e. with linear 32-bit address bus
access as performed by the CPU when reading and writing the on-chip memory.
DMM Commands
All DMM GUI settings can be done by debugger command line commands.
List of commands
DMM
DMM ADD <parameters>
DMM DEL <module handle>
DMM SAVE <mcuid>
DMM DELETEALLMODULES
DMM RELEASECACHES
DMM CACHINGON|CACHINGOFF
DMM WRITEREADBACKON|WRITEREADBACKOFF
DMM HCS12MERHANDLINGON|HCS12MERHANDLINGOFF
DMM OPENGUI [mcuid]
DMM SETAHEADREADSIZE <front size when halted> <back size
when halted> <front size when running> <back size when
running>
DMM command
Syntax
DMM
Purpose
Displays in the Command window the current DMM "Memory Types", "Overlap
Priorities" and memory ranges.
Syntax
DMM ADD <comment> <address> <size> <handle> <type> <cache
locking> <priority> <mapping> <access while running>
<access kind> <access size>
with:
<comment> a string for Comment field; "£" must be used for " " (space).
Purpose
Insert a new memory range in the DMM, as if added via the DMM dialog/user
interface.
Syntax
DEL <module handle>
with <module handle>, a memory range module handle as given/listed with
the DMM command.
Purpose
Delete one specific DMM memory range module by handle reference.
Syntax
DMM SAVE <mcuid>
with <mcuid>, a part/device MCUID value in range $0-$FFFF.
Purpose
Saves the DMM current setup in current project.ini file, under
"DMM_MCUIDxxxx_MODULEn=..." keys.
Syntax
DMM DELETEALLMODULES
Purpose
Removes all current DMM memory range modules. Useful to start a scripted
DMM setup.
Syntax
DMM RELEASECACHES
Purpose
Flushes once all currently cached data for each memory range module, even if the
cache locking is active, i.e. no refresh on halting is active.
Syntax
DMM CACHINGON
Purpose
Data caching is engaged (default DMM setup). No refresh on halting is active for
memory range modules defined with this option.
Syntax
DMM CACHINGOFF
Purpose
Data caching is disabled. The debugger flushes all caches even for memory range
modules defined without this option. Each time the debugger halts, the memory
data are retrieve from the target hardware for all memory range modules.
Syntax
DMM WRITEREADBACKON
Purpose
Syntax
DMM WRITEREADBACKOFF
Purpose
Syntax
DMM HCS12MERHANDLINGON
Purpose
Not relevant for HCS08 and ColdFire cores. Enables the handling of Memory
Expansion Registers for HCS12 devices, i.e. INITRM, INITRG and INITEE. The
DMM remaps automatically memory range module addresses according to the real
value of these registers when halting.
NOTE The debugger does not poll the MER registers while running. Also the
remapping is performed only on factory defined memory range modules, not
user defined memory range modules.
Syntax
DMM HCS12MERHANDLINGOFF
Purpose
Not relevant for HCS08 and ColdFire cores. Disables completely the feature
here above.
Syntax
DMM OPENGUI [mcuid]
with <mcuid>, a part/device MCUID value in range $0-$FFFF.
Purpose
Opens the DMM Graphical User Interface. Note that the MCUID parameter is not
mandatory.
Syntax
DMM SEATAHEADREADSIZE <front size when halted> <back size
when halted> <front size when running> <back size when
running>
with:
<front size when halted>: amount of bytes to read ahead of exact start of
read block address, when the hardware is halted.
<back size when halted>: amount of bytes to read after the exact block of
read addresses, when the hardware is halted.
<front size when running>: amount of bytes to read ahead of exact start
of read block address, when the hardware is running.
<back size when running>: amount of bytes to read after the exact block
of read addresses, when the hardware is running.
Purpose
Special debugger memory cache tuning in case of slow connection with hardware.
Commands Overview
The debugger supports scripting with the use of commands and command files. When you
script the debugger, you can automate repetitive, time-consuming, or complex tasks.
You do not need to use or have knowledge of commands to run the Simulator/Debugger.
However these commands are useful for editing debugger command files, for example,
after a recording session, to generate your own command files, or to set up your
applications and targets, etc.
This section provides a detailed list of all Simulator/Debugger commands. All command
names and component names are case insensitive. The command EBNF syntax is:
component [:component number] < ] command
where component is the name of the window component. For example: Data, Register,
Source, Assembly, etc. Component number is the number of the component. This
number does not exist in the component window title if only one component of this type is
open. For example, if you open a second Memory component window, the initial Memory
component window is renamed Memory:1 and the new one is called Memory:2. A
number is automatically associated with a component if there are several components of
the same type displayed.
Command Example:
in>Memory:2 < SMEM 0x8000,8
‘<‘ redirects a command to a specific component (in this example: Memory:2). Some
commands are valid for several or all components; if the command is not redirected to a
specific component, all components are affected. Also, a mismatch can occur because a
command’s parameters may differ for different components.
Command Syntax
To display the syntax of a command, type the command followed by a question mark.
Syntax Example:
in>printf?
PRINTF (<format>, <expression>, <expression>, ...)
Kernel Commands
Kernel commands are commands that can be used to build command programs. They can
only be used in a debugger command file, since the Command Line component can only
accept one command at a time. It is possible to build powerful programs by combining
Kernel commands with Base commands, Common commands and Component specific
commands. Table 34.1 contains all available Kernel commands.
A Affects a value
Base Commands
Base commands are used to monitor the Simulator/Debugger target execution. Target
input/output files, target execution control, direct memory editing, breakpoint
management and CPU register setup are handled by these commands. Base commands can
be executed independent of components that are open. Table 34.2 contains all available
Base commands.
LOG type [=] state {[,] type [=] Enables or disables logging of a specified
state} information type
RS Sets a register
register[=]value{,register[=]value}
Environment Commands
Simulator/Debugger environment commands are used to monitor the debugger
environment, specific component window layouts and framework applications and targets.
Table 34.3 contains all available Environment commands.
t
Component Commands
Component common commands are used to monitor component behaviors. They are
common to more than one component. Table 34.4 contains all available Component
commands.
range
A composition of two addresses to define a range of memory addresses. Syntax is shown
below:
address...address
or
address, size
where size is an ANSI format numerical constant.
Example:
0x2F00...0x2FFF
Refers to the memory range starting at 0x2F00 and ending at 0x2FFF (256 bytes).
Example:
0x2F00,256
Refers to the memory range starting at 0x2F00, which is 256 bytes wide. Both previous
examples are equivalent.
fileName
A DOS file name and path that identifies a file and its location. The command interpreter
does not assume any file name extension. Use backslash (\) or slash (/) as a directory
delimiter.
The parser is case insensitive. If no path is specified, it looks for (or edits) the file in the
current project directory. When no path is specified, the default directory is the project
directory.
Example:
d:/demo/myfile.txt
Example:
layout.hwl
Example:
d:/work/project.hwc
component
The name of a debugger component. A list of all debugger components is given by
choosing Component > Open. The parser is case insensitive.
Example:
Memory
Example:
SoUrCe
Module Names
Correct module names are displayed in the Module component window. Make sure that
the module name of a command that you implement is correct:
If the .abs is in HIWARE format, some debug information is in the object file (.o), and
module names have a .o extension (e.g., fibo.o).
In ELF format, module name extensions are .c, .cpp or .dbg (.dbg for program
sources in assembler) (e.g., fibo.c), since all debugging information is contained in the
.abs file and object files are not used.
Debugger Commands
The commands available when you use the Simulator/Debugger are defined on the
following pages.
A
The A command assigns an expression to an existing variable. The quoted expression
must be used for string and enum expressions.
Usage
A variable = value or A variable = "value"
Components
Debugger engine.
Example:
in>a counter=8
The variable counter is now equal to 8.
in>A day1 = "monday_8U" (Monday_8U is defined in an Enum)
The variable day1 is now equal to monday_8U.
in>A value = "3.3"
The variable value is now equal to 3.3
ACTIVATE
ACTIVATE activates a component window as if you clicked on its title bar. The window
is displayed in the foreground and its title bar is highlighted. If the window shows icons,
its title bar is activated and displayed in the foreground.
Usage
ACTIVATE component
Components
Debugger engine.
Example:
in>ACTIVATE Memory
Activates the Memory Component and brings the window to the foreground.
ADDXPR
The ADDXPR command adds a new expression in the data component.
Usage
ADDXPR “expression”
Where the parameter expression is an expression to be added and evaluated in the
data component.
Components
Data component.
Example:
in>ADDXPR “counter + 10”
The expression “counter +10” is added in the data component.
ATTRIBUTES
This command is effective for various components as described in the next sections.
NOTE Usually this command is not specified interactively by the user. However this
command can be written in a command file or a layout (".HWL") file to save
and reload component window layouts. An interactive equivalent operation is
typically possible, using Simulator/Debugger menus and operations, drag and
drops, etc., as described in the following sections in “Equivalent Operations”.
Usage
ATTRIBUTES list
where list=command{,command})
command=CACHESIZE value
Example:
command < ATTRIBUTES 2000
Usage
ATTRIBUTES list
where list=command{,command})
command=VALUES (ON|OFF)| TYPES (ON|OFF)
Example:
Procedure < ATTRIBUTES VALUES ON,TYPES ON
Usage
ATTRIBUTES list
where list=command{,command}
command= ADR (ON|OFF) |
SMEM range |
SPC address |
CODE(ON|OFF) |
ABSADR (ON|OFF) |
TOPPC address |
SYMB (ON|OFF)
NOTE Also refer to SMEM and SPC command descriptions for more detail about
these commands. The SPC command is similar to the TOPPC command but
also highlights the code and does not scroll to the top of the component
window.
Equivalent Operations
• ATTRIBUTES ADR ~ Select menu Assembly > Display Adr
• ATTRIBUTES SMEM ~ Select a range in Memory component window and
drag it to the Assembly component window.
• ATTRIBUTES SPC ~ Drag a register to the Assembly component window.
• ATTRIBUTES CODE ~ Select menu Assembly > Display Code
• ATTRIBUTES SYMB ~ Select menu Assembly > Display Symbolic
Example
Assembly < ATTRIBUTES ADR ON,SYMB ON,CODE ON, SMEM
0x800,16
Addresses, hexadecimal codes, and symbolic names are displayed in the Assembly
component window, and assembly instructions at addresses 0x800,16 are
highlighted.
The HSCROLLPOS command sets the position of the horizontal scroll box (the
hposition value is in columns: a column is about a tenth of the greatest register or
bitfield width). hposition is the absolute horizontal scroll position. The value 0
represents the first position on the left.
The parameters vposition and hposition can be constant expressions or symbols
defined with the DEFINE command.
The COMPLEMENT command sets the display complement format of register
values:
• one sets the first complement (each bit is reversed),
• none deselects the first complement.
An error message is displayed if:
• the parameter is a negative value
• the scroll box is not visible
If the given scroll position is bigger than the maximum scroll position, the current
absolute position of the scroll box is set to the maximum scroll position.
Equivalent Operations
• ATTRIBUTES FORMAT ~ Select menu Register > Options
• ATTRIBUTES VSCROLLPOS ~ Scroll vertically in the Register component
window.
• ATTRIBUTES HSCROLLPOS ~ Scroll horizontally in the Register component
window.
• ATTRIBUTES COMPLEMENT ~ Select menu Register > Options
Usage
ATTRIBUTES list
where list=command{,command})
command= FORMAT (hex|bin|dec|udec|oct) | VSCROLLPOS
vposition | HSCROLLPOS hposition | COMPLEMENT(none|one)
Where vposition=expression and hposition=expression
Example
in>Register < ATTRIBUTES FORMAT BIN
Contents of registers are displayed in binary format in the Register component
window.
in>Register < ATTRIBUTES VSCROLLPOS 3
Scrolls three positions down. The third line of registers is displayed on the top of
the register component.
in>Register < ATTRIBUTES VSCROLLPOS 0
Returns to the default display. The first line of registers is displayed on the top of
the register component.
in>DEFINE vpos = 5
in>Register < ATTRIBUTES HSCROLLPOS vpos
Scrolls five positions right. The second column of registers is displayed on the left
of the register component.
in>Register < ATTRIBUTES HSCROLLPOS 0
Returns to the default display. The first column of registers is displayed on the left
of the register component.
in>Register < ATTRIBUTES COMPLEMENT One
Sets the first complement display option. All registers are displayed in reverse bit.
NOTE Also refer to SMEM SPC, SPROC and SMOD command descriptions for more
detail about these commands.
Equivalent Operations
• ATTRIBUTES SPC ~ Drag and drop from Register component to Source
component.
• ATTRIBUTES SMEM ~ Drag and drop from Memory component to Source
component.
Usage
ATTRIBUTES list
where list=command{,command}
command= SPC address |
SMEM range |
SMOD module (without extension) |
SPROC numberAssociatedToProcedure |
MARKS (ON|OFF)
Example
in>Source < ATTRIBUTES MARKS ON
Marks are visible in the Source component window.
Usage
ATTRIBUTES list
where list=command{,command})
command=FORMAT(bin|oct|hex|signed|unsigned|symb)| S
COPE (global|local|user) |
MODE (automatic|periodical| locked|frozen) |
SPROC level |
SMOD module |
UPDATERATE rate |
COMPLEMENT(none|one)|
NAMEWIDTH width
NOTE Refer to SPROC, UPDATERATE and SMOD command descriptions for more
detail about these commands.
Equivalent Operations
• ATTRIBUTES FORMAT ~ Select menu Data > Format
• ATTRIBUTES MODE ~ Select menu Data > Mode
• ATTRIBUTES SCOPE ~ Select menu Data > Scope
• ATTRIBUTES SPROC ~ Drag and drop from Procedure component to Data
component.
• ATTRIBUTES SMOD ~ Drag and drop from Module component to Data
component.
Example
Data:1 < ATTRIBUTES MODE FROZEN
In Data:1 (global variables), variables update is frozen mode. Variables are not
refreshed when the application is running.
– signed decimal,
– unsigned decimal or
– symbolic.
• The COMPLEMENT command sets the display complement format of
memory values: one sets the first complement (each bit is reversed), none
deselects the first complement.
• The MODE command selects the display mode of memory words.
– In Automatic mode (default), memory words are updated when the target is
stopped. Memory words from the currently executed module or procedure
are displayed in the Memory component. Memory words are updated when
target is stopped.
– In Frozen mode, value from memory words displayed in the Memory
component are not updated when the target is stopped.
– In Periodical mode, memory words are updated at regular time intervals
when the target is running. The default update rate is 1 second, but it can be
modified by steps of up to 100 ms using the associated dialog box or
UPDATERATE command.
• The UPDATERATE command sets the variables update rate (see also
UPDATERATE command).
NOTE Also refer to SMEM, SPC and SMOD command descriptions for more detail
about these commands.
Equivalent Operations
• ATTRIBUTES FORMAT ~ Select menu Memory > Format
• ATTRIBUTES WORD ~ Select menu Memory > Word Size
• ATTRIBUTES ADR ~ Select menu Memory > Display > Address
• ATTRIBUTES ASC ~ Select menu Memory > Display > ASCII
• ATTRIBUTES ADDRESS ~ Select menu Memory > Address
• ATTRIBUTES COMPLEMENT ~ Select menu Memory > Format
• ATTRIBUTES SMEM ~ Drag and drop from Data component (variable) to
Memory component.
• ATTRIBUTES SMOD ~ Drag and drop from Source component to Memory
component.
• ATTRIBUTES MODE ~ Select menu Memory > Mode
• ATTRIBUTES UPDATERATE ~ Select menu Memory > Mode > Periodical
Usage
ATTRIBUTES list
where list=command{,command})
command=FORMAT(bin|oct|hex|signed|unsigned) |
WORD number |
ADR (ON|OFF) |
ASC (ON|OFF) |
ADDRESS address |
SPC address |
SMEM range |
SMOD module |
MODE (automatic|periodical| frozen) |
UPDATERATE rate |
COMPLEMENT (NONE|ONE)
Example:
Memory < ATTRIBUTES ASC OFF, ADR OFF
ASCII dump and addresses are removed from the Memory component window.
Usage
ATTRIBUTES list
where list=command{,command})
command= COLUMNWIDTH columnname columnfield columnsize |
EXPAND [name {subname}] deep |
COLLAPSE name {subname}|
SELECT name {subname} |
SPLIT pos |
MAXELEM ( ON | OFF ) [number] |
FORMAT (Hex|Int)
The COLUMNWIDTH command sets the width of one column entry on the right
pane of the Inspector Window. The first parameter (columnname) specifies which
column. The following column names currently exist:
• Names - simple name list
• Interrupts - interrupt list
• SymbolTableFunction - function in the Symbol Table
• ObjectPoolObject - Object in Object Pool without additional information
• Events - event list
• Components - component list
• SymbolTableVariable - variable or differentiation in the Symbol Table
• ObjectPoolIOBase - Object in Object Pool with additional information
• SymbolTableModules - non IOBase derived Object in the Object Pool
The column field is the name of the specific field, which is also displayed in the
Inspector Window.
The following commands set the width of the function names to 100:
inspect < ATTRIBUTES COLUMNWIDTH SymbolTableModules Name
100
NOTE Due to the “inspect <“ redirection, only the Inspector handles this command.
The EXPAND command computes and displays all subitems of a specified item up
to a given depth. An item is specified by specifying the complete path starting at
one of the root items like “Symbol Table” or “Object Pool”. Names with spaces
must be surrounded by double quotes.
To expand all subitems of TargetObject in the Object Pool up to four levels,
the following command can be used:
inspect < ATTRIBUTES EXPAND “Object Pool” TargetObject 4
NOTE Because the name Object Pool contains a space, it must be surrounded by
double quotes.
NOTE The symbol Table, Stack or other Items may have recursive information. So it
may occur that the information tree grows with the depth. Therefore,
specifying large expand values may use a large amount of memory.
The COLLAPSE command folds one item. The item name must be given. The
following command folds the TargetObject:
inspect < ATTRIBUTES COLLAPSE “Object Pool” TargetObject
The SELECT command shows the information of the specified item on the right
pane. The following command shows all Objects attached to the TargetObject:
inspect < ATTRIBUTES SELECT “Object Pool” TargetObject
The SPLIT command sets the position of the split line between the left and right
pane. The value must be between 0 and 100. A value of 0 only shows the right
pane, a value of 100 shows the left pane. Any value between 0 and 100 makes a
relative split. The following command makes both panes the same size:
inspect < ATTRIBUTES SPLIT 50
The MAXELEM command sets the number of subitems to display. After the
following command, the Inspector prompts for 1000 subitems:
inspect < ATTRIBUTES MAXELEM ON 1000
The FORMAT command specifies whether to display integral values like
addresses as hexadecimal or decimal. The following command specifies the
hexadecimal display:
inspect < ATTRIBUTES FORMAT Hex
Equivalent Operations
• ATTRIBUTES COLUMNWIDTH ~ Modify column width with the mouse.
• ATTRIBUTES EXPAND ~ Expand any item with the mouse.
• ATTRIBUTES COLLAPSE ~ Collapse the specified item with the mouse.
• ATTRIBUTES SELECT ~ Click on the specified item to select it.
• ATTRIBUTES SPLIT ~ Move the split line between the panes with the mouse.
• ATTRIBUTES MAXELEM ~ Select max. Elements... from the context menu.
AT
The AT command temporarily suspends a command file from executing until after a
specified delay in milliseconds. The delay is measured from the time the command file is
started. In the event that command files are chained (one calling another), the delay is
measured from the time the first command file is started.
NOTE This command can only be executed from a command file. The time specified
is relative to the start of command file execution.
Usage
AT time
where time=expression and expression is interpreted in milliseconds.
Components
Debugger engine.
Example:
AT 10 OPEN Command
This command (in command file) opens the Command Line component 10 ms
after the command file is executed.
AUTOSIZE
AUTOSIZE enables/disables windows autosizing. When on, the size of component
windows are automatically adapted to the Simulator/Debugger main window when it is
resized.
Usage
AUTOSIZE on|off
Components
Debugger engine.
Example:
in>AUTOSIZE off
Windows autosizing is disabled.
BASE
In the Profiler component, the BASE command sets the profiler base to code (total code)
or module (each module code).
Usage
BASE code|module
Components
Profiler component.
Example:
in>BASE code
BC
BC deletes a breakpoint at the specified address. When * is specified, all breakpoints are
deleted.
You can point to the breakpoint in the Assembly or Source component window, right-
click and choose Delete Breakpoint in the context menu, or open the ControlPoints
Window, select the breakpoint from the list and click Delete.
NOTE Correct module names are displayed in the Module component window. Make
sure that the module name of your command is correct: if the .abs is in
HIWARE format, some debug information is in the object file (.o), and
module names have a .o extension (e.g., fibo.o). In ELF format, module
name extensions are .c, .cpp or .dbg (.dbg for program sources in
assembler) (e.g., fibo.c), since all debugging information is contained in the
.abs file and object files are not used. Adapt the following examples with
your .abs application file format.
Usage
BC address|*
address is the address of the breakpoint to be deleted. This address is specified
in ANSI C or standard Assembler format. address can also be replaced by an
expression as shown in the example below.
When * is specified all breakpoints are deleted.
Components
Debugger engine.
Example1:
in>BC 0x8000
This command deletes the breakpoint set at the address 0x8000. The breakpoint
symbol is removed in the source and assembly window. The breakpoint is removed
from the breakpoint list.
Example 2:
in>BC &FIBO.C:Fibonacci
In this example, an expression replaces the address. FIBO.C is the module name
and Fibonacci is the function where the breakpoint is cleared.
BCKCOLOR
BCKCOLOR sets the background color.
The background color defined with the BCKCOLOR command is valid for all component
windows. Avoid using the same color for the font and background, otherwise text in the
component windows is not visible. Also avoid using colors that have a specific meaning in
the command line window. These colors are:
Red: used to display error messages.
Blue: used to echo commands.
Green: used to display asynchronous events.
NOTE When WHITE is given as a parameter, the default background color for all
component windows is set, for example, the register component is lightgray.
Usage
BCKCOLOR color
Where color can be one of the following: BLACK, GREY, LIGHTGREY,
WHITE, RED, YELLOW, BLUE, CYAN, GREEN, PURPLE,
LIGHTRED, LIGHTYELLOW, LIGHTBLUE, LIGHTCYAN,
LIGHTGREEN, LIGHTPURPLE
Components
Debugger engine.
Example:
in>BCKCOLOR LIGHTCYAN
The background color of all currently open component windows is set to
Lightcyan. To return to the original display, enter BCKCOLOR WHITE.
BD
In the Command Line component, the BD command displays the list of all breakpoints
currently set with addresses and types (temporary, permanent).
Usage
BD
Components
Debugger engine.
Example:
in>BD
Fibonacci 0x805c T
Fibonacci 0x8072 P
Fibonacci 0x8074 T
main 0x8099 T
One permanent and two temporary breakpoints are set in the function Fibonacci,
and one temporary breakpoint is set in the main function.
NOTE From the list, it is not possible to know if a breakpoint is disabled or not.
BS
BS sets a temporary (T) or a permanent (P) breakpoint at the specified address. If no P or
T is specified, the default is a permanent (P) breakpoint.
Equivalent Operation
You can point at a statement in the Assembly or Source component window, right-
click and choose Set Breakpoint in the context menu, or open the Controlpoints
Configuration Window and choose Show Breakpoint, then select the breakpoint
and set its properties.
NOTE Correct module names are displayed in the Module component window. Make
sure that the module name of your command is correct:
If the .abs is in HIWARE format, some debug information is in the object
file (.o), and module names have a .o extension (e.g., fibo.o). In ELF
format, module name extensions are .c, .cpp or .dbg (.dbg for program
sources in assembler) (e.g., fibo.c), since all debugging information is
contained in the .abs file and object files are not used. Adapt the following
examples with .abs application file format.
Usage
BS address| function [{mark}]
[P|T[ state]][;cond=”condition”[ state]]
[;cmd=”command”[ state]][;cur=current[ inter=interval]]
[;cdSz=codeSize[ srSz=sourceSize]]
address is the address where the breakpoint is to be set. This address is specified in
ANSI C format. address can also be replaced by an expression as shown in the
example below.
function is the name of the function in which to set the breakpoint.
mark (displayed mark in Source component window) is the mark number where
the breakpoint is to be set. When mark is:
• > 0: the position is relative to the beginning of the function.
• = 0: the position is the entry point of the function (default value).
• < 0: the position is relative to the end of the function.
P, specifies the breakpoint as a permanent breakpoint.
T, specifies the breakpoint as a temporary breakpoint. A temporary breakpoint is
deleted once it is reached.
State is E or D where E is for enabled (state is set by default to E if nothing is
specified), and D is for disabled.
condition is an expression. It matches the Condition field in the Controlpoints
Configuration window for a conditional breakpoint.
command is any Debugger command (at this level, the commands G, GO and
STOP are not allowed). It matches the Command field in the Controlpoints
Configuration window, for associated commands. For the Command function, the
states are E (enabled) or C (continue).
current is an expression. It matches the Current field (Counter) in the
Controlpoints Configuration window, for counting breakpoints.
interval is an expression. It matches the Interval field (Counter) in the
Controlpoints Configuration window, for counting breakpoints.
codeSize is an expression. It is usually a constant number to specify (for security)
the code size of a function where a breakpoint is set. If the size specified does not
match the size of the function currently loaded in the .ABS file, the breakpoint is
set but disabled.
sourceSize is an expression. It is usually a constant number to specify (for
security) the source (text) size of a function where a breakpoint is set. If the size
specified does not match the size of the function in the source file, the breakpoint is
set but disabled.
Components
Debugger engine.
Example:
in>BS 0x8000 T
This command sets a temporary breakpoint at the address 0x8000.
in>BS $8000
This command sets a permanent breakpoint at the address 0x8000.
BS &FIBO.C:Fibonacci
In this example, an expression replaces the address. FIBO.C is the module name
and Fibonacci is the function where the breakpoint is set.
More Examples:
in>BS &main + 22 P E ; cdSz = 66 srSz = 134
Sets a breakpoint at the address of the main procedure + 22, where the code size of
the main procedure is 66 bytes and its source size is 134 characters.
in>BS Fibo.c:main{3}
Sets a breakpoint at the third mark of the procedure main, where main is a
function of the FIBO.C module.
in>BS &counter + 5; cond ="fib1>fib2";cmd="bckcolor red"
Sets a breakpoint at the address of the variable counter + 5, where the condition is
fib1 > fib2 and the command is bckcolor red.
in>BS &Fibo.c:Fibonacci+13
Sets a breakpoint at the address of the Fibonacci procedure + 13, where Fibonacci
is a function of the FIBO.C module.
CALL
Executes a command in the specified command file.
NOTE If no path is specified, the destination directory is the current project directory.
Usage
CALL FileName [;C][;NL]
Components
Debugger engine.
Example:
in>cf \util\config.cmd
Loads the config command file.
CD
The CD command changes the current working directory to the directory specified in
path. When the command is entered with no parameter, the current directory is displayed.
The directory specified in the CD command must be a valid directory, that exists and is
accessible from the PC. When specifying a relative path in the CD command, make sure
the path is relative to the project directory.
NOTE When no path is specified, the default directory is the project directory. Using
the CD command may affect any commands which refer to a file with no path
specified.
Usage
CD [path]
path: The pathname of a directory that becomes the current working directory
(case insensitive).
Components
Debugger engine.
Example:
in>cd..
C:\Program Files\Freescale\demo
in>cd
C:\Program Files\Freescale\demo
in>cd /Freescale/prog
C:\Program Files\Freescale\prog
CF
The CF command reads the commands in the specified command file, which are then
executed by the command interpreter. The command file contains ASCII text commands.
Command files can be nested. By default, after executing the commands from a nested
command file, the command interpreter resumes execution of remaining commands in the
calling file. Any error halts execution of CF file commands. When the command is
entered with no parameter, the Open File dialog box is displayed. The CALL command is
equivalent to the CF command.
NOTE If no path is specified, the destination directory is the current project directory.
Usage
CF fileName [;C][;NL]
Where fileName is a file (and path) containing Simulator/Debugger commands.
;C specifies chaining the command file. This option is meaningful in a nested
command file only.
When the ;C option is given in the calling file, the command interpreter quits the
calling file and executes the called file. (i.e. in the calling file, commands following
the CF ... ;C command are never executed).
When the option is omitted, execution of the remaining commands in the calling
file is resumed after the commands in the called file have been executed.
;NL: when set, the commands that are in the called file are not logged in the
Command Line window (and not to log file, when a file has been opened with an
LF command), even if the CMDFILE type is set to ON (see also the LOG
command).
Components
Debugger engine.
Examples:
in>CF commands.txt
Executes the COMMANDS.TXT file, which contains debugger commands like those
described in this chapter.
!bckcolor green
!cf command2.txt
executing command2.txt
1!bckcolor red
1!
1!
done command2.txt
!bckcolor white
!
done command1.txt
!bckcolor green
!cf command2.txt ;C
executing command2.txt
1!bckcolor red
1!
1!
done command2.txt
done command1.txt
CLOCK
In the SoftTrace component, the CLOCK command sets the clock speed.
Usage
CLOCK frequency
Where number is a decimal number, which is the CPU frequency in Hertz.
Components
SoftTrace component.
Example:
in>CLOCK 4000000
CLOSE
The CLOSE command is used to close a component.
Component names are: Assembly, Command, Coverage, Data, Inspect, IO_Led, Led,
Memory, Module, Phone, Procedure, Profiler, Recorder, Register, SoftTrace, Source,
Stimulation.
Usage
CLOSE component | *
where * means “all components”.
Components
Debugger engine.
Example:
in>CLOSE Memory
The Memory component window is closed (unloaded).
COPYMEM
The COPYMEM command is used to copy a memory range to a destination range
defined by the beginning address. This command works on defined memory only. The
source range and destination range are tested to ensure they are not overlayed.
Usage
COPYMEM <Source address range> dest-address
Components
Memory.
Example:
in>copymem 0x3FC2A0..0x3FC2B0 0x3FC300
The memory from 0x3FC2A0 to 0X3FC2B0 is copied to the memory at 0x3FC300
to 0x3FC310. This Memory range appears in red in the Memory Component.
CMDFILE
The CMDFILE command allows you to define all target specific commands in a
command file. For example, startup, preload, reset, and path of this file.
Usage
CMDFILE <Command File Kind> ON|OFF ["<Command File Full
Name>"]
Components
Simulator/target engine.
Example:
in>cmdfile postload on "c:\temp\myposloadfile.cmd"
The myposloadfile command file executes after loading the absolute file.
CR
The CR command initiates writing records of commands to an external file. Writing
records continues until a close record file (NOCR) command is executed.
NOTE Drag & drop actions are also translated into commands in the record file.
NOTE If no path is specified, the destination directory is the current project directory.
Usage
CR [fileName][;A]
If fileName is not specified, a standard Open File dialog box is opened.
;A specifies to open a file fileName in append mode. Records are appended at the
end of an existing record file.
If the ;A option is omitted and fileName is an existing file, the file is cleared before
records are written to it.
Components
Debugger engine.
Example:
in>cr /Freescale/demo/myrecord.txt ;A
The myrecord.txt file is opened in “Append” mode for a recording session.
CYCLE
In the SoftTrace component, the CYCLE command displays or hides cycles. When
cycle is off, milliseconds (ms) are displayed.
Usage
CYCLE on|off
Components
Softtrace component.
Example:
in>CYCLE on
DASM
The DASM command displays the assembler code lines of an application, starting at the
address given in the parameter. If there is no parameter, the assembler code following the
last address of the previous display is displayed.
This command can be stopped by pressing the Esc key.
Equivalent Operation
Right-click in the Assembly component window, select Address... and enter the
address to start disassembly in the Show PC dialog box.
Usage
DASM [address|range][;OBJ]
address: A constant expression representing the address where disassembly
begins.
range: An address range constant that specifies addresses to be disassembled.
When range is omitted, a maximum of sixteen instructions are disassembled.
When address and range are omitted, disassembly begins at the address of the
instruction that follows the last instruction that has been disassembled by the most
recent DASM command. If this is the first DASM command of a session,
disassembly begins at the current address in the program counter.
;OBJ: Displays assembler code in hexadecimal.
Components
Debugger engine.
Example:
in>dasm 0xf04b
00F04B LDHX #0x0450
00F04E TXS
00F04F CLRH
00F050 CLRX
00F051 STX 0x80
00F053 INC 0x80
00F055 LDX 0x80
00F057 JSR 0xF000
00F05A STX 0x82
00F05C STA 0x81
00F05E LDA #0x17
00F060 CMP 0x80
00F062 BEQ *-20 /abs = F050
00F064 BRA *-19 /abs = F053
00F066 DECX
00F067 DECX
DB
The DB command displays the hexadecimal and ASCII values of the bytes in a specified
range of memory. The command displays one or more lines, depending on the address or
range specified. Each line shows the address of the first byte displayed in the line,
followed by the number of specified hexadecimal byte values. The hexadecimal byte
values are followed by the corresponding ASCII characters, separated by spaces. Between
the eighth and ninth values, a hyphen (-) replaces the space as the separator. Each non-
displayable character is represented by a period (.).
This command can be stopped by pressing the Esc key.
Usage
DB [address|range]
When address and range are omitted, the first longword displayed is taken from
the address following the last longword displayed by the most recent DB, DW, or
DL command, or from address 0x0000 (for the first DB, DW, DL command of a
session).
Components
Debugger engine.
Examples:
in>DB 0x8000..0x800F
8000: FE 80 45 FD 80 43 27 10-35 ED 31 EC 31 69 70 83
þ_Eý_C'.5í1ì1ipƒ
Memory bytes are displayed in the Command Line component window, with
matching ASCII characters. So, it is necessary to open the Command Line
component before executing this command to see the dumped code.
in>DB &TCR
0012: 5A Z
displays the byte that is at the address of the TCR I/O register. I/O registers are
defined in a DEFAULT.REG file.
DDEPROTOCOL
The DDEPROTOCOL command is used to configure the Debugger/Simulator dynamic
data exchange (DDE) protocol.
By default the DDE protocol is activated and not displayed in the command line
component.
Usage
DDEPROTOCOL ON|OFF|SHOW|HIDE|STATUS
Where:
• ON enables the DDE communication protocol
• OFF disables the DDE communication protocol
• SHOW displays DDE protocol information in the command line component
• HIDE hides DDE protocol information in the command line component
• STATUS provides information if the DDE protocol is active (on or off) and if
display is active (Show or Hide)
Components
Debugger engine.
Example:
in>DDEPROTOCOL ON
in>DDEPROTOCOL SHOW
in>DDEPROTOCOL STATUS
DDEPROTOCOL ON - DISPLAYING ON
The DDE protocol is activated and displayed, and status is given in the command
line component.
DECODE_SKIP
In the HC08 CPU and HCS08 CPU components, the DECODE_SKIP command defines
usage of SKIP/SKIP2 pseudo instructions.
Usage
DECODE_SKIP NO | SKIP | ALL | INFO
Where:
• NO decodes BRN and CPHX #xxxx instructions as is
• SKIP decodes BRN as SKIP pseudo instruction (default)
• ALL decodes BRN as SKIP and CPHX #xxxx as SKIP2 pseudo instructions
• INFO provides information if BRN is decoded as SKIP and if CPHX #xxxx is
decoded as SKIP2
Components
HC08 CPU, HCS08 CPU (also affected: Assembly and Trace components)
Example:
in>DECODE_SKIP ALL
in>DECODE_SKIP INFO
ALL (decode BRN as SKIP and CPHX #xxxx as SKIP2 instructions)
Decoding BRN as SKIP and CPHX #xxxx as SKIP2 is set and information about
it is displayed in the command line component.
DEFINE
The DEFINE command creates a symbol and associates the value of an expression with
it. Arithmetic expressions are evaluated when the command is interpreted. The symbol can
be used to represent the expression until the symbol is redefined, or undefined using the
UNDEF command. A symbol is a maximum of 31 characters long. In a command line, all
symbol occurrences (after the command name) are substituted by their values before
processing starts. A symbol cannot represent a command name. Note that a symbol
definition precedes (and hence conceals) a program variable with the same name.
Defined symbols remain valid when a new application is loaded. An application variable
or I/O register can be overwritten with a DEFINE command.
NOTE This command can be used to assign meaningful names to expressions, which
can be used in other commands. This increases the readability of command
files and avoids re-evaluation of complex expressions.
Usage
DEFINE symbol [=] expression
Components
Debugger engine.
Example:
in>DEFINE addr $1000
in>DEFINE limit = addr + 15
First addr is defined as a constant equivalent to $1000. Then limit is defined and
affected with the value ($1000 + 15)
A symbol defined in the loaded application can be redefined on the command line
using the DEFINE command. The symbol defined in the application is not
accessible until an UNDEF on that symbol name is detected in the command file.
Example:
A symbol named testCase is defined in the test application.
/* Loads application test.abs */
LOAD test.abs
/* Display value of testCase. */
DB testCase
/* Redefine symbol testCase. */
DEFINE testCase = $800
/*Display value stored at address $800.*/
DB testCase
/* Redefine symbol testCase. */
UNDEF testCase
/* Display value of testCase. */
DB testCase
DETAILS
In the Profiler component, the DETAILS command opens a profiler split view in the
Source or Assembly component.
Usage
DETAILS assembly|source
Components
Profiler components.
Example:
in>DETAILS source
DL
The DL command displays the hexadecimal values of the longwords in a specified range
of memory. The command displays one or more lines, depending on the address or range
specified. Each line shows the address of the first longword displayed in the line, followed
by the number of specified hexadecimal longword values.
When a size is specified in the range, this size represents the number of longwords that
display in the command line window.
This command can be stopped by pressing the Esc key.
NOTE Open the Command Line component before executing this command to see the
dumped code.
Usage
DL [address|range]
When range is omitted, the first longword displayed is taken from the address
following the last longword displayed by the most recent DB, DW, or DL
command, or from address 0x0000 (for the first DB, DW, DL command of a
session).
Components
Debugger engine.
Example:
in>DL 0x8000..0x8007
8000: FE8045FD 80432710
The content of the memory range starting at 0x8000 and ending at 0x8007 is
displayed as longword (four bytes) values.
in>DL 0x8000,2
8000: FE8045FD 80432710
The content of two longwords starting at 0x8000 is displayed as longword values
(four bytes).
Memory longwords are displayed in the Command Line component window.
DUMP
The DUMP command writes everything visible in the Data component to the command
line component.
Usage
DUMP
Components
Data component.
Example:
in> Data:1 < DUMP
DW
The DW command displays the hexadecimal values of the words in a specified range of
memory. The command displays one or more lines, depending on the address or range
specified. Each line shows the address of the first word displayed in the line, followed by
the number of specified hexadecimal word values.
When a size is specified in the range, this size represents the number of words that display
in the command line window.
This command can be stopped by pressing the Esc key.
NOTE Open the Command Line component before executing this command to see the
dumped code.
Usage
DW [address | range]
When address is an address constant expression, the address of the first word is
displayed.
When address and range are omitted, the first word displayed is taken from the
address following the last word displayed by the most recent DB, DW, or DL
command, or from address 0x0000 (for the first DB, DW, DL command of a
session).
Components
Debugger engine.
Example:
in>DW 0x8000,4
8000: FE80 45FD 8043 2710
The content of four words starting at 0x8000 is displayed as word values (two
bytes).
Memory words are displayed in the Command Line component window.
E
The E command evaluates an expression and displays the result in the Command Line
component window. When the expression is the only parameter entered (no option
specified) the value of the expression is displayed in the default number base. The result is
displayed as a signed number in decimal format and as unsigned number in all other
formats.
Usage
E expression[;O|D|X|C|B]
where:
;O: displays the value of expression as an octal (base 8) number.
;D: displays the value of expression as a decimal (base 10) number.
;X: displays the value of expression as an hexadecimal (base 16) number.
;C: displays the value of expression as an ASCII character. The remainder
resulting from dividing the number by 256 is displayed. All values are displayed in
the current font. Control characters (<32) are displayed as decimal.
;B: displays the value of expression as a binary (base 2) number.
Components
Debugger engine.
Example:
in>define a=0x12
in>define b=0x10
in>e a+b
in>=34
The addition operation of the two previously defined variables a and b is evaluated
and the result is displayed in the Command Line window. The output can be
redirected to a file by using the LF command (refer to LF and LOG command
descriptions).
ELSE
The ELSE keyword is associated with the LF command.
Usage
ELSE
Components
Debugger engine.
Example:
if CUR_TARGET == 1000 /* Condition */
set sim
else set bdi /* Other Condition */
ELSEIF
The ELSEIF keyword is associated with the IF command.
Usage
ELSEIF condition
where condition is same as defined in C language.
Components
Debugger engine.
Example:
if CUR_TARGET == 1000 /* Simulator */
set sim
elseif CUR_TARGET == 1001 /* BDI */
set bdi
ENDFOCUS
The ENDFOCUS command resets the current focus. It is associated with the FOCUS
command. Following commands are broadcast to all currently open components. This
command is only valid in a command file.
Usage
ENDFOCUS
Components
Debugger engine.
Example:
FOCUS Assembly
ATTRIBUTES code on
ENDFOCUS
FOCUS Source
ATTRIBUTES marks on
ENDFOCUS
The ATTRIBUTES command is first redirected to the Assembly component by the
FOCUS Assembly command. The code is displayed next to assembly instructions.
Then the Assembly component is released by the ENDFOCUS command and the
second ATTRIBUTES command is redirected to the Source component by the
FOCUS Source command. Marks are displayed in the Source window.
ENDFOR
The ENDFOR keyword is associated with the FOR command.
Usage
ENDFOR
Components
Debugger engine.
Example:
for i = 1..5
define multi5 = 5 * i
endfor
After the ENDFOR instruction, i is equal to 5.
ENDIF
The ENDIF keyword is associated with the IF command.
Usage
ENDIF
Components
Debugger engine.
Example:
if (CUR_CPU == 12)
DW &counter
else
DB &counter
endif
ENDWHILE
The ENDWHILE keyword is associated with the WHILE command.
Usage
ENDWHILE
Components
Debugger engine.
Example:
while i < 5
define multi5 = 5 * i
define i = i + 1
endwhile
After the ENDWHILE instruction, i is equal to 5
EXECUTE
In the Stimulation component, the EXECUTE command executes a file containing
stimulation commands. Refer to the I/O Stimulation document.
Usage
EXECUTE fileName
Components
Stimulation component.
Example:
in>EXECUTE stimu.txt
EXIT
In the Command line component, the EXIT command closes the Debugger application.
Usage
EXIT
Components
Debugger engine.
Example:
in>EXIT
The Debugger application is closed.
FILL
In the Memory component, the FILL command fills a corresponding range of Memory
component with the defined value. The value must be a single byte pattern (higher bytes
ignored).
Usage
FILL range value
The syntax for range is: LowAddress...HighAddress
Components
Memory component.
Equivalent Operation
The Fill Memory dialog box is available from the Memory context menu and by
selecting Fill or Memory > Fill menu entry.
Example:
in>FILL 0x8000..0x8008 0xFF
The memory range 0x8000...0x8008 is filled with the value 0xFF.
FILTER
In the Memory component, with the FILTER command, you select what you want to
display, for example modules: modules only, functions: modules and functions, or lines:
modules and functions and code lines. You can also specify a range to be logged in your
file. Range must be between 0 and 100.
Usage
FILTER Options [<range>]
Options = modules|functions|lines
Components
Coverage component.
Example:
in>coverage < FILTER functions 25..75
FIND
In the Source component, the FIND command is used to search a specified pattern in the
source file currently loaded. If the pattern has been found, it is highlighted. The search is
forward (default), backward (;B), match case sensitive (;MC) or match whole word
sensitive (;WW). The operation starts form the currently highlighted statement or from
the beginning of the file (if nothing is highlighted). If the item is found, the Source
window is scrolled to the position of the item and the item is highlighted in gray.
Equivalent Operation
You can select Source > Find or open the Source context menu and select Find to
open the Find dialog box.
Usage
FIND “string” [;B] [;MC] [;WW]
Where string is the “pattern” to match. It must be enclosed in double quotes. See
the example below.
;B the search is backwards, default is forwards.
;MC match case sensitive is set.
Components
Source component.
Example:
in>FIND “this” ;B ;WW
The “this” string (considered as a whole word) is searched in the Source
component window. The search is performed backward.
FINDPROC
If a valid procedure name is given as parameter, the source file where the procedure is
defined is opened in the Source Component. The procedure’s definition is displayed and
the procedure’s title is highlighted.
Equivalent Operation
You can select Source > Find Procedure or open the Source context menu and
select Find Procedure to open the Find Procedure dialog box.
Usage
FINDPROC procedureName
Components
Source component.
Example:
in>findproc Fibonacci
The Fibonacci procedure is displayed and the title is highlighted.
FOCUS
The FOCUS command sets the given component (component) as the destination for all
subsequent commands up to the next ENDFOCUS command. Hence, the focus command
releases the user from repeatedly specifying the same command redirection, especially in
the case where command files are edited manually. This command is only valid in a
command file.
Usage
FOCUS component
Components
Debugger engine.
Example:
FOCUS Assembly
ATTRIBUTES code on
ENDFOCUS
FOCUS Source
ATTRIBUTES marks on
ENDFOCUS
The ATTRIBUTES command is first redirected to the Assembly component by the
FOCUS Assembly command. The code is displayed next to assembly instructions.
Then the Assembly component is released by the ENDFOCUS command and the
second ATTRIBUTES command is redirected to the Source component by the
FOCUS Source command. Marks are displayed in the Source window.
FOLD
In the Source component, the FOLD command hides the source text at the program block
level. Folded program text is displayed as if the program block was empty. When the
folded block is unfolded, the hidden program text reappears. All text is folded once or (*)
completely, until there are no more folded parts.
Usage
FOLD [*]
Where * means fold completely, otherwise fold only one level.
Components
Source component.
Example:
in>FOLD *
FONT
FONT sets the font type, size and color.
Equivalent Operation
The Font dialog box is available by selecting the Component > Fonts menu entry.
Usage
FONT ‘FontName’ [size][color]
Components
Debugger engine.
Example:
FONT ‘Arial’ 8 BLUE
The font type is Arial, 8 points and blue.
FOR
The FOR loop allows you to execute all commands up to the trailing ENDFOR a
predefined number of times. The bounds of the range and the optional steps are evaluated
at the beginning. A variable (either a symbol or a program variable) may be optionally
specified, which is assigned to all values of the range that are met during execution of the
for loop. If a variable is used, it must be defined before executing the FOR command,
with a DEFINE command.
Assignment happens immediately before comparing the iteration value with the upper
bound. The variable is only a copy of the internal iteration value, therefore modifications
on the variable don't have an impact on the number of iterations.
This command can be stopped by pressing the Esc key.
Usage
FOR[variable =]range [“,” step]
Where variable is the name of a defined variable.
range: This is an address range constant that specifies addresses to be
disassembled.
step: constant number matching the step increment of the loop.
Components
Debugger engine.
Example:
DEFINE loop = 0
FOR loop = 1..6,1
T
ENDFOR
The T Trace command is performed six times.
FPRINTF
FPRINTF is the standard ANSI C command: Writes formatted output string to a file.
Usage
FPRINTF (<filename>, <&format>, <expression>,
<expression>, ...)
Components
Debugger engine.
Example:
fprintf (test.txt,"%s %2d","The value of the counter
is:",counter)
The content of the file test.txt is: The value of the counter is: 25
FRAMES
In the SoftTrace component, the FRAMES command sets the maximum number of
frame records.
Usage
FRAMES number
Where number is a decimal number, which is the maximum number of recorded
frames. This number must not exceed 1000000.
Components
SoftTrace component.
Example:
FRAMES 10000
G
The G command starts code execution in the emulated system at the current address in the
program counter or at the specified address. You can therefore specify the entry point of
your program, skipping execution of the previous code.
Usage
G [address]
When no address is entered, the address in the program counter is not altered and
execution begins at the address in the program counter.
Alias
GO
Components
Debugger engine.
Example:
G 0x8000
Program execution is started at 0x8000. RUNNING is displayed in the status bar.
The application runs until a breakpoint is reached or you stop the execution.
GO
The GO command starts code execution in the emulated system at the current address in
the program counter or at the specified address. You can therefore specify the entry point
of your program, skipping execution of previous code.
Usage
GO [address]
When no address is entered, the address in the program counter is not altered and
execution begins at the address in the program counter.
Alias
G
Components
Debugger engine.
Example:
in>GO 0x8000
Program execution is started at address 0x8000. RUNNING is displayed in the
status bar. The application runs until a breakpoint is reached or you stop execution.
GOTO
The GOTO command diverts execution of the command file to the command line that
follows the Label. The Label must be defined in the current command file. The GOTO
command fails, if the Label is not found. A label can only be followed on the same line by
a comment.
Usage
GOTO Label
Components
Debugger engine.
Example:
GOTO MyLabel
...
...
MyLabel: // comments
When the instruction GOTO MyLabel is reached, the program pointer jumps to
MyLabel and follows program execution from this position.
GOTOIF
The GOTOIF command diverts execution of the command file to the command line that
follows the label if the condition is true. Otherwise, the command is ignored. The
GOTOIF command fails, if the condition is true and the label is not found.
Usage
GOTOIF condition Label
where condition is same as defined in “C” language.
Components
Debugger engine.
Example:
DEFINE jump = 0
...
DEFINE jump = jump + 1
...
GOTOIF jump == 10 MyLabel
T
...
MyLabel: // comments
The program pointer jumps to MyLabel only if jump equals 10. Otherwise, the next
instruction (T Trace command) is executed.
GRAPHICS
In the Profiler component, GRAPHICS switches the percentages display in the graph bar
on/off.
Usage
GRAPHICS on|off
Components
Profiler component.
Example:
in>GRAPHICS off
HELP
In the Command line component, the HELP command displays all available commands.
Subcommands from the ATTRIBUTES command are not listed.
Component specific commands, which are not open, are not listed.
Usage
HELP
Components
Debugger engine.
Example:
in>HELP
HI-WAVE Engine:
VER
LF
NOLF
CR
NOCR
....
IF
The conditional commands (IF, ELSEIF, ELSE and ENDIF) allow you to execute
different sections depending on the result of the corresponding condition. The conditional
command may be nested. Conditions of the IF and ELSEIF commands, respectively,
guard all commands up to the next ELSEIF, ELSE or ENDIF command on the same
nesting level. The ELSE command guards all commands up to the next ENDIF command
on the same nesting level. Any occurrence of a subcommand not in sequence of “IF, zero
or more ELSEIF, zero or one ELSE, ENDIF” is an error.
Usage
IF condition
Where condition is same as defined in “C” language.
Components
Debugger engine.
Example:
DEFINE jump = 0
...
DEFINE jump = jump + 1
...
IF jump == 10
T
DEFINE jump = 0
ELSEIF jump == 100
DEFINE jump = 1
ELSE
DEFINE jump = 2
ENDIF
The jump = = 10 condition is evaluated and depending on the test result, the T
Trace instruction is executed, or the ELSEIF jump = = 100 test is evaluated.
INSPECTOROUTPUT
The Inspector dumps the content of the specified item and all computed subitems to the
command window. Uncomputed subitems are not printed. To compute all information, the
ATTRIBUTES EXPAND command is used.
Usage
INSPECTOROUTPUT [name {subname}]
The name specifies any of the root items. The subname specifies a recursive path
to subitems.
If a name contains a space, it must be surrounded by double quotes (").
Components
Inspector component.
Example:
in>loadio swap
in>Inspect<ATTRIBUTES EXPAND 3
in>INSPECTOROUTPUT “Object Pool” Swap
Swap
* Name Value Address Init...
- IO_Reg_1 0x0 0x1000 0x0 ...
- IO_Reg_2 0x0 0x1001 0x0 ...
INSPECTORUPDATE
The Inspector displays various information. Some types of information are automatically
updated. To make sure that displayed values correspond to the current situation, the
INSPECTORUPDATE command updates all information.
Usage
INSPECTORUPDATE
Components
Inspector component.
Example:
in>INSPECTORUPDATE
LF
The LF command initiates logging of commands and responses to an external file or
device. While logging remains in effect, any line that is appended to the command
window is also written to the log file.
Logging continues until a close log file (NOLF) command is executed. When the LF
command is entered with no filename, the Open File dialog box is displayed to specify a
filename.
Use the logging option (LOG) command to specify information to be logged.
If a path is specified in the file name, this path must be a valid path. When a relative path
is specified, ensure that the path is relative to the project directory.
Usage
LF [fileName][;A]
fileName is a DOS filename that identifies the file or device where the log is
written. The command interpreter does not assume a filename extension.
;A opens the file in append mode. Logged lines are appended at the end of an
existing log file.
If the ;A option is omitted and fileName is an existing file, the file is cleared before
logging begins.
Components
Debugger engine.
Example
in>lf /mcuez/demo/logfile.txt ;A
The logfile.txt file is opened as a Log File in “append” mode.
NOTE If no path is specified, the destination directory is the current project directory.
LOAD
The LOAD command loads a framework application (.abs file) for a debugging session.
When no application name is specified, the LoadObjectFile dialog box is opened.
If no target is installed, the following error message appears:
Error: no target is installed
If no target is connected, the following error message appears:
Error: no target is connected
Usage
LOAD[applicationName] [CODEONLY|SYMBOLSONLY]
[NOPROGRESSBAR] [NOBPT] [NOXPR] [NOPRELOADCMD]
[NOPOSTLOADCMD] [VERIFYFIRST|VERIFYALL|VERIFYONLY]
[AUTOERASEANDFLASH] [NORUNAFTERLOAD|RUNANDSTOPAFTERLOAD
= functionName|RUNAFTERLOAD] [DELAY] [ADD_SYMBOLS]
Where:
• applicationName is the name of the application to load
• CODEONLY and SYMBOLSONLY loads only the code or symbols
• NOPROGRESSBAR loads the application without progress bar
• NOBPT loads the application without loading breakpoints file (with BPT
extension)
• NOXPR loads the application without playing Expression file (with XPR
extension)
• NOPRELOADCMD loads the application without playing PRELOAD file
• NOPOSTLOADCMD loads the application without playing POSTLOAD file
• DELAY loads the application and waits one second
• VERIFYFIRST matches the "First bytes only" code verification option.
• VERIFYALL matches the "All bytes" code verification option.
• VERIFYONLY matches the "Read back only" code verification option.
• RUNAFTERLOAD runs application after loading
• RUNANDSTOPAFTERLOAD runs application after loading and set
temporary breakpoint at the specified function
• functionName is the name of the function to set temporary breakpoint at
• NORUNAFTERLOAD doesn't run application after loading (default)
Components
Debugger engine.
Example:
LOAD FIBO.ABS
The FIBO.ABS application is loaded.
NOTE If no path is specified, the destination directory is the current project directory.
LOADCODE
This command loads code into the target system. This command can be used if no
debugging is needed. If no target is installed, the following error message is displayed:
“Error: no target is installed”
If no target is connected, the following error message is displayed:
“Error: no target is connected”
Usage
LOADCODE [applicationName]
Components
Debugger engine.
Example:
LOADCODE FIBO.ABS
Code of the FIBO.ABS application is loaded.
NOTE If no path is specified, the destination directory is the current project directory.
LOADSYMBOLS
This command is similar to the LOAD command but only loads debugging information
into the debugger. This can be used if the code is already loaded into the target system or
programmed into a non-volatile memory device.
If no target is installed, the following error message is displayed:
“Error: no target is installed”
If no target is connected, the following error message is displayed:
“Error: no target is connected”
Usage
LOADSYMBOLS [applicationName]
Components
Debugger engine.
Example:
LOADSYMBOLS FIBO.ABS
Debugging information of the FIBO.ABS application is loaded. If no path is
specified, the destination directory is the current project directory.
LOG
The LOG command enables or disables logging of information in the Command Line
component window (and to logfile, when it as been opened with an LF command). If
LOG is not used, all types are ON by default i.e. all information is logged in the
Command Line component and log file.
NOTE RESPONSES: Responses are results of commands. For example, for the DB
command, the displayed memory dump is the response of the command.
Protocol messages are not responses.
ERRORS: Errors are displayed in red in Command Line component. Protocol
messages are not errors.
NOTICES: Notices are displayed in green in the Command Line.
Usage
LOG type [=] state {[,] type [=] state}
Where type is one of the following types:
CMDLINE: Commands entered on the command line.
CMDFILE: Commands read from a file.
RESPONSES: Command output response.
ERRORS: Error messages.
NOTICES: Asynchronous event notices, such as breakpoints.
Where state is on or off.
state is the new state of type:
• When ON, enables logging of the type.
• When OFF, disables logging of the type.
Components
Debugger engine.
Example:
LOG ERRORS = OFF, CMDLINE = on
Error messages are not recorded in the Log File. Commands entered in the
Command Line component window are recorded.
Example 1:
When executing the following command file:
define truth = 1
IF truth
bckcolor blue
at 2000 bckcolor white
else
bckcolor yellow
at 1000 bckcolor white
ENDIF
The following log file is generated:
!define truth = 1
!IF truth
! bckcolor blue
! at 2000 bckcolor white
!else
!- bckcolor yellow
!- at 1000 bckcolor white
!ENDIF
When commands executed from a command file are logged, all executed
commands that are in the FOR loop are logged the number of times they have been
executed. That is, a command file executed with the CF or CALL command
without the NL option and with the CMDFILE flag of the LOG command set to
TRUE.
Example 2:
When executing the following file:
define i = 1
FOR i = 1..3
ls
ENDFOR
The following log file is generated:
!define i = 1
!FOR i = 1..3
! ls
i 0x1 (1)
!ENDFOR
! ls
i 0x2 (2)
!ENDFOR
! ls
i 0x3 (3)
!ENDFOR
When commands executed from a command file are logged, all executed
commands that are in the WHILE loop are logged the number of times they have
been executed. That is, a command file executed with the CF or CALL command
without the NL option and with the CMDFILE flag of the LOG command set to
TRUE.
Example 3:
When executing the following file:
define i = 1
WHILE i < 3
define i = i + 1
ls
ENDWHILE
The following log file is generated:
!define i = 1
!WHILE i < 3
! define i = i + 1
! ls
i 0x2 (2)
!ENDWHILE
! define i = i + 1
! ls
i 0x3 (3)
!ENDWHILE
When commands executed from a command file are logged, all executed
commands that are in the REPEAT loop are logged the number of times they have
been executed. That is, a command file executed with the CF or CALL command
without the NL option and with the CMDFILE flag of the LOG command set to
TRUE.
Example 4:
When executing the following file:
define i = 1
REPEAT
define i = i + 1
ls
UNTIL i == 4
The following log file is generated:
repeat
until condition
!define i = 1
!REPEAT
! define i = i + 1
! ls
i 0x2 (2)
!UNTIL i == 4
! define i = i + 1
! ls
i 0x3 (3)
!UNTIL i == 4
! define i = i + 1
! ls
i 0x4 (4)
!UNTIL i == 4
LS
In the Command Line window, the LS command lists the values of symbols defined in the
symbol table and by the user. There is no limit to the number of symbols that can be listed.
The size of memory determines the symbol table size. Use the DEFINE command to
define symbols, and the UNDEF command to delete symbols.
The symbols that are listed with the LS command are split in two parts: Applications
Symbols and User Symbols.
Usage
LS [symbol | *][;C|S]
Where symbol is a restricted regular expression that specifies the symbol whose
values are to be listed.
* specifies to list all symbols.
;C specifies to list symbols in canonical format, which consists of a DEFINE
command for each symbol.
;S specifies to list symbol table statistics following the list of symbols.
Components
Debugger engine.
Example:
in>ls
User Symbols:
j 0x2 (2)
Application Symbols:
counter 0x80 (128)
fiboCount 0x81 (129)
j 0x83 (131)
n 0x84 (132)
fib1 0x85 (133)
fib2 0x87 (135)
fibo 0x89 (137)
Fibonacci 0xF000 (61440)
Entry 0xF041 (61505)
MEM
The MEM command displays a representation of the current system memory map and
lower and upper boundaries of the internal module that contains the MCU registers.
Usage
MEM
Components
Debugger engine.
Example:
in>mem
Type Addresses Comment
-------------------------------------------------------
IO 0.. 3F PRU or TOP TOP board resource or the PRU
NONE 40.. 4F NONE
RAM 50.. 64F RAM
NONE 650.. 7FF NONE
EEPROM 800.. A7F EEPROM
NONE A80..3DFF NONE
ROM 3E00..FDFF ROM
IO FE00..FE1F PRU or TOP TOP board resource or the PRU
NONE FE20..FFDB NONE
ROM FFDC..FFFE ROM
COP FFFF..FFFF special ram for cop
RT MEM 0.. 3FF (enabled)
-------------------------------------------------------
MS
The MS command sets a specified block of memory to a specified list of byte values.
When the range is wider than the list of byte values, the list of byte values is repeated as
many times as necessary to fill the memory block.
When the range is not an integer multiple of the length of the list, the last copy of the list
is truncated appropriately. This command is identical to the write bytes (WB) command.
Usage
MS range list
range: is an address range constant that defines the block of memory to be set to
the values of the bytes in the list.
list: is a list of byte values to be stored in the block of memory.
Components
• Debugger engine.
Example:
in>MS 0x1000..0x100F 0xFF
The memory range between addresses 0x1000 and 0x100F is filled with the 0xFF
value.
NB
Description
The NB command changes or displays the default number base for the constant values in
expressions. The initial default number base is 10 (decimal) and can be changed to 16
(hexadecimal), 8 (octal), 2 (binary) or reset to 10 with this command. The base is always
specified as a decimal constant.
Independent of the default base number, the ANSI C standard notation for constant is
supported inside an expression. That means that independent of the current number base
you can specify hexadecimal or octal constants using the standard ANSI C notation shown
in Table 34.6.
Usage
NB [base]
Where base is the new number base (2, 8, 10 or 16).
Components
Debugger engine.
Notation Meaning
Table Example:
0x2F00, /* Hexadecimal Constant */
043, /* Octal Constant */
255 /* Decimal Constant */
In the same way, the Assembler notation for constant is also supported. That
means that independent of the current number base you can specify hexadecimal,
octal or binary constants using the Assembler prefixes shown in Table 34.7.
Notation Meaning
Table Example:
$2F00, /* Hexadecimal Constant */
@43, /* Octal Constant */
%10011 /* Binary Constant */
When the default number base is 16, constants starting with a letter A, B, C, D, E
or F must be prefixed either by 0x or by $, as shown in Table 34.8. Otherwise, the
command line interpreter cannot detect if you are specifying a number or a symbol.
Notation Meaning
Table Example:
in>NB 16
The number base is hexadecimal.
NOCR
The NOCR command closes the current record file. The record file is opened with the CR
command.
Usage
NOCR
Components
Debugger engine.
Example:
in>NOCR
The current record file is closed.
NOLF
The NOLF command closes the current Log File. The log file is opened with the LF
command.
Usage
NOLF
Components
Debugger engine.
Example:
in>NOLF
The current Log File is closed.
OPEN
The OPEN command is used to open a window component.
Usage
OPEN "component" [x y width height][;I | ;MAX]
where:
• component is the component name with an optional path
• x is the X-axis of the upper left corner of the window component
• y is the Y-axis of the upper left corner of the window component
• width is the width of the window component
• height the height of the window component
When I is specified, the component window displays icons; when MAX is
specified, the component window is maximized.
Component names are: Assembly, Command, Coverage, Data, Inspect, IO_Led,
Led, Memory, Module, Phone, Procedure, Profiler, Recorder, Register, SoftTrace,
Source, Stimulation.
Components
Debugger engine.
Example:
in>OPEN Terminal 0 78 60 22
The Terminal component and window is opened at specified positions and with
specified width and height.
OUTPUT
With OUTPUT, you can redirect the Coverage component results to an output file
indicated by the path and file name.
Usage
OUTPUT FileName
Where FileName is file name (path + name).
Components
Coverage component.
Example:
in>coverage < OUTPUT c:\Program
Files\Freescale\myfile.txt
The Coverage output results are redirected to the file myfile.txt from the
directory C:\Program Files\Freescale.
P
The P command executes a CPU instruction, either at a specified address or at the current
instruction, (pointed to by the program counter). This command traces through subroutine
calls, software interrupts, and operations involving the following instructions (two are
target specific):
• Branch to SubRoutine (BSR)
• Long Branch to Subroutine (LBSR)
• Jump to Subroutine (JSR)
• Software Interrupt (SWI)
• Repeat Multiply and Accumulate (RMAC)
For example: if the current instruction is a BSR instruction, the subroutine is executed,
and execution stops at the first instruction after the BSR instruction. For instructions that
are not in the above list, the P and T commands are equivalent.
When the instruction specified in the P command has been executed, the software displays
the content of the CPU registers, the instruction bytes at the new value of the program
counter and a mnemonic disassembly of that instruction.
Usage
P [address]
address: is an address constant expression, the address at which execution begins.
If address is omitted, execution begins with the instruction pointed to by the
current value of the program counter.
Components
Debugger engine.
Example:
in>p
A=0x0 HX=0x450 SR=0x70 PC=0xF04E SP=0xFF
00F04E 94 TXS
STEPPED
Contents of registers are displayed and the current instruction is disassembled.
PAUSETEST
Displays a modal message box, shown in Figure 34.1, for testing purposes.
Usage
PAUSETEST
Components
Debugger engine.
Example:
in> pausetest
PRINTF
The PRINTF is the standard ANSI C command: Prints formatted output to the standard
output stream.
Usage
PRINTF (“[Text ]%format specification” , value)
Components
Debugger engine.
Example
in>PRINTF("The value of the counter is: %d", counter)
The output is: The value of the counter is: 2
PTRARRAY
The PTRARRAY command allows the user to specify a pointer to display as an array.
Usage
PTRARRY on|off [nb]
Where:
• on displays pointers as arrays.
• off displays pointers as usual (*pointer).
• nb is the number of elements to display in the array when unfolding a pointer
displayed as array.
Components
Data component.
Example:
in>Ptrarray on 5
Display content of pointers as array of five items.
RD
The RD command displays the content of specified registers. The display of a register
includes both the name and hexadecimal representation. If the specified register is not a
CPU register, then it looks for this register in a register file as an I/O register. This file is
called: MCUIxxxx.REG (where xxxx is a number related to the MCU).
NOTE This command is processor/derivative specific and does not display banked
registers if the processor does not support banking.
Usage
RD { <list> | CPU | * }
where list is a list of registers to be displayed. Registers to be displayed are
separated by a space. When RD CPU is specified, all CPU registers are displayed.
If no CPU is loaded, No CPU loaded is displayed as an error message.
When * is specified, the RD command lists the content of the register file that is
currently loaded. If no register file is loaded, following error message is displayed:
No register file loaded.
When there is no parameter, the previous RD command is processed again. If there
is no previous RD command, all CPU registers are displayed.
If list is omitted, the list and any other parameters of the previous RD command
are used.
For the first RD command of a session, all CPU registers are displayed.
Components
Debugger engine.
Example 1:
in>rd a hx
A=0x14
HX=0x2
Example 2:
in>rd cpu
A=0x0 HX=0x450 SR=0x70 PC=0xF04E SP=0xFF
RECORD
In the SoftTrace component, the RECORD command switches frame recording on / off
while the target is running.
Usage
RECORD on|off
Components
SoftTrace component.
Example:
in>RECORD on
REPEAT
The REPEAT command allows you to execute a sequence of commands until a specified
condition is true. The REPEAT command may be nested.
Press the Esc key to stop this command.
Usage
REPEAT
Components
Debugger engine.
Example:
DEFINE var = 0
...
REPEAT
DEFINE var = var + 1
...
UNTIL var == 2
The REPEAT-UNTIL loop is identical to the ANSI C loop. The operation
DEFINE var = var + 1 is done twice, then var = = 2 and the loop ends.
RESET
In the Profiler and Coverage component, the RESET command resets all recorded
frames (statistics).
In the SoftTrace component, the RESET command resets statistics and recorded frames.
NOTE Make sure that the RESET command is redirected to the correct component.
Targets also have their own RESET command and if RESET is not redirected,
the target is reset.
Usage
RESET
Components
Profiler and Coverage.
Example:
in>Profiler < RESET
RESTART
Resets execution to the first line of the current application and executes the application
from this point.
Usage
RESTART
Components
Engine component.
Example
in>RESTART
After the RESTART command, the cycle counter is initialized to zero.
RETURN
The RETURN command terminates the current command processing level (returns from
a CALL command). If executed within a command file, control is returned to the caller of
the command file (i.e. the first instance that did not chain execution).
Usage
RETURN
Components
Debugger engine.
Example:
In file d:\demo\cmd1.txt:
...
CALL d:\demo\cmd2.txt
T
...
In file d:\demo\cmd2.txt
...
...
RETURN // returns to the caller
The command file cmd1.txt calls a second command file cmd2.txt. It is so
necessary to insert the RETURN instruction to return to the caller file. Then the T
Trace instruction is executed.
RS
The RS command assigns new values to specified registers. The RS mnemonic is
followed by register name and new value(s).
An equal sign (=) may be used to separate the register name from the value to be assigned
to the register; otherwise they must be separated by a space. The contents of any number
of registers may be set using a single RS command. If the specified register is not a CPU
register, then the register is searched in a register file as an I/O register. This file is called:
MCUIxxxx.REG (where xxxx is a number related to the MCU).
Usage
RS register[=]value{,register[=]value}
register: Specifies the name of a register to be changed. String register is any of
the CPU register names, or name of a register in the register file.
value: is an integer constant expression (in ANSI format representation).
Components
Debugger engine.
Example:
in>rs a=0xff hx=0x7fff
S
The S command stops execution of the emulation processor. Use the Go G command to
start the emulator.
Usage
S
Alias
STOP
Components
Debugger engine.
Example:
in>s
STOPPING
HALTED
Current application debugging is stopped/halted.
SAVE
The SAVE command saves a specified block of memory to a specified file in Freescale S-
record format. The memory block can be reloaded later using the load S-record (SREC)
command.
NOTE If no path is specified, the destination directory is the current project directory.
Usage
SAVE range fileName [offset][;A]
offset: an optional offset to add or subtract from addresses when writing S-records.
The default offset is 0.
;A: appends the saved S-records to the end of an existing file. If this option is
omitted, and the file specified by fileName exists, the file is cleared before saving
the S-records.
Components
Debugger engine.
Example:
in>SAVE 0x1000..0x2000 DUMP.SX ;A
The memory range 0x1000...0x2000 is appended to the DUMP.SX file.
SAVEBP
The SAVEBP command saves all breakpoints of the currently loaded .ABS file into the
matching breakpoints file. Also, the matching file has the name of the loaded .ABS file
but its extension is .BPT. (For example, the Fibo.ABS file has a breakpoint file called
FIBO.BPT. This file is generated in the same directory as the .ABS file, when the user
quits the Simulator/Debugger or loads another .ABS file.)
If on is set, SAVEBP stores all breakpoints defined in the current application in the
matching .BPT file.
If off is set, SAVEBP does not store all breakpoints defined in the current application in
the matching .BPT file.
This command is only used in .BPT files and is related to the checkbox Save & Restore
on load in the Controlpoints Configuration Window. It is used to store currently defined
breakpoints (SAVEBP on) when the user quits the Simulator/Debugger or loads another
.ABS file.
NOTE For more information about this syntax, refer to BS command and to the
Control Points chapter.
Usage
SAVEBP on|off
Components
Debugger engine.
Example:
Content of the FIBO.BPT file
savebp on
BS &fibo.c:Fibonacci+19 P E; cond = "fibo > 10" E; cdSz
= 47 srSz = 0
BS &fibo.c:Fibonacci+31 P E; cdSz = 47 srSz = 0
BS &fibo.c:main+12 P E; cdSz = 42 srSz = 0
BS &fibo.c:main+21 P E; cond = "fiboCount==5" E; cmd =
"Assembly < spc 0x800" E; cdSz = 42 srSz = 0
SET
Sets a new current target for the debugger by loading the targetName component.
Usage
SET targetName
where targetName is name without extension of the target to set.
Components
Debugger engine.
Example:
in>SET Sim
The debugger’s current target is Simulator.
SETCOLORS
The SETCOLORS command is used to change the colors for a specific channel from the
Monitor component.
Usage
SETCOLORS ( "Name" ) ( Background) ( Cursor ) ( Grid
) ( Line ) ( Text )
Name is the name of the channel to modify.
Background is the new color for the channel background (the format is:
0x00bbggrr).
Cursor is the new color for the channel cursor (the format is: 0x00bbggrr).
Grid is the new color for the channel grid (the format is: 0x00bbggrr).
Line is the new color for the channel lines (the format is: 0x00bbggrr).
Text is the new color for the channel text (the format is: 0x00bbggrr).
Components
Monitor component.
Example:
in>SETCOLORS "Leds.Port_Register bit 0" 0x00123456
0x00234567 0x00345678 0x00456789 0x00567891
This changes the color attributes from the channel Leds.Port_Register bit 0
to the new values.
SLAY
The SLAY command is used to save the layout of all window components in the main
application window to a specified file.
NOTE Layout files usually have a .HWL extension. However, you can specify any file
extension.
NOTE If no path is specified, the destination directory is the current project directory.
Usage
SLAY fileName
Components
Debugger engine.
Example:
in>slay /hiwave/demo/mylayout.hwl
The current debugger layout is saved to the mylayout.hwl file in the
/hiwave/demo directory.
SLINE
With the SLINE command, a line of the source file is made visible. If the line is not
currently visible, the source scrolls so that it appears on the first line. If the line is currently
in a folded part, it is unfolded so that it becomes visible.
NOTE The given line number must be between 1 and number of lines in source file, or
else an error message is displayed.
Usage
SLINE line number
Components
Source component
Example:
in>sline 15
SMEM
In the Source component, the SMEM command loads the corresponding module’s
source text, scrolls to the corresponding text location (the code address) and highlights the
statements that correspond to this code address range.
In the Assembly component, the SMEM command scrolls the Assembly component,
shows the location (the assembler address) and select/highlights the memory lines of the
address range given as the parameter.
In the Memory component, the SMEM command scrolls the memory dump component,
shows the locations (the memory address) of the address range given as the parameter.
Usage
SMEM range
Components
Source, Assembly and Memory components.
Example:
in>Memory < SMEM 0x8000,8
The Memory component window is scrolled and specified memory addresses are
highlighted.
SMOD
In the Source component, the SMOD command loads/displays the corresponding
module’s source text. If the module is not found, a message is displayed in Command Line
window.
In the Data component, the SMOD command loads the corresponding module’s global
variables.
In the Memory component, the SMOD command scrolls the memory dump component
and highlights the first global variable of the module.
NOTE Correct module names are displayed in the Module component window. Make
sure that the module name of your command is correct. If the.abs is in
HIWARE format, some debug information is in the object file (.o), and
module names have a .o extension (e.g., fibo.o). In ELF format, module
name extensions are .c, .cpp or .dbg (.dbg or program sources in
Usage
SMOD module
Where module is the name of a module taking part of the application. Do not
include a path in the module name. The module extension (i.e., .DBG for assembly
sources or .C for C sources) must be specified.
The module name is searched in the directories associated with the GENPATH
environment variable. An error message is displayed:
• If the module specified does not take part of the current application loaded.
• If no application is loaded.
Components
Data, Memory and source components.
Example:
in>Data:1 < SMOD fibo.c
Global variables found in the fibo.c module are displayed in the Data:1
component window.
SPC
In the Source component, the SPC command loads the corresponding module’s source
text, scrolls to the corresponding text location (the code address) and highlights the
statement that corresponds to this code address.
In the Assembler component, the SPC command scrolls the Assembly component,
shows the location (the assembler address) and select/highlights the assembler instruction
of the address given as parameter.
In the Memory component, the SPC command scrolls the memory dump component,
shows the location (the memory address) of the address given as parameter.
Usage
SPC address
Components
Assembler, Memory and Source component.
Example:
in>Assembly < SPC 0x8000
The Assembly component window is scrolled to the address 0x8000 and the
associated instruction is highlighted.
SPROC
In the Data component, the SPROC command shows local variables of the
corresponding procedure stack level.
In the Source component, the SPROC command loads the corresponding module’s
source text, scrolls to the corresponding procedure and highlights the statement of this
procedure that is in the procedure chain.
level = 0 is the current procedure level. level = 1 is the caller stack level and so on.
NOTE When a procedure of a level greater than 0 is given as parameter to the SPROC
command, the statement corresponding to the call of the lower procedure is
selected.
Usage
SPROC level
Components
Data and Source components.
Example:
in>Source < SPROC 1
This command displays the source code associated with the caller function in the
Source component window.
SREC
The SREC command initiates the loading of Freescale S-Records from a specified file.
NOTE If no path is specified, the destination directory is the current project directory.
Usage
SREC fileName [offset]
offset: is a signed value added to the load addresses in the file when loading the file
contents.
Components
Debugger engine.
Example:
in>SREC DUMP.SX
The DUMP.SX file is loaded into memory.
STEPINTO
The STEPINTO command single-steps through instructions in the program, and enters
each function call that is encountered.
NOTE This command works while the application is paused in break mode (program
is waiting for user input after completing a debugging command).
Usage
STEPINTO
Components
Debugger engine.
Example:
in>STEPINTO
STEP INTO
TRACED
TRACED in the status line indicates that the application is stopped by an assembly
step function.
STEPOUT
The STEPOUT command executes the remaining lines of a function in which the current
execution point lies. The next statement displayed is the statement following the
procedure call. All of the code is executed between the current and final execution points.
Using this command, you can quickly finish executing the current function after
determining that a bug is not present in the function.
NOTE This command works while the application is paused in break mode (program
is waiting for user input after completing a debugging command).
Usage
STEPOUT
Components
Debugger engine.
Example:
in>STEPOUT
STEP OUT
STARTED
RUNNING
STOPPED
STOPPED in the status line indicates that the application is stopped by a step out
function.
STEPOVER
The STEPOVER command executes the procedure as a unit, and then steps to the next
statement in the current procedure. Therefore, the next statement displayed is the next
statement in the current procedure regardless of whether the current statement is a call to
another procedure.
NOTE This command works while the application is paused in break mode (program
is waiting for user input after completing a debugging command).
Usage
STEPOVER
Components
Debugger engine.
Example:
in>STEPOVER
STEP OVER
STARTED
RUNNING
STOPPED
STEPPED OVER (or STOPPED) in the status line indicates that the application is
stopped by a step over function.
STOP
The STOP command stops execution of the emulation processor. Use the Go G command
to start the emulator.
Usage
STOP
Alias
S
Components
Debugger engine.
Example:
in>STOP
STOPPING
HALTED
Current application debugging is stopped.
T
The T command executes one or more instructions at a specified address, or at the current
address (the address in the program counter). The T command traces into subroutine calls
and software interrupts. For example, if the current instruction is a Branch to Subroutine
instruction (BSR), the BSR is traced, and execution stops at the first instruction of the
subroutine. After executing the last (or only) instruction, the T command displays the
contents of the CPU registers, the instruction bytes at the new address in the program
counter and a mnemonic disassembly of the current instruction.
This command can be stopped by typing the Esc key.
Usage
T [address][,count]
address: is an address constant expression, the address where execution begins. If
address is omitted, the instruction pointed to by the current value of the program
counter is the first instruction traced.
count: is an integer constant expression, in the decimal integral interval [1, 65535],
that specifies the number of instructions to be traced. If count is omitted, one
instruction is traced.
Components
Debugger engine.
Example:
in>T 0xF030
TRACED
A=0x0 HX=0x7F02 SR=0x62 PC=0xF032 SP=0x44D
TESTBOX
Displays a modal message box shown in Figure 34.2 with a given string.
Usage
TESTBOX "<String>"
Components
Debugger engine.
Example:
in>TESTBOX "Step 1: init all vars"
TUPDATE
In Profiler and Coverage components, the TUPDATE command switches the time
update feature on/ off.
Usage
TUPDATE on|off
Components
Profiler and Coverage components.
Example:
in>TUPDATE on
UNDEF
The UNDEF command removes a symbol definition from the symbol table. This
command does not undefine the symbols defined in the loaded application.
Program variables whose names were redefined using the UNDEF command are visible
again. Undefining an undefined symbol is not considered an error.
Usage
UNDEF symbol | *
If * is specified, all symbols defined previously using the command DEFINE are
undefined.
Components
Debugger engine.
Example:
DEFINE test = 1
...
UNDEF test
When the test variable is no longer needed in a command program, it can be
undefined and removed from the list of symbols. After UNDEF test, the test
variable can no longer be used without (re)defining it.
Examples:
The value of an existing symbol can be changed by applying the DEFINE
command again. In this case, the previous value is replaced and lost. It is not put on
a stack. Then when UNDEF is applied to the symbol, it no longer exists, even if the
value of the symbol has been replaced several times:
in>DEFINE apple 0
in>LS
apple 0x0 (0) // apple is equal to 0
in>DEFINE apple = apple + 1
in>LS
apple 0x1 (1) // apple is equal to 1
in>DEFINE apple = apple + 1
in>LS
apple 0x2 (2) // apple is equal to 2
in>UNDEF apple
in>LS
// apple no longer exists
In the next example, we assume that the FIBO.ABS sample is loaded. At the
beginning, no user symbol is defined:
in>UNDEF *
in>LS
User Symbols: // there is no user symbol
Application Symbols: // symbols of the loaded
application
fiboCount 0x800 (2048)
counter 0x802 (2050)
_startupData 0x84D (2125)
Fibonacci 0x867 (2151)
main 0x896 (2198)
Init 0x810 (2064)
_Startup 0x83D (2109)
in>DEFINE counter = 1
in>LS
User Symbols: // there is one user symbol: counter
counter 0x1 (1)
Application Symbols: // symbols of the loaded application
fiboCount 0x800 (2048)
counter 0x802 (2050)
_startupData 0x84D (2125)
Fibonacci 0x867 (2151)
main 0x896 (2198)
Init 0x810 (2064)
_Startup 0x83D (2109)
in>undef counter
in>LS
User Symbols: // there is no user symbol
Application Symbols: // symbols of the loaded application
fiboCount 0x800 (2048)
counter 0x802 (2050)
_startupData 0x84D (2125)
Fibonacci 0x867 (2151)
main 0x896 (2198)
Init 0x810 (2064)
_Startup 0x83D (2109)
UNFOLD
In the Source component, the UNFOLD command is used to display the contents of
folded source text blocks, for example, source text that has been collapsed at program
block level. All text is unfolded once or (*) completely, until no more folded parts are
found.
Usage
UNFOLD [*]
Where * means unfolding completely, otherwise unfolding only one level.
Components
Source component.
Example:
in>UNFOLD *
UNTIL
The UNTIL keyword is associated with the REPEAT command.
Usage
UNTIL condition
Where condition is defined as in “C” language definition.
Components
Debugger engine.
Example:
repeat
open assembly
wait 20
define i = i + 1
until i==3
At the end of the loop, i = 3.
UPDATERATE
In the Data component and Memory component, the UPDATERATE command is used
to set the data refresh update rate. This command only has an effect if the Data or Memory
component to which it applies is set in Periodical Mode.
Usage
UPDATERATE rate
where rate is a constant number matching a quantity of time in tenths of a second,
between 1 and 600 tenth of second (0.1 to 60 seconds).
Components
• Data and Memory component.
Example:
in>Memory < updaterate 30
This commands sets the Memory component updaterate to 3 seconds.
VER
The VER command displays the version number of the Debugger engine and components
currently loaded in the Command line window.
Usage
VER
Components
Debugger engine.
Example:
in>ver
HI-WAVE 6.0.27
HI-WAVE Engine 6.0.49
Source 6.0.20
Assembly 6.0.14
Procedure 6.0.10
Register 6.0.14
Memory 6.0.19
Data 6.0.27
Data 6.0.27
Simulator Target 6.0.17
Command Line 6.0.16
In the Command Line component window, Debugger engine and components
versions are displayed.
WAIT
The WAIT command pauses command file execution for a time in tenths of second or
pauses until the target is halted when the option “;s” is set.
When no parameter is specified, it pauses for 50 tenths of a second (5 seconds).
When only time is specified, execution of the command file is halted for the specified
time.
When only ;s is specified, execution of the command file is halted until the target is
halted. If the target is already halted, command file execution is not halted.
When time and ;s are specified:
If the target is running, command file execution is halted for the specified time only if the
target is not halted. If the target is halted during the specified period of time (while
command file execution is pending), the time delay is ignored and the command file is
run.
If the target is already halted, command file execution is not halted (time delay is ignored).
Usage
WAIT [time] [;s]
Components
Debugger engine.
Example:
WAIT 100
T
...
Pauses for 10 seconds before executing the T Trace instruction.
WB
The WB command sets a specified block of memory to a specified list of byte values.
When the range is wider than the list of byte values, the list of byte values is repeated as
many times as necessary to fill the memory block. When the range is not an integer, a
multiple of the length of the list and the last copy of the list is truncated accordingly. This
command is identical to the memory set (MS) command.
Usage
WB range list
range: is an address range constant that defines the block of memory to be set to
the values of the bytes in the list.
list: is a list of byte values to be stored in the block of memory.
Alias
MS
Components
Debugger engine.
Example
in>WB 0x0205..0x0220 0xFF
This command fills up the memory range 0x0205..0x0220 with the 0xFF byte
value.
WHILE
The WHILE command allows you to execute a sequence of commands as long as a
certain condition is true. The WHILE command may be nested.
This command can be stopped by pressing the Esc key.
Usage
WHILE condition
Where condition is defined as in “C” language definition.
Components
Debugger engine.
Example:
DEFINE jump = 0
...
WHILE jump < 20
DEFINE jump = jump + 1
ENDWHILE
T
...
While jump < 100, the jump variable is incremented by the instruction DEFINE
jump = jump + 1. Then the loop ends and the T Trace instruction is executed.
WL
The WL command sets a specified block of memory to a specified list of longword values.
When the range is wider than the list of longword values, the list of longword values is
repeated as many times as necessary to fill the memory block. When the range is not an
integer or a multiple of the length of the list, the last copy of the list is truncated
accordingly.
When a size is specified in the range, this size represents the number of longwords to
modify.
Usage
WL range list
range: is an address range constant that defines the block of memory to be set to
the longword values in the list.
list: is a list of longword values to be stored in the block of memory.
Components
Debugger engine.
Example:
in>WL 0x2000 0x0FFFFF0F
This command fills up memory starting at address 0x2000 with the 0x0FFFFF0F
longword value, and modifies the addresses 0x2000 to 0x2003.
in>WL 0x2000, 2 0x0FFFFF0F
This command fills up the memory area 0x2000 to 0x2007 with the longword
value 0x0FFFFF0F.
WW
The WW command sets a specified block of memory to a specified list of word values.
When the range is wider than the list of word values, the list of word values is repeated as
many time as necessary to fill the memory block. When the range is not an integer or a
multiple of length of the list, the last copy of the list is truncated accordingly.
Usage
WW range list
range: is an address range constant that defines the block of memory to be set to
the word values in the list.
list: is a list of word values to be stored in the block of memory.
Components
Debugger engine.
Example:
in>WW 0x2000..0x200F 0xAF00
This command fills up the memory range 0x2000...0x200F with the 0xAF00 word
value.
ZOOM
In the Data component, the ZOOM command is used to display the member fields of
structures by ‘diving’ into the structure. In contrast to the UNFOLD command, where
member fields are not expanded in place. The display of the member fields replaces the
previous view. The ZOOM out command is used to return to the nesting level indicated
by the given identifier.
NOTE Addresses are not needed to zoom out. Simply type “ZOOM out”.
Usage
ZOOM address in|out
Where address is the address of the structure or pointer variable to zoom in or
zoom out, respectively.
Components
Data component.
Example:
in>ZOOM 0x1FE0 in
The variable structure located at address 0x1FE0 is zoomed in.
in>zoom &_startupData
zooms in the _startupData structure (&_startupData is the address of the
_startupData structure).
Debugger Environment
Various parameters of the Debugger may be set using environment variables. The syntax
is always the same:
Parameter = KeyName "=" ParamDef.
For example:
GENPATH=C:\INSTALL\LIB;D:\PROJECTS\TESTS;/usr/local/lib;/
home/me/my_project
The Debugger parameters may be defined in several ways:
• Using system environment variables supported by your operating system.
• Putting the definitions in a file called DEFAULT.ENV in the default directory.
• Putting definitions in a file given by the value of the system environment variable
ENVIRONMENT.
NOTE The default directory mentioned above can be set by using the system
environment variable DEFAULTDIR: Default Current Directory.
When looking for an environment variable, all programs first search the system
environment, then the DEFAULT.ENV file and finally the global environment file given
by ENVIRONMENT. If no definition can be found, a default value is assumed.
• If the tool is launched using a File Manager/Explorer, the current directory is the
location of the executable launched.
• If the tool is launched using an Icon on the Desktop, the current directory is the one
specified and associated with the Icon.
• If the tool is launched by dragging a file on the icon of the executable under
Windows 2000, the desktop is the current directory.
• If the tool is launched by another tool with its own current directory specified (for
example, WinEdit), the current directory is the one specified by the launching tool
(for example, current directory definition in WinEdit).
• For the Debugger tools, the current directory is the directory containing the local
project file. Changing the current project file also changes the current directory, if the
other project file is in a different directory. Note that browsing for a C file does not
change the current directory.
To overwrite this behavior, the environment variable DEFAULTDIR: Default Current
Directory may be used.
Example:
C:\WINDOWS\MCUTOOLS.INI
D:\INSTALL\PROG\MCUTOOLS.INI
If a tool is started in the D:\INSTALL\PROG\DIRECTORY, the project file in the same
directory as the tool is used (D:\INSTALL\PROG\MCUTOOLS.INI).
If the tool is started outside the D:\INSTALL\PROG directory, the project file in the
Windows directory is used (C:\WINDOWS\MCUTOOLS.INI).
NOTE For more information about MCUTOOLS.INI entries, see the compiler
manual.
[HI-WAVE]
Window0=Source 0 0 60 30
Window1=Assembly 60 0 40 30
Window2=Procedure 0 30 50 15
Window3=Terminal 0 45 50 15
Window4=Register 50 30 50 30
Window5=Memory 50 60 50 30
Window6=Data 0 60 50 15
Window7=Data 0 75 50 15
Target=Sim
Target: Specifies the target used when starting the Debugger (loads the file <target> with
a .tgt extension), for example, Target=Sim for HC(S)08 Freescale Full Chip Simulator,
or Target=Motosil, Target=Bdi.
Window<n>: Specifies coordinates of the windows that must be open when the Debugger
is started. The syntax for a window is:
Window<n>=<component> <XPos> <YPos> <width> <height>
where n is the index of the window. This index increments for each window and
determines the sequence in which windows open. In the case of overlapping windows, this
index determines which windows appear on top of other windows. Values for the index
must be in the range 0–99.
Component specifies the component type to open, for example, Source, Assembly.
XPos specifies the X coordinate of the top left corner of the component (in percentage
relative to the width of the main application client window).
YPos specifies the Y coordinate of the top left corner of the component (in percentage
relative to the height of the main application client window).
width specifies the width of the component (in percentage relative to the width of the
main application client window).
height specifies the height of the component (in percentage relative to the height of the
main application client window).
Example:
Window5=Memory 50 60 50 30
Window number 5 is a Memory component, its starting position is at: 50% from main
window width, 60% from main window height. Its width is 50% from main window width
and its height 30% from main window height.
Other Parameters
• It is possible to load a previously saved layout from a file by inserting the following
line in your PROJECT.INI file:
Layout=<LayoutName>
Where LayoutName is the name of the file describing the layout to be loaded, for
example, Layout=lay1.hwl
NOTE The layout path can be specified if the layout is not in the project directory.
• It is possible to load a previously saved project from a file by inserting the following
line in your PROJECT.INI file:
Project=<ProjectName>
where ProjectName is the name of the file describing the project to be loaded,
for example, Project=Proj1.hwc
NOTE The project path can be specified if the project is not in the project directory.
This option can be used for compatibility with the old .hwp format
(Project=oldProject.hwp) and opens as a new project file.
NOTE If Layout and Project are defined in PROJECT.INI, the Project parameter
overwrites the Layout parameter, also containing layout information.
MainFrame=<nbr.>,<nbr.>,<nbr.>,<nbr.>,<nbr.>,<nbr.>,
<nbr.>,<nbr.>,<nbr.>,<nbr.>
This variable is used to save and load the Debugger main window states: positions, size,
maximized, minimized, display icons when opened, etc. This entry is used for internal
purposes only.
• The toolbar, status bar, heading line, title bar and small border can be specified in the
default section:
– The toolbar can be shown or hidden with the following syntax:
Toolbar = (0 | 1)
If 1 is specified, the toolbar is shown, otherwise the toolbar is hidden.
– The status bar can be shown or hidden with the following syntax:
Statusbar = (0 | 1)
If 1 is specified, the status bar is shown, otherwise the toolbar is hidden.
– Title bars can be shown or hidden with the following syntax:
Hidetitle = (0 | 1)
If 1 is specified, the title bars are hidden, otherwise they are shown.
– The heading lines can be shown or hidden with the following syntax:
Hideheadlines = (0 | 1)
If 1 is specified, the heading lines are hidden otherwise they are shown.
– The border can be reduced with the following syntax:
Smallborder = (0 | 1)
If 1 is specified, borders are thin otherwise they are normal.
• The environment variable BPTFILE authorizes the creation of breakpoint files; they
may be enabled or disabled. All breakpoints of the currently loaded .abs file are
saved in a breakpoints file. BPTFILE may be ON (default) or OFF. When ON,
breakpoint files are created. When OFF, breakpoint files are not created.
BPTFILE =(On | Off)
Example:
GENPATH=C:\INSTALL\LIB;D:\PROJECTS\TESTS;/usr/local/hiwave/
lib;/home/me/my_project
If a directory name is preceded by an asterisk ("*"), the programs recursively search the
directory tree for a file, not just the given directory. Directories are searched in the order
they appear in the path list.
Example:
GENPATH=.\;*S;O
NOTE Some DOS environment variables (like GENPATH, LIBPATH, etc.) are used.
We strongly recommend working with WinEdit and setting the environment by means of a
DEFAULT.ENV file in your project directory. This project directory can be set in
WinEdit's Project Configure menu command. This way, you can have different projects in
different directories, each with its own environment.
NOTE When using WinEdit, do not set the system environment variable
Defaultdir. If you do and this variable does not contain the project
directory given in WinEdit’s project configuration, files might not be put
where you expect them.
Line Continuation
It is possible to specify an environment variable in an environment file (default.env/
.hidefaults) over multiple lines by using the line continuation character ‘\’:
Example:
OPTIONS=\
-W2 \
-Wpd
This is the same as:
OPTIONS=-W2 -Wpd
Be careful when using the line continuation character with paths. For example:
GENPATH=.\
TEXTFILE=.\txt
Results in:
GENPATH=.TEXTFILE=.\txt
To avoid such problems, use a semicolon’;’ at the end of a path, if there is a ‘\’ at the end:
GENPATH=.\;
TEXTFILE=.\txt
Environment Variables
The remainder of this section is devoted to describing each of the environment variables
available for the Debugger. The options are listed in alphabetical order and each is divided
into several sections described in Table 35.1.
Topic Description
Arguments Describes and lists optional and required arguments for the variable.
Description Provides a detailed description of the option and how to use it.
Example Gives an example of usage and effects of the variable where possible.
The examples show an entry in the default.env file for PC.
Tools
SmartLinker, Debugger
Synonym
None
Syntax
ABSPATH=" {<path>}.
Arguments
<path>: Paths separated by semicolons, without spaces.
Description
When this environment variable is defined, the SmartLinker stores the absolute files it
produces in the first directory specified. If ABSPATH is not set, the generated absolute
files are stored in the directory in which the parameter file was found.
Example:
ABSPATH=\sources\bin;..\..\headers;\usr\local\bin
Tools
Compiler, Assembler, Linker, Decoder, Librarian, Maker, Burner, Debugger.
Synonym
None.
Syntax
"DEFAULTDIR=" <directory>.
Arguments
<directory>: Directory specified as default current directory.
Default
None.
Description
With this environment variable the default directory for all tools may be specified. All
tools indicated above take the specified directory as their current directory instead of the
one defined by the operating system or launching tool (for example, editor).
Example:
DEFAULTDIR=C:\INSTALL\PROJECT
See also:
The Current Directory
Global Initialization File (MCUTOOLS.INI - PC Only)
Tools
Compiler, Linker, Decoder, Librarian, Maker, Burner, Debugger.
Synonym
HIENVIRONMENT
Syntax
"ENVIRONMENT=" <file>.
Arguments
<file>: file name with path specification, without spaces
Default
None.
Description
This variable has to be specified at the system level. Normally the application looks in the
The Current Directory for an environment file named default.env. Using
ENVIRONMENT (for example, set in the autoexec.bat for DOS), a different file
name may be specified.
Example:
ENVIRONMENT=\Freescale\prog\global.env
Tools
Compiler, Linker, Decoder, Burner, Debugger.
Synonym
HIPATH
Syntax
"GENPATH=" {<path>}.
Arguments
<path>: Paths separated by semicolons, without spaces.
Default
Current directory
Description
If a header file is included with double quotes, the Debugger searches in the current
directory, then in the directories given by GENPATH and finally in the directories given
by LIBRARYPATH: ‘include <File>’ Path.
Example:
GENPATH=\sources\include;..\..\headers;\usr\local\lib
See also:
Environment variable LIBPATH
Tools
Compiler, ELF tools (Burner, Linker, Decoder)
Synonym
LIBPATH
Syntax
"LIBRARYPATH=" {<path>}.
Arguments
<path>: Paths separated by semicolons, without spaces.
Default
Current directory
Description
If a header file is included with double quotes, the Compiler searches in the current
directory, then in the directories given by GENPATH: #include “File” Path and finally in
directories given by LIBRARYPATH: ‘include <File>’ Path.
Example:
LIBRARYPATH=\sources\include;..\..\headers;\usr\local\
lib
See also:
Environment variable GENPATH: #include “File” Path
Environment variable USELIBPATH: Using LIBPATH Environment Variable
Tools
Compiler, Linker, Decoder, Burner, Debugger.
Synonym
None.
Syntax
"OBJPATH=" <path>.
Default
Current directory
Arguments
<path>: Path without spaces.
Description
If a tool looks for an object file (for example, the Linker), then it first checks for an object
file specified by this environment variable, then in GENPATH: #include “File” Path and
finally in HIPATH.
Example:
OBJPATH=\sources\obj
Tools
Compiler, Assembler, Linker, Librarian, Debugger.
Synonym
None.
Syntax
"TMP=" <directory>.
Arguments
<directory>: Directory to be used for temporary files.
Default
None.
Description
If a temporary file has to be created, normally the ANSI function tmpnam() is used. This
library function stores the temporary files created in the directory specified by this
environment variable. If the variable is empty or does not exist, the current directory is
used. Check this variable if you get an error message “Cannot create temporary file”.
Example:
TMP=C:\TEMP
See also:
The Current Directory
Tools
Compiler, Linker, Debugger.
Synonym
None.
Syntax
"USELIBPATH=" ("OFF" | "ON" | "NO" | "YES")
Arguments
ON, YES: The environment variable LIBRARYPATH: ‘include <File>’ Path is
used to look for system header files <*.h>.
NO, OFF: The environment variable LIBRARYPATH: ‘include <File>’ Path is not
used.
Default
ON
Description
This environment variable allows a flexible usage of the LIBRARYPATH: ‘include
<File>’ Path environment variable, because LIBRARYPATH: ‘include <File>’ Path may
be used by other software (for example, version management PVCS).
Example:
USELIBPATH=ON
See also:
Environment variable LIBRARYPATH: ‘include <File>’ Path
Debugger Files
The Debugger comes with several program, application, configuration files and examples.
These files and file extensions are listed in the following table.
*.DLL A .DLL file that contains one or more functions compiled, linked,
and stored separately from the processes that use them. The
operating system maps the DLLs into the process's address space
when the process is starting up or while it is running. The process
then executes functions in the DLL. The DLL of the Debugger is
provided for supported library and extended functions.
*.MON Firmware loading file for loading a specified target, for example,
Firm0508.mon
Book IX Contents
Each section of the Debugger manual includes information to help you become more
familiar with the Debugger, to use all its functions and help you understand how to use the
environment.
This book is divided into the following chapters:
Book 9: Debugger Legacy
• Legacy PEDebug Target Interface
• Legacy Target Interfaces Removed
• HC(S)08 Full-Chip Simulator Components No Longer Supported
• Testterm
• Timer
• Wagon
• Winlift
X
X-Position 146
.xpr file 81
XTAL Command 261
Y
Y-Position 146
Z
ZOOM command 838
Zoom menu entry 82