Home
HC(S)12(X) Debugger.book
Contents
1. HC S 12 X Debugger Manual File Extension Description ABS Absolute framework application file e g fibo abs ASM Assembler specific file e g macrodem asm BBL Burner Batch Language file e g fibo bbl BPT Debugger Breakpoint file e g fibo bpt C CPP C and C source files CHM Compiled HTML help file CMD Command File Script for example Reset cmd CNF Specific cpu configuration file CNT Help Contents File for example cxa cnt CPU Central Processor Unit Awareness file DBG Debug listing files for example Fibo dbg DEFAULT ENV Debugger Default Environment file 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 H Header file HIWAVE EXE The Debugger for Windows executable program HWL Debugger Layout file for example default hwl HWC Debugger Configuration file project hwc EXE Other Windows executable program for example LINKER EXE FPP Flash Programming Parameters files CPU specific for example mcu0e36 fpp HLP Application Help file for example Hiwave hlp 653 Debugger Engine Environment Varia
2. 0 0 00 0c eee eee eee 474 Configuration FPP File Loading 0 00 00 0 00008 474 Loading an Application in Flash eese 475 HC S 12 X Debugger Manual 17 Table of Contents Preparing Loading an Application in Flash 0 0 0 0 e ee eee 477 Hardware Considerations 00 0 eee eee eee 478 HC12 CPU12 CPU devices 20 0 0 eee eee 478 HCI12B32 5 exe RD E ot LEER ad RE Ende 478 HCI2D60 cle RN pe PS doce ee ties 478 HCI2DGJI28 2 ok deed Ge BE PUPA DUE ReRPLDUOCBEPUMERLSS 479 HCS12 and HCS12X CPU devices eese 480 HCS12 EEPROM s Relocation 0 0 0 0 eee 481 EB386 Compliancy and RAM Moving 00 0000 0005 482 Legacy Flash Programming Commands in Preload and Postload Command lui EL 482 Book IV Commands Book IV Contents bbe eed we Re eee IE eR ES doe 485 20 Debugger Engine Commands 487 Commands Overview lisse hn 487 Command Syntax cerro pese de perpe ee dba ees 488 Available Command Lists 0 0 0 cece ene eens 488 Kernel Commands 0 0 0 ce eee ene nes 488 Base Commands os ceterae ures ro teet by N Ena RENS dete E 489 Environment Commands 00 eee eens 491 Component Commands sees 492 Component Specific Commands 0 0 0 0 00 00000 493 Command Syntax Terms 0 0 00 eee ee eee ee 496 Mod le Naimes LEES Nie a ee beta eee Re 497 Debugger Co
3. 0 0 0 e eee eee eee 617 FCS Associated Component specific Commands 617 22 HC S 12 X Debugger Manual Table of Contents ADDEOHANNEL ttc 7 4 eL Po Psi es Bhs eed cba e Dri 619 ADCPORT 35 cep ee oe Rei et Se esa ee ely 619 CPORT 6 56 eee cht eb eR ERR ER E abate wen eed 620 DEECHANNEL iex Rer Ra eae tl ya seas Ages os COE 620 IIPORT 4 ieak She ARES ees Ee a ed 621 ITVEC oi d ode Dee LES Der Dr ERN RUSO EIMPPERNSS 621 KPORT 4 doe Ee CERE P ee pe ERN 622 ECDPORT ote Exe VIMUS UD NOSE he EEE eed 622 EINKADDR 5 seo a dete aL ae ER REOR 623 PBPORT 4 5 nee eReRRERN i be a Gabe Godin Abe Ue 623 PORT use LER ata Sida n ec s Lees 624 PSMODE Leben EN REEVEGN EN espe ede TS We n 624 REGBASE zb vwoLpgs ve Dee reed aig keene te eee ES 625 RESETCY CLES 6 5 veh VIL 625 RESETMEM eee eye debe EY RUM aE ne 626 RESETRAM e bere Rib RE ERE RE E Galen sa sas ET 627 RESETSTAT 3 chee eth eh baits ed HERE EUN Nen 627 SEGPOR DT ited cae tad ie pi eae Metee AS hoes Se SAM ELDER 628 SETCONTROED RIP TEN BOs CAD ee 628 SEICPU 5 cca S428 eee es Mee sah ae aie dates Set aU EN De Des 629 SHOWCYCLES ix eee eG oh See sso Ga EE bienes 629 WPORT os e eLAenDleuieR UU Beate ea HN RP 630 Book V Environment Variables Book V Contents ciue ci RR Re RACER RE ene t 631 22 Debugger Engine Environment Variables 633 Debugger Environment 0 0 0 0 e 634 The Current Directory ci eret uen MIR ae Bae Ce ed aed
4. 38 6 Address LX w Display Adr 3 X v Display Absolute Address Online disassembly can be performed in one of the following ways Using Popup Menu 1 Point in the Assembly component and right click The Assembly Popup Menu is displayed 2 Choose Display Code Figure 6 7 on page 206 Using Assembly Menu 1 Click the title bar of the Assembly component The Assembly menu appears in the debugger menu bar 2 Choose Assembly Display Code The Assembly component displays the corresponding code on the left of each assembler instruction 206 HC S 12 X Debugger Manual How To How to Communicate with the Application How to Communicate with the Application The Debugger has a pseudo terminal facility Use the Test Term or Terminal component window to communicate with the application using specific functions defined in the ERMINAL H file and used in the calculator demo file Start the Debugger and choose Open from the Component menu T 1 2 Open the TestTerm or Terminal Component 3 Choose Load from the Simulator menu 4 Load the program CALC ABS Data entered in the TestTerm or Terminal component window through the keyboard will be fetched by the target application with the Read function The target application can send data to the Terminal component window of the host with the Write function About startup cmd reset cmd preload cmd postload cmd The
5. IX DFDF IY DFDF IP cooo pc cooo PPacE 0 Startup cer SXHINZVC E Data 1 fF Buta Symb Global BH startupData 6 tagstartup 00 00 uu uu 00 00 E SEG END SSTACK 0 array 0 of signed char 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Al Data 2 ioj xj Auto Symb Local Debugger Main Window Toolbar The Debugger Main Window toolbar is the default toolbar Most of the Main Window menu commands have a related shortcut icon on this toolbar Figure 2 4 on page 12 identifies each default icon Figure 2 4 Debugger Main Window Toolbar oaa s e e on GGe Aa 62S a amp amp E b Sh e e Vy eo AUN is Ko By 4 4 AE Sy A tool tip is available when you point the mouse at an icon 12 HC S 12 X Debugger Manual Debugger Interface Debugger Main Window Debugger Main Window Status Bar The status bar at the bottom of the Debugger Main Window shown in Figure 2 5 on page 13 contains a context sensitive help line for connection specific information e g number of CPU cycles for the Simulator connection and execution status Figure 2 5 The Debugger Status Bar For Help press F1 50139 HALTED Z Main Window Menu Bar The Debugger Main Window Menu Bar shown in Figure 2 6 on page 13 is associated with the main function of the debugger application connection and selected windows Figure 2 6 Debugger Window Menu Bar True Time Simulator amp Real Time D
6. MCU Configuration Dialog Box The Hardware Model drop down list can be expanded to select another type of debug interface than the SofTec inDART HCS12 The HW Code drop down list can be expanded to select another HCS12 derivative Note that at this document release time only the SofTec inDART HCS12 is available Pressing the Communication Settings button opens the Communication Settings Dialog Box Communication Settings Dialog Box 414 Pressing the Communication Settings button in the MCU Configuration dialog box opens the Communication Settings dialog box which allows you to fine tune critical parameters needed for proper operation with the chosen target microcontroller The dialog box is divided into four sections BDM Clock Frequency Detection Miscellaneous 3DM Clock Source and Fast Programming All of the parameters must be carefully set otherwise successful operations cannot result HC S 12 X Debugger Manual Refer to the inDART HCS12 In Circuit Debugger Programmer for Freescale HCSI12 Family FLASH Devices User s Manual from SofTec for further details Figure 13 3 Communication Settings Dialog Box Communication Settings x m BDM Clock Frequency Detection Automatic Detection Recommended for devices which support the SYNC BDM command Show Freq C Manual This value should be as close as possible to the actual bus frequency usually OSCCLK 2 Freq
7. Size IdentNum Ident 4 HexNumber Size B w L The identifiers declared in IdDeclaration are stored in a table of identifiers and can be also used in Expression e f is specified the time is absolute it is the number of cycles since the Full Chip Simulation was started f is specified the time is relative to the previous time specification f nothing is specified time is the number of cycles since execution of the Stimulation file e 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 n 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 HC S 12 X Debugger Manual 381 HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins Electrical Signal Generators and Signals Application to Device Pins 382 Signal IO Component This Signal io is the first implementation of a Signal Generator reading in real debugger time a file describing electrical levels Levels are applied available at a virtual io pin called SignalPin as float value Levels are programmed one after the other in duration in the debugger internal Event queue of the Full Chip Simula
8. Symbol Table The symbol table shown in Figure 3 78 on page 126 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 HC S 12 X Debugger Manual 125 Debugger Components Visualization Utilities Figure 3 78 Inspector Window Symbol Table E Inspect D x E Components Name RetumType i Stack Fibonacci unsignedint 0x866 Ox2F Normal unsigned int Fibonacci u 88 Symbol Table BS fibo c Events Icon The Inspect window Events icon shown in Figure 3 79 on page 126 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 Figure 3 79 Inspector Window Events Icon tr Components Stack COP event 16777216 28 Symbol Table B Events A Exceptions c9 Object Pool Target biect iil CNotify12 Events are only used in the HC S 12 X 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 80 on page 127 shows all currently raised exceptio
9. Word Size etc The remaining entries in this menu are explained in table 3 17 Memory Menu Description on page 80 Drag Out Table 3 22 on page 88 Describes the drag actions possible from the Memory component Table 3 22 Memory Component Drag Possibilities 88 Window Assembly Destination Component Action Displays disassembled instructions starting at the first address selected The instructions corresponding to the selected memory area are highlighted in the Assembly component 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 greyed in the source component Drop Into Table 3 23 on page 89 shows the drop actions possible in the Memory component HC S 12 X Debugger Manual Debugger Components General Debugger Components Table 3 23 Memory Component Drop Possibilities Source Component Action Window Assembly Dumps memory starting at the selected PC instruction The PC location is selected in the memory component Data Dumps memory starting at the address where the selected variable is located The memory area where the variable is located is selected in the memory compone
10. in A dayl 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 is iconized its title bar is activated and displayed in the foreground Usage ACTIVATE component Components Debugger engine Example in gt ACTIVATE Memory Activates the Memory Component and brings the window to the foreground 498 HC S 12 X Debugger Manual 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 gt 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 In the Command Component The ATTRIBUTES command allows you to set the display and state options of the Command component window The CACHESIZE command sets the cache size in lines for the Command Line window The cache size value is between 10 and 1000000 NOTE Usually this command is not specified interactively by the user However this command can be written in a command file or a layout
11. List of defined breakpoints the BS command is used as shown in Listing 4 1 on page 152 Listing 4 1 Breakpoint BPT File Syntax BS address P T state l cond condition statel cmd command state cur current inter interval cdSz codeSize srSz sourceSize 152 In the code above 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 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 D or C where E is for enabled state is set by default to E if nothing is specified D is for disabled and C for Continue condition is an expression It matches the Condition field in the Controlpoints Configuration Window Breakpoints Tab on page 150 for conditional breakpoint command is any debugger command It matches the Command field in the Controlpoints Configuration Window Breakpoints Tab on page 150 for associated commands current is an expression It matches the Current field Counter in the Controlpoints Configuration Window Breakpoints Tab on page 150 for counting breakpoints interval is an expression It matches the Interval field Counter in the Controlpoints Configuration Window Breakpoints Tab on page 150 for counting breakpoints
12. The Debugger parameters may be defined in several ways Using system environment variables supported by your operating system e Putting the definitions in a file called DEFAULT ENV in the default directory NOTE The maximum length of environment variable entries in the DEFAULT ENV hidefaults is 4096 characters 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 on page 645 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 NOTE Ensure that no spaces exist at the end of environment variables 634 HC S 12 X Debugger Manual Th e Current Directory The most important environment for all tools is the current directory The current directory is the base search directory where the tool begins to search for files for example the D EFAULT ENV hidefaults file Normally the current directory of a tool is determined by the operating system or program that launches another one for example WinEdit For MS Windows based operating systems the current directory definition is more complex If the tool is launched
13. Troubleshooting on page 229 Configuring DA C IDE for Freescale Tool Kit Install the DA C software The Freescale CD contains a demo version located in Addons VDA C Run Setup to install the Typical installation A few configurations are required in order to make efficient use of Freescale Tools within DA C IDE Create a new project Configure the working directories Configure the file types Configure the Freescale library path Adding files to project Building the Database Configure the tools HC S 12 X Debugger Manual 213 Synchronized Debugging Through DA C IDE Configuring DA C IDE for Freescale Tool Kit In the following sections we assume that the Freescale tool kit is installed in C Freescale directory You may have to adapt the paths to your current installation An example configuration for the M68k CPU is provided which can be adapted to each CPU supported by Freescale Create New Project Start DA C exe and choose Project gt New Project from the main menu Browse to the directory and enter a project file name for example C Freescale work lt processor gt c myproject Change the processor field to your CPU A specific project file is created with dcp extension for example myproject dcp Configure Working Directories Choose Options gt Project from the main menu of DA C The window shown in Figure 9 1 on page 214 contains options which establish directories for the proje
14. 0 1 Moves the cursor to the right increases AC 1 0 Moves the full screen to the left The cursor follows this move Moves the full screen to the right The cursor follows this move Set DDRAM Address e Puts the address indicated by a6a5a4a3a2al1a0 into AC When the number of lines is 2 the address goes from 00h to 1Fh for the 1st line and from 40h to 5Fh for the 2nd line The a6 bit indicates the line a6 0 to indicate the Ist line and 1 to indicate the 2nd one Function Set If DL 1 the data exchange is 8 bits wide e f N 20 the display will take place on one line If N 1 the display will take place on two lines The Initialization Step Initialization needs essentially 7 steps The Function Set instruction must be sent 3 times successively to fix the exchange data width and a 4th time to fix the number of lines used The example shown in Figure 11 35 on page 343 configures the display module in 8 bit mode 2 lines with the cursor visible and an increase of AC the cursor moves to the right HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 35 The LCD Display Initialization RS RW d d amp E di do di de 1 0 0 0 0 Function Set 3 bits Mode HAHAHAH Function Set 8 bits Mode bo e e e e w e e e e Function Set 8 bits Mode A o e o 1 Function Sef
15. DW on page 529 addresslrange Displays memory bytes as words G on page 543 address Starts execution of the application currently loaded GO on page 544 address Starts execution of the application currently loaded LF on page 550 fileName A Opens a log file LOG on page 553 type state L type state Enables or disables logging of a specified information type MEM on page 558 Displays the memory map MS on page 559 range list Sets memory bytes NOCR on page 562 Closes the record file NOLF on page 562 Closes the log file P on page 565 address Single assembly steps into program RESTART on page 570 Restarts the loaded application RD on page 568 listl 490 Displays the content of registers HC S 12 X Debugger Manual Table 20 2 List of Base Commands continued Command Syntax RS on page 572 register value register value Short Description Sets a register S on page 573 Stops execution of the loaded application STEPINTO on page 583 Steps to the next source instruction of the loaded application STEPOUT on page 584 Executes program out of a function call STEPOVER on page 585 Steps over the next source instruction of the loaded application STOP on page 586 Stops execution of the loaded application SAVEBP on page 575 onloff Saves breakpoints T on pag
16. Example in cd C Freescale demo in gt cd C Freescale demo in gt cd Freescale prog C Freescale prog The new project directory is C Freescale prog 516 HC S 12 X Debugger Manual 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 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 logge
17. File Control Commands It is also possible to open and close input and output files through special Escape sequences in the data stream from serial port or virtual SCI Table 11 25 on page 367 illustrates the different possible commands and associated Escape sequences where filename is a sequence of characters terminated by a control character e g CR and is a valid filename Table 11 25 Terminal File Control Commands Escape Sequence Function ESC h 1 Close output file ESC h 2 filename Open output file ESC n 3 filename Open output file and suppress output to terminal display ESC h 4 Close input file HC S 12 X Debugger Manual 367 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Table 11 25 Terminal File Control Commands continued Escape Sequence Function ESC h 5 filename Open input file ESC h 6 filename Append to existing output file ESC h 7 filename Append to existing output file and suppress output to terminal display ESC is the ESC Character ASCII code 27 decimal These commands can be given in the data stream sent from the serial port or virtual SCI port but not from the input file or the keyboard They only have an effect if there are any connections reading from the input file or writing to the output file The TERM_Direct function declared in termi
18. HC S 12 X Debugger Manual Figure 14 2 Set Connection Dialog Box HCS12 Serial Monitor Selection Set Connection E xl Wo 0 0 0 gs Ced Abatron BDI HCS erial Monitor P amp E Multilink Cyclone Pro Full Chip Simulation SofTec HCS12 5 Select HC12 as Processor then HCS12 Serial Monitor as connection in the Set Connection dialog box and click the OK button 6 Now in the Monitor Setup window Monitor Communication tab choose the correct Host serial communication port if necessary Figure 14 3 Monitor Setup Window Monitor Communication Tab Monitor Setup x CUN NENNEN ok fe Cancel 7 Press the OK button The HCS12 Serial Monitor connection reads the device silicon ID This ID can match several derivatives HC S 12 X Debugger Manual 419 HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface 8 Set the correct derivative matching with your hardware in the Derivative Selection dialog box Figure 14 4 Derivative Selection Dialog Box Derivative Selection MC9SO8GB32 7 MC3508GB32 MC9SO8GT32 MCSS08GB50 MC9S O8GT60 9 Press the OK button The Monitor Setup window is opened again to propose to use the mirrored vector table feature We recommand that you use the Vector Table Mirroring feature Otherwise vectors cannot be programmed as captured and protected from erasing or overwriting by the HCS12 Serial Monitor Figure 14 5 Monitor Setup Windo
19. 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 584 HC S 12 X Debugger Manual 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 HC S 12 X Debugger Manual 585 Debugger Engine Commands Debugger Commands STOP PING HALTI ED STOP The STOP command stops execution of the emulation processor Use the Go G on page 543 command to start the emulator NOTE The STOP command ends as soon as the PC is changed Usage STOP Alias S Components Debugger engine Example in gt STOP 586 Current application debugging is stopped HC S 12 X Debugger Manual T The T command executes one or more instructions
20. 300 The End of Period Time represents the number of bus clock cycles to come before the counter is reset The End of Duty Time represents the number of bus clock cycles to come before the output changes state In center aligned mode The End of Period Time represents the number of bus clock cycles to come before the counter changes state This means that the event period is half the effective period of the centered output waveform The End of Duty Time represents the number of bus clock cycles to come before the output changes state A End of Duty Time is set after the end of each Period Event Registers PWME PWM Enable Register PWME7 PWME6 PWMES PWME4 PWME3 PWME2 PWME1 and PWMEO are simulated PWMPOL PWM Polarity Register PPOL7 PPOL6 PPOLS PPOLA PPOL3 PPOL2 PPOL1 and PPOLO are simulated PWMCLK PWM Clock Select Register PCLK7 PCLKL6 PCLK5 PCLK4 PCLK3 PCLK2 PCLK1 and PCLKO are simulated PWMPRCLK PWM Prescale Clock Select Register PCKB2 PCKBI PCKBO PCKA2 PCKAI and PCKAO are simulated PWMCAE PWM Center Align Enable Register CAE7 CAE6 CAES CAE4 CAE3 CAE2 CAE1 CAE are simulated PWMCTL PWM Control Register CONA5 CON23 and CONOI are simulated PFRZ is not simulated but the system will act as if PFRZ is always set to 1 PWMSCLA PWM Scale A Register Is simulated PWMSCLB PWM Scale B Register Is simulated HC S 12 X Debugger Man
21. 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 will take the directory specified as their current directory instead of the one defined by the operating system or launching tool for example editor NOTE This is an environment variable at the system level global environment variable It CANNOT be specified in a default environment file DEFAULT ENV hidefaults Example DEFAULTDIR C NINSTALLNPROJECT See also The Current Directory on page 635 Global Initialization File MCUTOOLS INI PC Only on page 636 HC S 12 X Debugger Manual 645 Debugger Engine Environment Variables Environment Variables ENVIRONMENT Environment File Specification Tools Compiler Linker Decoder Librarian Maker Burner Debugger Synonym HIENVIRONMENT Syntax ENVIRONMENT lt file gt Arguments lt file gt 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 on page 635 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 NOTE This is an environment variable at the system level global environme
22. Example If the specified address is 210 the Phone component keypad is associated with the memory byte at address 0x210 Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations No limitation HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities ADC DAC Component The ADC DAC window shown in Figure 11 20 on page 331 consists of a Digital to Analog and an Analog to Digital converter Figure 11 20 ADC DAC Window lm ADC DAC x OUTPUT Description The ADC DAC component is made of 4 units as shown in Figure 11 21 on page 332 Asignal generator Ananalog to digital converter ADC A digital to analog converter DAC A visualization unit HC S 12 X Debugger Manual 331 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 21 Internal Converter Module Organization and Coupler Connections 332 Sinusoidal Signal Generator dy de ds dy ds da di do xd e ADC Port ADC State Port DAC Port Rdy dr de ds da ds da di do The 4th unit shows the value of the initial analog signal and value of the DAC output analog signal Communication with the mainframe is done through 3 parallel ports of 8 bits A port with 1 significant bit to indicate the conversion state Aninput port to recover the ADC valu
23. Example in gt SHOWCYCLES 133801 in gt RESETCYCLES in gt SHOWCYCLES 0 This command displays the number of CPU cycles executed since the last RESETCYCLES command in the Command Line component HC S 12 X Debugger Manual 629 Debugger Connection specific Commands Full Chip Simulator Commands WPORT The WPORT command is used to set the port addresses of the Wagon component Usage WPORT address ident address ident Address locates the port address value of the component various formats are allowed the default format is hexadecimal Ident is a known identifier its content will define the port address Components Wagon Example in WPORT 0x100 0x200 Ports of the Wagon are now defined at addresses Ox 100 and 0x200 630 HC S 12 X Debugger Manual Book V Environment Variables 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 This book the Debugger Environment Variables defines the HC12 HCS12 and HC S 12 X environment variables both those environment variables used by the debugger engine and those specific to individual debugger connections Book 5 Environment Variables Chapter 5 1 Debugger Engine Environment Variables on page 633 Chapter 5 2 Connection specific Environment Variables on page 655 HC S 12 X D
24. The variable structure located at address 0x1 FEO is zoomed in in gt zoom amp startupData zooms in the startupData structure amp startupData is the address of the _startupData structure 598 HC S 12 X Debugger Manual 21 Debugger Connection specific Commands Abatron BDI Connection Commands This section describes the Abatron BDI Connection specific commands that are used when the Abatron BDI Connection is set The Abatron BDI Connection specific commands are BANKREG on page 600 BDI on page 600 PROTOCOL on page 601 RESET on page 602 Those commands are entered in the Abatron BDI Connection Command Files or in the Command Line component of the debugger This section describes each of the commands available for the Abatron BDI Connection The commands are listed in alphabetical order Each is divided into several topics Table 21 1 Command Description Parameters Topic Description Short Description Provides a short description of the command Syntax Specifies the syntax of the command in a EBNF format Description Provides a detailed description of the command and how to use it Example Small example of how to use the command HC S 12 X Debugger Manual 599 Debugger Connection specific Commands Abatron BDI Connection Commands BDI Short Description Executes any direct BDI command Syntax BDI ABATRON direct command where ABATRON direct comma
25. address ident 618 Sets the ports addresses of the Wagon component HC S 12 X Debugger Manual Debugger Connection specific Commands Full Chip Simulator Commands ADDCHANNEL The ADDCHANNEL command is used to create a new channel for the Monitor component Usage ADDCHANNEL Name Name is the name for the new channel Components Monitor component Example in gt ADDCHANNEL Leds Port Register bit 0 A new channel Leds Port Register bit 0 is created in the Monitor component ADCPORT The ADCPORT command is used to set the ports addresses used by the Adc Dac component Usage ADCPORT address ident address ident address ident Address locates the port address value of the component many formats are allowed the default format is hexadecimal Ident is a known identifier its content will define the port address Components ADC DAC component Example in gt ADCPORT 0x100 0x200 0x300 The ports of the ADC DAC component are now defined at the addresses 0x100 0x200 and 0x300 HC S 12 X Debugger Manual 619 Debugger Connection specific Commands Full Chip Simulator Commands CPORT The CPORT command is used to set the 5 coupler port addresses and the control port address of the coupler component Usage CPORT address ident address ident address ident Address locates the port address value of the component many formats are allowed the
26. 112 fj Source i Ind x1 C hiware DEMO SAMPLES ibo c Line 21 fib2 l fibo n i 2 m while i lt n A fibo fibl m5 fibl fib2 fib2 fibo toto counter fiboCount i x Select ToolTips gt Enable from the source menu entry to enable or disable the tool tips feature Select ToolTips gt Mode from the source menu entry to select normal or details mode which provides more information on a selected procedure Select ToolTips gt Format from the source menu entry to select the tool tip display format Decimal Hexadecimal Octal Binary or ASCII HC S 12 X Debugger Manual Debugger Components General Debugger Components On Line Disassembling For information about performing on line disassembly refer to section How to Consult Assembler Instructions Generated by a Source Statement on page 205 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 66 on page 113 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 Figure 3 66 On Line Disassembling ii Source i ixl ii Assembly iof x fibl fib2 fibo
27. 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 gt SAVE 0x1000 0x2000 DUMP SX A The memory range 0x1000 0x2000 is appended to the DUMP SX file HC S 12 X Debugger Manual 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 all breakpoints defined in the current application will be stored in the matching BPT file If off is set all breakpoints defined in the current application will not be stored in the matching BPT file This command is only used in BPT files and is related to the checkbox Save amp 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 on page 513 comman
28. Abatron BDI HC512 Serial Monitor P amp E Multilink Cyclone Pro Full Chip Simulation SofTec HCS12 See P amp E CABLE12 and CABLE12HS P amp E ICD12 Cable 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 amp E Multilink Cyclone Pro HC S 12 X Debugger Manual 249 HC12 Debugging First Steps Loading the ICD 12 Connection The Connection menu selection P amp E Multilink Cyclone Pro loads the proper drivers etc for the ICD 12 connection 4 In the Debugger Main window the Connection heading has been renamed MultilinkCyclone Pro Click on this heading to display its menu with the list of possible ICD 12 selections Figure 10 16 MultilinkCyclone Pro ICD 12 Menu 250 e Time Simulator amp Real Time Debugger D Profiles RTHO2c My Documents Debbie P amp E Mult iew Run MultilinkCyclonePro Component Source Window Help 2 Load Ctri L Reset Ctrl R Set Derivative Set Communication Speed cc REA Command Files zaxi SSS 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 MultilinkCycloneProl Reset triggers a reset of the connection and executes the command file reset cmd HC S 12 X Debugger Man
29. Define a memory block name Define how the Full Chip Simulation verifies the memory Setthe type of the memory RAM ROM FLASH EEPROM or I O Define start and end addresses Define the wait state the time for each read or write access Set the width of the bus that accesses the memory Set access details like auto configure automatically computing read and write access misaligned access allowing misaligned access on words and longs Open and save memory configuration Add delete or update memory blocks HC S 12 X Debugger Manual 263 HC S 12 X Full Chip Simulation Connection Figure 11 6 Memory Configuration Dialog Box Memory Configuration lxi r Mode Memory Check auto on load ie Stop if no memory Stop on read undefined J Stop on write protected type statt end wait state bus width name 0 16 AUTO RAM RAM 0000 0003 0 16 Auto Segment RAM 0008 000E 0 16 Auto Segment RAM 0010 0013 0 16 Auto Segment RAM 0015 0016 0 16 Auto Segment RAM 0014 OO1F 0 16 Auto Segment RAM 0028 0030 0 16 Auto Segment Ram nn nnm n 1R utn S enment Name auro ROM Type ROM Start l Eni FO Wait state o Access Details i Set Up grt IV Auto Configure C Bbits 16bits 32bits Add Update Delete V Allow misaligned access Cancel Help Memory Configuration Modes Use the Memory Configuration dialog box to select the memory configuration mode auto configuratio
30. 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 NOTE Connection components are introduced in their respective manuals Loading Component Windows In the Debugger Main Window Menu Bar shown in Figure 3 1 on page 46 you can use the Component menu to load all framework components Each Debugger component you select will appear as a window in the Debugger main window Figure 3 1 Debugger Window Menu Bar 46 5 True Time Simulator amp Real Time Debugger D sProfilesRTHO2CMy Dog File View Run Simulator Component Assembly Window Help Clarita x Bs g Per Set Target D Profiles RTHO2c My Doc Fonts Background Color include lt hidef h gt es and macros include amp mc68hc912dgl128 h derivative information pragma LINK INFO DERIVATIVE mc6Shc9l12dgl28 To open the window that lets you choose one or more components 1 Choose Component gt Open 2 In the Open Window Component window shown in Figure 3 2 on page 47 select the desired component NOTE To open more than one component select multiple components HC S 1
31. HC S 12 X Debugger Manual In the Source Component The ATTRIBUTES command allows you to set the display and state options of the Source component window The SMEM show memory range command and SPC show PC address command loads the corresponding module s source text scrolls to the corresponding text range location or text address location and highlights the corresponding statements The SMOD show module command loads the corresponding module s source text If the module is not found a message is displayed in the Component Windows Object Info Bar on page 35 The SPROC show procedure command loads the corresponding module s source text scrolls to the corresponding procedure and highlights the statement that is in the procedure chain of this procedure The numberAssociated ToProcedure is the level of the procedure in the procedure chain The MARKS command ON or OFF displays or hides the marks NOTE Also refer to SMEM on page 578 SPC on page 580 SPROC on page 581 and SMOD on page 579 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 ATTRIBUTES SMOD Drag and drop from Module component to Source component ATTRIBUTES SPROC Drag and drop from Procedure component to Source component ATTRIBUTES MARKS Select menu Source gt Marks Us
32. HCS12 and HCS12X CPU devices All protections are fully removed when erasing and programming The security byte at FFOF is always reprogrammed to unsecure when erasing actually due to aligned word programming FFOE FFOF is programmed to FFFE The debugger asserts aligned word programming as specified in FTSxxxK and FTXxxxK specifications HCS12 and HCS12X device fpp files having been simplified to increase programming speed as devices may have up to 512 kBytes of onchip flash Indeed changing programming methods for each Program Page 32 PPAGE s on MC9S12DP512 would slow down the programming By consequence only relevant onchip flash blocks have their own listed module and the list below gives an overall availability for all HCS12 and HCS12X devices HC S 12 X Debugger Manual FLASH 4000 onchip flash in 4000 7FFF also a mirror of PPAGE 3E on HCS 12 devices and FD on HCS12X devices This module is provided to design non banked code like for ISR s code startup code etc FLASH C000 onchip flash in C000 FFFF also a mirror of PPAGE 3F on HCS 12 devices and FF on HCS12X devices This module is provided to design non banked code like for ISR s code startup code etc and vectors ALL PPAGES also previously called PAGED The entire onchip flash memory CAUTION Erasing this module erases de facto FLASH 4000 and FLASH C000 modules e FLAT8000 Pxx or FLASH 8000 HCS12X and EEPROM 800 HCS1
33. Hz 6000000 C Use ECLK Signal Requires the target s ECLK signal to be connected to inDART s ECLK signal in the Enhanced BDM connector Show Freg r Misc DD OUT Voltage Provided to the DD OUT Connector OFF Do Not Modify EEPROM Contents HC S 12 X Debugger Manual r BDM Clock Source CLKSWw Bit C Use Altemate Frequency CLKSW 0 The clock that drives the BDM communication is the alternate fixed frequency source The exact clock source depends on the HCS12 derivative Use System Bus Frequency CLKSW 1 fou should avoid using this option while running a user program that might change the bus frequency because this could result in loss of BDM communication r Fast Programming PLL Freq H2 Jeco00000 Enable Fast Programming If enabled speeds up programming by driving the internal PLL circuitry to the frequency specified An appropriate loop filter must be provided to the device s XFC pin Cancel 415 Softec HCS12 Connection 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 Please see Stop Command Handling section in inDART HCS12 In Circuit Debugger Programmer forFreescale HC12 Family FLASH Devices User s Manual from SofTec for further details User s Manual Option Select the
34. ICOVW Input Control Overwrite Register NOVW7 NOVW6 NOVWS NOVW4 NOVW3 NOVW2 NOVW and NOVWO are simulated ICSYS Input Control System Control Register SH37 SH26 SH15 SH04 TFMOD PACMX BUFEN and LATQ are simulated PTPSR Precision Timer Prescaler Select Register Is simulated if the derivative supports it PTMCPSR Precision Timer Mod Cnt Prescaler Select Reg Is simulated if the derivative supports it PBCTL 16 Bit Pulse Accumulator B Control Register PBEN and PBOVI are simulated PBFLG Pulse Accumulator B Flag Register PBOVF is simulated PAS3H PAOH 8 Bit Pulse Accumulators Holding Registers 0 3 Is simulated MCCNT Modulus Down Counter Count Register Is simulated TCOH TC3H Timer Input Capture Holding Registers 0 3 Is simulated HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Not memory mapped Registers PORTT Port T The functionality linking the PWM module and the port T have been simulated the register involved is PTT Port T I O Register PORTTBitx The pins are simulated as not memory mapped and can be accessed one by one through the object pool PORTTBit0 to PORTTBit7 Periodic Interrupt Timer PIT The I O device Periodic Interrupt Timer PIT is not simulated Pulse Width Modulator PWM This I O device simulates the Pulse Width Modulator PWM PWM with 8 and 6 channels are supported The PWM with 6 chan
35. N0 PutChar str 0 1 strt j j void GuessTheNumber void int ran rand RAND MAX 9 AS1 Init PutString Guess a Number between 0 and 9 n PutString Number BOTS cn unsigned char c if AS1 RecvChar amp c ERR OK PutChar c PutChar Li Coos VON ili ce 09v PutString not a number try again n HC S 12 X Debugger Manual 395 HC S 12 X Full Chip Simulation Connection FCS Tutorials else if c ran 0 PutString nCongratulation You have found the number PutString nGuess a new number n ran rand RAND_MAX 9 else if c gt ran 0 PutString lower n else PutString greater n j PutString Number else could wait a bit here for Call the function GuessTheNumber in the main routine void main void Processor Expert internal initialization DON T REMOVE THIS CODE PE low level init End of Processor Expert internal initialization k Write your code here GuessTheNumber Processor Expert end of main routine DON T MODIFY THIS CODE for Processor Expert end of main routine DON T WRITE CODE BELOW End of main routine DO NOT MODIFY THIS TEXT 396 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Step 10 Run The application is now fini
36. 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 is opened A grey vertical bar is displayed 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 on page 67 or point to a blank line as shown below and right click to select Add Expression in the popup 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 66 HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 19 Edit Expression Dialog Box 1 14 1nr fibl fib2 610 Edit Exp
37. Usage MESSAGE SHOW ID lt message number ID gt 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 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS and Silicon On chip Peripherals Simulation Example in MESSAGE HIDE RESET All previously hidden messages are displayed again now FCS and Silicon On chip Peripherals Simulation Full Chip Simulation means not only to simulate the core instruction set but also the on chip i o devices such as CRG PWM ECT In the section Supported Derivatives on page 276 the supported i o devices are listed for each supported derivative By generating a new project with the New HC 12 Project Wizard and the connection Full Chip Simulation everything is setup to run the project with FCS support With the menu option Simulator gt Set Derivative you can change the derivative to simulate Additional to the derivatives you will find special entries HC S 12 X CORE and HC S 12 X SAMPLE The CORE entries allow to simulated the chip without FCS support plain instructions only and the SAMPLE entries allow to simulate a chip with a minimal set of commonly available onchip peripherals like Register Block Memory Expansion Registers Clock and Reset Gener
38. a DI EFAULT RI EG file HC S 12 X Debugger Manual DDEPROTOCOL The data DDEPROTOCOL command is used to configure the Debugger Simulator dynamic exchange DDE protocol By default the DDE protocol is activated and not displayed in the command line component Usage DDEPROTOCOL ONIOFFISHOWIHIDEISTATUS 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 Deb ugger engine Example in gt DDEPROTOCOL ON in gt DDEPROTOCOL SHOW in gt DDEPROTOCOL STATUS DDEPROTOCOL ON DISPLAYING ON The DDE protocol is activated and displayed and status is given in the command line component NOTE For more information on Debugger Simulator DDE implementation please refer to the chapter that deals with Debugger DDE Capabilities on page 211 HC S 12 X Debugger Manual 525 Debugger Engine Commands Debugger Commands 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
39. fileName AUTOID loads the parameter file according to fileName you can specify the path If this command includes AUTOID the MCUID determines the parameter file autocheck is checked in the NVMC dialog box FLASH RELEASE releases the current FPP file loaded by the Flash Programmer therefore the Flash Programmer address mapping is disabled and no non volatile memory is handled FLASH MEMMAP maps the Flash Programmer address filtering to route the code for block programming FLASH MEMUNMAP unmaps the Flash Programmer address filtering Programming is therefore disabled as long as FLASH MEMMAP is not executed FLASH ENABLE enables the specified modules If no modules are specified enables all available blocks This command ignores modules that cannot be enabled FLASH DISABLE disables the specified modules If no modules are specified all disables all available blocks This command ignores modules that cannot be disabled FLASH ERASE erases the specified modules If no modules are specified erases all available blocks FLASH AEFSKIPERASING specifies non volatile memory blocks to protect from mass erasing at application automated programming The command should be placed in a Startup command file If no modules are specified no blocks are erased NOTE This command is compatible and replicated in the NVM Programming Selection dialog FLASH UNPROTECT unprotects the specified modules If no modules are specified unprotects
40. 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 512 HC S 12 X Debugger Manual 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 popup 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 addressl function mark PIT state cond condition state cmd command state cur current inter interval
41. in gt 0xc000 For Help press F1 2 000000 MHz 195 264 717 MC9512DP256B FCS RUNNING PWM Channel 0 We are going to create step by step the demo run in the executive tutorial The application makes use of the PWM Pulse Width Accumulator With the final application you will be HC S 12 X Debugger Manual 397 HC S 12 X Full Chip Simulation Connection FCS Tutorials able to change the period and duty time of the PWM and you will see the changes displayed in a chart Step 1 Environment Setup The tutorial is using Processor Expert you can get a free Processor Expert licence Special Edition from www codewarrior com Step 2 Creating Project Launch the CodeWarrior IDE In the CodeWarrior menu Select File gt New Make sure the Project tab is active Select HC S 12 New Project Wizard Enter a project name like MyPWMChannel0 Change the directory if you want Location Set Click OK The project wizard opens to let you select the device language etc Select a derivative like MC9S12DP256B and click Next Select C for the language and click Next Select Yes for Processor Expert support and click Next Select No for PCLint support and click Next Select none for floating point support and click Next Select Full Chip Simulation and click Finish A new project is created using the wizard and the Processor Expert is available Several windows should be visible
42. 00000838 26 F7 20 EF 00000840 26 03 FF 08 00000848 FB 00 04 20 nnnnnesn ae NR ww nn IV Hex Format Cancel NOTE If Hex Format is checked numbers and letters are interpreted as hexadecimal numbers Otherwise expressions can be typed and Hex numbers should be prefixed with Ox or Display Address With the Display Address dialog box shown in Figure 3 39 on page 84 the memory component dumps memory starting at the specified address HC S 12 X Debugger Manual 83 Debugger Components General Debugger Components Figure 3 39 Display Address Dialog Box Display 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 84 HC S 12 X Debugger Manual Debugger Components General Debugger Components CopyMem Submenu The CopyMem dialog box shown in Figure 3 40 on page 85 allows you to copy a memory range to a specific address Figure 3 40 CopyMem Dialog Box CopyMem x Source from Address hex to Address hex Destination from Address hex v Hex Format Cancel Help 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 without changes Press the Help button to open the help file a
43. 999985 999986 999987 999990 999991 999992 999993 999994 999995 999996 999997 999998 999999 1000000 HCS12X XGATE XGATE HCS12X HCS12X HCS12X XGATE XGATE XGATE XGATE XGATE XGATE XGATE HCS12X HCS12X HC 12X E0807A L 0808 X E08808 L E08078 L E0807C L 22FC L 080C X E0880C L ElAC X ElAE X 0800 X E08800 L E200 X E0807A L E0807E L 22F8 L EE80 Set Time Base Show Location v Textual Graphical Instructions Items Dump Go to Frame R v Enabled v Records memory accesses Clear XGATE 0802 X XGATE XGATE XGATE XGATE XGATE XGATE XGATE XGATE HCS12X XGATE XGATE E08802 L 0804 X E08804 L E200 X 0806 X E08806 L 0808 X E08808 L E0807C L asoc x E08s8oc L RL 0 100 By default the Full Chip Simulation records instructions only faster Check Record memory accesses and choose Textual mode in the Trace menu context sensitive popup menu to record memory accesses Many information can be retrieved from the Trace window like instructions and instruction addresses data address data value and read write access type true time cycles and total simulation cycles for each instruction 270 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection function name and module name for each instruction variable name and module name for each global variable data access Figure 11 10 Bus Trace Data Access S
44. 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 in DEFINE addr 1000 limit addr 15 526 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 HC S 12 X Debugger Manual 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
45. Appears only in the popup menu if a watchpoint is set or disabled on the pointed to variable When selected deletes this watchpoint Enable Watchpoint Appears only in the popup menu if a watchpoint is disabled on the pointed to variable When selected enables this watchpoint Disable Breakpoint Appears only in the popup menu if a breakpoint is set on the pointed to instruction When selected disables this watchpoint Show Watchpoints Opens the Watchpoints Setting dialog box and allows you to view the list of watchpoints defined in the application Refer to Control Points on page 147 Show location Forces all open components to display information about the pointed to variable e g the Memory component selects the memory range where the variable is located SUBMENU Open Module The dialog shown in Figure 3 31 on page 76 lists all source files bound to the application Global variables from the selected module are displayed in the data component This is only supported when the component is in Global scope mode HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 31 Open Modules Dialog Box Modules LX Drag Out Table 3 14 on page 76 describes the drag actions possible from the Data component Table 3 14 Dragging Data Possibilities Destination Component Window Command Line Action Dragging the name appends the address of the
46. Auto on Access The Memory Configuration dialog box contains a single RAM entry with unspecified starting and ending addresses You cannot modify these addresses You can adjust wait states and other such settings only for the whole RAM block Auto Configuration on Load Initially the dialog box lists a single RAM and a single ROM block with unspecified starting and ending addresses You can adjust wait states and other such settings separately for RAM and ROM blocks For the ELF DWARF Object file format the Memory Configuration dialog box lists separate RAM and ROM blocks for each data and code segment in the absolute file once an application has been loaded The segment addresses and lengths determine the starting and ending addresses of each block you cannot modify these addresses Initial attributes of each code and data block come from the corresponding initial RAM and ROM blocks you can modify these attributes independently Manual Configuration The Memory Configuration dialog box lists an entry for each memory block You can modify such entries without restriction HC S 12 X Debugger Manual 265 HC S 12 X Full Chip Simulation Connection 266 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 Onc
47. Cancel Help 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 on page 58 The command line component appends corresponding items of the current command HC S 12 X Debugger Manual 57 Debugger Components General Debugger Components Table 3 5 Drop Into Command Component 58 Source Component Action Window Assembly The Command Line component appends the address of the pointed to instruction to the current command Data 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 Memory Appends the selected memory range to the Command Line window Register The address stored in the pointed to register is appended to the current command Demo Version Limitations Only 20 commands can be entered and then command component is closed and it is no longer possible to open a new one in the same Debugger session Command files with more than 20 commands cannot be executed Associated Commands BD on page 512 CF on page 517 E on page 530 HELP on page 547 NB on page 560 LS on page 557 SREC on page 582 SAVE on page 574 NOTE For mo
48. Environment Variables section ofthe project file through the statement Target Abatron BDI The Abatron BDI Connection automatically detects that the target is connected to your system If nothing is detected the Communication Device Specification Edit Box on page 439 pops up The target is not connected or is connected to a different port If no target is set or if a different target is set load the Abatron BDI Connection as described below In the debugger select Component Set Target in the component menu HC S 12 X Debugger Manual Abatron BDI Connection BDI Interface Software Setup Figure 15 9 Debugger Component Menu a True Time Simulator amp Real Time Debugger The Set Connection dialog box is displayed Select Abatron BDI Connection in the list of proposed targets and click OK Figure 15 10 Set Connection Dialog Box Set Target L BDIK Target Interface BDIK Target Interface GDI Target Interface HC512 Serial Monitor Target Interface ICD12 Target Interface Simulator T arget Interface SofTec HCS12 Target Interface After a successful target loading the Debugger Main Window Target menu item is replaced by Abatron BDI HC S 12 X Debugger Manual 435 Abatron BDI Connection BDI Interface Software Setup Figure 15 11 Abatron BDI Menu ge True Time Simulator amp Real Time Debugger You can change the communication parameter baud rate and port by selecting the menu entry Ab
49. Example in gt DL 0x8000 0x8007 8000 FE8045FD 80432710 The content of the memory range starting at 0x8000 and ending at 0x8007 is displayed as longword 4 bytes values in DL 0x8000 2 8000 FE8045FD 80432710 The content of 2 longwords starting at 0x8000 is displayed as longword 4 bytes values Memory longwords are displayed in the Command Line component window 528 HC S 12 X Debugger Manual 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 should be displayed 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
50. 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 lt ATTRIBUTES 2000 HC S 12 X Debugger Manual 499 Debugger Engine Commands Debugger Commands 500 In the Procedure Component The ATTRIBUTES command allows you to set the display and state options of the Procedure component window The VALUES and TYPES commands display or hide the Values or Types of the parameters Usage ATTRIBUTES list where list command command command V ALUES ONIOFF TYPES ONIOFF Example Procedure ATTRIBUTES VALUES ON TYPES ON In the Assembly Component The ATTRIBUTES command allows you to set the display and state options for the Assembly component window The ADR command displays or hides the address of a disassembled instruction ON OFF is used to switch the address on or off SMEM show memory range and SPC show PC address scroll the Assembly component to the corresponding address or range code location and select highlight the corresponding assembler lines or range of code The CODE command displays or hides the machine code of the disassembled instruction ON OFF is used to switch on or off the machine code The AB
51. OM7 OL7 OM6 OL6 OM5 OLS OMA OLA OM3 OL3 OM2 OL2 OMI OLI OMO and OLO are simulated TCTL3 TCTL4 Timer Control Register 3 4 EDG7B EDG7A EDG6B EDG6A EDGSB EDG5A EDG4B EDG4A EDG3B EDG3A EDG2B EDG2A EDGIB EDGIA EDGOB and EDGO are simulated TIE Timer Interrupt Enable Register C71 C6I C5I C4 C3I C2I C1I and COI are simulated TSCR2 Timer System Control Register 2 TOI TCRE PR2 PR1 and PRO are simulated TFLG1 Main Timer Interrupt Flag 1 C7F C6F C5F C4F C3F C2F CIF and COF are simulated TFLG2 Main Timer Interrupt Flag 2 TOF is simulated TCx Timer Input Capture Output Compare Registers 0 7 Is simulated PACTL 16 Bit Pulse Accumulator A Control Register PAEN PEDGE and PAOVI are simulated PAFLG Pulse Accumulator A Flag Register PAOVF is simulated PACNS3 PACN2 Pulse Accumulators Count Registers 2 3 Is simulated PACN1 PACNO Pulse Accumulators Count Registers 0 1 Is simulated MCCTL 16 Bit Modulus Down Counter Control Register MCZI MODMC RDMCL ICLAT FLMC MCEN MCPR1 and MCPRO are simulated HC S 12 X Debugger Manual 297 HC S 12 X Full Chip Simulation Connection Supported Derivatives 298 MCFLG 16 Bit Modulus Down Counter FLAG Register MCZF POLF3 POLF2 POLFI and POLFO are simulated ICPAR Input Control Pulse Accumulators Register PA3EN PA2EN PAIEN and PAOEN are simulated DLYCT Delay Counter Control Register Not simulated
52. OSEK Kernel Awareness Inspector Alarm The Alarm shown in Figure 5 6 on page 188 displays the current state of OSEK alarm trace Figure 5 6 Inspector Alarm Inspect ol x Name Alarm State Assigned Counter Notified Task Event to set Time to expire Cycle period o HALF SEC AL HALF SEC AL ALARMSTOP SYSTEMTIMER ControlTask HALF SEC Oxfed4 0x0 83 POLLINPUTS AL POLLINPUTS AL ALARMRUN SYSTEMTIMER InputTask 0x3 0x3 33 STALL END AL STALL END AL ALARMSTOP SYSTEMTIMER ControlTask STALLEN Oxfed4 0x0 83 REVERSE ap REVERSE AL ALARMSTOP SYSTEMTIMER Controllask REVERSE Oxfed4 0x0 When selecting Alarm in the hierarchical tree on the left side additional information concerning the alarm are displayed 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 alarm mechanism to the application software Assigned Counter is the name of the counter used by alarm Notified Task alarm management allows the user to link task activation to a certain counter value the assignment of an alarm to a counter as well as 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
53. Procedure Profiler Recorder Register SoftTrace Source Stimulation Components Debugger engine Example in gt OPEN Terminal 0 78 60 22 The Terminal component and window is opened at specified positions and with specified width and height HC S 12 X Debugger Manual 563 Debugger Engine Commands Debugger Commands OUTPUT With OUTPUT you can redirect the Coverage component results to an output file indicated by the file name and his path Usage OUTPUT FileName Where FileName is file name path name Components Coverage component Example in gt coverage OUTPUT c Freescale myfile txt The Coverage output results are redirected to the file myfile txt from the directory C Freescale 564 HC S 12 X Debugger Manual 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 on page 565 and T on page
54. Refer to the Debugger HCS12 Onchip DBG Module User Interface manual for all related information Bus Trace Selectthe MONITOR HCS12 gt Bus Trace toption o open the Trace component window within the debugger main window Refer to the Debugger HCS12 Onchip DBG Module User Interface manual for all related information Select Derivative Select the MONITOR HCS12 gt Select Derivative option to open the Derivative Selection Dialog Box Monitor Setup Window The Monitor Setup window has two tabs as shown in Figure 22 10 Monitor Setup Window Monitor Communication Tab and Figure 22 11 Monitor Setup Window Vector Table Mirroring Tab 422 HC S 12 X Debugger Manual Figure 14 8 Monitor Setup Window Monitor Communication Tab Monitor Setup Monitor Communication Tab Using the Monitor Communitaction tab it is possible to set or modify the current serial communication port when opening the HOST Serial Communication Port list box s drop down list Checking the Show Monitor TX RX checkbox reports in the debugger Command Line window all low level communication frames between the host computer and the HCS12 Serial Monitor HC S 12 X Debugger Manual 423 HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface Figure 14 9 Monitor Setup Window Vector Table Mirroring Tab 424 Monitor Setup xi Monitor Communication Vector Table Mirroring Vector Table Mirroring Setup Vector Ta
55. Right 135 ROMs 430 RS 572 RS 232 serial communication 236 428 RSRC 320 RTC 317 Run To Cursor 52 117 RUNNING 441 RWU 320 S S 573 SAVE 574 Save Configuration 16 Save Configuration As 16 Save Layout 134 Save Memory Block 266 SAVEBP 575 SBK 320 SBR 320 SCOBDH 320 SCOBDL 320 SCOCRI 320 HC S 12 X Debugger Manual SCOCR2 320 SCODRH 321 SCODRL 321 SCOSRI 320 SCOSR2 321 SCIBDH 320 SCIBDL 320 SCICRI 320 SCICR2 320 SCIDRH 321 SCIDRL 321 SCISRI 320 SCISR2 321 SCIInput 320 321 SCUnputH 320 321 SCIOutput 321 SClOutputH 321 Scope 68 SDI 46 search order 652 Searching Order Assembly source files 652 C source files 652 Object files source files 652 SEGPORT 628 Select Derivative 422 Selecting 471 473 474 Send to Back 135 Send to Front 135 Serial Communication Interface 286 320 Serial Peripheral Interface 288 SerialInput 320 322 SerialOutput 322 SET 576 Set Bank 438 Set Breakpoint 52 116 Set Target 30 Set Zero Base 110 357 SETCOLORS 576 SETCONTROL 628 SETCPU 629 Setcpu command file 262 Setup 134 Setup dialog 440 Setup 438 Show Breakpoints 52 117 Show Location 52 117 673 Show Protocol 440 SHOWCYCLES 629 SHOWPROT 658 Simulation 5 428 Single Step 23 Size 135 Size of Port 137 SKIPILLEGALBREAK 659 SLAY 577 SLINE 577 Sloping 142 Small Borders 18 SMEM 578 SMOD 579 SofTec HC08 Communication Settings Dialog Box 41
56. Scroll into the procedure Interrupt Routine BN moo UY qp cm Set a breakpoint in the Interrupt Routine as shown below The Source component window is shown in Figure 11 74 on page 376 HC S 12 X Debugger Manual 375 HC S 12 X Full Chip Simulation Connection True Time I O Stimulation Figure 11 74 Source Component Window imi Source ioj xj IN DEMO lo_demo c 8 9 1 l gt decreasing interrupt void Interrupt Routine void E dir 1 operation to be executed on interrupt B static void Delay void 0A Wait for a short time volatile char cnt 0 while cnt lt DELAY cnt a Activate Stimulation Window by clicking on it Choose Stimulation gt Execute 0 Choose Run gt Start Continue After about 300 000 cycles the Full Chip Simulation stops on the breakpoint in the interrupt routine and the corresponding source line is highlighted The interrupt has been called Start the Full Chip Simulation It stops approximately each 100 000 cycles on the same breakpoint Restart and repeat these actions until 1 200 000 cycles Start again the Full Chip Simulation runs until 10 000 000 cycles and stops on the breakpoint Start the Full Chip Simulation It continues to run The stimulation is finished The interrupts have been invoked by the Stimulation component source io int txt The listing of the Stimulation file is given in Hypertextparanum Listing 11 8 io int txt def a TargetOb
57. Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 4 Supported Derivatives continued Derivative Name MC9S12DB128B Modules Analog to Digital Converter on page 288 Byteflight BF on page 285 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 MC9S12DG128B HC S 12 X Debugger Manual Analog to Digital Converter on page 288 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 279 HC S 12 X Full Chip
58. Source component Example in gt findproc Fibonacci The Fibonacci procedure is displayed and the title is highlighted HC S 12 X Debugger Manual FOCUS Description The FOCUS command sets the given component component as the destination for all subsequent commands up to the next ENDFOCUS on page 532 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 NOTE Itis not possible to visually notice that a component is FOCUSed However you can use the ACTIVATE on page 498 command to activate a component window 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 HC S 12 X Debugger Manual 539 Debugger Engine Commands Debugger Commands 540 FOLD Description In the Source component the FOLD command hides the source text at the program block level Folded pro
59. T9 T 587 T8 321 Target 10 Target commands 599 Target Interface Dialogs 447 TC 321 TCIE 320 TCNT 319 TCRE 318 319 674 TCTL1 319 TCTL2 319 TCTL3 319 TCTLA 319 TCx 319 TDRE 320 TE 320 termbgnd c 443 Terminal 443 Terminal Address 443 Terminal area 443 Terminal Emulation 443 Terminal work space 443 TESTBOX 588 Text 141 Text Mode 144 Textcolor 144 TFLGI 319 TFLG2 319 TIE 320 Tile 33 Timer 318 319 Timer Module 301 Timer Update 60 TIOS 319 TMP 650 TMSKI1 319 TMSK2 319 TOI 319 Toolbar 12 18 Customizing 18 ToolTips 118 ToolTips Activation 112 ToolTips format 112 ToolTips mode 112 Top 135 TRACED 442 Trigger Module Settings 422 True Time Simulator and Real Time Debugger Configuration 192 Default Layout Configuration 638 Demo Version Limitations 6 Drag and Drop 38 Engine 5 Layout 639 Project 639 project ini 638 HC S 12 X Debugger Manual Running from a command line 9 Smart User Interface 37 Tool tip 12 User Interface 37 Using on Windows 95 or Windows NT 4 0 WIN2000 192 TUPDATE 588 U UDec 70 82 106 200 UNDEF 589 UNFOLD 591 Unfold 122 Unfold AII Text 122 Unfolding 114 Mark 114 unprotected 472 Unprotecting 473 Unselecting 471 474 Unsigned Decimal 200 UNTIL 592 UPDATERATE 592 USELIBPATH 651 User 69 User s Manual 416 V VA 598 Variable 447 Address 202 Displaying Global Variables 199 Displaying Local Variables 199 Editing Value 201 Format
60. Table 11 21 Stimulation Popup Menu Description Open File Opens a dialog box to load a stimulation file Execute Starts execution of the input file HC S 12 X Debugger Manual 357 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Table 11 21 Stimulation Popup Menu continued Description Display Switches display of stimulated file on or off Cache size Opens the Size of the Cache dialog box Cache Size The Size of the Cache dialog box shown in Figure 11 58 on page 358 allows you to define the number of lines displayed in the Stimulation component If the Limited Size of Cache checkbox is unchecked the number of lines is unlimited If the Limited Size of Cache check box is checked the number of lines is limited to the value displayed in the edit box This value should be between 10 and 1000000 By default the number of lines is 1000 Figure 11 58 Size of the Cache Dialog Box Size of the Cache x zn Number of lines to be cached 1000 Cancel Help NOTE The bigger the cache size the slower new lines are logged Example of a Stimulation File Using an editor open the file named IO VAR TXT located in the project directory Listing 11 1 on page 358 is an example file Listing 11 1 Stimulation File Example def a END 10000000 a TargetObject 210 B PERIODICAL 200000 50 50000 a 128 150000 a 4 0 358 HC S 12 X Debugger
61. Using the Left Mouse Button and Pressing the B Key 1 Point at a variable in the Data window and holding down the left mouse button press the B key 2 Aread write access watchpoint is defined for the selected variable Once a read write access watchpoint has been defined you can continue program execution The application stops after the next read or write access on the variable Read write access watchpoints remain active until they are disabled or deleted Defining a Counting Watchpoint A counter can be associated with any type of watchpoint read write read write The Debugger provides two ways to define a counting watchpoint Using the Data Popup Menu Point at a variable in the Data window and right click The Data Popup Menu is displayed 2 Choose Set Watchpoint from the Popup Menu A Read Write Watchpoint is defined 3 Point in the Data Component Window and right click The Source Popup Menu is displayed 4 Choose Show WatchPoints from the Popup Menu The Controlpoints Configuration window Watchpoints tab is displayed Select the watchpoint you want to define as a counting watchpoint From the dropdown box select the type of access you want to track In the interval field specify the interval count for the watchpoint Goran iva OF Close the window by clicking OK A counting watchpoint is defined for the selected variable Using the Left Mouse Button and Pressing the S Key 1 Point at a varia
62. WINDOWS Example C WINDOWSNMCUTOOLS 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 INT 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 636 HC S 12 X Debugger Manual Local Configuration File usually project ini The Debugger does not change the default env file Its content is read only All configuration properties are stored in the configuration file The same configuration file can be used by different applications The shell uses the configuration file with the name project ini in the current directory only That is why this name is also suggested to be used with the Debugger Only when the shell uses the same file as the compiler the editor configuration written and maintained by the shell can be used by the Debugger Apart from this the Debugger can use any file name for the project file The configuration file has the same format as windows ini files The Debugger stores its own entries with the same section name as in the global mcutools ini file The current directory is always the directory containing the configuration file If a configuration file in a different directory is loaded then
63. 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 HC S 12 X Debugger Manual 185 Real Time Kernel Awareness OSEK Kernel Awareness Events State the event is represented by its mask The event mask is the number which range is from 1 to OXFFFFFFFF When the event mask value is set tol 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 186 HC S 12 X Debugger Manual Real Time Kernel Awareness OSEK Kernel Awareness Inspector Stack The Stack shown in Figure 5 4 on page 187 displays the current state of OSEK stack trace Figure 5 4 Inspector Stack When selecting Stack in the hierarchic
64. alarm management allows the user to link event setting to a certain counter value the assignment of an alarm to a counter as well as 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 188 HC S 12 X Debugger Manual Real Time Kernel Awareness OSEK Kernel Awareness Inspector Message The Message shown in Figure 5 7 on page 189 displays the current state of OSEK message trace Figure 5 7 Inspector Message t Inspect D X bb Message Type Notified Task Event to be set 32 Msg Input 4 Msg Input UNQUEUED ControlTask KEY EVENT SG Msg lock w UNQUEUED LockTask gt When selecting Message in the hierarchical tree on the left side additional information concerning task are displayed on the right side e 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 which is to be set when the message is sent HC S 12 X Debugger Manual 189 Real Time Kernel Awareness OSEK Kernel Awareness 190 HC S 12 X Debugger Manual How To This chapter provides answers to frequently asked questions Click any of the fo
65. 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 20 6 on page 560 Usage NB base Where base is the new number base 2 8 10 or 16 Components Debugger engine Table 20 6 ANSI C Constant Notation 560 Ox Hexadecimal constant 0 Octal constant Table Example Ox2F00 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 20 7 on page 561 HC S 12 X Debugger Manual Table 20 7 Assembler Notation for Constant Hexadecimal constant Octal constant Yo Binary constant Table Example 2F00 Hexadecimal Constant 43 Octal Constant 2610011 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 Ox or by as shown in Table 20 8 on page 561 Otherwise the command
66. 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 gt Q the position is relative to the beginning of the function e Q the position is the entry point of the function default value e lt Q 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 HC S 12 X Debugger Manual 513 Debugger Engine Commands Debugger Commands 514 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 Configurati
67. interpreted The CPU context of the task is then expected in the variables PC SP SR DL HC S 12 X Debugger Manual 179 Real Time Kernel Awareness Application Example Rnn and EN EN describes the status of the task If EN is bigger than 1000 the status is expected in the string MSG Application Example Listing 5 1 on page 180 shows an example of OSPARAM PRM file for SOOM System REM Listing 5 1 OSPARAM PRM File File OSParam PRM implementation for SOOM System RI RO R7 DO D7 R8 R15 A0 A7 MSG message displayed in Procedure Chain window Ej S DL MD B 8 A6 in PD dynamic link H SP MD B 4 A7 in PD stack pointer PC MD B 14 PC in PD program counter SR MW B 12 SR in PD status register STATUS 1000 Initialized with 1000 IF MwW B 18 1 THEN IF registers are saved in task Control Block THEN RO MD B 22 R1 MD B 26 R2 MD B 30 R3 MD B 34 R4 MD B 38 R5 MD Bt42 R6 MD B 46 R7 MD B 50 R8 MD B 54 R9 MD B 58 R10 MD B 62 R11 MD B 66 R12 MD B 70 END R13 B R14 DL R15 i SP i MB B 112 i contains the current state of the selected task IF i 0 THEN MSG ReadyInCOQSc ELSIF i 1 THEN MSG BlockedByAccept ELSIF i 2 THEN MSG WaitForDReply ELSIF i 3 THEN MSG WaitForMail ELSIF i 4 THEN
68. pointed frame Holding down the left mouse button and pressing the D key forces all open component 108 windows to show the code matching the pointed to frame SoftTrace Menu The SoftTrace Menu shown in Figure 3 62 on page 109 contains the functions described in Table 3 34 on page 109 HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 62 SoftTrace Menu wv Record Clock Speed Max Frames v Cycles ms Reset Table 3 34 SoftTrace Menu Description Menu Entry Description Record Switches recording on and off Clock Speed Sets the clock frequency Max Frames Sets the maximum number of recorded frames Therefore you can minimize the amount of memory required to display frames Cycles Displays cycles instead of time in ms ms Displays time in ms instead of cycles Reset Removes all recorded frames Associated Popup Menu The SoftTrace popup menu shown in Figure 3 63 on page 109 contains functions described in Table 3 35 on page 110 associated with the pointed to frame Figure 3 63 SoftTrace Associated Popup Menu Set Zero Base Show Location v Record Clock Speed Max Frames v Cycles ms Reset HC S 12 X Debugger Manual 109 Debugger Components General Debugger Components Table 3 35 SoftTrace Associated Popup Menu Description Set Zero Base Sets the zero base frame to the pointed to f
69. selected instruction Source Source component scrolls to the source statements and highlights it HC S 12 X Debugger Manual Debugger Components General Debugger Components Drop Into Table 3 4 on page 54 shows the drop actions possible in the Assembly component Table 3 4 Drop Into Assembly Component Source Component Window Source Action Displays disassembled instructions starting at the first high level language instruction selected The assembler instructions corresponding to the selected high level language instructions are highlighted in the Assembly component Memory Displays disassembled instructions starting at the first address selected Instructions corresponding to the selected memory area are highlighted in the Assembly component Register Displays disassembled instructions starting at the address stored in the source register The instruction starting at the address stored in the register is highlighted Procedure The current assembly statement inside the procedure is highlighted in the Assembly component Demo Version Limitations No limitation Associated Commands Following commands are associated with the Assembly component ATTRIBUTES on page 499 SMEM on page 578 SPC on page 580 Command Line Component The Command Line window shown in Figure 3 7 on page 55 interprets and executes all Debugger commands and functions The command entry a
70. 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 76 on page 125 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 maybe the connection simulator are listed 124 HC S 12 X Debugger Manual Debugger Components Visualization Utilities Figure 3 76 Inspect Window Components Icon Components z Stack HiwaveBase Undefined H 2 Symbol Table Source Window amp Events Assembly Window Procedure Window Register Window Memory Window 4 amp Exceptions Object Pool AE TargetObject Data Window id Swap Data 2 Window ig Leds Inspect Window Target Target ElfLoader Object File Loader Swap IODevice ID Led Window Command Window Stack Icon The Stack icon shown in Figure 3 77 on page 125 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 Figure 3 77 Inspector Window Stack Icon imi Inspect iof x tr Components EB Stack unsigned int Oxbef 0x2 B Fibonacci B n fibt fib2 n fibo D i EA main i Ed Startup B m ri GG CumbealT shla zl
71. 0 0 eee eee eee 395 Step 10 Run sce ee ghee HERI et hp epe 397 PWM Chantel 0 eR S ER Een bete EL 397 Step 1 Environment Setup 0 00 0 eee 398 Step 2 Creating Project 398 Step 3 Target CPU Window 0 0 0 0 eee eee 398 Step 4 Creating PWM Bean 0 0 00 0 0 eee eee 399 Step 5 Project Panel Window 0 0 00 02 ee eee eee 399 Step 6 Bean Inspector PWM8 PWM 2000 399 Step 7 Generate Driver Code 0 0 00 ee eee eee eee 399 HC S 12 X Debugger Manual 13 Table of Contents Step 8 Verification of Files Created 00 399 Step 9 Entering User Code 0 0 0 0 ee eee eee 400 Step 10 RUM see chet RR Rer ae ae ees 400 VisualizationTool Properties 0 0 0 ee eee 401 Chart Properties sercanta n Ree RI ea ee es 401 Period Bar Properties 2 0 eee eee eee eee 401 Duty Time Bar Properties 402 12 P amp E Multilink Cyclone Pro Connection 405 Introduction ce eese eee ERO ew deen ape eg E EE 405 Windows NT Installation Notice 0 0 cece eee eee ene 405 Interfacing Your System and P amp E Multilink Cyclone Pro 406 Loading the P amp E Multilink Cyclone Pro Connection 407 Default Connection Setup eee 411 13 Softec HCS12 Connection 413 Technical Considerations 0 0c cece eee een eae 413 inDart HCS12 Menu
72. 2 lines display e 5 e e o 1 1 1 Screen on and cursor visible Nn oe oe z e oe oe e e e Screen erased E oe oe z oe z oe e Entry Mode Set AC will be increased End of initialization LCD Menus Figure 11 36 on page 343 shows the LCD menu which is identical to the popup menu Its entry is described in Table 11 16 on page 343 Figure 11 36 LCD Menu Setup The LCD menu contains the Setup function to launch the LCD Display dialog box Table 11 16 LCD Display Menu Description Opens the LCD Display dialog box Setup HC S 12 X Debugger Manual 343 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities LCD Display The LCD Display dialog box shown in Figure 11 37 on page 344 allows you to set the address of the lines port and columns port Figure 11 37 LCD Display Dialog Box Setup LCD Display x m Parts address Select an address or insert a value hex Data freo000 X Control EmA v Port B Port C Port E 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 on page 352 Drag Out Nothing can be dragged out Drop Into Nothing can be dropped into the Lcd d
73. 2 on page 194 Figure 6 2 Load an Application in the Debugger A AmE File View Run Simulator Component Data Window Help oleja Heje X se zz e ee 9 startO8 c for 7 E forever initialize the program call dil if startupData gs ECCLE RE asm Bj abs F140 cheshire i Procedure Srartim ii 5 STEPPED pA The Source component contains source from the module containing the entry point for the application usually the startup module The highlighted statement is the entry point The Assembly component contains the corresponding disassembled code The highlighted statement is the entry point The Global Data component contains the list of global variables defined in the module containing the application entry point HC S 12 X Debugger Manual 195 How To How To Start an Application The Local Data component is empty The PC in the Register component is initialized with the PC value from the application entry point How To Start an Application There are two different ways to start an application 1 Choose Run gt Start Continue 2 Click the Start gt Continue icon in the debugger tool bar gt RUNNING in the status line indicates that the application is running The application will continue execution until you decide to stop the execution See How To Stop an Application on page 196 a breakpoint or watchpoint has been reached an exception has been detected
74. 2064 2109 symbols of the loaded application 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 HC S 12 X Debugger Manual 591 Debugger Engine Commands Debugger Commands UNTIL The UNTIL keyword is associated with the REPEAT on page 569 command Usage UNTIL condition Where condition is defined as in C language definition Components Debugger engine Example repeat open as wait 20 define until i sembly i i 1 592 At the end of the loop i is equal to 3 UPDATERATE Description 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 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 upd
75. 5 8932 v default env 211 11 5 99 9 H Monitors v projectini 1017 Configuratio 11 5 9893 Prog v fibo mak 140 n 7 31 88 1 zy Tutorials fibo MAP 6 29KB 7 22 99 9 Egg Work Default mem 160 77 378 aine fibo o 599 0 File 10 14 99 h v Fibo prm 400 8 18 97 1 e ie v Readme tst 567 Text Docum 8 26 98 1 zy Recycled H Temp MIRI gt In the same way select fibo prm file and add it to this project 218 HC S 12 X Debugger Manual Synchronized Debugging Through DA C IDE Configuring DA C IDE for Freescale Tool Kit You can also add a directory to the project in the following way Select Explorer View Tab in Project Window e 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 popup 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 section Configure the file type will be added to the project Building The Database Development Assistant for C provides the static code analysis of C source files as well as generating various data based on the results Analysis of the project source files and generation of the database are divided into two phases the analysis of individual program modules and generation of dat
76. 587 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 O0xFO4E SP OxFF 00F041 Xi n STEPP 94 TXS D Contents of registers are displayed and the current instruction is disassembled HC S 12 X Debugger Manual 565 Debugger Engine Commands Debugger Commands PAUSETEST Displays a modal message box shown in Figure 20 1 on page 566 for testing purpose Figure 20 1 Test Pause Message Box P i Next test statement Usage PAUSETEST Components Debugger engine Example in gt pausetest 566 HC S 12 X Debugger Manual 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 gt PRINTF The value of the counter is d counter The outputis The value of the counter is 2 PTRARRAY The PTRARRAY command allows to specify if a poi
77. 635 Global Initialization File MCUTOOLS INI PC Only 636 Local Configuration File usually projectini 0 000 637 Default Layout Configuration PROJECT IND 638 HC S 12 X Debugger Manual 23 Table of Contents Ini File Activation 2s esc hs jaye od ph RR EE UL E MD pee ELITR 640 Environment Variable Paths 00 0 0 eee eee eee eee 641 Line Continuation 0 0 eee eee ee eee 642 Environment Variables 0 0 0 0 0 cece eee eee 643 ABSPATH Absolute Path 1 0 0 0 0 00 0 0 2 ee eee eee 644 DEFAULTDIR Default Current Directory 645 ENVIRONMENT Environment File Specification 646 GENPATH include File Path 647 LIBRARYPATH include lt File gt Path 0 0 00 0000008 648 OBJPATH Object File Path 00 0 2 e eee ee eee 649 TMP Temporary directory 0 0 eee eee eee 650 USELIBPATH Using LIBPATH Environment Variable 651 Search Order for Source Files ee eee 652 In the Debugger for C Source Files c cpp l l esee 652 In the Debugger for Assembly Source Files dbg llus 652 In the Debugger for Object Files HILOADER 652 Debugger Files eee ERR MR CREER EDI RE ERES 652 23 Connection specific Environment Variables 655 Connection specific Environment Variables 00005 655 Abatron BDI Conn
78. Assembly lt spc cdSz 42 srSz 0 ea B Case 2 if FTBO ABS is loaded and Save amp 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 Ifonly one or few functions differ after a recompilation not all BP will be lost To achieve that BPs are disabled only if the size of a function has changed 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 a 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 breakpoint will be set and disabled If there is no difference the breakpoint will be set and enabled HC S 12 X Debugger Manual 153 Control Points Setting Breakpoints NOTE For more information about this syntax see BS on page 513 and SAVEBP on page 575 commands Setting Breakpoints The Debugger supports 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 breakp
79. Bit 7 0 data sent from SCI to terminal window HC S 12 X Debugger Manual 287 HC S 12 X Full Chip Simulation Connection Supported Derivatives 288 Serial Peripheral Interface This I O device simulates the Serial Peripheral Interface SPI Registers SPICR1 SPI Control Register 1 SPIE SPE MSTR CPOL CPHA and LSBFE are simulated SPICR2 SPI Control Register 2 SPISWAI and SPCO are simulated SPIBR SPI Baud Rate Register SPPR2 SPPR1 SPPRO SPR2 SPR1 and SPRO are simulated SPISR SPI Status Register SPIF SPTEF and MODF are simulated SPIDR SPI Data Register Bit 7 0 are simulated Not memory mapped Registers SPIValue This is a not memory mapped register and will serve to sent and receive swap a character from and to the SPI Bit 7 0 data sent from to SPI Converter Modules Analog to Digital Converter This I O device simulates the Analog to Digital Converter ATD 8 channels and 16 channel versions of the ATD module are supported The analog inputs are reachable separately through the object pool They are called PADO to PAD7 PAD15 For the ATD module 1 PADO input corresponds to the PAD8 PAD 16 pin of the microcontroller HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Conversion Results The analog inputs of ATD module are simulated as 8 bit logic values Therefore the simulation of the conversion itself only has a limited interest The con
80. Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 MC9S12DP512 Analog to Digital Converter on page 288 41850 Bus BLCD on page 285 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 4 Supported Derivatives continued Derivative Name MC9S12DT128B Modules Analog to Digital Converter on page 288 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface M
81. Connection Abatron BDI Requirements For CPU12 and HCS12 supports banked memory handling e g M 85HC8124A4 M68HC912DG128 MC9S12DP256 Refer to the Banked Memory Location Window on page 447 section Abatron BDI Requirements Ensure that your hardware target board incorporates a Background Debug Mode BDM port for CPU background interfacing with the BDI interface and the debugger Please check the technical specifications provided by the ABATRON User Manuals and Freescale One free serial communication port of your computer is required to communicate with the BDI interface You may need to set it up even if you will be using an Ethernet communication instead of an RS 232 serial communication Abatron BDI Connection Introduction Another advanced feature of the debugger for the embedded systems development world is the ability to load different connections which implements the interface with target systems The Abatron BDI Connection is introduced in this document This document describes the specific features of the Abatron BDI Connection With this interface you can download an executable program from the debugger environment to an external target system based on a Freescale MCU which will execute it You also have the feedback of the real target system behaviour to the debugger The debugger supervises and monitors the MCU of the target system i e control the CPU execution You can read and write in internal external
82. Display Properties Dialog Box 0 00 00 000 e eee 335 IT Keyboard Component o ceriose 0 0 00 eee eee eee 336 IT Keyboard Menu 0 cece cece nee 337 Interruption Keyboard Setup 0 0 0 0 0 eee eee eee 337 LED Component ez SR eae PS I E eed 339 LED Operation eot ERR eed edad RE Reed 339 Instruction Lasting iisi loas b ale Bane b EE is 340 The Initialization Step 00 eee eee eee 342 LCD Menus 2 opus Tree prREReDP TRE VESEPEIUNREEdedS E SER 343 LED Displays ott RED RWeSSE IL Eehuteeti bete 344 Monitor Component ss roen e e ee eee 345 Monitor Men sce eR onde aoe barnes UE RE pe vs 345 Add Channel oe ab RIA IRERPRETSES 346 Monitor Settings 0 20 ee eee ee hene 346 HC S 12 X Debugger Manual 11 Table of Contents Change Colors s arenes aa ele ea eee ae 347 Push Buttons Component 0 0 0 eee eee eee eee 349 Push Buttons Menu 02 0c e 349 Push Buttons Setup cisco tr RR a ESO 349 Use with I O cPotts ico REOR UeDWU De RE ES 350 Use with LEDs Component 0 0 0 0 2 cee e 350 Programmable IO Ports Component 00 000 5 352 Programmable IO Ports Menu 2 0 eee eee eee eee 352 Port Addresses r coe tale era ettet o p depu es oat 353 7 Segments Display Component 0 0000 e eee eee 354 7 Segments Display Menu 00 00 00 2 eee eee ee eee 355 7 Segments Display Setup 0 00 ce eee
83. Enable Register KWIFD Port D Flag A falling edge on the associated pin sets each flag Register provided that the corresponding DDRD Register bit is reset To clear the flag write one to the corresponding bit of the KWIFD register PORTH Port H Register Implemented DDRH Port H Data Implemented Direction Register KWIEH Port H Interrupt Implemented Enable Register KWIFH Port H Flag A falling edge on the associated pin sets each flag Register provided that the corresponding DDRH Register bit is reset To clear the flag write one to the corresponding bit of the KWIFH register PORTJ Port J Register Implemented DDRJ Port J Data Implemented Direction Register KWIEJ Port J Interrupt Implemented Enable Register KWIFJ Port J Flag A falling edge on the associated pin sets each flag Register provided that the corresponding DDRJ Register bit is reset To clear the flag write one to the corresponding bit of the KWIFJ register KPOLJ Port J Polarity Implemented Register HC S 12 X Debugger Manual Table 11 11 Key Wakeups HC S 12 X Full Chip Simulation Connection Supported Derivatives Abbr Full Name Implemented Meaning PUPSJ Port J Pull Up Pulldown Select Register Not simulated as there are no physical outputs PULEJ Port J Pull Up Pulldown Enable Register Not simulated as there are no physical outputs The Full Chip Simulation does not implement Port D register mapping in wide expanded
84. Environment section Select a variable with the mouse or Up Down buttons Command Buttons OK Changes are confirmed and saved in current project file Cancel Closes dialog box without saving changes Help Opens the help file HC S 12 X Debugger Manual 17 Debugger Interface Debugger Main Window View Menu In the Main Window View menu Figure 2 9 on page 18 you can choose to show or hide the toolbar status bar window component titles and headlines see the Component Windows Object Info Bar on page 35 You can select smaller window borders and customize the toolbar Table 2 3 on page 18 describes the View Menu entries Figure 2 9 View Menu v Toolbar v Status Bar Hide Title Hide Headline Small Border Customize Table 2 3 View Menu Description Menu Entry Description Toolbar Check uncheck Toolbar if you want to display or hide it 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 Customize Opens the debugger Customize Toolbar window Customizing the Toolbar When you select Customize from the View menu the Customize Toolbar dialog box appears You can customize the
85. Example Program Without Stimulation 1 Run the debugger with the Full Chip Simulation connection The Main Window is shown in Figure 11 70 on page 372 Figure 11 70 FCS l O Simulation Main Window True Time Simulator amp Real Time Debugger Mi x File View Run Simulator Component Source Window Help olsa e epe z z 2 ik Source Bee Assembly ioj x For Help press F1 372 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection True Time I O Stimulation 2 Choose Simulator gt Set gt Sim 3 Choose Component gt Open gt Io led The IO Led component is shown in Figure 11 71 on page 373 Figure 11 71 IO Led Component Window QOQOOQOOQOQ PORT 00 DDR 00 4 Choose Component gt Open gt Template The Template component is shown in Figure 11 72 on page 373 Figure 11 72 Template Component Window fl Template x Choose Simulator gt Load io demo abs 5 6 Choose Run gt Start Continue or click the green arrow icon 7 Tf the program halts in startup click the Start Continue command again 8 Choose Run gt Halt to stop execution after a few seconds The Template component is a view linked to a specific memory location in TargetObject In the source code of the test program you can find a variable associated with it define PORT_DATA volatile unsigned char 0x0210 Value with range 0 255 The Template component polls
86. Files of type Flash monitoring file fpp Cancel If you check the Auto select according to MCUID checkbox the NVMC utility searches for and loads the corresponding F PP 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 dies not save the FPP in the project file Click the Cancel button to close the dialog box without saving changes Loading an Application in Flash The Load button and the Load selection of the connection specific menu function identically Using either of these controls brings up the Load Executable File dialog box which lets you select the file to be loaded The Load Executable File dialog box lists the executable files that relate to blocks selected in the NVMC dialog box HC S 12 X Debugger Manual 475 HC S 12 X Flash Programming NVMC Graphical User Interface Figure 18 8 Load Executable File Dialog Box Look in C3 wsditzc gt amp e x sit a HexbO00 abs ai Hex1b000 abs Hex6bO00 abs Hex7b000 abs a Hex9000 abs Files of type Executables abs Cancel If a problem occurs during application loading into flash the NVMC utility displays an error message Figure 18 9 FLASH Programming Error Message B
87. HC S 12 X Debugger Manual Control Points 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 it is 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 it is disabled f Save amp Restore on load is checked and the user quits the Debugger or loads another ABS file all breakpoints will be saved f Save amp Restore on load is unchecked default only this flag SAVEBP off is saved Breakpoint File BPT Example Case 1 if FIBO ABS is loaded and Save amp Restore on load was checked in a previous session of the same ABS file and breakpoints have been defined the FIBO BPT looks as shown in Listing 4 2 on page 153 Listing 4 2 Breakpoint File with Save amp Restore on load Checked savebp on BS amp fibo BS amp fibo BS amp fibo 0x800 me I BS amp fibo c 9 e c Fibonacci 19 P E cond fibo gt 10 E cdSz 47 srSz 0 Fibonacci 31 P E cdSz 47 srSz 0 main 12 P E cdSz 42 srSz 0 main 21 P E cond fiboCount 5 E cmd
88. Interface Software Setup 0 00 00 ee eee 430 Running the ABATRON Configuration Tool 430 Example with B10C12 EXE Configuration Tool 430 Firmware Loading slseeeeeeeeeeee eA 431 Initialization List Startup Init List Loading 432 Communication with the Debugger Setup 433 BDI Working Mode and Setup List Transmission 434 Loading the Abatron BDI Connection 00 434 Abatron BDI Connection Menu Entries eese eee 437 0 To P eee ea E E ee UE 437 Reset cu ur debe E EV EE A ee bie ele a 437 Communication or Connect 2 2 ee eee eee 437 Setup hog yee yarns Sa Ro po RR e etude ase oe ec e RU de eda tati 438 Configure BDI Box various ec re 438 Set Bank ome e oie eee to ert e wate eee ae NE ea DA 438 Command Files xor e de ERN ne ugh ee 438 Help in etpRREPEP ETE RO SP PED MEUS REEF 438 Abatron BDI Connection Windows Edit and Dialog Boxes 438 Communication Device Specification Edit Box 439 Setup Dialog Box 2 oe REUS teeing be ee eee ewe dey 440 Abatron BDI Status Bar Information 0 0 0000 441 otatus Messages cbse ERAS V a a ten deer IMEEM 441 BDI ready V XRK e pa eda ma pU baal KORR RT EROR RR X RC ae Os 441 No Link To Target ssal ei a ERE eed a EE MUS 441 RUNNING e eea bide eae eb ubRERE PARA 441 HC S 12 X Debugger Ma
89. MSG DelayQueue ELSIF i 5 THEN MSG BlockedByReceive ELSIF i 6 THEN MSG WaitForSemaphore ELSIF i 7 THEN MSG Dummy ELSIF i 8 THEN MSG SysBlocked ELSE MSG invalid END 180 HC S 12 X Debugger Manual Real Time Kernel Awareness Inspecting Kernel Data Structures Inspecting Kernel Data Structures To allow the debugger to display the data structures of the operating system the corresponding symbol information has to be available This is the case when using SOOM System REM When another kernel is used its source code would have to be available and would have to be compiled However if only the object code is available the needed symbol information can be generated in the following way The kernel data structures of interest have to be described using ANSI C language as shown in Listing 5 2 on page 181 Listing 5 2 Kernel Data Structure Description typedef struct PD int status struct PD next long regs 6 PD This is an example of the definition of a simple task descriptor Variables can be collected in a structure and have to be assigned to a segment for example OS_DATA shown in Listing 5 3 on page 181 Listing 5 3 OS_DATA Structure pragma DATA_SEG OS_DATA struct PD readyList list of tasks ready to be executed char filler 6 unimportant variables int processes total number of tasks PD processes 10 the 10 possible
90. Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities In the first line the stimulated object is defined This object is located at address 0x210 and is 1 byte wide Once 200000 cycles have been executed the memory location 0x210 is accessed periodically 50 times line 3 First the memory location is set to 128 and then 100000 cycles latter it is set to 4 NOTE the True Time I O Stimulation on page 372 section describes in detail and with example how to take advantage of this component NOTE Drag Out Nothing can be dragged out Drop Into Nothing can be dragged into Demo Version Limitations Only 15 interrupts and memory access will be generated HC S 12 X Debugger Manual 359 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities TestTerm Component The TestTerm window shown in Figure 11 59 on page 360 is a user friendly terminal input output It provides a simple SCI Serial Communication Interface interface which is Full Chip Simulation independent Figure 11 59 TestTerm Window ii TestTerm IDE x Calculator 41 69 2829 The TestTerm component emulates a serial communication interface based at the address 200 hex therefore providing 5 simulated memory mapped registers described in Table 11 22 on page 360 Table 11 22 TestTerm Simulated Memory Mapped Registers Register Name Function Register Address BAUD Bau
91. Manual for your CPU from ABATRON Use the following sequence to load code into the internal flash l Flash Erase 2 Flash Load 3 Download the code using the normal debugger Abatron BDI Load browser menu entry or the debugger LOAD command Every write to the flash range including WB WW WL commands uses the programming algorithm 4 Flash Idle Examples of HC12 CPU12 Direct Commands For the Direct Commands the following default values are used HC912B32 FLASH ERASE addr 8000 size 8000 sram BDI Workspace FLASH LOAD addr 8000 size 8000 sram BDI Workspace HC912D60 FLASH ERASE addr 8000 size 8000 sram BDI Workspace FLASH LOAD addr 1000 size F000 sram BDI Workspace HC912DA G128 FLASH ERASE addr 8000 size 8000 sram BDI Workspace FLASH LOAD addr 4000 size C000 sram BDI Workspace Finally set your Preload Command File and Postload Command File of your project directory with the BDI command as shown HC912B32 Before downloading in Preload Command File HC S 12 X Debugger Manual 445 Abatron BDI Connection Flash Programming 446 BDI flash erase BDI flash load After downloading in Postload Command File BDI flash idle HC912D60 Before downloading in Preload Command File BDI flash erase addr 8000 size 8000 BDI flash erase addr 1000 size 7000 BDI flash load After download in Postload Command File BDI flash idle HC912DA128 HC912DG128 Before do
92. Nothing can be dropped into the Module Component window Demo Version Limitations Only 2 modules are displayed HC S 12 X Debugger Manual 95 Debugger Components General Debugger Components Procedure Component The Procedure window shown in Figure 3 49 on page 96 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 Figure 3 49 Procedure Window 96 E Procedure i IDE XI fibo c Address 8055 Fibonaccs ne 5 main zi Startup In the Procedure Component window entries in the call chain are displayed in reverse order from the last most recent on top call 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 t
93. On chip DBG Module e Chapter 3 2 HCS12X On chip DBG Module Chapter 3 3 Debugging Memory Map on page 457 Chapter 3 4 HC S 12 X Flash Programming on page 467 HC S 12 X Debugger Manual 451 Book IIl Contents 452 HC S 12 X Debugger Manual 15 HCS12 On chip DBG Module Documentation for this chapter is now being updated and will be available on a special Web Release of this product on or before March 15 2006 HC S 12 X Debugger Manual 453 HCS12 On chip DBG Module 454 HC S 12 X Debugger Manual 16 HCS12X On chip DBG Module Documentation for this chapter is now being updated and will be available on a special Web Release of this product on or before March 15 2006 HC S 12 X Debugger Manual 455 HCS12X On chip DBG Module 456 HC S 12 X Debugger Manual 17 Debugging Memory Map Introduction The Debugging Memory Map DMM is a software Manager caring for all debugger accesses to device chip memory and also caring for 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 NOTE The Debugging Memory Map Manager and DMM user interface replaces the Legacy Banked Memory Location dialog Set Bank menu entry By the way the BANKWINDOW command has been completely removed as banks handling is now transparently h
94. PORTT pins individually as standard parallel port I O pins or as timer pins For standard parallel I O pins reading and writing are transparen behavin like reading writing in typical RAM For this configuration assign the value 1 to the channel x bit IOSx in the TIOS register for compare mode Assign the value 0 to the OMx and OLx bits of the TCL1 or TCTL2 register for Timer disconnected from output pin logic mode output action Capture Stimulation on PORTT You can simulate rising and falling edge input signals on PPORT with the Stimulat component I O Stimulation In this case PORTT is bit accessible via non memory mapped I O registers PORTTBIt0 through PORTTBit7 The stimulation example below periodically stimulates the PORTT bit 5 to simulate an input capture def a TIMER PORTTBit5 PERIODICAL 4000 500 1000 a 1 3000 a 0 END Other user designed I O components also can set the PORTT bit value Use OP SetValue RegisterBlock PORTTBit5 amp parameter NO UPDATE function with parameter n 0 1 16 Bit Modulus Down Counter Related Registers MCCTL 16 bit modulus down counter control register All bits simulated except ICLAT bit MCCNT modulus down counter count register Fully simulated HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Capture Compare Timer TIOS timer input capture output compare select Simulated CFORC timer compare forc
95. Profiler Component The Profiler window shown in Figure 3 51 on page 98 provides information on application profile NOTE In cases where in cases of advanced code optimizations like linker overlapping ROM code areas the profiler output data is affected In such a case it is recommended to switch of such linker optimizations Figure 3 51 Profiler Window El fibo c Fibonacci main E startup c Init Startup 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 52 on page 98 To obttain a split view in either the Source or Assembly windows select Details Source or Details Assembly or both from the Profilier menu and submenu The split windows effect ends when the Profilier window is closed Figure 3 52 Split View in the Source and Assembly Windows i Source im x rea DE x fibo n i 2 while i lt n fibl fibZ CPRPODRPRR 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 98 HC S 12 X Debugger Manual Debugger Components General Debugger Components Split views are removed when th
96. Program Page Index Register Is simulated Multiplexed External Bus Interface MEBI This I O device simulates the Multiplexed External Bus Interface MEBI The MEBI block is part of the Core and its description can be found in the CORE manual This block controls the behavior of the ports A B E and K the IRQ and XIRQ signals and the operating mode of the Core normal extended special In the Full Chip Simulation only the single chip mode is simulated Therefore ports A and B cannot be used as external bus lines Only the I O behavior of the ports is simulated except for port E The IRQ and XIRQ functionality going through port E pins 0 and 1 are simulated together with the various I O enabling conditions of the port E pins described in the PEAR register When a port E pin is not selected as a I O pin it stays at 0 other functionality are not simulated HC S 12 X Debugger Manual 293 HC S 12 X Full Chip Simulation Connection Supported Derivatives 294 Port Integration Module PIM This I O device simulates the Port Integration Module PIM The PIM module controls all the ports that are not directly associated to the CORE All registers present in the PIM module are port specific apart from the MODRR register that affects ports S P M J and H All port specific registers have been implemented together with the interrupt logic associated Timer Modules Clock and Reset Generator CRG This I O device simulates th
97. Project lt ProjectName gt where ProjectName is the name of the file describing the project to be loaded for example Project Projl 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 will be opened as a new project file See File Menu on page 14 section for more details about Projects NOTE _ If Layout and Project are defined in PROJECT INT the Project parameter overwrites the Layout parameter also containing layout information MainFrame lt nbr gt lt nbr gt lt nbr gt lt nbr gt lt nbr gt lt nbr gt lt nbr gt lt nbr gt lt nbr gt lt nbr gt This variable is used to save and load the Debugger main window states positions size maximized minimized iconized 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 HC S 12 X Debugger Manual 63 Debugger Engine Environment Variables Local Configuration File usually project ini 640 Tooolbar 01 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 th
98. Properties you will find general settings Software drivers are found under the tab Methods and Events Select Properties tab Select Period and enter 100 ms Select Starting pulse width and enter 10 ms Step 7 Generate Driver Code We are going to generate the code for the I O drivers and the files for the user code Select the Make icon in the Project Manager window or the menu bar Project gt Make or F7 Processor Expert shows several messages One message indicates that we have started the code generation The second message shows the progress with the information processed and the code generated Another window shows compiling and linking progress Step 8 Verification of Files Created We can verify the folders created by Processor Expert User Modules A file MyPWMChannel0 C that is the placeholder for the main procedure and any other procedure desired by the user These other procedures can of course be placed in additional files HC S 12 X Debugger Manual 399 HC S 12 X Full Chip Simulation Connection FCS Tutorials 400 Generated Code The C files for the code associated with the beans added to the project This includes initialization input output and the declarations necessary for the use of the functions Step 9 Entering User Code e Open the user module MyPWMChannel0 C Replace the main routine with the following co
99. S 12 X Full Chip Simulation Connection FCS Visualization Utilities IT Keyboard Component The IT Keyboard window shown in Figure 11 26 on page 336 is a 20 key keyboard that generates an interruption when a key is pressed Figure 11 26 IT Keyboard Window im IT Keyboard Ea The IT Keyboard consists of a 20 key keyboard as shown in Figure 11 26 on page 336 These 20 keys are positioned at the intersection of the five lines X0 to X4 and the 4 columns YO 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 will give a logical level 0 and a key pressed on this line or column will place the column or the line corresponding on the low level For example if line X2 is activated column Y3 will decrease 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 Figure 11 27 IT Keyboard Constitution 336 X0 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities 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 a0 at line X4 X3 X2 X1 X0 being at 1 Read the column successively from Y3 to YO Put a0 at line X3 X4 X2 X1 XO being at 1 Read the column again from
100. Show Protocol On Off Syntax SHOWPROT 1 0 Default The default value is 0 HC S 12 X Debugger Manual Description If the Show Protocol is used all the commands and responses sent and received are reported in the Command Line component of the debugger If the variable is set to 1 Show Protocol is activated This variable is set according to the Show Protocol check box of the Communication Device Specification Dialog Box on page 436 Example SHOWPROT 1 NOTE The Show Protocol is a useful debugging feature if there is a communication problem SKIPILLEGALBREAK Short Description Enables skipping illegal breakpoints Syntax SKIPPILLEGALBREAK 1 0 Default The default value is 0 Description This variable is set according to the Continue on illegal break banked hardware breakpoint option check box of the Setup Dialog Box on page 440 The Continue on illegal break banked hardware breakpoint option check box is only available for the HC12 CPU12 derivative You can check this check box to overcome the 2 byte address size on chip break module which does not handle the PPAGE e g HC912DG128 Note that internally the target will be halted by the hardware breakpoint in Flash memory compared with the breakpoint that you set then relaunched if not bank matching Example SKIPILLEGALBREAK 1 HC S 12 X Debugger Manual 659 Connection specific Environment Variables Abatron BDI Connect
101. Simulation Hep SofTec HCS12 C Program FilesFreescaleNCW for HC12 V4 5prog HC5125ERIALMON tgt zl HC S 12 X Debugger Manual 255 HC12 Debugging First Steps Switching to HCS12 Serial Monitor Connection 3 Select HC12 as Processor then HCS12 Serial Monitor as the connection in the Set Connection dialog box and click the OK button 4 Now in the Monitor Setup window Monitor Communitation tab choose the correct Host serial communication port if necessary Figure 10 26 Monitor Setup Window Monitor Communication Tab a 5 Press the OK button The HCS12 Serial Monitor connection reads the device silicon ID This ID can match several derivatives 6 Set the correct derivative matching with your hardware in the Derivative Selection dialog box Figure 10 27 Derivative Selection Dialog Box Derivative Selection MC3S08GB32 MC3508GB32 MC9SOBGT32 M GBE MCSSOBGTEQ 256 HC S 12 X Debugger Manual 7 Press the OK button The Monitor Setup window is opened again showing the Vector Table Mirroring Tab to propose to use the mirrored vector table feature We recommand that you use the Vector Table Mirroring feature Otherwise vectors cannot be programmed as captured and protected from erasing or overwriting by the HCS12 Serial Monitor 8 To enable this specific feature check the Enable Vector Table Mirroring checkbox Figure 10 28 Monitor Setup Window Vector Table Mirroring Tab 9 Pres
102. 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 on page 223 In the Menu Start Actions click on new and fill in the created New Action box with amp Link then validate with ENTER After setting the corresponding bitmap copy the following lines shown in Listing 9 2 on page 222 in the Action Script field and change the directory to where the linker is located Listing 9 2 Script for Linker Action Association c Freescale prog linker exe fibo prm Sif SExist edout Message No Messages found Cancel ErrClr ErrGet edout oe oe 222 HC S 12 X Debugger Manual Synchronized Debugging Through DA C IDE Configuring DA C IDE for Freescale Tool Kit Figure 9 8 DA C Linker Settings User Defined Actions amp Linker Up FRE po Linker BMP c hiware prog linker exe fibo prm if Exist edout 4Message No Messages found Cancel XE rrCh 4EnGet edout Maker Configuration In the same way you can now configure the maker as illustrated in Figure 9 9 on page 224 In the Menu Start Actions click on new and fill in the created New Action box with amp Make then press ENTER After setting the corresponding bitmap copy the lines from Listing 9 3 on page 223 in the Action Script field and change the direct
103. Step 3 Target CPU Window The Target CPU window in the center shows a footprint of the processor selected for the development In the device we see the different on chip modules such as CPU Timer A D converter Modules with an icon attached to them are modules used by the application The pins that are used to connect external functions are indicated by a line and an icon symbol of the function attached CPU and Port A Optional 398 Place the cursor of the mouse on the pins to see a description of their functions Enlarge the Target CPU window and you will see different on chip modules HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Step 4 Creating PWM Bean Select Bean Categories gt CPU internal peripherals gt Timer gt PWM Step 5 Project Panel Window The Project Panel window shows and keeps track of the beans that have been created for this application This Panel is a tab of the Project Manager window A click on the next to a bean shows a list of methods and or events related to the bean A green tick indicate if the named methods or event is selected and a red cross that code has not been generated Under Beans you should find the previously created bean with the name PWM8 PWM Step 6 Bean Inspector PWM8 PWM In this window you can modify the behavior of the bean to your needs In the tab
104. Step Over a Function Call Flat Step 000 198 Step Out from a Function Call 0 0 0 eee eee 198 Step on Assembly Level cs mrna oe n e E E eee 199 How To Work on Variables l l 199 Display Local Variable from a Function lsslel eese 199 Display Global Variable from a Module 0000 199 Change Format for Variable Value Display 200 Modify a Variable Value 2 0 0 0 cee eee ee eee 201 Get the Address Where a Variable is Allocated 202 Inspect Memory Starting at a Variable Location Address 202 Load an Address Register with the Address of a Variable 202 How To Work on the Register 203 Change Format of Register Display l l 203 Modify a Register Content 0 0 cece eee ee eee eee 203 HC S 12 X Debugger Manual 7 Table of Contents Modify Index or Accumulator Register Content 203 Modify Bit Register Content llle eese 204 Start Memory Dump at Address Where Register Is Pointing 204 Modify Content of Memory Address 00 0 00002 eee ee eee 205 How to Consult Assembler Instructions Generated by a Source Statement 205 How To View Code wie feb Sol ea tok hue ee eeeERAEDTETa C ES pes 206 How to Communicate with the Application 000 207 About startup cmd reset cmd preload cmd postload cmd 207
105. TC5_H 0x009A 0x00 TC5_L 0x009B 0x00 TC6_H 0x009C 0x00 TC6_L 0x009D 0x00 TC7_H 0x009E 0x00 TC7_L Ox009F 0x00 PACTL 0x00A0 0x00 305 HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 7 TIM Simulated Registers Register Register Initial Remarks Name Address Value PAFLG 0x00A1 0x00 PACNT H 0x00A2 0x00 PACNT L 0x00A3 0x00 TIMTST 0x00AD 0x00 TCBYP PCBYP The Full Chip Simulation does not support these TIMTST bits writing to them has no effect These bits have meaning only for chip testing in special mode PORTT Ox00AE 0x00 DDRT OxOOAF 0x00 Serial Communication Interface SCI You should implement the SCI module as a separate class because there are several almost identical instances of this class Supported Features Table 11 8 on page 306 shows the SCI supported features Table 11 8 SCI Supported Features Abbr Full Name Implemented Meaning Baud Rate Control SBRx Baud Rate Bit transmittal follows current baud rate settings BTST Reserved for Ignored internal tests BSPL Reserved for Ignored internal tests BRLD Reserved for Ignored internal tests 306 Control Register HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Table 11 8 SCI Supported Features Supported Derivatives Abbr Full Name Implemented Meaning LOOP LOOP Mode
106. 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 gt RESTART After the RESTART command the cycle counter is initialized to zero 570 HC S 12 X Debugger Manual RETURN The RETURN command terminates the current command processing level returns from a CALL on page 515 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 Iin file d demo cmd2 txt ETURN returns to the caller d 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 on page 587 Trace instruction is executed HC S 12 X Debugger Manual 571 Debugger Engine Commands Debugger Commands 572 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
107. The Freescale debugger uses the Multilink Cyclone Pro to communicate with an external system also called a connection With this interface you can download an executable program from the Freescale debugging environment The destination of this program is an external connection target based on a Freescale MCU that executes the program The Freescale debugger receives feedback of real target system behavior The Freescale debugger fully supervises and monitors the connection target system MCU That is it controls the CPU execution You can read and write in internal or external memory when the MCU is in background mode You have full control over the CPU state You can stop execution proceed in single step mode and set breakpoints in the code NOTE When creating a new ICD 12 debugging project you must select the P amp E Multilink Cyclone Pro connection in the stationery Wizard Windows NT Installation Notice For access to the parallel port of a host computer running Windows NT you must install a special driver To install this driver first install the Freescale Development Kit on the Host then run the setup program This program is in the directory icd dr bat prog drivers Nt ICD Freescale installation on the host computer includes installation of this directory HC S 12 X Debugger Manual 405 P amp E Multilink Cyclone Pro Connection Interfacing Your System and P amp E Multilink Cyclone Pro Alternatively you can run the
108. The LOOP mode determines SCI connection to the outer world As this SCI is simulated there is no connection to simulate WOMS Wired Or Mode Special feature of LOOP mode not simulated RSRC Receiver Special feature of LOOP mode not simulated Source M Mode 8 or 9 data bits Supported different timing 9 bit WAKE Wakeup by Not supported Address Mark Idle ILT Idle Line Type Considered in the Idle Line Detection PE Parity Enabled Not simulated PT Parity Type Not simulated TIE Transmit Supported Interrupt Enable TCIE Transmit Supported Complete Interrupt Enable RIE Receive Supported Interrupt Enable ILIE Idle Line Supported Interrupt Enable TE Transmitter Transmission process stops if this bit is clear Enable RE Receiver Enable Receive process stops if this bit is clear As the input register is not part of the simulation it still receives stimuli RWU Receiver Wake Not supported Up Control HC S 12 X Debugger Manual 307 HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 8 SCI Supported Features Abbr Full Name Implemented Meaning SBK Send Break Upon the first set of the SBK Flag the transmitter starts sending 10 11 if M bit is set O values The counter will be set only if the flag was cleared previously After the counter sends the required number of 0 bits it continues send 0 bits as long as the SBK flag remains set Status Registers
109. Title and Headline Tey fibl fib2 fib2 fib2 fibo iH E return fibo E void main void Figure 2 13 on page 20 shows a component window without a title and headline and with a small border Figure 2 13 Component Window without Title and Headline and with Small Border i 2 E while i WB fibo fibl fib2 fibl fib2 fib2 fibo M i m return fibo E void main void v b Figure 2 14 on page 21 shows a component window without headline and small border 20 HC S 12 X Debugger Manual Debugger Interface Debugger Main Window Figure 2 14 Component Window without Headline and Small Border i Source i OE x dai fibl fib2 fib2 fibz fibo i E return fibo E Run Menu The Main Window Run menu shown in Figure 2 15 on page 22 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 on page 22 HC S 12 X Debugger Manual 21 Debugger Interface Debugger Main Window Figure 2 15 Run Menu True Time Simulator amp Real Time Debugger D Profiles RTHO2c My Documents MyProj Simulator ini File view Run Simulator Component Memory Window Help Start Continue F5 Restart Ctrl Shift F5 a r D Profiles Single Step Fil incl Step Over F10 ines and macros cooo LDS 8448 incl Step Out Shift F 11 rivative information CALL 0x8004 0x00 pragn
110. Unfolding Use this feature to show or hide a section of source code e g source code of a function For example if a section is free of bugs you can hide it All text is unfolded at loading Sections of code that can be folded are enclosed between E and E i Sections of code that can be unfolded are hidden under m Double click a folding mark k or E to fold the text located between the marks Double click an unfolding mark m to unfold the text that is hidden behind the mark HC S 12 X Debugger Manual Debugger Components General Debugger Components Source Menus The Source Menu ia shown in Figure 3 68 on page 115 and Figure 3 69 on page 116 shows the functions associated with the Source Popup Menu while Table 3 36 on page 116 describes these functions Figure 3 68 Source Menu Source Window Help Open Source File Copy Ctrl C tL Go To Line Ctrl G Find Ctrl F Find Procedure Ctrl I i Folding gt v Marks ToolTips HC S 12 X Debugger Manual 115 Debugger Components General Debugger Components Figure 3 69 Source Associated Popup Menu _stal gif USE C p int D Protiles RTHO2c My Documents nextun sources Set Breakpoint Run To Cursor for 33 Show Breakpoints i p Show Location if i brei Set Markpoint a Show Markpoints dst pt 2 Open Source File do E Copy Ghl G 23 Ant dsi Go To Line Ctr
111. Use the DEFINE on page 526 command to define symbols and the UNDEF on page 589 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 ClS 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 3S specifies to list symbol table statistics following the list of symbols Components Debugger engine Example in gt ls User Symbols j 0x2 2 Application Symbols counter 0x80 128 fiboCount 0x81 129 j 0x83 131 n 0x84 132 fibl 0x85 133 fib2 0x87 135 fibo 0x89 137 Fibonacci OxF000 61440 Entry OxF041 61505 When LS is performed on a single symbol e g in gt ls counter that is an application variable as well as a user symbol the application variable is displayed HC S 12 X Debugger Manual 557 Debugger Engine Commands Debugger Commands Example with j being an application symbol as well as a user symbol in gt ls j Application Symbol j 0x83 131 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 Debug
112. X Full Chip Simulation Connection True Time I O Stimulation watching the Template component The arrow is not raising with continuity but jumping around The value of PORT DATA is now handled from outside from our Stimulation component Using an editor open the file named io var txt in the Full Chip Simulation demo directory This file looks like Hypertextparanum Listing 11 7 io var txt Define an identifier a which is located at address 0x210 This identifier is 1 Byte wide def a TargetObject 210 B After 200 000 cycles have expired repeat 50 time the code sequence specified between the keywords PERIODICAl and END PERIODICAL 200000 50 50000 a 128 After 50 000 cycles write 128 at address 0x210 150000 a 4 After 150 000 cycles write 4 at address 0x210 END 10000000 a 0 After 10 000 000 cycles write 0 at address 0x210 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 and then 100 000 cycles later it is set to 4 Example Program with Stimulated Interrupt Choose Simulator gt Reset Activate Stimulation Window by clicking on it Choose Stimulation gt Open File io int txt Select the Source component window Choose Source Open Module io demo c
113. Y3 to YO e 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 is interesting when scanning This one could work only when a key is activated and not continually IT Keyboard Menu Figure 11 28 on page 337 shows the IT Keyboard menu and its entries are described in Table 11 15 on page 337 Figure 11 28 IT Keyboard menu Setup Table 11 15 IT Keyboard Menu Description Opens the Interrupt keyboard setup dialog Interruption Keyboard Setup The Interrupton Keyboard Setup dialog box shown in Figure 11 29 on page 338 allows you to set the address of the lines port the columns port and the number of the interruption vector HC S 12 X Debugger Manual 337 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 29 Interruption Keyboard Setup Dialog Box Interruption keyboard Setup Ea m Ports address Keys label Select an address or insert a value hex 0 1 2 3 Lines Columns m Interruption vector Vector number hex 40 zz gt Z 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 u
114. a debugger display filter for a Memory window e g when creating an no read access while running memory address range A Flat memory architecture i e without memory blocks moving feature would provide the following Priority drop down list e g HC12 HCS12 HCS12X cores Figure 17 4 HC12 HCS12 or HCS12X Core Types Priority highest debugger m highest debugger Comment default device lowest debugger The default is the way the CPU sees the different memory onchip blocks all memory block with the same priority Memory Read Caching The Refresh memory when halting option controls the debugger memory cache When this option is checked internal image cache of memory data are always deleted and the data is always retrieved from hardware when required by the debugger When unchecked usually by default for Non Volatile Memory areas the DMM keeps a copy of the data and does not read retrieve the data from hardware until next application loading programming NOTE Each declared memory address range in the GUI has its own private code cache monitored by the DMM The DMM CACHINGOFF command can fully disable the caching feature for the entire DMM i e for all defined memory ranges The DMM CACHINGON command re enables the caching feature HC S 12 X Debugger Manual 461 Debugging Memory Map CPU Core Types and Priorities Access While Running The no memory access while running option can be used
115. a RR Beta Son eon Ge als Rotten ae pele oe pe ene Rae dd 543 com 544 GOTO 6 oit Ip webs x eA MER b 545 GOTOIBZ iod EU EU RU ee eh EM Hee P 546 GRAPHICS crepat osde ee eere eek ice E gerbes edema 547 HELP cueste xb x ER ER epe ne 547 IE iso We eee eei eee e 548 INSPECTOROUTPUT eic ER RR RARE lee alee RE 549 INSPECTORUPDATE ere An RUE ip HOT 549 EE Sse sis cedens tic tt ne We ka LC UE ORARE A ENORMI 550 LOAD ek orgies bien a a eee ea Baa anal lie etre ent A R ence A 551 LOADCODE Ww 6 hats pha ead sian see etd be EUER 552 LOADSYMBOLS abit ee cakes See eee SAS ae dea oes 552 POG ieee ote exp nx rep EE URP SU 553 More About Logging of IF FOR WHILE and REPEAT 554 DS hot Lr atre eee S 557 MEM sii eee buie tbussseualU ebbe 558 MS zer a eut doe Rs UR ERI RESI UC OUR fub rs RC nee dee 559 IN Bia ue bRSERRERRS CP ERUS OL Ma od AREA ERE 560 NOGCR i scuba lunette Corgan br rented RE RR ERE Eder aee 562 HC S 12 X Debugger Manual Table of Contents NOLE ie itt wets tes et aes hp SUPER UAE 562 OPEN d iita over eed deduc oue E ntes 563 OUTPUT reine ar a E OE VERE NER dete tae RS 564 D ni Eutnexes Soa ea ata ONERE eA E EE Eee 565 PAUSETEST uem seed eee UMANE OR ils 566 PRINTE Lou lateew E OE WERT RECEN C ESETECRELQUBERCS 567 PIRARRAY oeste de peer EY EUN dire dr eee EFI 567 RD tre sa WAR e DU see tae E LU ON eee eae CUN 568 RECORD eei eee ERVeNTSUPE EET E Pad CER Ed eed 569 REPBAT i2 2unievetRbmnuht REP eR ae bo db
116. a specified command is executed 176 HC S 12 X Debugger Manual Real Time Kernel Awareness The Debugger allows you to load and control applications on the target system or applications simulated on the host It also allows you to inspect the state of the application which includes global variables processor registers and the procedure call chain including the local automatic variables This chapter describes how applications built of several tasks are handled by a generic awareness support and an OSEK awareness Click any of the following links to jump to the corresponding section of this chapter Introduction on page 177 Task Description Language on page 178 Application Example on page 180 nspecting Kernel Data Structures on page 181 OSEK Kernel Awareness on page 183 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 and between any tasks in the system Realtime kernels use data struct
117. address 0x220 in TargetObject def pbits Leds Port Register B 7 3 defines pbits as bits 5 6 and 7 in the byte B register named Port Register in Leds In the Full Chip Simulation names of target objects can be specified In our example it is the name of the port register defined by the IO Led component 10000 pbits 3 sets the 3 bits of Leds Port Register accessed with pbits to binary 011 Other bits are unaffected The new value of Port Register will be 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 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 NOTE Ina periodical loop the time marker without operator is interpreted as 378 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection True Time I O Stimulation 20000 b pbits 1 reads pbits 3 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 PERIODICAL 100000 10 executes the following block 10000 a 128 30000 RAISI 3 7 3 test
118. all available blocks This command ignores modules that cannot be unprotected FLASH PROTECT protects the specified modules If no modules are specified protects all available blocks This command ignores modules that cannot be protected FLASH SELECT selects the specified modules for flash programming If no modules are specified selects all available blocks for flash programming FLASH UNSELECT unselects the specified modules If no modules are specified unselects all available blocks The unselected state protects against accidental flash programming HC S 12 X Debugger Manual 609 Debugger Connection specific Commands NVMC Commands 610 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 aload 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 LOADCONTE X restores current buffer content into the MCU SRAM FLASH OVLBACKUP backups application code overlap with programming runtime algorithm RAM preset for debugging The command should be executed before the application file loading FLASH OVLRESTORE restores installs writes in RAM the application code overlap with programming runtime algorithm The command should be executed aft
119. amp E Multilink Cyclone Pro driver automatically detects the ICD 12 connection to your system However if the driver detects nothing an error message informs you that the connection hardware is not connected or that the target is connected to a different port If the PROJECT INI file connection setting is incorrect load the P amp E Multilink Cyclone Pro driver From the Debugger main menu select Component Set Connection as shown below Figure 12 2 Component Menu Component Data Window Help Open Set Connection Fonts Background Color The Set Connection dialog box now appears HC S 12 X Debugger Manual 407 P amp E Multilink Cyclone Pro Connection Loading the P amp E Multilink Cyclone Pro Connection Figure 12 3 Set Connection Dialog Box Connection Menu Set Connection 1 x 408 Processor Connection Pe Multilink Cyclone Pro Cancel Abatron BDI HC512 Serial Monitor P amp E Multilink Cyclone Pro Full Chip Simulation SoffecHCS12 P amp E CABLE12 and CABLE12HS P amp E ICD12 Cable Press the Down Arrow button to display the list of available connections The Connection menu selection P amp E Multilink Cyclone Pro loads the proper drivers etc for the P amp E Multilink Cyclone Pro connection HC S 12 X Debugger Manual P amp E Multilink Cyclone Pro Connection Loading the P amp E Multilink Cyclone Pro Connection In the Debugger Main w
120. and resets the hardware target The BDI interface automatically processes the initialization list startup init list stored in the interface Communication or Connect Select entry Abatron BDI Communication or Abatron BDI Connect to display the Communication Device Specification Edit Box on page 439 If the connection to the target has failed the entry Communication of menu Abatron BDI is replaced with Connect HC S 12 X Debugger Manual 437 Abatron BDI Connection Abatron BDI Connection Windows Edit and Dialog Boxes Setup Select Abatron BDI Setup to open the Setup Dialog Box on page 440 to set the link to the ABATRON configuration tool to set the download mode or to set the Continue on illegal break banked hardware breakpoint option only available for HC12 CPU12 derivative Configure BDI Box Select Abatron BDI Configure BDI Box to open the configuration tool delivered by ABATRON that you copied on your computer If no application tool path is currently set in the Setup Dialog Box on page 440 a browser dialog Select BDI Box Configuration Tool is automatically opened to create a link to the configuration tool application The link is then saved in the Setup Dialog Box on page 440 Set Bank This dialog is only available if the connected processor is a Freescale CPU12 HC12 derivative Select the entry Abatron BDI Set Bank to display the Banked Memory Location Wind
121. and unsigned formats may be selected Structures can be expanded to display their member fields Pointers can be traversed to display data they are pointing to Watchpoints can be set in this component Refer to Control Points on page 147 chapter Data Operations Double click a variable line to edit the value e Click the folded unfolded icons HAE to unfold fold the structured variable Double click a blank line Opens the Expression editor to insert an expression in the Data Component window Select a variable in the Data component and left mouse button R key to set a Read watchpoint on the selected variable A green vertical bar is displayed on the HC S 12 X Debugger Manual 65 Debugger Components General Debugger Components left side of the variables on which a read watchpoint has been defined If a read access on the variable is detected 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 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
122. 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 T O devices program variables and so forth The following components of the continuously growing set of visualization utilities belong to the standard Debugger installation HC S 12 X Debugger Manual 123 Debugger Components Visualization Utilities Inspector Component The Inspector window shown in Figure 3 75 on page 124 displays information about several topics It displays loaded components the visible stack pending events pending exceptions and loaded I O devices Figure 3 75 Inspector Component Window imi Inspect LL GE x E Components Name InitV alue Stack IO Reg 1 0x0 0x1000 0x0 3j 38 Symbol Table IQ Reg 2 0x0 01001 0x0 CB Events 4 amp Exceptions 8 Object Pool TargetObject id Leds Swap d Swap E TR ods 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
123. at connection 450 Display Code 50 Display Headline 136 Display Scrollbars 136 HC S 12 X Debugger Manual Display Symbolic 50 Display Version 142 Displayfont 144 DL 528 Down Counter 318 Download Mode and Data Transfer Verification 441 DPAGE 449 DPAGE Banked Memory Area 449 Drag Out 338 Dragging 37 38 Driving True Time Simulator and Real Time Debugger trough DDE 211 Drop Into 338 DUMP 529 DW 529 E E 530 Editing Memory 205 Register 203 Variable 201 Editmode 133 134 136 Editor 66 EEPPROM 290 ELSE 531 ELSEIF 531 Enable Breakpoint 52 116 enabled 472 Enabling 473 End 472 ENDFOCUS 532 ENDFOR 533 ENDIF 533 ENDWHILE 534 Enhanced Capture Timer 296 318 Environment ABSPATH 644 DEFAULTDIR 645 ENVIRONMENT 634 File 634 GENPATH 647 649 HIENVIRONMENT 646 HIPATH 647 649 LIBPATH 648 651 LIBRARYPATH 648 668 OBJPATH 649 TMP 650 USELIBPATH 651 Variable 643 Environment variables 447 ENVpath 11 EPAGE 449 EPAGE Banked Memory Area 449 EQUAL Mask 139 142 Erase 445 Erase Flash 416 422 Erasing 473 Ethernet 236 428 429 EXECUTE 534 EXIT 535 Exit 16 Explorer 635 Expression Command File 67 Expression Editor 66 External Bus Interface 292 F FE 321 FEE28 478 FEE32 479 Field Description 144 145 File Environment 634 File Manager 635 Filename 139 FILL 535 Fill Memory Dialog 83 FILTER 536 FIND 537 Find 118 120 Find Procedure 118 121 FINDPROC 538 Firmware 431 FLASH 608 Co
124. 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 OxF030 TRACED A 0x0 HX 0x7F02 SR 0x62 PC 0xF032 SP 0x44D 00F032 B787 STA 0x87 Contents of registers are displayed and current instruction is disassembled HC S 12 X Debugger Manual 587 Debugger Engine Commands Debugger Commands TESTBOX Displays a modal message box shown in Figure 20 2 on page 588 with a given string Figure 20 2 Test Box Message Box N St
125. at address 800 DB testCase Redefine symbol testCase UNDEF testCase Display value of testCase DB testCase NOTE Also refer to examples given for the command UNDEF on page 589 DETAILS In the Profiler component the DETAILS command opens a profiler split view in the Source or Assembly component Usage DETAILS assemblylsource Components Profiler components Example in DETAILS source HC S 12 X Debugger Manual 527 Debugger Engine Commands Debugger Commands 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 should be displayed 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 addresslrange 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 on page 523 DW on page 529 DL on page 528 command of a session Components Debugger engine
126. by the DMM and rules handle the Memory Expansion Registers MER i e INITRM INITRG INITEE On each debugger halt the MER Registers are read and if necessary the DMM offsets internally range addresses NOTE The debugger does not poll the MER registers while running Also the remapping is performed only on factory defined memory range not on user defined memory ranges The DMM HCS12MERHANDLINGOFF command can be executed to disable the MER Registers tracking The DMM HCS12MERHANDLINGON command can be executed to re engage this feature NOTE By factory default setup HCS12 DBG12 Fifo Registers have been protected to reserve the DBG12 Fifo Reading for the debugger DBG interface Removing this protection leeds to incorrect program flow rebuild 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 internal register space please refer to device specifications RAM memory block please refer to device specifications EEPROM memory block please refer to device specifications e onchip flash EEPROM please refer to device specifications remaining external space please refer to device specifications 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 HC S 12 X Debugger M
127. can be gotten by typing BANKWINDOW without any parameters in the Command Line component Listing 21 1 BANKWINDOW gt Banking Status in gt in gt bankwindow PPAGE Settings Status enabled Reg Adr 0x30 Range 0x8000 to Number of Pages DPAGE Settings Status disabled Reg Adr 0x34 Range 0x7000 to 604 Oxbfff 64 Ox 7fff HC S 12 X Debugger Manual Debugger Connection specific Commands Abatron BDI Connection Commands Number of Pages O0 EPAGE Settings Status disabled Reg Adr 0x36 Range 0x400 to Ox7ff Number of Pages 0 in gt The status of the PPAGE Banked Memory area can be changed Listing 21 2 BANKWINDOW gt PPage Status Change in gt BANKWINDOW PPAGE OFF in gt BANKWINDOW PPAGE Settings Status disabled Reg Adr 0x30 Range 0x8000 to Oxbfff Number of Pages 64 DPAGE Settings Status disabled Reg Adr 0x34 Range 0x7000 to Ox7fff Number of Pages 0 EPAGE Settings Status disabled Reg Adr 0x36 Range 0x400 to Ox7ff Number of Pages 0 in gt HC S 12 X Debugger Manual 605 Debugger Connection specific Commands ICD 12 Commands ICD 12 Commands 606 Consider these hints for configuring the ICD 12 connection for a specific MCU and memory configuration Connection initialization includes execution of startup file startup cmd during ICD 12 driver loading Triggering a reset through the Icd Reset menu
128. 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 DEFINI op 0 FOR loop 1 6 1 T ENDFO The T Trace command is performed 6 times HC S 12 X Debugger Manual 541 Debugger Engine Commands Debugger Commands FPRINTF Description FPRINTF is the standard ANSI C command Writes formatted output string to a file Usage FPRINTF filename amp 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 Description 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 542 HC S 12 X Debugger Manual G Description 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
129. 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 read protected this sets the memory as read protected The DMM never tries to read this range Writing in this range is done as physical memory type HC S 12 X Debugger Manual 465 Debugging Memory Map CPU Core Types and Priorities 466 write protected this sets the memory as write protected The DMM stops all debugger writes to this range Reading in this range is done as physical memory type r w protected this sets the memory as read and write protected Reading and writing to this memory range is fully blocked by the DMM physical this sets the memory range as physical i e with linear 16 bit address bus access as performed by the CPU when reading and writing the onchip memory banked this type handles the PPAGE register when accessing the Program page banked data typically program code in onchip Flash in 8000 BFFF address range window ram banked this type covers accessing 1000 1FFF ram data window the user application accesses via RPAGE in global address space Important All accesses are casted by the DMM to global memory which should therefore be defined for the matching range eep banked this type covers accessing 800 BFF eeprom data window
130. can communicate and debug CPU12 HCS12 core based hardware connected throught the SofTec in circuit debugger programmer units i e SofTec Microsystems HCS12 ISP Debuggers Programmers inDART Series and Starter Kits AK SK PK ZK and newer Series Please refer to the inDART HCS12 In Circuit Debugger Programmer for Freescale HCS12 Family FLASH Devices User s Manual from SofTec for communication hardware requirements and SofTec product installation inDart HCS12 Menu Options Once the SofTec HCS12 connection is set the connection menu entry in the debugger main toolbar is inDART HCS12 Figure 13 1 inDART HCS12 Menu Options s True Time Simulator amp Real Time Debugger D ProfilesRTHO2cMy Documents YourProj Si File View Run inDART HCS12 Component Memory Window Help nif Load Ctrl L Reset Ctrl R CES Setup 10l xl Ia E Connect Gornmand Files MCU Configuration About HC S 12 X Debugger Manual 413 Softec HCS12 Connection Communication Settings Dialog Box MCU Configuration Option Select the inDART HCS12 gt MCU Configuration option to display the MCU Configuration Dialog Box Figure 13 2 MCU Configuration Dialog Box MCU Configuration i X r Hardware Model HW code ARAE Cancel In Circuit Real Time Debugger Programmer for Freescale HCS12 and HCS12X Families r Device Device code MC9S12432 hi Communication Settings
131. cmd 56 FPP file loading 474 hidefaults 635 645 646 650 hwl 639 HWP 15 hwp 639 JANI 15 PJT 15 rec 102 WND 45 wnd 35 xpr file 67 Numerics 16 Bit Modulus Down Counter 318 A A 498 ABATRON Configuration tool 430 About Box 34 About True Time Simulator and Real Time Debugger 33 ABSPATH 644 ACTIVATE 498 ADCPORT 619 Add New Instrument 133 134 ADDCHANNEL 619 Address 80 83 Address 50 ADDXPR 499 Align 135 All Text Folded At Loading 122 Analog 136 Analog to Digital Converter 288 AND Mask 139 140 142 Application Assembly Step 199 Embedded 5 HC S 12 X Debugger Manual Loading 195 Starting 196 Step In 197 Step Out 198 Step Over 198 Stopping 196 Target 5 Application loading 475 Arrange Icons 33 ASCII 83 Assembly Step 23 Assembly Step Out 23 Assembly Step Over 23 AT 509 ATTRIBUTES 499 Auto 106 auto configure 263 Auto on Access 265 Auto on Load 265 Auto select according to MCU Id 475 Automatic 68 82 AUTOSIZE 509 B Background Color 30 Background Debug Mode 236 428 Backgroundcolor 136 137 Banked hardware breakpoint 441 Banked Memory Location dialog 447 Banked Memory Location Target commands 602 banked memory model 317 Banking on CPU12 438 BANKREG 600 Banks 318 438 BANKWINDOW 603 BANKWINDOWnR 661 Bar 136 Barcolor 138 Bardirection 138 BASE 510 BC 510 BCKCOLOR 511 BD 512 BDI 600 Abatron setup 430 Configuration 430 Interface 429 665 Interface setup 430 BDI Firmwar
132. comment about the defined memory address range HC S 12 X Debugger Manual The Information scrollable window gives a general diagnostic of the DMM This diagnostic has less information the the edition mode diagnostic Pressing the New button will open the edition dialog box to create a new memory address range Pressing the Modify button opens the edition dialog of the selected memory address range to modify it More memory range information is displayed in the edition dialog and an enhanced diagnostic is also displayed Pressing the Delete button will lead to memory range removal after a warning dialog Pressing the Revert to default button will remove after a warning dialog the current setup usually saved in the current project and retrieve the default factory setup from an internal database Edition Dialog Box Figure 17 2 Memory Address Range Edition Dialog Box v Enable memory module Start 0 End 3FFF hex Type physical IV refresh memory when halting Priority RAM memory block T no memory access while running Comment Ram Information 4 memory range from 0x0 to Ox3fff is of physical typ therefore accessed directly in device physical PER 0x0 Oxtfff Each time the debugger is stopped or reset the memory data is retrieved from hardware EE OK Cancel The Enable memory module option checkbox maps the module memory range in the debugger Unchecking this option make
133. corresponding entry in the list of defined breakpoints HC S 12 X Debugger Manual 6 i Control Points Setting Breakpoints 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 Close the window by clicking OK If you continue program execution the condition is evaluated each time the instruction containing the conditional breakpoint is reached When the condition is TRUE the application stops Deleting Breakpoints The Debugger provides three ways to delete a breakpoint A 1 3 4 5 Using Delete Breakpoint from Source Popup Menu In the Source component window point at a C statement where a breakpoint has previously been defined and right click The Source Popup Menu is displayed Choose Delete Breakpoint from the Popup Menu The breakpoint is deleted Holding down the left mouse button pressing the D key Point at a C statement in the Source Component window where a breakpoint has previously been defined and holding down the left mouse button press the D key The breakpoint is deleted Choosing Show Breakpoints from Source Popup Menu Point in the Source Component window and right click The Source Popup Menu is displayed Choose Show Breakpoints
134. device simulates the Enhanced Capture Timer ECT The various functionality are cycle accurate up to 99 The simulation might differ from the hardware concerning the pipelining of the instructions some interruptions might be raised with a delay of one instruction The function with error detected in the hardware are not simulated one mode of operation being used as default further information are given in the case of not implemented features Modes of Operation NORMAL and STOP mode are implemented when entering the FREEZE or WAIT mode the system behaves like in STOP mode Registers TIOS Timer Input Capture Output Compare Select Register IOS7 IOS6 IOSS5 IOSA IOS3 IOS2 IOS1 and IOSO are simulated CFORC Timer Compare Force Register FOC7 FOC6 FOC5 FOC4 FOC3 FOC2 FOC1 and FOCO are simulated OC7M Output Compare 7 Mask Register OC7M7 OC7M6 OC7M5 OC7M4 OC7M3 OC7M2 OC7MI and OC7M are simulated OC7D Output Compare 7 Data Register OC7D7 OC7D6 OC7D5 OC7D4 OC7D3 OC7D2 OC7DI and OC7D0 are simulated TCNT Timer Count Register Partly simulated In the test mode TCNT is not writable TSCR1 Timer System Control Register 1 TEN and TFFCA are simulated TTOV Timer Toggle On Overflow Register 1 TOV7 TOV6 TOVS TOV4 TOV3 TOV2 TOV1 and TOVO are simulated HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives TCTL1 TCTL2 Timer Control Register 1 2
135. display are now defined at addresses 0x100 and 0x200 SETCONTROL The SETCONTROL command is used to modify the number of ticks and pixels for a Monitor component specific channel This will change the horizontal scale of this channel Usage SETCONTROL Name Ticks Pixels Name is the name of the channel to modify Ticks is the new number of ticks for this channel Pixels is the new number of pixels for this channel Components Monitor component Example in gt SETCONTROL Leds Port Register bit 0 100 1 The horizontal scale from the channel Leds Port Register bit O will be defined with the value 100 for the Ticks value and 1 for pixels value HC S 12 X Debugger Manual Debugger Connection specific Commands Full Chip Simulator Commands SETCPU Load CPU awareness for the debugger Usage SETCPU ProcessorName where ProcessorName is a supported processor HC05 HC08 HC11 HC12 HC16 M68K M CORE XA ST7 and PPC Components Simulator component Example in gt SETCPU HC08 The simulator HCO08 sim is loaded SHOWCYCLES The SHOWCYCLES command returns the number of CPU cycles already done since the beginning of the simulation in the Command Line component RESETCYCLES is performed internally or since the last RESETCYCLES on page 625 command The number of cycles executed is also the number displayed in the status bar CPU cycles counter Usage SHOWCYCLES Components Debugger engine
136. edit box are stored for a later debugging session in the Abatron BDI section of the project file Setup Dialog Box The Setup dialog box is opened selecting the Abatron BDI menu entry Abatron BDI Setup Figure 15 15 Setup Dialog Box 440 Setup Enter here the path to the ABATRON configuration tool The BDI Box Configuration Tool Path edit box is set up with the path and application name of the configuration tool from ABATRON The application tool is automatically browsed when selecting the Abatron BDI Configure BDI Box menu entry and browsing for the application Otherwise press the Browse button to look for the tool The edit box contains for example HC S 12 X Debugger Manual Abatron BDI Connection Abatron BDI Status Bar Information C tmp B10c12 exe In the Download Mode and Data Transfer Verification you can set different options to transfer data from the computer to the BDI box By default use the Verify only first option If necessary you can set a different option to improve transfer speed or security By default data compression is enabled for asynchronous communication channels With older computers it is possible that download speed is faster without data compression The Continue on illegal break banked hardware breakpoint option check box is only available for the HC12 CPU12 derivative You can check this check box to overcome the 2 byte address size on chip break module which does
137. ee eee 355 Stimulation Component 0 0 00 cee eee ee eee 357 Stimulation Popup Menu 0 cece eee 357 Example of a Stimulation File 00 0000 0008 358 TestIerm Component i ete be Gb abe ER epee eee RS 360 Output Redirection lsleeeeeeee e 361 How to Redirection inb Ep RENI 362 Using TestI rm ek rect wakes BERG eG uy eS 362 TestTerm Men oops Mek cei PER COP EQSRREPERETU ES HE 363 Terminal Component 0 0 0 eee eee ene 365 Configure Terminal Connections 0 00 0 esee 366 Input and Output Files sira enpor eee 367 File Control Commands 0 0 0 cee eee eee 367 How to Use Virtual SCI 2 ee eee 369 Wagon Component oiie sonare a ie A eee eee nee 370 Wagon Menu io cg eee nee he tow eed pdt bes 370 Wagon Setup ied mee ees e o RR hia ones ts 370 True Time I O Stimulation 0 0 0 0 cee ee 372 Stimulation Program Examples 00 0 000 e eee eee eee ee 372 Running an Example Program Without Stimulation 372 Example Program with Periodical Stimulation of a Variable 374 Example Program with Stimulated Interrupt 375 Example of a Larger Stimulation File 000 377 Stimulation Input File Syntax 380 HC S 12 X Debugger Manual 12 Table of Contents E BNE 2 oeduduermelc et hace pe eek Ayes dale oid ee a 380 Electrical Signal Generators and Signals Applica
138. enabled and Disable in the Command group box is enabled 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 HC S 12 X Debugger Manual 151 Control Points Breakpoints 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 amp Restore on load flag Save amp Restore on load checkbox in the Controlpoints Configuration Window Breakpoints Tab on page 150 the SAVEBP command is used SAVEBP on when checked SAVEBP off when unchecked NOTE For more information about this see the SAVEBP on page 575 command
139. entry and then by clicking on Inspect icon in the Open Window Component window HC S 12 X Debugger Manual Real Time Kernel Awareness OSEK Kernel Awareness When the RTK components icon is selected in the hierarchical content of the items the right side displays various information about OSEK Awareness Figure 5 2 CodeWarrior RTK Inspect Window 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 on page 185 displays the current state of the OSEK task trace Figure 5 3 Inspector Task 7 Inspect oxi l Task Priority TaskState Events State Waited Events Task Event Masks Current Task Stack Task Properties in MotorDriveTask MotorDriveTask 10 WAITING UPEVENT 5 MotorDriveTask_ EXTENDED F 85 ControlTask iz contrattask WAITING KEY_EVENT ControlTask STACK EXTENDED F 83 TniTask i SUSPENDED MAIN STACK BASIC NONP B3 InputTask SUSPENDED MAIN STACK BASIC FULL B LockTask SUSPENDED MAIN STACK BASIC FULL
140. et op ben pK gone anes bg ines ora 596 MUR E 597 DA P 597 ZOOM cie ee tace rece eae A ae RU rete duda fici o TR gen 598 21 Debugger Connection specific Commands 599 Abatron BDI Connection Commands 0 0 0 e cece eee eee 599 Banked Memory Location associated Commands 602 BANKWINDOW Examples 00 00 0002 cee ee eee eee 604 ICD 12 Commands ev eek Sete eer RE s 606 Command Files and ICD 12 Commands 0 0005 606 ICD 12 Memory Configuration Commands 606 NVMC Commands s eRESDISRAICBRReEERRRBR EM Re eM es 608 ELEASE pie XR WP p Cebee 608 BEGIE a E EEE E mt pe pte ele eR e or TE S EE 611 DMM Gommands c sibs agua RR AERIS alee haben ede 614 Debugging Memory Map Manager Commands 614 DMM Command rei sic ies coo ee RU MR e on EORR E Ra 614 DMM ADD command 0 0 cece eee eee eens 614 DMM DEL Command 2 22 66 cece eee ee eee eee ee 615 DMM SAVE Command a TEE E ee eee 615 DMM DELETEALLMODULES Command 615 DMM RELEASECACHES Command 0 000005 616 DMM CACHINGON Command 0 0 0 2 eee eee eee 616 DMM CACHINGOFF Command 5 000 202 eee ee eee 616 DMM HCSI2MERHANDLINGON Command 616 DMM HCS12MERHANDLINGOFF Command 616 DMM OPENGUI Command 0 0 00 eee eee eee 617 Full Chip Simulator Commands
141. except if the connection does not care about Mcuid s Full Chip Simulator Commands Simulator environment commands are used to monitor the debugger environment specific component window layouts and framework applications and targets Table 21 3 on page 617 contains all available Environment commands Table 21 3 Full Chip Simulator Commands Command Syntax Short Description SETCPU on page 629 Sets a new cpu simulator ProcessorName RESETCYCLES on page 625 Resets Simulator CPU cycles counter RESETMEM on page 626 Resets all configured memory to undefined RESETRAM on page 627 Resets RAM to undefined RESETSTAT on page 627 Resets the statistical data SHOWCYCLES on page 629 Returns executed Simulator CPU cycles FCS Associated Component specific Commands Component specific commands are associated with specific components supported by the Full Chip Simulator Table 21 4 on page 618 contains all available Component Specific commands HC S 12 X Debugger Manual 617 Debugger Connection specific Commands Full Chip Simulator Commands Table 21 4 List of Component specific Commands Command Syntax ADCPORT on page 619 address ident address ident address I ident Short Description Sets the ports addresses used by the Adc Dac component ADDCHANNEL on page 619 Name Creates a new channel Name for the Monitor component CPORT on p
142. 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 HC S 12 X Debugger Manual 543 Debugger Engine Commands Debugger Commands 544 GO Description 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 HC S 12 X Debugger Manual GOTO Description 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
143. file Browse Header Directories CAH IWARESLIBSMBSKC include Browse Preinclude file TADA CAPINCLUDENHIWARE MB8xxx CPU32 V5 0 h Browse Nested Comments M C Comments M r Report these warnings when enabled ortable declaration value is unknown y nown ncluded 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 Preprocessor Header Directories This text box determines the list of directories that are to be searched for files named within the include directive A semicolon separates directories Only listed directories are searched for files named between lt and gt Searching for files named between quotation marks starts in the directory of the source file containing include directive HC S 12 X Debugger Manual 217 Synchronized Debugging Through DA C IDE Configuring DA C IDE for Freescale Tool Kit The list of header directories can be assigned in a file In that case this field contains the file name absolute or relative in relation to the project root with prefix Directories are separated with a semi colon or new line Define the library path matching your CPU assuming Freescale tools are installed on C Freescale c Freescale lib lt processor gt c include Preprocessor Preinclu
144. file executed with the CF or CALL command without the NL option and with the CMDFILE flag of the LOG command set to TRUE Example3 When executing the following file define i 1 WHILE i 3 define i i 1 ls ENDWHILE HC S 12 X Debugger Manual 555 Debugger Engine Commands Debugger Commands The following log file is generated Idefine i 1 IWHILE i 3 define i i 1 Is i 0x2 2 ENDWHILE define i i 1 Is 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 acommand file executed with the CF or CALL command without the NL option and with the CMDFILE flag of the LOG command set to TRUE Example4 When executing the following file define i 1 REPEAT define i i 1 ls UNTIL i The following log file is generated repeat until condition Idefine i 1 IREPEAT define i i 1 Is r 0x2 2 IUNTIL i 4 define i i 1 1s i 0x3 3 IUNTIL i 4 define i i 1 Is i 0x4 4 IUNTIL i 4 556 HC S 12 X Debugger Manual 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
145. follow the rule from ANSI C constant values prefixed by Ox 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 HC S 12 X Debugger Manual 201 How To How To Work on Variables 202 Get the Address Where a Variable is Allocated The Debugger provides you with the start address and size of a variable if you do the following 1 Point to a variable name in a Data Component 2 Click the variable name The start address and size of the selected variable is displayed in the Data info bar Inspect Memory Starting at a Variable Location Address The Debugger provides two ways to dump the memory starting at a variable allocation address Using Drag and Drop 1 Drag a var
146. for Cycle Refresh Count 10000 Now lets add a nice chart where we can see the changing value of the channel in a graphic Right mouse click gt Add New Instrument gt Chart Double click on the Chart to see the Chart Properties Chart Properties Select for Kind of Port Expression Select for Port to Display pwmChannel 0 Select for High Display Value 2 Select for Type of Unit Target Periodical Select for Unit Size 1000 Select for Numbers of Units 1000 Leave all others on default With the follwing bar we can change the period value of the PWM channel 0 Right mouse click gt Add New Instrument gt Bar e Double click on the Bar to see the Bar Properties Period Bar Properties Select for Kind of Port Variable Select for Port to Display _PWMPER01 Overlap_STR PWMPEROSTR Byte Leave all others on default You might add labels with Right mouse click gt Add New Instrument gt Static Text Now lets add a bar to change the duty time HC S 12 X Debugger Manual 401 HC S 12 X Full Chip Simulation Connection FCS Tutorials Right mouse click gt Add New Instrument gt Bar Double click on the Bar to see the Bar Properties Duty Time Bar Properties Select fo
147. format module name extensions are c cppor dbg dbg or program sources in assembler e g ibo c since all debugging information is contained in the abs file and object files are not used Please adapt the following examples with your abs application file format Usage SMOD module Where module is the name of a module taking part of the application The module name should contain no path The module extension i e DBG for assembly sources or C for C sources etc 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 e f no application is loaded Components Data Memory and source components Example in gt Data 1 SMOD fibo c Global variables found in the ibo c module are displayed in the Data 1 component window HC S 12 X Debugger Manual 579 Debugger Engine Commands Debugger Commands 580 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 co
148. from the Popup Menu The Breakpoints Setting dialog is displayed In the list of defined breakpoints select the breakpoint to delete Click Delete The selected breakpoint is removed from the list of defined breakpoints Click OK to close the Breakpoints Setting dialog box The icon associated with the deleted breakpoint is removed from the source component HC S 12 X Debugger Manual 159 Control Points Setting Breakpoints Associate a Command with a Breakpoint Each breakpoint temporary permanent counting or conditional can be associated with a debugger command This command can be specified in the Breakpoints tab of the Controlpoints Configuration window To open this window Choose Show Breakpoints from Source Window Popup Menu 1 Point in the Source Component Window and right click The Source Popup Menu is displayed 2 Choose Show Breakpoints from the Popup Menu The Controlpoints Configuration window with the Breakpoints tab displayed appears In the Breakpoints tab of the Controlpoints Configuration window 1 You can select the breakpoint to modify by clicking on the corresponding entry in the list of defined breakpoints 2 Youcan 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 breakpoint using the command CALL or CF Example CF breakCmd cmd 3 Click OK to close the wi
149. hardware connections For the HC S 12 X 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 HC S 12 X Debugger Manual 127 Debugger Components Visualization Utilities Inspector Operations Click the folded unfolded icons EHE 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 Ox in decimal in octal with preceding 0 or in binary with preceding amp To see the IO Led in the Inspector as shown in Figure 3 82 on page 128 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 O Led component Figure 3 82 How to See the IO Led in the Inspector Window 128 I Inspect iof x 7 Componen
150. in red indicating that a breakpoint has been set Then select Debug gt Run the Debugger is now started and after a while stops on the specified breakpoint Up to now you can debug from DA C IDE with the toolbar as shown in Figure 9 15 on page 229 or from the Debugger Figure 9 15 DA C toolbar B 3d Eo 34 NOTE Incase of changes 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 1 When loading DAC component into the Debugger if the message box shown in Figure 9 16 on page 229 is displayed Figure 9 16 DA C Component Loading Error Message Component Loading Error x e Could not load component dac vwnd or one of its libraries Error code 125 check if the NGapi d11 is located in the M prog directory of your current Freescale installation If not copy the specified DLL into this directory HC S 12 X Debugger Manual 229 Synchronized Debugging Through DA C IDE Troubleshooting 2 If the message box shown in Figure 9 17 on page 230 is displayed in DA C IDE Figure 9 17 DA C Debugger Support Message Debugger support This means that the current name specified in the Options Debugger main menu of DA C doesn t match the debugger name specified in the Debugger Open th
151. isses eek eee RR eR Be 163 Multiple Selections sss dosso eee bee dc e pr RR 164 Checking Syntax scole pee eR perge Dr Ne Ta eiaeia 164 Setting Watchpoints 0 0 0 cee een 165 Setting a Read Watchpoint 00 00 cece ee eee eee 165 Setting a Write Watchpoint 00 0 0 eee eee eee ee 166 Defining a Read Write Watchpoint 0 000 000 00008 166 Defining a Counting Watchpoint 00 00 20 167 Defining a Conditional Watchpoint 00 0000 erenn 168 Deleting a Watchpoint 0 0 2c eee ee ee eee 169 Associate a Command with a Watchpoint 005 169 Demo Version Limitations suser erenneren rrr 170 Markpoimts 5 34 2 sre x e a Ce ORO RUE UR LUCR De SR e edaa 171 Markpoints Tab reesi haea III 173 Setting Markpomts raoe a E AE E E RE PER ees E A 174 Setting a Source Markpoint ssleseeeeeee eee 174 Setting a Data Markpoint 0 0 0 0 eee ee eee 174 Setting a Memory Markpoint 0 00 00 cece ee eee eee 175 Deleting a Markpoint slesleeeeleeee eee 175 Halting on a Control Point 0 0 eee eee 176 5 Real Time Kernel Awareness 177 Introduction eese aaa aw eo Pea eee tate ge ey 177 Inspecting Task State 2 ss armud i e ee eee 178 RTK Interface Eee ETE sae cab 178 Task Description Language ssseseeee rrr areren 178 Application Example sseseseeeeee ee 180 Inspecting Kernel Data Structu
152. iust C Libraries Stop Bulld Chl Break C Debugger Project GQ Debugger Cmd Fi Remove Object Code Ctrl Re search for Files Reset Project Entry Paths Synchronize Modification Dates Debug FS Carit Run Cots Set Default Project Set Default Target 17 fles K x Debugger Command Line Start You can start the debugger from a DOS command line The command syntax is as follows HIWAVE EXE lt AbsFileName gt lt options gt where AbsFileName is the name of the application to load in the debugger Preceed each option with a dash Command Line Options DOS command line options are T lt time gt Test mode The debugger terminates after the specified time in seconds The default value is 300 seconds For example HC S 12 X Debugger Manual 9 Debugger Interface Starting the Debugger 10 c Freescale prog hiwave exe T 10 The above example instructs the debugger to terminate after 10 seconds Target lt targetname gt This option sets the specified connection For example C Freescale prog hiwave exe c Freescale demo hc12 sim fibo abs w Target sim The command in the above example starts the debugger and loads fibo abs file W Wait mode Debugger will wait even when a lt exeName gt is specified Instancez ecurrentTargetName This option defines a build instance name When a build instance is defined the same one will be used For example c Freescale prog hiwave exe Instance curre
153. 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 will prompt for 1000 subitems inspect ATTRIBUTES MAXELEM ON 1000 The FORMAT command specifies whether integral values like addresses should be displayed 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 bet
154. line interpreter cannot detect if you are specifying a number or a symbol Table 20 8 Base is 16 Constants Starting with Letter A B C D E or F 5AFD Hexadecimal constant 5AFD AFD Hexadecimal constant AFD Table Example in NB 16 The number base is hexadecimal HC S 12 X Debugger Manual 561 Debugger Engine Commands Debugger Commands NOCR The NOCR command closes the current record file The record file is opened with the CR on page 521 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 on page 550 command Usage NOLF Components Debugger engine Example in NOLF The current Log File is closed 562 HC S 12 X Debugger Manual 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 xis the X axis of the upper left corner of the window component yis 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 will be iconized when MAX is specified the component window will be maximized Component names are Assembly Command Coverage Data Inspect IO Led Led Memory Module Phone
155. not handle the PPAGE e g HC912DG128 Note that internally the target is halted by the hardware breakpoint in Flash memory compared with the breakpoint that you set then relaunched if not bank matching This feature is available as an optional Code execution breaks are not handled when this option is set and illegal code execution is not detected Please use this option carefully Abatron BDI Status Bar Information When the Abatron BDI connection has been loaded specific information is given in the debugger status bar From left to right the name of the target CPU and the debugger status target status are displayed Figure 15 16 Abatron BDI Connection Debugger Status Bar For Help press F1 MC68HC12 CPU12 HALTED Status Messages Status messages are described in the following sections BDI ready V x xx The debugger is ready and waits until a new target or application is loaded This message is generated once the debugger has been started and the connection to the hardware target has been established by the BDI V x xx is the current BDI firmware version No Link To Target Connection to the target system has failed RUNNING The application is currently executing in the debugger HC S 12 X Debugger Manual 441 Abatron BDI Connection Abatron BDI Status Bar Information 442 HALTED Execution of the application has been stopped on user request The menu entry Run Halt or the Halt icon in the tool bar h
156. of a CPU derivative A derivative such as the HC12B32 has just one on chip Flash module other derivatives have multiple modules NOTE The dialog box does not have a Select or Unselect button as you merely click on a module in the list to select it 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 HC S 12 X Debugger Manual 471 HC S 12 X Flash Programming NVMC Graphical User Interface Figure 18 6 Non Volatile Memory Control Dialog Box xi r Configuration File D tested slave Prog FPP mcu03CF fpp Browse IV Auto select according to MCUID Ox03CF MCU speed 8 03 MHz Save and restore work space content r Modules Name Start End State Select All FLASH 4000 00004000 O0007FFF Enabled Blank FLASH PAGEU 00008000 D000BFFF Enabled Programmed Enable FLASH C000 Enabled Programmed Unprotected 7 Enabled Programmed Unprotected Disable Enabled Programmed Enabled Programmed Unprotected Protect Enabled Proarammed FLASH PAGES 00058000 0005BFFF Enabled Programmed Unprotected Unprotect FLASH PAGEB O0068000 O006BFFF Enabled Programmed FLASH PAGE 00078000 0007BFFF _ Enabled Programmed Unprotected EEPROM DOO 00000 Disabled Erase Load teebki Cancel Help For each block the dialog box has a line composed of
157. 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 ah ER APA the matching assembler instruction in the Assembler component window is also selected This instruction is the next instruction to be executed by the CPU HC S 12 X Debugger Manual 111 Debugger Components General Debugger Components If breakpoints have been set in the program they will be marked in the program source with a special symbol depending on the kind of breakpoint For information on breakpoints refer to sections in the Control Points chapter If execution has stopped 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 Tool Tips Features The Debugger source component provides tool tips to display variable values The tool tip is a small rectangular pop up window that displays the value of the selected variable shown in Figure 3 65 on page 112 or the parameter value and address of the selected procedure A parameter or procedure can be selected by double clicking it Figure 3 65 ToolTips Features
158. on page 46 General Debugger Components on page 48 Visualization Utilities on page 123 Component Introduction The Debugger kernel includes various components CPU Components CPU components handle processor specific properties such as register naming instruction decoding disassembling stack tracing etc A specific implementation of the CPU module has to be provided for each processor type that is supported in the debugger The CPU related component is not introduced in this section However this system component is reflected in the Register component Memory component and all other Connection dependent components The appropriate CPU component is automatically loaded when loading a framework ABS file Therefore it is possible to mix frameworks 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 HC S 12 X Debugger Manual 45 Debugger Components Component Introduction Connection Components
159. on page 569 REPEAT loop instruction RETURN on page 571 Returns from a CALL command TESTBOX on page 588 Displays a message box with a string UNDEF on page 589 symbol Undefines a userdefined symbol UNTIL on page 592 condition Condition of a REPEAT loop WAIT on page 594 time s Command file execution pause WHILE on page 596 condition WHILE loop instruction 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 HC S 12 X Debugger Manual 489 Debugger Engine Commands Commands Overview be executed independent of components that are open Table 20 2 on page 490 contains all available Base commands Table 20 2 List of Base Commands Command Syntax BC on page 510 addressl Short Description Deletes a breakpoint breakpoint clear BS on page 513 addresslfunction PIT state Sets a breakpoint breakpoint set CD on page 516 path Changes the current working directory CR on page 521 fileName A Opens a record file command records DASM on page 522 addresslrange OBJ Disassembles DB on page 523 addresslrange Displays memory bytes DL on page 528 addresslrange Displays memory bytes as longwords
160. 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 on page 133 Table 3 43 Visualization Tool Menu Description Menu Entry Description Properties Displays the properties of the currently selected instrument Shortcut lt Ctrl P gt Add New Instrument Enables to choose an instrument from the list and add it to the view Paste Pastes an instrument that has been previously copied Shortcut lt Ctrl V gt Select All Selects all the instruments of the view Shortcut lt Ctrl A gt Edit mode Switches between Display mode and Edit mode In Edit mode this entry is checked Shortcut lt Ctrl E gt HC S 12 X Debugger Manual 133 Debugger Components Visualization Utilities Table 3 43 Visualization Tool Menu Description continued Menu Entry Load Layout Description instruments w Loads a VisualizationTool Layout vt1 The actual Shortcut lt Ctrl L gt ill not be removed Save Layout Saves the current layout to a file vt1 Shortcut lt Ctrl S gt Associated Popup Menu The context menu of the VisualizationTool depends on the current selection It can contains the entries described in Table 3 44 on page 134 Table 3 4
161. or Data component window Press the right mouse button Select Show Watchpoints from either menu Click the left mouse button The ControlPoints Configuration window appears The Watchpoints tab of this window is shown in Figure 4 6 HC S 12 X Debugger Manual 161 Control Points Watchpoints Figure 4 4 Memory Popup Menu Memory uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu Figure 4 5 Data Popup Menu 162 Show Wy atchp oints HC S 12 X Debugger Manual Figure 4 6 Con Controlpoints Configuration Control Points Watchpoints trolpoints Configuration Window Watchpoints tab Breakpoints Watchpoints Markpoints r Watchpoint Address Size Disable v Hex format Name zi Condition Condition Disable Command Disable Command Continue r Counter Current fi Interval fi Add Update Delete Show Location OK Cancel Help ema he 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
162. 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 Command group box that displays the command string to execute and state of the command disabled or continue after command execution HC S 12 X Debugger Manual 163 Control Points Watchpoints 164 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 Cancel button to ignore all modifications Help button to display help file and related help information Multiple Selections For watchpoints you can do multiple selections in the Watchpoints tab of the Controlpoints Configuration window using the Shift and Ct
163. page 290 Flash FTS on page 290 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 277 HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 4 Supported Derivatives continued 278 Derivative Name MC9S12D64 Modules Analog to Digital Converter on page 288 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 MC9S12DB128A Analog to Digital Converter on page 288 Byteflight BF on page 285 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299
164. process are imported with the connection software and are specific to that connection This chapter is intended to list and describe those variables Connection specific Environment Variables The following sections address connection environment variables that can be manually edited Abatron BDI Connection Environment Variables This section describes the environment variables which are used by the Abatron BDI Connection The Abatron BDI Connection specific environment variables are BDICONE on page 656 COMDEV on page 657 COMPRESS on page 658 SHOWPROT on page 658 SKIPILLEGALBREAK on page 659 VERIFY on page 660 These variables are stored in the BDIK section from the project file Listing 23 1 Example of the BDIK section from the project file BDIK CMDFILEO CMDFILE STARTUP ON startup cmd CMDFILE1 CMDFILE RESET ON reset cmd CMDFILE2 CMDFILE PRELOAD ON preload cmd HC S 12 X Debugger Manual 655 Connection specific Environment Variables Abatron BDI Connection Environment Variables Q MDFILE3 CMDFILE POSTLOAD ON postload cmd OMDEV COM1 57600 HOWPROT 0 DICONF C tmp B10c12 exe KIPILLEGALBREAK 0 ERIFY 1 COMPRESS 1 lt nwna The remainder of this section describes each of the variables available for the Abatron BDI Connection The variables are listed in alphabetical order and are divided into sev
165. 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 HC S 12 X Debugger Manual Debugger Components General Debugger Components Terminal and TestTerm Record Data typed in the Terminal component and TestTerm component is recorded during a record session The resulti ng file can be replayed only if the time is also recorded Record Time menu entry of the recorder has to be checked before recording Recorder Men u The Recorder menu shown in Figure 3 58 on page 103 changes according to the current session The menu items are described in Table 3 30 on page 103 Figure 3 58 Recorder Menu Record Replay Record Time Table 3 30 Recorder Menu Description Menu Entry Description Record Starts recording from a debug session Replay Starts replaying from a debug session Record Time If set the evolution time is also recorded Instant 0 corresponds to the beginning of the recording In Listing 3 2 on page 103 an abs file is loaded a breakpoint is set the assembly component is configured to display the code and addresses The Datal component display is switched to local varia
166. 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 93 on page 142 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 Figure 3 93 Switch Instrument 430 Switch instrument attributes are shown in Table 3 54 on page 142 Table 3 54 Switch Instrument Attributes Attribute Bitnumber to Display Description Specifies the number of the bit you want to display Display 0 1 Enables to display the value of the bit in its upper left corner Top Position is 142 Specifies if the up position is either zero or one Especially useful to easily transform the push button into a reset button HC S 12 X Debugger Manual Debugger Components Visualization Utilities Table 3 54 Switch Instrument Attributes continued Attribute Kind of Switch Description Changes the look of the instrument Following kinds of switches are available Slide Switch Toggle Switch Jumper Push Button
167. selection executes another command file reset cmd Choosing the Icd Force BDM menu selection executes command files forcebdm cmd and reset cmd CMDL describes the general syntax of command files Command Files and ICD 12 Commands Consider these hints for configuring the ICD 12 connection for a specific MCU and memory configuration Connection initialization includes execution of startup file startup cmd during ICD 12 driver loading Triggering a reset through the Icd Reset menu selection executes another command file reset cmd Choosing the Icd Force BDM menu selection executes command files forcebdm cmd and reset cmd CMDL describes the general syntax of command files ICD 12 Memory Configuration Commands After a reset the system configures only the boot chip select CSBOOT To access to other memories you also must configure the MCU chip select logic Normally your application startup code does this configuration But for debugging you must repeat this configuration after each reset so that you can load your application To configure chip selects appropriately for access to the external devices write your own startup and reset command files startup cmd and reset cmd Use the commands WB address value write byte WW lt address gt value write word 16 bit WL address value write long 32 bit NOTE Your ICD 12 connection in
168. side LED Instrument The LED instrument is used for observing one definite bit of one byte Figure 3 91 on page 141 There are only two states On and Off Figure 3 91 Led Instrument Ig LED instrument attributes are shown in Table 3 52 on page 141 Table 3 52 LED Instrument Attributes Attribute Description Bitnumber to Display Defines the bit of the given byte to be displayed Color if Bit 1 Defines the color if the given bit is set Color if Bit 0 Defines the color if the given bit is not set 7 Segment Display Instrument This is the well known 7 Segment Display instrument for numbers and characters It has seven segments and one point These eight units represent eight bits of one byte Figure 3 92 on page 141 Figure 3 92 7 Segment Display Instrument ce 0 7 Segment Display instrument attributes are shown in Table 3 53 on page 142 HC S 12 X Debugger Manual 141 Debugger Components Visualization Utilities Table 3 53 7 Segment Display Instrument Attributes 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 will represent one bit of one byte Sloping Switches the sloping on or off Display Version Selects the appearance of the instrument There are two versions available Color if Bit 1 Defines the color of an activated
169. specific information about a topic About Information about the debugger version and copyright and license information is displayed HC S 12 X Debugger Manual Debugger Interface Component Associated Menus About Box Select Help gt about to display the About box shown in Figure 2 25 on page 34 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 Figure 2 25 About Box Co 8686 6 6 ll Version 6 1 fi c Copyright Freescale 1987 2005 http www codewarrior com mailto license amp imetrowerks com Extended Information Directory D Profiles R THO2c My Documents MyProj Environment file D Profiles R THO2c My Documents MyProj Simulator ini GENPATH C Program Files Freescale Cw for HC12 V5 0B lib hel 2c sre C P1 LIBPATH C Program Files Freescale CW for HC12 V5 0BMibNhc12c include C OBJPATH D Profiles R THO2c My Documents MyProj bin ABSPATH D Profiles A THO2c My Documents MyProj bin TEXTPATH D Profiles RTHO2c My Documents MyProj bin Web lt http www codewarrior com gt LM_LICENSE_FILE C Program Files Metrowerks CW for StarCore v2 6 license License File C Program Files Freescale CW for HC12 V5 0B license dat Application FLEXIm License Version 2 000 8 4a Vendor daemon metrowks v rji tik
170. specifications CS space external please refer to MC68HC812A4 specifications P space external please refer to MC68HC812A4 specifications D space external please refer to MC68HC812A4 specifications HC S 12 X Debugger Manual remaining external space please refer to MC68HC812A4 specifications 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 All Others 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 internal register space please refer to device specifications RAM memory block please refer to device specifications EEPROM memory block please refer to device specifications onchip flash EEPROM please refer to device specifications remaining external space please refer to device specifications 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 read protected this sets the memory as read protected The DMM never tries to read this r
171. target is stopped n Frozen mode values from variables displayed in the data component are not updated when the target is stopped n Periodical mode variables 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 the UPDATERATE command The UPDATERATE command sets the variables update rate see also UPDATERATE on page 592 command The SPROC show procedure and SMOD show module commands display local or global variables of the corresponding procedure or module The SCOPE command selects and displays global local or user defined variables The COMPLEMENT command sets the display complement format of Data values one sets the first complement each bit is reversed none unselects the first complement The NAMEWIDTH command sets the length of the variable name displayed in the window NOTE BmReferto SPROC on page 581 UPDATERATE on page 592 and SMOD on page 579 command descriptions for more detail about these commands HC S 12 X Debugger Manual Equivalent Operations ATTRIBUTES FORMAT Select menu Data Format ATTRIBUTES MODE Select menu Data Mode ATTRIBUTES SCOPE Select menu Data gt Scope ATTRIBUTES SPROC Drag and drop from Procedure component to Data component ATTRIBUTES SMOD Drag and drop from Module component to Data component ATTRIBUTES UPDATERATE Sele
172. the SCI A read access to the SCDR can read this value The system takes the ninth bit from the SCIInputH register A read access to SCIInput has no specified meaning bit 7 0 character send to the SCI SCIInputH This is a non memory mapped register that sends a character the ninth bit to the SCI You must write this register value before you write the SCIInput register value A read access to SCIInputH has no specified meaning bit 7 1 unused bitO ninth bit send to the SCI SCIOutput This is a non memory mapped register that receives a character sent from the SCI A write access to the SCDR triggers the value that the SCIOutput receives The SCIOutputH register receives the ninth bit A write access to SCIOutput has no specified meaning bit 7 0 character send from the SCI SCIOutputH This is a non memory mapped register that receives a character the ninth bit sent from the SCI A write access to SCIOutput has no specified meaning HC S 12 X Debugger Manual 321 HC S 12 X Full Chip Simulation Connection Supported Derivatives 322 bit 7 1 unused bitO ninth bit send from the SCI SerialInput This non memory mapped register is an alias for the SCI Input register It connects the SCI to the terminal window but does not support the ninth bit A read access to SerialInput has no specified meaning bit 7 0 data from terminal window to SCI SerialOutput This non memory mapped register is an alias for the SCIOutput re
173. the current directory also changes When the current directory changes the default env file is reloaded Always when a configuration file is loaded or stored options in the environment variable COMPOPTIONS are reloaded and added to the project options Beware of this behavior when a different default env file exists in different directories which contain incompatible options in COMPOPTIONS When a project is loaded using the first default env its COMPOPTIONS are added to the configuration file If this configuration is stored in a different directory where a default env file exists with incompatible options the Debugger adds options and marks the inconsistency Then a message box appears to inform the user that the default env options were not added In such a situation the user can either remove the option from the configuration file with the option settings dialog or remove the option from default env with the shell or a text editor depending on which options should be used in the future At startup there are three ways to load a configuration use the command line option prod the project ini file in the current directory or Open Project entry from the file menu If the option prod is used then the current directory is the directory the project file is in If prod is used with a directory the project ini file in this directory is loaded HC S 12 X Debugger Manual 637 Debugger Engine Environment Variables Local Configuratio
174. 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 could not detect a correct device Disabled one or all modules are disabled Enabled Blank Programmed gt 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 472 HC S 12 X Debugger Manual 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 To save the current RAM data check this box Saving RAM data slows down the NVMC checking this checkbox is equivalent to entering the SAVECONTEXT and LOADCONTEXT commands Flash Module Handling Flash parameter files which have the extension FPP contain MCU specific parameters as well as programs to handle internal flash modules The FPP Files section includes additional information about FPP files The FPP f
175. 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 Textcolor Defines the color of the given text Static Text is used for adding descriptions on the workspace Its attributes are shown in Table 3 56 on page 144 Table 3 56 Static Text Attributes Description Field Description Contains the text to be displayed Value is used for displaying a value in different ways decimal hexadecimal octal or binary Its attributes are shown in Table 3 57 on page 144 Table 3 57 Value Attributes Attribute Description Field Description Contains the additional description that will be displayed 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 o Its attributes are shown in Table 3 58 on page 145 144 HC S 12 X Debugger Manual Debugger Components Visualization Utilities Table 3 58 Relative Value Attributes Attribu
176. the number of CPU cycles reaches 10 000 000 Example of a Larger Stimulation File Hypertextparanum contains this example and is commented below This example file may not work as expected if the variables defined here do not refer to a port in TargetObject In our example we have only defined the objects TargetObject 210 and 212 over the Io led component Definitions of b c and pbits are only here for illustration Remove these definition lines and the lines that refer to them if the example presented here is not executable Listing 11 9 Example File io ex txt 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 PERIODICAL 100000 10 10000 a 128 30000 RAISE 7 3 test interrupt END 1000000 RAISE 7 3 test interrupt HC S 12 X Debugger Manual 377 HC S 12 X Full Chip Simulation Connection True Time I O Stimulation Detailed Explanation def a TargetObject 210 B defines a as byte mapped at address 0x210 in TargetObject def x TargetObject 212 defines x as byte mapped at address 0x212 in TargetObject Size can be omitted B for byte is default def b TargetObject 216 W defines b as word W mapped at address 0x216 in TargetObject def c TargetObject 220 L defines c as long L mapped at
177. the user application accesses via EPAGE in global address space Important All accesses are casted by the DMM to global memory which should therefore be defined for the matching range global this type covers accessing of the global memory space via BDM GPAGE register Global address space The Memory window with Address Space setup to Global displays the global space memory of the device xgate this type covers accessing of the XGATE memory space as the XGATE core would see it The Memory window with Address Space setup to X GATE displays the XGATE space memory of the device When existing the Flash Ram XGATE memory split is internally evaluated by the DMM NOTE _ By factory default setup HCS12X DBG12X Fifo Registers have been protected to reserve the DBG12X Fifo reading for the debugger DBG interface Removing this protection leeds to incorrect program flow rebuild Except physical and protected access types all types are routed to Global memory when reading from the device However for Non Volatile Memory programming reasons eep banked and banked types are routed to logical paged when writing to the device DMM Commands All DMM GUI settings can be done by debugger command line commands these commands are explained in the Debugger Connection specific Commands on page 599 chapter of this manual HC S 12 X Debugger Manual 18 HC S 12 X Flash Programming Non
178. 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 Shortcut Shift F11 keys Assembly Step If the application is halted this command performs a single step at the 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 Step Over Similar to the Step Over command but steps over subroutine call instructions Shortcut CRTL F10 keys Assembly Step Out If the application is halted inside a function this command continues execution and stops on the CPU instruction following the current function invocation This command is similar
179. this value and displays it in a speedometer like outlook In the procedure IO Show in io_demo c shown in Hypertextparanum this value is incremented or decremented 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 HC S 12 X Debugger Manual 373 HC S 12 X Full Chip Simulation Connection True Time I O Stimulation Listing 11 6 IO Show Procedure in io demo c static void IO Show void for t endless loop dir 1 do Delay PORT_DATA while dir 1 amp amp PORT_DATA 255 dir 1 do Delay PORT_DATA while dir 1 amp amp PORT DATA 0 Example Program with Periodical Stimulation of a Variable 1 Choose Simulator gt Reset 2 Choose Simulator Load Jo_demo abs 3 Choose Component Open Stimulation The Stimulation component is shown in Figure 11 73 on page 374 Figure 11 73 The Stimulation Component Window E Stimulation oix def a Target bject 210 B 10000000 Activate Stimulation Window by clicking on it 4 5 Choose Stimulation Open File io var txt 6 Choose Stimulation Execute 7 Choose Run Start Continue The Stimulation component executing io var txt accesses TargetObject at the address 0x210 associated with PORT DATA in the source You can observe this by 374 HC S 12 X Debugger Manual HC S 12
180. to a different place than default default is start of onchip ram The command will also resize the workspace as a range must be passed as parameter The command is therefore more powerful than FLASH NVMIF2RELOCATE however the range must be correctly setup to match the targeted part FLASH NVMIF2RELOCATE O resets any setup made with FLASH NVMIF2WORKSPACE or FLASH NVMIF2RELOCATE command The command should be executed by preference from a Startup cmd file HC S 12 X Debugger Manual Debugger Connection specific Commands NVMC Commands eg FLASH NVMIF2WORKSPACE 0x3800 Ox3FFF The command implies that onchip ram is available at relocation position and range prior any flash driver is loaded This command can provide more flexibility for EB386 Example 1 Layout device ram memory relocation lt blockNo gt blockNo isa 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 sys
181. 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 Jlfno path is specified the destination directory is the current project directory 550 HC S 12 X Debugger Manual LOAD The LOAD command loads a framework application abs file for a debugging session When no application name is specified the LoadObjectFile dialog is opened 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 LOAD applicationName CODEONLYIS YMBOLSONLY NOPROGRESSBAR NOBPT NOXPR NOPRELOADCMD NOPOSTLOADCMD DELAY VERIFYFIRSTIVERIFY ALLIVERIFYONLY VERIFYOPTIONSISYMBOLSOPTIONS Where applicationName is the name of the application to l
182. to discard debugger access to a memory range which could typically be accessed while running This feature is useful to protect onchip I O Register flags from being triggered by debugger memory reads due to display refreshes Remarks Itis possible to create as many memory ranges as desired down to a single byte Deleting Default Factory ranges generates warning dialogs Indeed some settings are required for the debugger to debug and removing ranges would leed to eroneous 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 CPU Core Types and Priorities 462 HC12 CPU12 Core Priorities MC68HC812A4 derivative 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 internal register space please refer to MC68HC812A4 specifications RAM memory block please refer to MC68HC812A4 specifications EEPROM memory block please refer to MC68HC812A4 specifications Espace external please refer to MC68HC812A4
183. to the Step Out command but stops before the assignment of the result from the function call Shortcut CTRL Shift F11 keys Control Points Opens the Controlpoints Configuration Window which contains tabs that allow you to control Breakpoints Watchpoints and Markpoints refer to Control Points on page 147 chapter HC S 12 X Debugger Manual Debugger Interface Debugger Main Window You can provide shortcuts for some of these functions using the toolbar Refer to the Debugger Main Window Toolbar on page 12 and Customizing the Toolbar on page 18 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 Points on page 147 chapter Connection Menu This menu entry Figure 2 16 on page 24 appears between the Run and Component menus when no connection is specified in the PROJECT INT file and no connection has been set The Connection name is replaced by an actual connection name when the expanded connection is set If a connection has been set the number of menu entries is depending on the connection To set the connection select Component gt Set Connection Refer to the Component Menu on page 29 section for details Figure 2 16 Connection Menu True Time Simulator amp Real Time Debugger D Profiles RTHO2c My Documents MyProj Simulator ini File View Ru
184. 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 Oxff hx 0x7fff HC S 12 X Debugger Manual S The S command stops execution of the emulation processor Use the Go G on page 543 command to start the emulator NOTE The S command ends as soon as the PC is changed Usage S Alias STOP Components Debugger engine Example in s STOPPING HALTED Current application debugging is stopped halted HC S 12 X Debugger Manual 573 Debugger Engine Commands Debugger Commands 574 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 on page 582 command NOTE If no path is specified the destination directory is the current project directory Usage SAVE range fileName offset
185. unchecking the related checkbox Enter or modify the command of a selected control point Enabling disabling the command of a selected control point by checking unchecking the related checkbox Enabling disabling multiple control point commands by selecting control points and checking unchecking the related checkbox Modifying the counter and or limit of a single control point With breakpoints the following operations are also available Enabling disabling halting on a single temporary breakpoint by checking unchecking the matching checkbox Enabling disabling halting on multiple temporary breakpoints by checking unchecking the matching checkbox With watchpoints the following operations are also available Enabling disabling halting on a single read and or write access by checking unchecking the corresponding checkboxes Enabling disabling halting on multiple read and or write accesses by checking unchecking the corresponding checkboxes Defining the memory range controlled by the watchpoint 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 148 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 a
186. use the environment Book 2 HC S 12 X Debugger Connections defines the connections available for debugging code written for HC12 CPUs Chapter 2 1 HC12 Debugging First Steps on page 235 Chapter 2 2 HC S 12 X Full Chip Simulation Connection on page 259 Chapter 2 3 P amp E Multilink Cyclone Pro Connection on page 405 Chapter 2 4 Softec HCS12 Connection on page 413 Chapter 2 5 HCS12 Serial Monitor Connection on page 417 Chapter 2 6 Abatron BDI Connection on page 427 HC S 12 X Debugger Manual 233 Book Il Contents 234 HC S 12 X Debugger Manual 10 HC12 Debugging First Steps Debugging HC12 code using the CodeWarrior IDE requires that a project be created or exist which specifies a connection that can be used to debug the code This section guides you through the first steps toward HC12 code debugging with CodeWarrior and the following connections Full Chip Simulation connection HCSI2 Serial Monitor connection SofTec inDart HCS12 connection ICD 12 connection BDIK connection It does not replace all the additional documentation provided in this manual but gives you a good start Technical Considerations While they can be used to debug HCS12 and HCS12X code selectable in the Wizard any of the connections listed in the previous paragraph may be used to debug HC12 code Some of these connections have special technical considerations as discussed in the followin
187. 0 48000 58000 68000 78000 tion Range 7FFF BFFF FFFF 1BFFF 2BFFF 3BFFF 4BFFF SBFFF 6BFFF 7BFFF Status Enabled Programmed Unselected Enabled Blank Unselected Enabled Programmed Protected Unselected Enabled Programmed Protected Unselected Enabled Blank Unselected Enabled Blank Protected Unselected Enabled Blank Unselected Enabled Blank Protected Unselected Enabled Blank Unselected Enabled Programmed Protected Unselected displays flash modules loads p file or performs flash operations Syntax FLASH SELECT UNSELECT AEFSKIPERASING lt blockNo gt UNPROTEC ARM DISARM SAVECONT OVLBACKUP OVLRESTORE ON SKIPS 608 TATUSOFF ERASE ENABLE DISABLE PROTECT EXT LOADCONTEXT MEMMAP MEMUNMAP RELEASE PROTOCOLON PROTOCOLOFF SKIPSTATUS NVMFREQUENCY lt frequency in Hz gt NVMIF2RELOCATE lt address gt NVMIF2WORKSPACE lt address gt lt address gt INIT lt fileName gt AUTOID HC S 12 X Debugger Manual Debugger Connection specific Commands NVMC Commands Description The FLASH command displays names locations and states of all available modules provided that a parameter f pp file is already loaded If no parameter file is loaded this command loads either the f pp file for the current MCUID or the last used fpp file FLASH INIT
188. 0 0005 274 MESSAGE SHOW ID Command 0 0002 c eee 274 MESSAGE HIDE RESET Command 000 274 FCS and Silicon On chip Peripherals Simulation 275 Supported Derivatives 0 0 00 0 ec eee eee 276 Communication Modules 0 0 00 c eee eee eee eee 285 Byteth ght BF 3 5 iu ce teo RETRO te aula as 285 J1850 Bus BLED sire ot 24 dates bn ER GRE eb en 285 Motorola Scalable CAN MSCAN 000 cece eee eens 285 Inter IC Bus IC cea eee oe ee ee eee dee ca ae es 286 Serial Communication Interface 2 2 0 cece eee 286 Serial Peripheral Interface cee eee eee 288 Converter Modules mnsine 0 00 e cee teen n 288 Analog to Digital Converter 0 0 0 ee eee eee eee 288 Memory Modules 0 0 00 eee e 290 EEPROM EETS zb eet ae ee be bate 290 Flash FTS eI REESE ee Iq E Wed 290 Miscellaneous Modules eene 290 Voltage Regulator VREG lesse 290 Debug Module DBG seseeeeeeee e 291 SI2X IND oce mea NER re ROUES eti ee SUE 291 XGATE ieilke d wed A eser eI Ie Re M S Y EAS 291 Port O Modules 4 REA EXE DEA IE ed 292 External Bus Interface EBI 0 00 ene 292 Module Mapping Control MMC 0 002 000 00008 293 Multiplexed External Bus Interface MEBI 293 Port Integration Module PIM 0 cece eee ee ee eee 294 Timer Modules iv E 64 DRE DRE LRDESP RP ee ee a 2
189. 0 5 ge Cancel Help 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 74 on page 121 allows you to select the Fold functions described in Table 3 37 on page 122 Figure 3 74 Folding Menu Unfold Fold Unfold All Text Fold All Text All Text Folded At Loading HC S 12 X Debugger Manual 121 Debugger Components General Debugger Components Table 3 37 Folding Menu Description Menu Entry Description Unfold Unfolds the displayed source code Fold Folds the displayed source code Unfold All Text Unfolds all displayed source code Fold All Text Folds all displayed source code All Text Folded At Folds all source code at load time Loading Drag Out Table 3 38 on page 122 shows the drag actions possible from the Source component Table 3 38 Source Drag Possibilities Destination Component Action Window Assembly Displays disassembled instructions starting at the first high level language instruction selected The assembler instructions corresponding to the selected high level language instructions are hi
190. 000 Cancel Help HC S 12 X Debugger Manual 369 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Wagon Component The Wagon window shown in Figure 11 66 on page 370 simulates a tool machine wagon functionality Figure 11 66 Wagon Window 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 also positions the wagon at the left border The STOP button stops the wagon at the current position Wagon Menu Figure 11 67 on page 370 shows the Wagon menu and is described in Table 11 26 on page 370 Figure 11 67 Wagon Menu Setup Table 11 26 Wagon Menu Description 370 Opens the Wagon setup dialog box shown in Figure 11 68 on page 371 Wagon Setup When you select Setup from the Wagon Menu the Ports Address Selection dialog box appears This is the Wagon component Setup window HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 68 Ports Address Selection Dialog Box Ports address selection Ea Motor port Output freoo00 Sensor port Input re000g v Port B Choose a port or insert 4 Port C Port D Port E Cancel In the Motor Port section you can insert an address in hexadecimal to select the Wagon direction in the Sensor Port field you can inse
191. 04 3 051758e 005 3 051758e 004 3 051758e 005 3 356934e 004 3 051758e 005 3 662109e 004 3 051758e 005 EOF HC S 12 X Debugger Manual 383 HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins File Example 2 FILELOOP INF LOOP INF TIMEUNIT NONE TIMEFACTOR 0 5 GAIN 1 DCOFFSET 0 OPTION NORMAL 5 File Parameters 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 the number of time 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 programmation multiplies the number of cycles or time duration by this factor 384 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins 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 e ONLYPOSITIVE at Pin level setup after gain and offset set 0 if signal level lt 0 e ONLYN
192. 0x0800 EE PR nprotect all EEPROM blocks PPAGE Select Flash Array 0 FEEMCR Enable program of boot block PPAGE Select Flash Array 1 FEEMCR Enable program of boot block PPAGE Select Flash Array 2 FEEMCR Enable program of boot block PPAGE Select Flash Array 3 FEEMCR Enable program of boot block INITRM Map RAM to 0x2000 Quit this dialog box by clicking OK and save the settings if necessary Communication with the Debugger Setup Select Setup Communication from the Setup menu to open the Communication Setup dialog box Figure 15 7 Communication Setup Dialog Box Communication Setup HC S 12 X Debugger Manual _ Cancel e 433 Abatron BDI Connection BDI Interface Software Setup In this dialog box set the communication for your future use of the BDI with the debugger Settings made here should be identical to communication settings made in the debugger within the Communication Setup Dialog Box on page 433 Press the Test button to check the setup then click OK to quit this dialog and save the settings if necessary BDI Working Mode and Setup List Transmission Select Setup Mode to open the dialog below and download the configuration to the target board by clicking Transmit after setting the required parameters Figure 15 8 BDI Working Mode Dialog Box 434 BDI Working Mode MC68HC912DA128 HC312DA128 Loading the Abatron BDI Connection The target is setinthe
193. 128B 280 MC9S12DJ256B 281 MC9S12DJ64 281 MC9S12DP256B 282 MC9S12DP512 282 MC9S12DT128B 283 MC9S12DT256B 283 MC9S12XDP512 284 MC9S12XDT512 285 MCCNT 318 MCCTL 318 MCU Communication 414 mceu03cl fpp 478 mcu03c3 fpp 478 mcu03c4 fpp 479 HC S 12 X Debugger Manual mculd 474 MCUTOOLS INI 192 636 MEM 558 Memory Dump 78 Word 78 Memory banking 428 Memory Configuration Modes 264 Memory Expansion Register 317 memory model 317 Menu Help 33 Run 21 Target 24 29 View 18 Window 31 MicroC 90 misaligned access 263 Mode 80 Module 94 Modules 471 Modulus Down Counter 318 Monitor Communication 422 MONITOR HCS08 gt Bus Trace 422 MONITOR HCS08 gt Erase Flash 422 MONITOR HCS08 gt Monitor Communications 422 MONITOR HCS08 gt Select Derivative 422 MONITOR HCS08 gt Trigger Module Settings 422 MONITOR HCS08 gt Vector Mirroring Setup 422 Motorola Scalable CAN 285 MS 559 ms 109 Multiplexed External Bus Interface 293 N Name 472 NB 560 NETWORK 439 New 15 NF 321 No Link To Target 441 NOCR 562 Nodefaults 10 NOLF 562 671 NV PARAMETER FILE 474 O Object Info Bar 35 OBJPATH 649 Oct 70 81 106 200 Octal 200 OP_SetValue 318 OPEN 563 Open Component 30 Open Configuration 15 Open Memory Block 266 Open Source File 117 Options 192 Pointer As Array 68 Options Autosize 33 Options Component Menu 33 OR 321 OSEK Kernel Awareness 183 OSEK ORTI 183 OSEK RTK Inspector 184 OSPARAM PRM 178 Out
194. 12dg128 C007 CALL 0x8000 0x00 Assembly Step Ctrl F11 COOB BGND Assembly Step Over Ctrl F10 cooc BGND Assembly Step Out Ctrle Shift F11 CO00D SUBB 17 COOF SUBB 25 Control Points L EnableInterrupte forties SMA wait forever HC12 CPU Cycles 0 mr a DFs DF IX DFDF IY DFDF iP cooo pc cooo PPacE oO DFDD CCR SXHINZVC Startup Auto Symb Global startupData lt 6 gt _tagStartup 00 00 uu uu 00 00 E SEG END SSTACK 0 array 0 of signed char 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Auto Symb Local Table 2 4 Run Menu Description Menu entry Description Start Continue Starts or continues execution of the loaded application from the current program counter PC until a breakpoint or watchpoint is reached runtime error is detected or user stops the application by selecting Run gt Halt Shortcut F5 key 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 22 HC S 12 X Debugger Manual Debugger Interface Debugger Main Window Table 2 4 Run Menu Description continued Menu entry Single Step Description If the application is halted
195. 173 This window can be opened through the Source Memory or Data window popup menu as described below To open the Controlpoints Configuration window with the Markpoints tab exposed 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 popup menu 4 Click the left mouse button The ControlPoints Configuration window appears with the Markpoints tab of this window exposed as shown in Figure 4 10 Figure 4 7 Source Window Popup Menu 3 Source Bl x D Profiles RTHO2c My DocumentssnextunssourcesNStart 8 c Line 288 1 A fendi f n Set Breakpoint m void Startup void r parameter file purpose 1 i Run To Cursor 2 i Show Breakpoints i Show Location wn init dat etc Ir 3 g 5 called from _PRE zas at di e Linker y Show Markpoints p ELE OBJECT P Open Source File DisableInterrupts is done in the pre endif Gopy Gic for 77 BH for am call the root lif startupDat GoTo Line Ctrl G INIT_SP 0 initialize t Find Ctrl F INIT SP FROM ST FindProcedure Ctrl I A Init Folding gt startupData ma ie T 39 end loop for Mar B ToolTips E Z HC S 12 X Debugger Manual 171 Control Points Markpoints Figure 4 8 Memory Popup Menu Memory 0108 PRERE uu uu uu uu miuus uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu
196. 2 X Debugger Manual Debugger Components Component Introduction Figure 3 2 Open Window Component Window Open Window Component x Details Assembly OK X oe M emory Cancel Browse 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 HC S 12 X Debugger Manual 47 Debugger Components General Debugger Components Multiple Component Windows If you load a project that targets both HC12 and XGATE cores the Debugger shows two component windows as follows One Assembly window for the HC12 source code and one assembly window for the XGATE source code One Data window for the HC12 portion of the application and one Data window for the XGATE portion of the application One Procedure window for the HC12 call chain and one Procedure window for the XGATE call chain One Register window for the HC12 core and one Register window for the XGATE core One Source window for the HC12 source code and one Source window for the XGATE source code General Debugger Components This chapter describes the various features and usage of the debugger components 48 HC S 12 X Debugger Manual Debugger Components General
197. 20 CodeWarrior Integration 209 Color if 142 Color if Bit 141 COMDEV 657 Command 145 Syntax 487 Command File Dialog 27 262 Command File menu entry 27 262 Command File Playing 56 Command Files 438 Command Line 9 Commands 599 602 608 Communication 429 437 Communication Device Specification dialog 439 COMn 439 666 Compare 318 COMPLEMENT DATA Component 504 Memory Component 505 Register Component 501 Component Assembly 49 195 196 Associated Menus 34 Command Line 54 Coverage 58 CPU 45 DAC 63 Data 65 195 196 199 Framework 6 Inspector 124 IO Led 325 LED 327 Main Menu 35 Memory 78 205 MicroC 90 Module 94 Phone 329 Pop Up Menu 36 Profiler 98 Recorder 102 Register 105 196 203 SoftTrace 108 Source 111 195 196 Stimulation 357 Target 46 Terminal 207 VisualizationTool 131 Window 45 Components File 35 COMPOPTIONS 637 COMPRESS 658 Compression 441 658 Configuration 16 Configuration file 432 Configuration Tool 430 Configure BDI Box 430 Configure Box 438 Connect 437 Continue on illegal break 438 441 659 Control Point Definition 147 Dialogs 147 HC S 12 X Debugger Manual Copy 134 COPYMEM 520 CopyMem 80 Copyright 33 Coverage 428 CPORT 620 CPU Cycle 13 cycle 105 CPU cycles 64 bits 260 CPUI12 427 443 CR 521 Cross debugging 5 Ctrl E 133 Ctrl L 134 Ctrl S 134 CTRL P 136 Current Directory 635 645 Customize 18 Cut 135 CYCLE 521 Cycle 109 D DAC Configu
198. 22005 624468804 eee eRe cee dees he RSEN EP RA 1 Book Debugger Engine Book Contents occ cee che Eee IRR Res XR eee 3 1 Introduction 5 Freescale Debugger 225i ski wie haste senda eee AER RE ru RA 5 Debugger Application csi cero e e a S E EE V 5 Debugger Features 4 coger Re REN SEXT EEEE EEE P ERR RR Gp A 6 Demo Version Limitations on Components 0005 6 2 Debugger Interface 7 Introduction m ESPERE RE UHERRNI RAO beet A d ase 7 Application Programs cues sve ber E REREX ERE ERAN NEU 7 Starting the Debugger 8 Starting from within the IDE 0 0 00 eee eee ee 8 Starting Debug from the Project Window 2 000 8 Starting Debug from the Main Window Menu Bar 9 Debugger Command Line Start 00 0 0 eee 9 Command Line Options 0 00 0 c eee eee ee 9 Order of Commands 0 0 eee eee 11 Debugger Main Window lesser 11 Debugger Main Window Toolbar 0 0 0 0 eese 12 Debugger Main Window Status Bar 0 00 00 0 02 eee ee eee 13 HC S 12 X Debugger Manual 1 Table of Contents Main Window Menu Bar 0 0 cee eee 13 File Menus 2 cuu er Eie pube ev Ue 14 Preferences Window 0 0 cece cece eee eee 16 aum 18 Customizing the Toolbar 0 0 02 cece eee 18 Run Menus ico obe bo pee Gane eDrpieRELDIOCEEN ER es 21 Connection Menu n r E ERE Ih 24 Loading
199. 228 HC S 12 X Debugger Manual 227 Synchronized Debugging Through DA C IDE Debugger Interface Figure 9 13 DA C Component Opening m Open Window Component 00000000 uu uu uu uu 00000004 uu uu uu uu 00000008 uu uu uu uu 000000C uu uu uu uu 00000010 uu uu uu uu 00000014 uu uu uu uu 00000018 uu uu uu uu 000001C uu uu uu uu 00000020 uu uu uu uu 00000024 uu uu uu uu 00000028 uu uu uu uu 000002C uu uu uu uu 00000030 uu uu uu uu 100000034 uu uu uu uu 00000038 uu uu uu uu The Debugger DAC window which is needed for communication with DA C IDE is now opened Figure 9 14 on page 228 Figure 9 14 DA C Window m DA C Link x You have to save this configuration by selecting File gt Save Project from the main menu of the Debugger This component will be automatically loaded the next time this project is called Close the Debugger 228 HC S 12 X Debugger Manual Synchronized Debugging Through DA C IDE Synchronized Debugging Synchronized Debugging We can now test the synchronization between 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 popup menu The cursor points to the void main void statement In the main menu from DA C select Debug gt Set Breakpoint or click on the corresponding button on the debug toolbar the selected line is highlighted
200. 2X This range gives the possibility to design a linear source code to be programmed from address 4000 to FFFF The reset default page Pxx visible in 8000 BFFF may vary from one HCS12 device to another and be exactly the 3E PPAGE on HCS12X devices This way of programming can be used to evaluate a 48 kBytes application other several devices but remain critical due to the lack of control of the current PPAGE Indeed if the PPAGE changes by program CALL or changed by PPAGE register accidentally writing the program code stored in the window range 8000 BFFF cannot be executed properly This implies not to use the entire capacity of the flash of a device NOTE For some backward compatibility reasons these modules cannot be erased but only programmed Erasing is available but does not make any operation ALL EPAGES also previously called EEP PAGED HCS12X only The entire onchip flash memory CAUTION Erasing this module erases de facto all other EEPROM modules HCS12 EEPROM s Relocation HCS12 devices provide sometimes hidden EEPROM memory that can only be accessed when changing the Memory Expansion Register called INITEE Fully Hidden EEPROM The EEPROM is fully blankchecked The FPP file will remap the EEPROM via INITEE automatically to 2000 at the condition that the user did not relocate himself the EEPROM changing INITEE In that HC S 12 X Debugger Manual 481 HC S 12 X Flash Programming Hard
201. 365 can be used to simulate input and output It can receive characters from several input devices and send them to other devices Figure 11 62 Terminal Window P Terminal of x ZH 06 test file ZH 06 C Date Oct 04 1996 15 28 10 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 11 63 on page 365 Figure 11 63 Terminal Menu and Popup Menu Terminal Ol x Clear Gopy Ghl E Paste Gorey Input File Close Input File Output File Close Output File Configure Connections Cache Size To open the popup menu just right click in the terminal window HC S 12 X Debugger Manual 365 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Configure Terminal Connections The terminal window is very flexible and can redirect characters received from any available input device to any available output device You can specify these connections by choosing Configure Connections in the context menu of the terminal component This opens the dialog box shown in Figure 11 64 on page 366 Figure 11 64 Configure Terminal Connections Dialog Box 366 Configure Terminal
202. 4 SofTec HCOS8 First Steps From Within an Existing Project 253 255 SofTec HC08 First Steps Using the Stationery Wizard 237 247 SofTec HC08 inDart HC08 Connection Menu Options 413 SofTec HC08 MCU Configuration Dialog Box 254 SofTec HC08 Set Connection Dialog Box 254 SofTec HC08 Technical Considerations 235 236 413 Softec HC08 Connection 235 413 Softec HCS08 Connection 457 SPC 580 Splitting View 59 SPROC 581 SREC 582 ST SectionTitle 1 3 233 235 259 413 417 451 457 467 485 487 599 631 633 655 ST1619 HDS Postload command file 29 262 Preload command file 28 Reset command file 28 Startup command file 28 Start 103 472 Start Continue 22 Starting an Application 196 startup 637 Startup command file 28 Startup Init List 432 startup cmd 207 HC S 12 X Debugger Manual State 472 States 472 Statistics 99 Status Bar 13 18 Status Bar Information for the BDIK Target Interface 441 Status Message 441 BDI Ready 441 HALTED 442 No Link To Target 441 Reset 442 RUNNING 441 Status register bits 105 Step In 197 Assembly Instruction 199 Source Instruction 197 Step Out 23 197 Function Call 198 Step Over 23 197 198 STEPINTO 583 STEPOUT 584 STEPOVER 585 STEPPED 442 STEPPED OVER 442 Stepping and Breakpoints Messages 442 Stepping Message STEPPED 442 STEPPED OVER 442 STOPPED 442 TRACED 442 Stimulation 318 STOP 586 STOPPED 442 Stopping an Application 196 Symbolic 69 70 200 T
203. 4 VisualizationTool Popup Menu 134 Menu entry Context Description Edit mode Always Switches between Display mode and Edit mode In Edit mode this entry is checked Setup Always Shows the Setup dialog of the VisualizationTool Load Layout Edit mode Loads a VisualizationTool Layout vt 1 Save Layout Always Saves the current layout to a file vt1 Add New Edit mode Shows a new popup menu with all available Instrument instruments Properties Only one Shows up the property dialog box for the currently instrument selected instrument PEDE Shortcut Ctrl P Remove At least one Removes all currently selected instruments selection Shortcut Delete Copy At least one Copies the data of the currently selected selection instruments into the clipboard Shortcut Ctrl C HC S 12 X Debugger Manual Debugger Components Visualization Utilities Table 3 44 VisualizationTool Popup Menu continued Menu entry Context Description Cut At least one Cuts the currently selected instruments into the selection clipboard 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 the current instrument to the back of the Z selection order Send to Front At least one Brings the current instrument to the front of the Z selection order Clone Attributes More than Clones
204. 5 on page 100 shows the Profiler popup menu the Delete and Graphics menu entries are described in Table 3 29 on page 100 Figure 3 55 Profiler Split View Associated Popup Menu Delete Graphics Table 3 29 Profiler Split View Associated Popup Menu Description 100 Delete Removes the split view from the host component Graphics Toggles the graphic bars display in the split view Profiler Output File Functions You can redirect the Profiler component results to an output file by choosing Output File Save As in the menu or popup menu Output File Filter By choosing Output Filter the dialog box shown in Figure 3 56 on page 101 lets you select what you want to display i e modules only modules and functions or modules and functions and code lines You can also specify a range of coverage to be logged in your file HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 56 Output File Filter Dialog Box Output File Filter x Content C Modules C Modules Functions Modules Functions Code Lines r Range to dump From o To 1100 Es Cancel Help Output File Save The Save As entry opens a Save As dialog box where you can specify the output file name and location Associated Popup Menu Identical to menu Drag Out All displayed items can be dragged out Destination windows may display information about the time spen
205. 520 CMDPFILDE Imber ERR ERE Ub best xs 520 CR EM 521 CYCLE s ie eR CROPS RI ate ales od Renae E a reg 521 DAS Mi i ue Since ae HN aie et ee ie eco ee RM 522 DBS UP 523 DDEPROTOGOL e erre ee ea wee a US 525 DEFINE siege teak idee ae thd oe bbe eda 526 DETAILS es cotter ee aia eR ates deed see UE LE 527 DLE pex dise ehe e tte bae eR ELE 528 DUMP cies beh Wt bee et ete E CUEDRPERNHEEEEWPOTSRET 529 DW 5 rester D MH eite eene 529 E venbetenesd tate cu utet etes etre bini ird 530 ELSE x svosssesekERS ERG ERE ERR Ur Bat bute qa pena e iE 531 ELSEIF ER MeRMERURMERSA RUPEE Caee ET Rep diet 531 ENDFOCUS erbe e Sheth cab CREE ADU RUE RAT ER E 532 HC S 12 X Debugger Manual 19 Table of Contents 20 ENDEOR fos eetiumwveeeLPRNERUH UE a eek eet SIR RUPES 533 ENDIF eis ep REN Gand Pp MEE UO bu deeem 533 ENDWHILE LI Rue eos eed eee ee DU ERES 534 EXECUTE iki e ETC e bee eere wee t eus 534 EXIT ecient ested ae die A eR e e 535 Toes onde e poe t oet e petes ose god n 535 FIETER iR er dee OP vie eder poesi yas 536 FIND isc es Fed eee teers une pity eee he NOERHE REA 537 EINDPROG cns pak ERE AR eol ute ee aed Sete 538 FOCUS 5 1 toot aoe te bebe eS ere ene petet 539 FOEDz ee ESe4 xbv kh tee a SEE EE uL bees 540 BON Ds oii askin aUe sped Nea seers Wes 540 FOR crf ogee BOA Mees bee Dee pU teddy aed TEE acetals 541 FPRINTF e ix ewumtlectebestat y V Be ie is oh eae 542 FRAMES s ee ae tea pet Sho AS aa es Oa ae A 542 Cool Gd
206. 65 Local and Global 65 Mode 68 Scope 65 Showing Location 202 Type 65 Value 200 Vector Mirroring Setup 422 VER 593 VERIFY 660 Version number 33 Vert Text Alignment 144 Vertical Size 135 VisualizationTool 675 7 Segment Display 141 Analog 137 Bar 138 Bitmap 139 140 Demo 146 Demo limitation 146 Demo Version Limitations 146 DILSwitch 140 Instrument 136 Knob 140 LED 141 Setup 136 Switch 142 Text 143 Voltage Regulator 290 W W 10 WAIT 594 WAKE 320 WATCHPOINT 443 Watchpoint Checking condition 164 Command 169 Conditional 168 176 Counting 167 176 Definition 147 Deleting 169 175 Read 165 174 Read Write 148 Read Write 166 175 WATCHPOINT 443 Write 166 WB 595 WHILE 554 596 Width 137 Windows 635 WinEdit 635 WL 597 WOMS 320 Word 81 Word size 80 WorkDir 192 Working Mode 434 WorkingDirectory 192 WPORT 630 WW 597 HC S 12 X Debugger Manual X X Position 136 Y Y Position 136 Z ZOOM 598 Zoom in 68 676
207. 7 CodeWarrior Integration 209 Debugger Configuration 209 8 Debugger DDE Capabilities 211 Introduction ese ED eee ee RA ea 211 DDE Implementation sese oere i a a E E E 211 Driving Debugger through DDE 0 00 0 esses 211 9 Synchronized Debugging Through DA C IDE 213 Configuring DA C IDE for Freescale Tool Kit 0 0 213 Create New Project isse Rp re erem te e se des 214 Configure Working Directories 214 Configure File Types lesse 216 Configure Library Path 00 0 0 eee eee eee 216 Adding Files to Project 2 0 0 eee eee eee 218 Building The Database saene onei nyan E e e eee ee eee eee 219 Configuring The Tools 0 0 0 0 eee ee 221 Compiler Configuration 00 0 0 eee eee eee 221 Linker Configuration 0 0 0 c cece ee 222 Maker Configuration 223 Debugger Interface crese niae cette N 224 DA C IDE and Debugger Communication 0 225 Communication DLL Installation elles esee 225 Debugger Properties Configuration 0 000 226 Debugger Project File Configuration 00 0 227 Synchronized Debugging 0 0c cee eee 229 HC S 12 X Debugger Manual 8 Table of Contents Troubleshootmg duce tad ie Rr Nep RENE ON ph etae t US 229 Book Il HC S 12 X Debug Connections Book II Contents ceo ee ee OPI e 233 10 HC12 Debugging First Steps 235 Technical Con
208. 7600 Show Protocol Cancel Help If the connection to the BDI box has failed dialog box automatically opened or using menu entry Abatron BDI Connect it is possible to modify the Communication Device Specification edit box The Communication Device specification edit box should contain the communication settings to connect to the BDI box The syntax of the initialisation string is COMn baudrate where n is the COM port number like 1 2 3 etc and where baudrate is 9600 19200 38400 57600 115200 according to the setup done with the ABATRON configuration application e g COM1 57600 For the communication via an Ethernet and bdiNet use the following initialisation string NETWORK ip address port where ip address is the IP address of the BDI box or bdiNet in the form xxx xxx xxx xxx and port is the bdiNet port usually 1 for BDI1000 and BDI2000 e g NETWORK 151 120 25 101 1 HC S 12 X Debugger Manual 439 Abatron BDI Connection Abatron BDI Connection Windows Edit and Dialog Boxes The Show Protocol check box allows you to switch on off the displays of the messages sent between the debugger and the BDI interface If the Show Protocol box is checked all commands and responses sent and received are reported in the Command Line window NOTE _ The Show Protocol checkbox is a useful debugging feature if there is a communication problem The settings performed in the Communication Device Specification
209. 8 Edit Name Width Dialog Box Name Width fi 6 Cancel Help This dialog box allows you to adjust the width of the variable name displayed in the Data window This string will be cut off if it is longer than 16 characters Thus by enlarging the value you can adapt the window to longer names HC S 12 X Debugger Manual 73 Debugger Components General Debugger Components Zoom and Sort Submenus Figure 3 29 Zoom and Sort Submenus Zoom in v Not Sorted Ea Alphabetical By Address Associated Popup Menu Figure 3 30 Data Popup Menu Open Module Add Expression Set Watchpoint Show Watchpoints Set Markpoint Show Markpoints Show Location Zoom b Scope b Mode gt Format b Options b Sort b Table 3 13 on page 75 specifies the Data Popup Menu entries 74 HC S 12 X Debugger Manual Table 3 13 Data Popup Menu Debugger Components General Debugger Components Menu Entry Description Open Module Opens the Open Module dialog box Set Watchpoint Appears only in the popup menu if no watchpoint is set or disabled on the pointed to variable When selected sets a read write watchpoint on this 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 Delete Watchpoint
210. 94 Clock and Reset Generator CRG 000 cece ene 294 BlOCKS steht wit ik Roa A ees EM EA Hi 294 Enhanced Capture Timer ECT 20 0 eee ee eee 296 Periodic Interrupt Timer PIT 0 0 0 cece eee eee eee 299 Pulse Width Modulator PWM 00 cece eens 299 HC S 12 X Debugger Manual 10 Table of Contents Timer Module TIM reme INE ESREUNSETELSES 301 Legacy HC12 CPU12 Derivatives Simulation 301 MC68HC812A4 sil e mb Hie ede a es eee NS 301 HC912DG128x HC912DT128x 0 eee 317 FCS Visualization Utilities 323 Analog Meter Component 0 0 0 0 cece eee eee ees 323 Analog Meter Operations 0 00 ce eee eee ee eee 324 Analog Meter Menu 0 0 0 eee ee ee eee 324 TIO LED Component eee RR ERREUR eda be un Ee ee 325 IO LBD Operations ler RR RE Ime Rees 325 IO E BD MenU n rex FREE ote ERR E LEER 325 Demo Version Limitations 0 00 0c eee eee 326 LED Component ete Sheesh ee eens so eee eee Gea wae LES 327 LED Operations i5 ihe cata whoa E RP HERUM beta tees 327 LED MenU iex eee erbe E SER SEDE Reg 327 Phone Component iil Re ERU be eb g eb ee bale ay 329 Phone Operations llle 330 ADC DAG Component ove ee heh oe beh ERSTE 331 ADC DAC MENU a scie eru hePAM Soe eae aha wees 333 ADC DAC Setup Dialog Box 2 0 0 0 0 0 0 0 eee eee 333 Conversion Parameters Dialog Box 000000005 334
211. Banked Memory Area check box you must set the start address and the end address of this memory range For some connections the number of pages must be specified in decimal e g 0 to 256 for HC812A4 For some other connections the EPAGE register address must be specified in hexadecimal e g 0x36 for HC812A4 HC S 12 X Debugger Manual 449 Abatron BDI Connection HC12 and HCS12 Banked Memory support Figure 15 20 Banked Memory Location Window Various Tab PPage DPage EPage Various v Display dialog at connection if banked memory locations not defined Various Tab Not For All Connections If you are using an HC12 derivative which supports banking and you don t want to enable this mechanism or if you want to use only one bank out of three you can suppress the automatic display of the Banked Memory Location dialog by checking the Display dialog at connection if banked memory locations not defined check box NOTE The settings entered in this dialog box are stored for a later debugging session in the targetName section of the project file 450 HC S 12 X Debugger Manual Book Ill HC S 12 X Debug Connections Common Features Book Ill 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 3 HC S 12 X Debugger Connections Common Features e Chapter 3 1 HCS12
212. Connections E x Default Configuration ALTEN r Connections From To Add Input File gt Virtual SCI Add All Keyboard gt Virtual SCI Adan Virtual SCI gt Display Remove All Virtual SC gt Output File Remove Al r Serial Port Virtual SCI COM1 m Virtual SCI Input Port Scil Serial utput Baud Rate 19200 i i Virtual SCI Output Port s ci Seriallnput Show Protocol Cancel Help 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 which input devices will be redirected 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 will then appear 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 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities If a connection from or to the virtual SCI port has been chosen it is a
213. Ctrl Shift F1 Browse in the prog directory of your Freescale installation and select the help file matching your CPU HC S 12 X Debugger Manual 215 Synchronized Debugging Through DA C IDE Configuring DA C IDE for Freescale Tool Kit Configure File Types From the main menu of DA C choose File Types to configure the basic file types The File Types Tab of the Project Options Window contains options which determine file types of the project For an efficient use of Freescale tools Figure 9 2 on page 216 shows file extension types that can be defined Figure 9 2 DA C Project Options Window File Types Tab 216 Project Options Configure Library Path An additional configuration path must be defined to specify the location of library header files needed for DA C symbol analysis This can be done by choosing Options Analysis for Symbols gt C Source in the main menu of DA C The window shown in Figure 9 3 on page 217 contains options that determine parameters of the C source code analysis HC S 12 X Debugger Manual Synchronized Debugging Through DA C IDE Configuring DA C IDE for Freescale Tool Kit Figure 9 3 Analysis for Symbols Options Window C Source Tab Analysis for Symbols Options 2l x General C Source Source Maximum identifier length 40 HIWARE MB8xxx CPU32 V5 0 2 ci Special table processing Preprocessor Defines Control
214. Cyclone Pro Connection on page 405 Chapter 2 4 Softec HCS12 Connection on page 413 e Chapter 2 5 HCS12 Serial Monitor Connection on page 417 Chapter 2 6 Abatron BDI Connection on page 427 Book 3 HC S 12 X Debugger Connections Common Features e Chapter 3 1 HCS12 On chip DBG Module on page 453 e Chapter 3 2 HCS12X On chip DBG Module on page 455 Chapter 3 3 Debugging Memory Map on page 457 HC S 12 X Debugger Manual 1 Manual Contents Chapter 3 4 HC S 12 X Flash Programming on page 467 Book 4 Commands Chapter 4 1 Debugger Engine Commands on page 487 Chapter 4 2 Debugger Connection specific Commands on page 599 Book 5 Environment Variables Chapter 5 1 Debugger Engine Environment Variables on page 633 Chapter 5 2 Connection specific Environment Variables on page 655 2 HC S 12 X Debugger Manual Book I Debugger Engine 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 Book I the Debugger engine defines the HC12 HCS12 and HCS12X common and base features their functionality and gives a description of the components that are available in the debugger This book is divided into the following chapters HC S 12 X Debugger Manual This chapter describes the manual and spec
215. DATA MC68HC812A4 Technical Summary 16 Bit Microcontroller 1996 CPUI2 Reference Manual Preliminary draft 15 July 95 AMCU Division 1995 MOTOROLA HC912DG128x HC912DT128x This section explains derivative simulated mechanisms and implemented features that match the real HC12 derivatives It also explains simulation limitations For technical specifications of all I O mechanisms please see MOTOROLA MC68HC912DA128 MC68HC912DG128 16 Bit Microcontroller Technical Summary from MOTOROLA INC 1997 27 August 1997 rev1 0 Register Block You can reassign the 1 kilobyte register block to any 2 kilobyte boundary within the standard 64 kilobyte address space Related Register INITRG Initialization of Internal Register Position Register simulated Memory Expansion Register The system fully simulates this mechanism within CALL and RTC instructions for banked memory model HC S 12 X Debugger Manual 317 HC S 12 X Full Chip Simulation Connection Supported Derivatives 318 NOTE Also see the Programming in Bank Windows section of this manual for application programs creation adaptation Related Register Program Page Register PPAGE PIX2 PIX1 PIX0 bits memory defined but NOT updated Enhanced Capture Timer 16 Bit Modulus Down Counter Simulated 8 Input Capture Output Compare channels all channels are NON BUFFERED and identical except channel 7 with TCRE Timer Counter Reset Enable also implemented You may configure
216. DFDF IY DFDF iP cooo Pc cooo PPAGE 0 5tartup sP DFDD ccR sxuruzvc IP Procedure E startupData 6 _tagStartup 00080 00 00 uu uu 00 00 E SEG END SSTACK 0 array 0 of signed char 00088 00 O0 00 00 OO 00 00090 00 00 00 00 00 00 00098 00 00 00 00 00 00 For Help press F1 READY displayed in the status bar indicates that the simulator is ready HC S 12 X Debugger Manual 193 How To Automating Debugger Startup Automating Debugger Startup Often the same tasks have to be performed after starting the Debugger These tasks can be automated by writing a command file that contains all commands to be executed after startup of the Debugger as shown in Listing 6 1 on page 194 Listing 6 1 Example of a Command File to Automate Tasks load fibo abs bs amp main t g This file will first load an application then set a temporary breakpoint at the start of the function main and start the application The application will then stop 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 This is done in the application that starts the Debugger for example Editor Explorer Make utility Example Freescale PROG HIWAVE EXE c init cmd When the Debugger is started with this command line it will execute the command specified
217. DI interface box and the debugger The BDI Interface Software Setup on page 430 section describes how to setup the BDI interface box using the ABATRON configuration tool The discussion focuses on the firmware and the initialization list startup init list The Abatron BDI Connection Menu Entries on page 437 section provides a description of the Abatron BDI Connection specific menu entries The Abatron BDI Connection Windows Edit and Dialog Boxes on page 438 section provides a description of the Abatron BDI Connection specific dialog boxes The Abatron BDI Status Bar Information on page 441 section describes the status bar messages for the Abatron BDI Connection The Terminal Emulation on page 443 section describes how to emulate a text terminal between CPU12 CPU16 and CPU32 derivatives and the debugger The Flash Programming on page 445 section describes how to proceed to program on chip non volatile memory area The HC12 and HCS12 Banked Memory support on page 447 section lists all the debugger commands specific to this connection The Banked Memory Location Window on page 447 section describes how to use the banked memory model manager with related CPU12 derivatives Abatron BDI Highlights The Abatron BDI Connection currently supports the BDI Background Debug Interfaces designed by ABATRON AG including the BDI HS on CPU12 and the BDI1000 on the CPU12 HC S 12 X Debugger Manual 427 Abatron BDI
218. DRE flag is set 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 Outputs 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 Redirection is handled through Escape sequences of the output data stream Table 11 24 on page 361 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 Table 11 24 Redirections and Associated Escape Sequences Escape Sequence Function ESC h 1 Output to Terminal window only ESC h 2 filename Output to both Terminal window and file ESC h 3 filename Output to file only ESC h 4 Read from keyboard ESC h 5 filename Read input from file fileName ESC h 6 filename Output to Terminal window and append to file ESC h 7 filename Append to file only ESC is the ESC character ASCII code 27 decimal These commands can be used anywhere in the output stream HC S 12 X Debugger Manual 361 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities How to Redirect By default an output redirection is set to the TestTerm component windo
219. Data Reg Are simulated XGATE Registers XGMCTL XGATE Module Control Register Is simulated XGCHID XGATE Channel ID Register Is simulated XGVBR XGATE Vector Base Address Is simulated XGIF XGATE Interrupt Flag Vector Is simulated XGSWT XGATE Software Trigger Register Is simulated HC S 12 X Debugger Manual 291 HC S 12 X Full Chip Simulation Connection Supported Derivatives 292 XGSEM XGATE Semaphore Register Is simulated XGCCR XGATE Condition Code Register Is simulated XGPC XGATE Program Counter Is simulated XGR1 XGATE Register 1 Is simulated XGR2 XGATE Register 2 Is simulated XGR3 XGATE Register 3 Is simulated XGR4 XGATE Register 4 Is simulated XGR5 XGATE Register 5 Is simulated XGR6 XGATE Register 6 Is simulated XGR7 XGATE Register 7 Is simulated Port I O Modules External Bus Interface EBI The I O device External Bus Interface EBI is not simulated HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Module Mapping Control MMC Registers GPAGE Global Page Index Register Is simulated DIRECT Direct Page Register Is simulated Miscellaneous System Control Register Is not simulated MTSTO Reserved Test Register Zero Is not simulated RPAGE RAM Page Index Register Is simulated EPAGE EEPROM Page Index Register Is simulated PPAGE
220. Debugger Components Assembly Component The Assembly window shown in Figure 3 3 on page 49 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 Figure 3 3 Assembly Window E Assembly iof XI Fibonacci 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 on page 50 contains all functions associated with the assembly component Theses
221. Debugger Manual use DEFAULTS else use HI WAVE The environment variables are loaded from the default env file If an entry Layout lll exists the layout file lll hwl is loaded and executed The target is set if entry Target ttt exists load target ttt If an entry Project ppp exists the command file ppp is executed The configuration file hwc is loaded entry configuration hwc Environment Variable Paths Most environment variables contain path lists indicating where to search for files A path list is a list of directory names separated by semicolons following the syntax below PathList DirSpec DirSpec DirSpec z DirectoryName 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 N 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 WinEdi
222. Destination Component Window Assembly Action Displays disassembled instructions starting at the first high level language instruction selected The assembler instructions corresponding to the selected high level language instructions are highlighted in the Assembly component Register Loads the destination register with the PC of the first instruction selected HC S 12 X Debugger Manual Debugger Interface Highlights of the User Interface Table 2 11 Dragging from the Source Component Window Destination Component Action Window Memory Displays the memory area corresponding with the high level language source code selected The memory area corresponding to the selected instructions are greyed in the memory component Data A selection in the Source window is considered an expression in the Data window as if it was entered through the Expression Editor of the Data component please see Data Component on page 65 and Expression Editor on page 66 Dragging from the Memory Component Window Table 2 12 on page 41 summarizes dragging from the Memory Component Table 2 12 Dragging from the Memory Component Window Destination Component Window Assembly Action Displays disassembled instructions starting at the first address selected Instructions corresponding to the selected memory area are highlighted in the Assembly component Command Line Appends the sel
223. E Wc 0 0 0 sw Full Chip Simulation M Abatron BDI HCS12 Serial Monitor P amp E Multilink Cyclone Pro ip Simulation 3 Select HC12 as Processor 4 Select SofTec HCS12 as connection Figure 10 23 MCU Configuration Dialog Box MCU Configuration inDART HCS12 E 5 In the MCU Configuration dialog box choose the correct target processor 6 Press the OK button to start debugging 254 HC S 12 X Debugger Manual Switching to HCS12 Serial Monitor Connection To take the first steps toward debugging with CodeWarrior choosing the HCS12 Serial Monitor connection from within an existing debugging project that uses another conection such as the Full Chip Simulation take the following steps 1 Within the Debugger Main window select the Component entry Figure 10 24 Debugger Main Window Component Menu nulator amp Real Time Debugger D Profiles RTHO2c My Documents Switcher HCS12 FCS Component Memory Window Help ELE et Connection Fonts J2c My Docu Background Color void M our own code here 308002 E terrupts 308004 I 2 From the Component menu choose Component gt Set Connection to select another connection Figure 10 25 Set Connection Dialog Box HCS12 Serial Monitor Selection Set Connection I x Processor Connection JHcs1 2 Serial Monitor Cancel HCS12 Serial Monitor P amp E Multilink Cyclone Pro Full Chip
224. EBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 MC9S12DT256B HC S 12 X Debugger Manual Analog to Digital Converter on page 288 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 283 HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 4 Supported Derivatives continued 284 Derivative Name MC9S12XDP512 Modules Analog to Digital Converter on page 288 Clock and Reset Generator CRG on page 294 Debug Module DBG on page 291 External Bus Interface EBI on page 292 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Module Mapping Control MMC on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Periodi
225. EE ea Gags Hades 569 RESET eR tite aa IRE A ED ob eR 570 RESTART erret IER Nu e Eee ses as eed 570 RETURN 2 pESL6RS Soo bee PS err T ERGO REESE SE 571 RS hA esesheUeteseRU MU DOR Neh Een 572 Sessor De zc are Glass ais laters oe e te tete E ee RIED 573 SAVE eis Se eh C EPOD CU PUER RR ORE AN UA RUIN ERE OE 574 SAVEBP io nne IR siethdp he a heed doing tbt 575 SET deiode tenute e e A al ge BR iE 576 SETCOLORS vrbe epeuigenvem eiue tegi P eps 576 SEAY Vere EV cated abe acme aw PERd at Gel E pr EN DP e ele 577 SLINE E READER AE as Ake eae a EC 577 SMEM 92e de DER aie c sea diate did 578 SMOD ne o ERU Ua etos Ero b op ere ales SR Re In eae en tag 579 SPC Lector aeu d tede pee 580 SPROG 3 comae elt ale C ELE SR NERO NACER 581 SREGC ux Ie oc du UTR We e dee ex UP eR 582 STEPINTO eI RHEIN DERI bebe Rekha 583 STEPOUT oh lbs Re bib REI E PEE ERE A 584 STEPOVER eR eder xe RII A AUG eles 585 STOP ccc 586 T oem teclesetipset e vb Mu teh Ve 587 TESTBOX coo ae teia y eu biG nies Bia dee ee Eu S eM 588 TUPDATE tgs eh ek dps da aden REEL ERR eh add 588 UNDER io canterina e a eU ERU EH EE PHA 589 UNFOLD e RII dee ea bag ates 591 HC S 12 X Debugger Manual 21 Table of Contents UNLIE c cedet ert Sides as PUR tente ea e S 592 UPDATERATE D DelenbdeIreGueP LC Xu dus bp d 592 VER ited ntesne ERR rye VR E Se ohh RA AE PONE REY 593 WAIDiueE Sikii mu empereur eed AME Ee ER 594 WB ELEDU eA hale cat Med emt s 595 WHILE gaan tene
226. EGATIVE at Pin level setup after gain and offset set 0 if signal level gt 0 ABSOLUTE at Pin level setup after gain and offset set Isignal levell Signal IO Usage The Signal io can handle 16 signals at the same time Each signal block is independant in parameters and options from other blocks The Signal component can be opened within Open I O Component Dialog Box on page 261 or with the openio signal command It can be released within the same dialog or with the close signal command Signal Commands SETSIGNALFILE Command SETSIGNALFILE specifies the signal file to use Syntax SETSIGNALFILE value 0 15 gt lt file name gt The SETSIGNALFILE X command creates a virtual SignalGeneratorX module having a S gnalPin 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 NFCSsignals folder of the debugger installation path For example creating 3 generators setsignalfile 0 sinus 1l1bit 0 5v 1Hz txt setsignalfile 1 saw 11bit 0 5v 1Hz txt setsignalfile 2 square 1 5v 1Hz txt Then virtual pins connections with the Pinconn IO on page 387 CONNECT command connect SignalGenerator0 SignalPin Atd0 PADO HC S 12 X Debugger Manual 385 HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins 386 connect SignalGeneratorl
227. Enabled Blank Protected Unselected FLASH PAGEA 48000 4BFFF Enabled Blank Unselected FLASH PAGE5 58000 5BFFF Enabled Programmed Unprotected Selected FLASH PAGE6 68000 6BFFF Enabled Blank Unselected FLASH PAGE7 78000 7BFFF Enabled Blank Protected Unselected HALTED The FLASH PAGES module is programmed Now you must protect and unselect the module Listing 21 6 Protect and Unselect Module in gt flash protect 7 MCU clock speed 8025000 Module Name Address Range Status FLASH 4000 4000 7FFF Enabled Blank Unselected FLASH PAGEO 8000 BFFF Enabled Blank Unselected FLASH_C000 C000 FFFF Enabled Blank Protected Unselected FLASH PAGE T 18000 1BFFF Enabled Blank Protected Unselected FLASH PAGE2 28000 2BFFF Enabled Blank Unselected FLASH PAGE3 38000 3BFFF Enabled Blank Protected Unselected FLASH PAGEA 48000 4BFFF Enabled Blank Unselected FLASH PAGE5 58000 5BFFF Enabled Programmed Protected Selected FLASH PAGE6 68000 6BFFF Enabled Blank Unselected FLASH PAGE7 78000 7BFFF Enabled Blank Protected Unselected in flash unselect 7 This completes the example HC S 12 X Debugger Manual 613 Debugger Connection specific Commands DMM Commands DMM Commands 614 All DMM GUI settings can be done by debugger command line commands Debugging Memory Map Manager Commands The following list of commands provides the possibility to fully script the debugging devic
228. Flag is set HC S 12 X Debugger Manual 443 Abatron BDI Connection Terminal Emulation The following is a possible target implementation Listing 15 1 CPU 12 Target Implementation typedef struct unsigned char rxFlag unsigned char rxChar char txBuffer TermDataT define TermData TermDataT 0x0800 static char txBuffer 2 char GetChar void char rxChar while TermData rxFlag 0 wait for input rxChar TermData rxChar TermData rxFlag 0 return rxChar void PutChar char ch txBuffer 0 ch txBuffer 1 0 TermData txBuffer txBuffer while TermData txBuffer 0 wait for output buffer empty void PutString char str TermData txBuffer str while TermData txBuffer 0 wait for output buffer empty 444 HC S 12 X Debugger Manual Abatron BDI Connection Flash Programming Flash Programming The BDI supports downloading and debugging code that runs in the internal Flash memory of the target CPU Breakpoints are automatically mapped to the hardware breakpoint registers To erase the internal flash and to enable writing to flash Direct Commands to BDI are used Direct commands to BDI can be executed from a CMD command file like in the Preload Command File and the Postload Command File or the Command Line component with the BDI command This flash programming support is not available for all CPUs Please check for availability in the User
229. HC S 12 X Debugger Manual 4 lt freescale semiconauctor Freescale M and the Freescale logo are trademarks of Freescale Semiconductor Inc CodeWarrior is a trademark or reg istered trademark of Freescale Semiconductor Inc in the United States and or other countries All other product or ser vice names are the property of their respective owners Copyright O 1989 2006 by Freescale Semiconductor Inc All rights reserved Information in this document is provided solely to enable system and software implementers to use Freescale Semicon ductor products There are no express or implied copyright licenses granted hereunder to design or fabricate any inte grated circuits or integrated circuits based on the information in this document Freescale Semiconductor reserves the right to make changes without further notice to any products herein Freescale Semiconductor makes no warranty representation or guarantee regarding the suitability of its products for any partic ular purpose nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation consequential or incidental dam ages Typical parameters that may be provided in Freescale Semiconductor data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including Typ
230. IBO 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 LH 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 HC S 12 X Debugger Manual 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 ena
231. IC ADVANCED EXPERT Step 7 Generation of Driver Code We are going to generate the code for the I O drivers and the files for the user code SIN T s E mR S Select the Make icon in the Project Manager window or the menu bar Project gt Make or F7 Processor Expert shows several messages One message indicates that we have started the code generation The second message shows the progress with the information processed and the code generated Another window shows compiling and linking progress Step 8 Verification of Files Created We can verify the folders created by Processor Expert User Modules A file MyGuessTheNumber C that is the placeholder for the main procedure and any other procedure desired by the user These other procedures can of course be placed in additional files 394 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Generated Code The C files for the code associated with the beans added to the project This includes initialization input output and the declarations necessary for the use of the functions Step 9 Entering User Code Open the user module MyGuessTheNumber C Insert the following code before the main routine include lt stdlib h gt void PutChar unsigned char c while AS1_SendChar c ERR_TXFULL could wait a bit here j j void PutString const char str while str 0
232. Is Pointing The Debugger provides two ways to dump memory starting at the address a register is pointing to Using Drag and Drop 1 Drag a register from the Register component to Memory component Choose Address Figure 6 6 Memory menu Display Address Auto 00000840 20 13 FC 08 02 C3 00 01 204 1 Right click in the Memory component The Memory Popup Menu is displayed 2 Choose Address from the Popup Menu The Memory dialog box shown in Figure 6 6 on page 204 is opened 3 Enter the register content in the Edit Box and choose OK to close the dialog box HC S 12 X Debugger Manual How To Modify Content of Memory Address The memory component scrolls until it reaches the address stored in the register This feature allows you to display a memory dump from the application stack NOTE If Hex Format is checked numbers and letters are considered to be hexadecimal numbers Otherwise expressions can be typed and Hex numbers should be prefixed with Ox or Modify Content of Memory Address The Debugger allows you to change the content of a memory address Double click the memory address you want to modify Content from the current memory location is highlighted and can be edited 1 The format for the input value depends on the format selected for the Memory component If the format for the component is Hex the input value is treated as a Hex value If input value is 10 the mem
233. LOCK bit in FEE32LCK register flash enable disable via ROMON32 bit in MISC register HC12DG128 fpp file name mcu03c4 fpp number of Flash modules 10 applet code currently not relocatable loaded at 0x2000 using 0x400 bytes all flash modules enable disable at same time via ROMON bit in MISC register module name FLASH 4000 module number 0 16 KBytes unpaged Flash located in 0x4000 0x8000 also matches 1 1FEE even page 6 that is FLASH PAGEG module name FLASH PAGEO module number 1 16 KBytes paged Flash accessed in bank window 0x8000 OxBFFF equivalent to cf Technical Summary 00FEE Flash even page 0 module name FLASH C000 module number 2 16 KBytes unpaged Flash located in OxXC000 OxFFFF also matches 11FEE odd page 7 that is FLASH PAGET7 boot sector unprotectable protectable 8 KBytes in range OXE000 OxFFFF or paged range 0xA000 OxBFFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register module name FLASH PAGE module number 3 16 KBytes paged Flash accessed in bank window 0x8000 0xBFFF equivalent to cf Technical Summary 00FEE Flash odd page 1 boot sector unprotectable protectable 8 KBytes in range 0xA000 0xBFFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register module name FLASH PAGE2 module number 4 HC S 12 X Debugger Manual 479 HC S 12 X Flash Programming Hardware Considerations 480 16 KBytes paged Flash accessed i
234. M CACHINGON Command 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 DMM CACHINGOFF Command 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 DMM HCS12MERHANDLINGON Command Syntax DMM HCSI2MERHANDLINGON Purpose 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 DMM HCS12MERHANDLINGOFF Command Syntax DMM HCSI2MERHANDLINGOFF Purpose disables completely the feature here above HC S 12 X Debugger Manual Debugger Connection specific Commands Full Chip Simulator Commands DMM OPENGUI Command Syntax DMM OPENGUI mcuid with lt mcuid gt a part device mcuid value in range 0 FFFF Purpose opens the DMM Graphical User Interface Note that if the Mcuid is not specified changes will not be saved for the next connection session not saved in project
235. Manual Debugger Components General Debugger Components Figure 3 34 Word Size Submenu v Byte Word L Word Table 3 17 Word Size Submenu Description Menu Entry Description Byte Sets display unit to byte size Word Sets display unit to word size 22 bytes Lword Sets display unit to Lword size 4 bytes Format Submenu With the Format Submenu shown in Figure 3 35 on page 81 you can set the memory display format Table 3 18 on page 81 describes the menu entries Figure 3 35 Format Submenu v Hex Oct Bin Dec UDec BitReverse Table 3 18 Format Submenu Description Menu Entry Description Hex Selects the hexadecimal memory display format Bin Selects the binary memory display format Oct Selects the octal memory display format Dec Selects the signed decimal memory display format HC S 12 X Debugger Manual Debugger Components General Debugger Components Table 3 18 Format Submenu Description continued UDec Selects the unsigned decimal memory display format Bit Reverse Selects the bit reverse memory display format each bit is reversed Mode Submenu With the Mode submenu shown in Figure 3 36 on page 82 you can set the memory mode format Table 3 19 on page 82 describes the menu entries Figure 3 36 Mode Submenu v Automatic Periodical Frozen Table 3 19 Mode Submenu Description Menu Entry Description Automat
236. Manual How To How To Work on Variables Step on Assembly Level The Debugger provides two ways of stepping to the next assembler instruction 1 Choose Run gt Assembly Step 2 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 How To Work on Variables This section shows the different methods to work on variables Display Local Variable from a Function The Debugger provides two different ways to see the list of local variables defined in a function Using Drag and Drop 1 Drag a function name from the Procedure component to a Data component with attribute local Using Double click 1 Double click a function name in the Procedure component The Data component with attribute local that is neither frozen or locked displays the list of variables defined in the selected function with their val
237. Options 413 MCU Configuration Option eee 414 MCU Configuration Dialog Box 414 Communication Settings Dialog Box 00 0 0 eee eee eee 414 User s Manual Option 0 00 0 cece eee eee 416 About OpUOD i xe e dea ae een aa eode aa Baal ey 416 14 HCS12 Serial Monitor Connection 417 Serial Monitor Technical Considerations llle esses 417 CodeWarrior and Serial Monitor Connection 0 0 0 e ee eee 417 HCS12 Serial Monitor Interface 1 0 0 0 0 eee 418 MONITOR HCS12 Menu Options 00 0000 eee eee 421 Monitor Communication 2 0 0 ee eee eee 422 Vector Mirroring Setup llle eee 422 BErase Elash TEETH nit as DICE Re ee ERE 422 Trigger Module Settings 0 0 0 0 ee eee eee eee 422 BUS T Ce zo ER Patek wae ae E RH ewe ds 422 select Derivative ey E ern be ek RR RD UR 422 HC S 12 X Debugger Manual 14 Table of Contents Monitor Setup Window 0 0 0 eee ce eee 422 Monitor Communication Tab 0 00 00 2 eee eee eee 423 Vector Table Mirroring Tab 0 0 0 eee eee ene 424 Derivative Selection Dialog Box 0 00 02 c cece eee eee 425 15 Abatron BDI Connection 427 Abatron BDI Highlights 427 Abatron BDI Requirements 0 0 00 0c cece eee eee 428 Abatron BDI Connection Introduction 0 00 00 00 02 eee 428 Interfacing Abatron BDI andYour System 000 429 BDI
238. S 12 X Debugger Manual 323 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 13 Analog Meter Template Window i Template Ea Vlg TR va NY 6896 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 Analog Meter Operations In the vertical bar the value can be tracked vertically in the gauge and horizontal bar the value can be tracked horizontally and in the knob the value is adjusted when tracking the mouse around the center Analog Meter Menu The Analog Meter does not have a menu 324 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities IO LED Component The IO LED window shown in Figure 11 14 on page 325 contains 8 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 off at the DDR address symbolic values Figure 11 14 IO LED Component Window oeceec PORT 54 DDR 5 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 lO LED Operations B
239. SADR command shows or hides the absolute address of a disassembled instruction like branch to ON OFF is used to switch on or off the absolute address The TOPPC command scrolls the Assembly component in order to display the code location given as an argument on the first line of Assembly component window The SYMB command displays or hides the symbolic names of objects ON OFF is used to switch the symbolic display on or off Usage ATTRIBUTES list where list command command command ADR ONIOFF SMEM range SPC address CODE ONIOFF ABSADR ONIOFF TOPPC address SYMB ONIOFF NOTE Also refer to SMEM on page 578 and SPC on page 580 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 HC S 12 X Debugger Manual Equivalent Operations ATTRIBUTES ADR Select menu Assembly gt 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 gt Display Code ATTRIBUTES SYMB Select menu Assembly gt 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 address
240. Save As dialog where you can specify the output file name and location an example is shown in Listing 3 1 on page 61 Listing 3 1 Example Output File with Modules and Functions Coverage Item 94 4 Application FULL fibo c FULL Fibonacci FULL main 86 0 startup c 80 5 Init FULL _Startup Split View Associated Popup Menu The popup menu for the split view Figure 3 14 on page 62 contains the Delete entry which is used to remove the split view HC S 12 X Debugger Manual 61 Debugger Components General Debugger Components Figure 3 14 Coverage Split View Associated Popup Menu imi Source e xX C DEMO SAMPLES fibo c Line 26 20 914 19 986 t fibl fib2 Delete fib2 fibo 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 Demo Version Limitations Only modules are displayed and the Save function is disabled Associated Commands DETAILS on page 527 FILTER on page 536 GRAPHICS on page 547 OUTPUT on page 564 RESET on page 570 TUPDATE on page 588 62 HC S 12 X Debugger Manual Debugger Components General Debugger Components DA C Link Component The DA C Link window shown in Figure 3 15 on page 63 is an interface module between the DA C Development As
241. Segments Display Menu Figure 11 53 on page 355 shows the Seven segments display component menu and the menu entry is described in Table 11 20 on page 355 Figure 11 53 7 Segments Display Menu Setup Table 11 20 7 Segments Display Menu Description Opens the Seven segments display component setup dialog 7 Segments Display Setup The 7 Sements Display dialog box shown in Figure 11 54 on page 355 allows you to select the display and related value Figure 11 54 7 Segments Display Dialog Box Setup 7 Segments Display x r Ports address Select an address or insert a value hex Select a display reo00 Segments activation EXE Port B Port C Port D Port E 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 on page 352 EOM MUN HC S 12 X Debugger Manual 355 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Control Bits Configuration The 2 bytes sent to the 7 segments must be composed as shown in Figure 11 55 on page 356 Figure 11 55 Seven Segments Display Control Bits SELAFF Select of displa 356 SELSEG Select of segments Per ee 5 4 3 sz 5r oO 97 9e 55 amp 4 B3 ez e 96 LeLFT T41sl l
242. Select the binary data display format Oct Select the octal data display format Dec Select the signed decimal data display format UDec Select the unsigned decimal data display format 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 70 HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 24 Mode Submenu v Automatic Periodical Locked Frozen Table 3 12 on page 71 describes the Mode Submenu entries Table 3 12 Mode Submenu Menu Entry Description Automatic Switches to Automatic mode default variables are updated when the connection is stopped Variables from the currently executed module or procedure are displayed in the data component Periodical Switches to Periodical mode variables are updated at regular time intervals when the connection is running The default update rate is 1 second but can be modified by steps of up to 100 ms using the associated dialog box see below Locked Switches to Locked mode value from variables displayed in the data component are updated when the connection is stopped Frozen Switches to Frozen mode value from variables displayed in the data component are not updated when the connection is stopped NOTE In Locked and Frozen mode variables from a specific module are displayed in th
243. Setting Temporary Breakpoints For information on how to set breakpoints refer to sections in the Control Points chapter Point to an instruction in the Source component Window and click the right mouse button The Source window popup menu is displayed Select Run To Cursor from the popup menu The application continues execution and stops at this location Holding down the left mouse butoon and pressing the T key Sets a temporary breakpoint at the nearest code position visible with marks thereafter the program runs and breaks at this location as shown in Figure 3 67 on page 114 HC S 12 X Debugger Manual 113 Debugger Components General Debugger Components Figure 3 67 Setting Breakpoints 114 ji Source ul xf Gi Assembly B XJ fibl 0 fib2 1 fibo n i 2 while i lt n F H fibl fib2 tinz fibo 1H return fibo M LDA J Z Setting Permanent Breakpoints Point to an instruction in the Source component Window and click the right mouse button The Source Component popup menu is displayed Select Set Breakpoint from the popup menu The permanent breakpoint icon is displayed in front of the source statement pointed to Holding down the left mouse button and pressing the P key Sets a permanent breakpoint at the nearest code position visible with marks The permanent breakpoint icon is displayed in front of the source statement pointed to Folding and
244. 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 lt value 0 15 gt Example CLOSESIGNALFILE 1 Remarks A messagebox is displayed with line error in case of signal file scripting error The Signal component is compatible with cycle time duration modification bus speed change via PLL and True Time feature and reprograms automatically level duration when duration in seconds is provided or no duration info provided Currently all header parameters are mandatory also EOF in the same order as described in EBNF here above without spacing between words Base Signal Files Provided The following files can be resused to create more complex signal description There are current stored in the prog FCSsignals folder of the debugger installation path e saw_11bit_0_5v_1Hz txt a saw tooth signal with a 11 bit sampling definition scaled on a 1 Herz frequency in a 0 to 5 Volts voltage range e saw_8bit_0_5v_1kHz txt a saw tooth signal with a 8 bit sampling definition scaled on a 1000 Herz frequency in a 0 to 5 Volts voltage range e sinus _11bit_0_5v_1Hz txt a sinus signal with a 11 bit sampling definition scaled on a 1 Herz freq
245. Simulation Connection Supported Derivatives 286 Inter IC Bus IIC The I O device Inter IC Bus IIC is not simulated Serial Communication Interface This I O device simulates the Serial Communication Interface SCI The not memory mapped registers SCIInput SCIInputH and SerialInput serve to send characters to the SCI Module The not memory mapped registers SCIOutput SCIOutputH and SerialOutput contain the characters sent from to the SCI Module Registers SCOBDH SCI Baud Rate Register High SBR12 SBR11 SBR10 SBR9 and SBR8 are simulated SCOBDL SCI Baud Rate Register Low SBR7 SBR6 SBR5 SBR4 SBR3 SBR2 SBR1 and SBRO are simulated SCOCR1 SCI Control Register 1 M and ILT are simulated SCOCR2 SCI Control Register 2 TIE TCIE RIE ILIE TE RE and SBK are simulated SCOSR1 SCI Status Register 1 TDRE TC RDRF IDLE and OR are simulated SCOSR2 SCI Status Register 2 RAF is simulated SCODRH SCI Data Register High R8 and T8 are simulated SCODRL SCI Data Register Low R7 T7 R6 T6 R5 T5 R4 T4 R3 T3 R2 T2 R1 T1 and RO TO are simulated HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Not memory mapped Registers SClinput This is a not memory mapped register and will serve to send a character to the SCI This value will be received from the SCI and can be read through a read access to the SCDR The ninth bit is taken fro
246. Simulation Connection Supported Derivatives Table 11 4 Supported Derivatives continued 280 Derivative Name MC9S12DG256B Modules Analog to Digital Converter on page 288 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 MC98S12DJ128B Analog to Digital Converter on page 288 41850 Bus BLCD on page 285 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 4 Supported Derivatives continued Derivative Name MC9S12DJ256B Modules Analog to Di
247. Status Register Interrupt Request System sets SPIF after the eighth SCK cycle in a data transfer and clearing by reading the Status Register followed by a read or write access to the SPI data register Write Collision Status Register System sets this flag upon the writing of new data to the Data Register during a serial data transfer Mode Error Interrupt Status Flag Data Register Not simulated as no physical transmission takes place 8 bit Data Register for SPI data Port S Port S Data Register Not simulated as no physical transmission takes place Data Direction Register Data Direction for Port S Bit x Direction of Data Only bits 4 and 5 have any effect Virtual register Value simulates the data register of a second SPI device This permits simulate communication with a second SPI device The transmission can be in Normal or a Bidirectional Mode the device can be set as Master or Slave See also Technical Summary MC68HC812A4 page 84 figure 24 Key Wakeups Table 11 11 on page 312 defines the Key Wakeups HC S 12 X Debugger Manual 311 HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 11 Key Wakeups 312 Abbr Full Name Implemented Meaning Key Wakeups Registers PORTD Port D Register Implemented DDRD Port D Data Implemented Direction Register KWIED Port D Interrupt Implemented
248. TDRE Transmit Data The system sets this flag upon the move of the Register Empty value to be transmitted from the transmit data Flag register to the serial shift register TC Transmit The system sets this flag if the transmission of one Complete Flag value ends but no other value is yet in the transmit data register RDRF Receive Data The system sets this flag upon the complete read of Register Full a value and the clearing of RDRF Flag IDLE Idle Line The system sets this flag after a period without any Detection Flag input as stated in 3 The system considers the ILT flag OR Overrun Error The system sets this flag if the receipt of value Flag ends but the processor has not yet read the value NF Noise Error Flag Not supported as no physical transmission takes place FE Framing Error Not supported as no physical transmission takes Flag place PF Parity Error Flag Not supported as no physical transmission takes place RAF Receiver Active Supported and cleared only when going into idle Flag mode Detection of a false start bit does not clear this flag as no physical transmission takes place Data Register R8 Receive Bit 8 Supported 308 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Table 11 8 SCI Supported Features Supported Derivatives Abbr Full Name Implemented Meaning T8 Transmit Bit 8 Supported Rx Tx Receive Transmit Bit x Supported with autoc
249. TE Displays the list of active connections NOTE There is no limitation of connections NOTE This list of simulated pins for a derivative Full Chip Simulation is provided in the Inspect component under the Object Pool key HC S 12 X Debugger Manual 387 HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins Command Set to Apply Signal on ATD Pin The following example loads the Pinconn and Signal IO components create a signal generator generating the signal described in square 1 5v 1kHz txt The generator output signal pin is connected to the onchip ATD via the PADO pin openio Pinconn openio Signal setsignalfile 0 square 1 5v 1kHz txt connect SignalGenerator0 SignalPin Atd0 PADO 388 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials FCS Tutorials This chapter contains a tutorial on how to use the Full Chip Simulation The tutorial is split up into small steps After completing the last step a full functional example should exist This chapter contains the following sections Supported Derivatives on page 276 PWM Channel 0 on page 397 Guess the Number We are going to create step by step the demo run in the executive tutorial The application makes use of the SCI Serial Communication Interface and a terminal window from the debugger At the end the user can guess a number between 0 and 9 This guessing is d
250. 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 Switch Color Specifies the color of the switch Bounces If enabled gives access to the following other attributes to configure the way the switch will bounce Nb Bounces Specifies the number of bounces before stabilization Bounces on Edge Specifies wether the switch will bounce on falling rising or both edges Type of Unit Synchronizes the frequency of the bouncing either on the timer of your host machine or on CPU cycles Pulse Width 100ms Defines the duration of one bounce This attribute should be filled in if you chose 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 It should be filled in 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 94 on page 143 Figure 3 94 Text Instrument Value Please use Text Mode to switch between the five available modes Text instrument common attributes are shown in the Table 3 55 on page 144 HC S 12 X Debugger Manual 143 Debugger Components Visualization Utilities Table 3 55 Text Instrument Attributes Attribute Description Text Mode Specifies
251. 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 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 Clock Frequency Setup The Full Chip Simulation provides a true time information It is possible to provide an oscillator clock frequency to the debugger The debugger CPU awareness and io modules provide the clock factor to apply to this input frequency to derive the CPU cycle frequency Figure 11 8 Clock Frequency Setup Dialog Box Clock Frequency Setup x Oscillator frequency 4 000000 MHz Display in status bar CPU cycles True Time in ms CPU frequency 2 000000 MHz v Reset cycles time on debugger reset Clock factor 0 500 Either the Oscillator or CPU frequency can be specified The Clock factor will then automatically determine the other value The Clock factor is derived from the CPU awareness or from the peripheral simulation model Cancel Help Derivative specific IO simulations caring of bus speed change multiply or divide through PLL modules dynamically update the clock factor i e while the application is simulation is run
252. 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 HC S 12 X Debugger Manual 545 Debugger Engine Commands Debugger Commands GOTOIF Description 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 546 HC S 12 X Debugger Manual GRAPHICS Description In the Profiler component GRAPHICS switches the percentages display in the graph bar on off Usage GRAPHICS onloff Com Profiler component ponents Example in gt 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 will not be listed either Us
253. _ROM DEFAULT_RAM INTO MY RAM MyPage DEFAULT ROM INTO PAGE 2 PAGE 4 END STACKSIZE 0x50 VECTOR ADDRESS OxFFFE Startup set reset vector IN FLASH on Startup a4 Follow the loading command example in Debugger Connection specific Commands on page 599 or follow these instructions 1 From the Debugger menu bar open the connection specific menu such as SDT Select Flash the NVMC dialog box appears 2 If you are sure about the absolute location of your application you do not need to select a module But if you program in a protected area boot block make sure that the matching module is unprotected HC S 12 X Debugger Manual 477 HC S 12 X Flash Programming Hardware Considerations 3 Click the Load button the NVMC utility selects all modules and opens the Load Executable File dialog box 4 Select the ABS file to be loaded into Flash Loading begins a progress bar appears When loading is finished the NVMC dialog box displays the new state of the modules 5 This completes loading You can close the NVMC dialog box and run your application For some some hardware however you first must do a connection reset by clicking the reset button of the Debugger Hardware Considerations 478 This section consists of hardware specific information about current FPP files A release note will explain any new FPP file features NOTE The Flash Programming release note in the on line documentation
254. a Connection 0 0 eee eee eee 25 Connection Command File Window 00 0000 000000 27 Component Menu 0 eadi E AEE 29 Window Menu iiie a REIR Ere RES UEEE ERE EE 31 Help Menu acere re aed ogee ep E pue 33 About BOX tacos per UR lene gs igs hae ee tee GS DP PE 34 Component Associated Menus llle 34 Component Main Menu 0 0 cece eee 35 Component Piles seereis erae eee hae x RR UH B eI Re E 35 Component Windows Object Info Bar lsleseeeelee esee 35 Component Popup Menu 00 eee es 36 Highlights of the User Interface 2 0 00 0 eee eee 37 Activating Services with Drag and Drop 0 02000 37 To Drag and Drop an Object eee 38 Drag and Drop Combinations 0 00 0c eee eee ees 39 Dragging from Assembly Component Window 39 Dragging from Data Component Window 04 39 Dragging from Source Component Window 40 Dragging from the Memory Component Window 41 Dragging from Procedure Component Window 42 Dragging from Register Component Window 42 Dragging from Module Component Window 43 Selection Dialog BOK eere ia en aa E E E A AE E 43 3 Debugger Components 45 Component Introduction lle ne 45 CPU Components i esee kem eter ERE e ed ti etd 45 Window Components ls
255. a about global symbols usage Results of the analysis are saved in database files on the disk which enables their later use in DA C You can choose between the unconditional analysis of all project files and the analysis of changed source files only using Start Build database and Start gt Update database commands The latter one will optionally check if the include files used in program modules are changed as well To build the database in our example use Start gt Build database command which makes the unconditional analysis of all project files and creates a database containing information about analyzed source code Errors and Warnings detected during this operation are displayed in the Messages window as illustrated in Figure 9 5 on page 219 for Fibo c sample file Figure 9 5 DA C Message Window amp Messages OL x Analysis for Symbols 15 DT 302 fiboCount Global identifier usedi in TIE one module Fiboc 16 Warming 302 counter Global identifier used in only one module Fiboc 18 Warming 302 Fibonacci Global identifier used in only one module 4 warnings 0 errors detected HC S 12 X Debugger Manual 219 Synchronized Debugging Through DA C IDE Configuring DA C IDE for Freescale Tool Kit 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 P
256. 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 that would be available from within the debugger from Command line 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 Driving Debugger through DDE The DDE implementation in the Debugger allows you to drive it easily by using the DDE command To do this you have to use a program that can send a DDE message a DDE client application like DDECLient exe from Microsoft The service name of the Debugger DDE Server is HI WAVE and the Topic name for the Debugger DDE Server is Command The following example is done with DDECLient exe from Microsoft 1 Ru
257. abled and the program will not halt Temporary breakpoints are automatically removed when they are reached Show Breakpoints Opens the Controlpoints Configuration Window s Breakpoints Tab and allows you to view the list of breakpoints defined in the application and modify their properties See Control Points chapter Show Location Highlights a code range in the Assembly component window matching the line or selected source code The line or the Source code range are highlighted as well Set Markpoint Appears only in the Popup Menu if a markpoint is disabled at the nearest code position visible with marks When selected enables this markpoint Delete Markpoint Appears only in the Popup Menu if a markpoint is set at the nearest code position visible with marks When selected disables this markpoint Show Markpoints Opens the Controlpoints Configuration Window s Markpoints Tab and allows you to view the list of markpoints defined in the application and modify their properties See Control Points chapter Set Program Counter The Program Counter is set to the address of the selected Source code Open Source File Opens the Source File Dialog if a CPU is loaded see chapter below Copy CTRL C Copies the selected area of the source component into the clipboard You can select a word by double clicking it You can select a text area with the mouse by moving the pointer to the lef
258. ad options and choose a Simulation Execution Framework an ABS application file HC S 12 X Debugger Manual 25 Debugger Interface Debugger Main Window Figure 2 17 Load Executable File Window Load Executable File xl Look in DWPd sj e ek Ee MyProj Data prm Sources File name l Files of type Executables abs elf gt Cancel Load Options Load Code Symbols Load Symbols only Load Code only Load Code to onchip Non Volatile Memory erase and flash Options Code Verification Options l None C First bytes only Allbytes Read back only v Remember options selection above Open Button When this button is pressed the application code and symbols are loaded Load Options Buttons These three buttons allow you to select which part of the executable file will be loaded Load Code Button Loads the application code only Only the application is loaded into the target system This button can be used if no debugging is needed Load Symbols Button Loads symbols only Only debugging information is loaded This button can be used if the code is already loaded into the target system or programmed into a non volatile memory device ROM FLASH Verify Code Button Loader loads no data into memory However it reads back current data matching the same areas from the target memory and compares all data with the data from the selected file Open and Load Code Opt
259. age ATTRIBUTES list where list command command command SPC address SMEM range SMOD module without extension SPROC number AssociatedToProcedure MARKS ONIOFF Example in gt Source lt ATTRIBUTES MARKS ON Marks are visible in the Source component window HC S 12 X Debugger Manual 503 Debugger Engine Commands Debugger Commands 504 In the Data Component The ATTRIBUTES command allows you to set the display and state options of the Data component window The FORMAT command selects the format for the list of variables The format is one of the following binary octal hexadecimal signed decimal unsigned decimal or symbolic Usage ATTRIBUTES list where list command command command FORMA T binloctlhexlsignedlunsignedlsymb SCOPE globalllocalluser MODE automaticlperiodicall lockedlfrozen SPROC level SMOD module UPDATERATE rate COMPLEMENT nonelone NAMEWIDTH width The MODE command selects the display mode of variables In Automatic mode default variables are updated when the target is stopped Variables from the currently executed module or procedure are displayed in the data component Variables are updated when target is stopped 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 n Locked mode values from variables displayed in the data component are updated when the
260. age HELP Components Debugger engine Example in gt HELP HI WAVE Engine VER LF NOLF CR NOCR HC S 12 X Debugger Manual 547 Debugger Engine Commands Debugger Commands IF The conditional commands IF on page 548 ELSEIF on page 531 ELSE on page 531 and ENDIF on page 533 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 DEFINE jump jump 0 jump 1 IF jump 10 T E LSEIF E LSE E NDIF DEFINI DEFINE jump 0 jump 100 DEFINI jump 1 jump 2 548 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 HC S 12 X Debugger Manual INSPECTOROUTPUT The Inspector dumps the content of the specified item and all computed subitems to the command window Uncompute
261. age 176 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 You can set or disable a control point set a condition and an optional command and set the current count and counting interval using the popup menu of the Source Memory or Assembly window You can see and edit control point characteristics through the three tabs of the Controlpoints Configuration Window Breakpoint Watchpoints and Markpoints tabs These three tabs have common properties that allow you to interactively perform the following operations on control points Selecting a single control point from a list box and clicking Delete Selecting multiple control points from a list box and clicking Delete HC S 12 X Debugger Manual 147 Control Points Breakpoints Enabling disabling a selected control point by checking or unchecking the related checkbox Enabling disabling multiple control points by checking or unchecking the related checkbox Enter or modify the condition of a selected control point Enabling disabling the condition of a selected control point by checking
262. age 620 address I ident address ident address ident address ident address ident Sets the 5 port addresses and control port address of the IO Ports component ITPORT on page 621 address I ident address ident Sets the line and column port addresses of the IT Keyboard component ITVECT on page 621 address I ident Sets the interrupt vector port address of the IT Keyboard component KPORT on page 622 address I ident address ident Sets the line and column port addresses of the Keyboard component LCDPORT on page 622 address ident address ident Sets the data port and the control port address of the Lcd component LINKADDR on page 623 address ident address ident address ident address ident address ident Sets the components internal port addresses used with the IO Ports as memory buffers PBPORT on page 623 address ident Sets the port address of the Push Buttons component PORT on page 624 address Sets the LED components port address SEGPORT on page 628 address ident address ident Set the display selection port and the segment selection port addresses of the 7 Segments display component SETCONTROL on page 628 Name Ticks Pixels Changes the number of ticks and pixels for the Name channel from the Monitor component WPORT on page 630 address ident
263. ain 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 Example1 in rd a hx A 0x14 HX 0x2 Example2 in rd cpu A 0x0 HX 0x450 SR 0x70 PC 0xF04E SP OxFF 568 HC S 12 X Debugger Manual RECORD In the SoftTrace component the RECORD command switches frame recording on off while the target is running Usage RECORD onloff Components SoftTrace component Example in gt 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 HC S 12 X Debugger Manual 569 Debugger Engine Commands Debugger Commands 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
264. al tree on the left side additional information concerning the stack are displayed 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 on page 187 displays the current state of OSEK SystemTimer trace Figure 5 5 Inspector SystemTimer Inspect olx BB SYSTEMTIMER Name MAXALLOWEDVALUE TICKSPERBASE MINCYCLE Current Value Activated Alarm r ALARM Ni SYSTEMTIMER OxFFFF Ox12c ALARM r When selecting SystemTimer in the hierarchical tree on the left side additional information concerning the timer are displayed on the right side of the window under the following headings Name displays name of the system timer e MAXALLOWEDVALUE displays the maximum allowed counter value When the counter reaches this value it rolls over and starts count 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 Current Value displays the current value of the system timer Activated Alarm displays associated alarms HC S 12 X Debugger Manual 187 Real Time Kernel Awareness
265. all available Kernel commands Table 20 1 List of Kernel Commands Command Syntax A on page 498 Short Description Affects a value AT on page 509 Sets a time delay for command execution CALL on page 515 fileName C NL Executes a command file DEFINE on page 526 symbol expression Defines a user symbol ELSE on page 531 Other operation associated with IF command ELSEIF on page 531 condition Other conditional operation associated with IF command ENDFOCUS on page 532 488 Resets the current focus refer to FOCUS command HC S 12 X Debugger Manual Table 20 1 List of Kernel Commands continued Command Syntax ENDFOR on page 533 Short Description Exits a FOR loop ENDIF on page 533 Exits an IF condition ENDWHILE on page 534 Exits a WHILE loop FOCUS on page 539 component Sets the focus on a specified component FOR on page 541 variable range step FOR loop instruction FPRINTF on page 542 fileName format parameters FPRINTF instruction GOTO on page 545 label Unconditional branch to a label in a command file GOTOIF on page 546 condition Label Conditional branch to a label in a command file IF on page 548 condition Conditional execution PAUSETEST on page 566 Displays a modal message box PRINTF on page 567 Text value PRINT instruction REPEAT
266. and Line command or using the Setcpu property tab of the connection Command Files dialog The default Setcpu command file is SETCPU CMD By default the SETCPU CMD file located in the current project directory is enabled as the current Setcpu command file HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Other Commands Files are described in the Debugger Interface section in the Debugger Engine book Memory Configuration The memory configuration interface is a Full Chip Simulation advanced configuration feature The emulated memory is divided 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 ROM and so forth The memory configuration facility uses a binary file format to read and set the Full Chip Simulation configuration The extension for binary files is mem the default memory file is default mem The subsection Format of the Default Memory Configuration File includes Listing 11 2 on page 362 the EBNF syntax definition of the file format Memory Configuration Dialog Box Features The memory configuration dialog box Figure 11 6 on page 264 lets you perform these memory block operations interactively Select the configuration mode for simulation
267. andled by the Debugging Memory Map Manager In case of error due to this command execution please remove comment this obsolete command In case of any further debugging problem due to this command removal please contact the support team 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 GUI Graphical User Interface 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 anytime the way to access the memory HC S 12 X Debugger Manual 457 Debugging Memory Map Debugging Memory Map GUI Debugging Memory Map GUI The graphical user interface is flexible enough to be handled without much difficulty and live diagnostic is displayed within the dialog Anytime it is possible to revert to default factory setup and most of the time the user does not even need to edit change settings within the DMM GUI The DMM GUI can be opened by choosing the Debugging Memory Map option in the connection menu in the debugger main window This opens the DMM Window Figure 17 1 Debugging Memory Map Window 458 MC9S12E256 Debugging Memory Map xi Type Rang
268. ange Writing in this range is done as physical memory type write protected this sets the memory as write protected The DMM stops all debugger writes to this range Reading in this range is done as physical memory type r w protected this sets the memory as read and write protected Reading and writing to this memory range is fully blocked by the DMM physical this sets the memory range as physical i e with linear 16 bit address bus access as performed by the CPU when reading and writing the onchip memory additionally for MC68HC812A4 derivative extra banked this type handles the EPAGE register when accessing the Extra page banked data typically data in 400 7FF window e banked this type handles the PPAGE register when accessing the Program page banked data typically program code in 8000 BFFF address range window HC S 12 X Debugger Manual 463 Debugging Memory Map CPU Core Types and Priorities 464 data banked this type handles the DPAGE register when accessing the Data page banked data typically variables in 7000 7FFF address range window additionally for MC68HC912xx128 derivatives banked this type handles the PPAGE register when accessing the Program page banked data typically program code in onchip Flash in 8000 BFFF address range window HCS12 Core The HCS12 core provides memory block moving with overlap priorities These overlap rules are handled
269. ansion Assignment Register Memory Expansion Not simulated as there are no physical outputs Assignment General Purpose IO Current Non Supported Modules Non Supported Modules A D Converter Device Register Block Address Map Table 11 13 shows the mapping of the Register Block Address 314 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 13 Register Block Address Map Register Description Remarks Block Address 0000 000D Port access Not simulated memory configuration controls correct timing of memory accesses 000E 000F Reserved 0010 Internal RAM Register not simulated Use the memory mapping configuration dialog box to specify simulated memory configuration 0x0011 Register Block Completely simulated mapping 0012 0013 ROM Registers not simulated Use the memory EEPROM configuration dialog box to specify simulated mapping memory configuration 0014 0017 Clock Function Control Completely simulated 001E 001F Interrupt Control amp Highest Priority Interrupt Completely simulated 0020 002E Key Wakeup Control Completely simulated 002F Reserved 0030 0033 Port Registers Currently not simulated 0034 0038 PAGE amp memory configuration Registers Page Registers are simulated 0039 003B Reserved 003C 003F HC S 12 X Debugger Manual Ch
270. anual of poor usage but can still be used for display purposes on chip unimplemented memory range Types read protected this sets the memory as read protected The DMM never tries to read this range Writing in this range is done as physical memory type write protected this sets the memory as write protected The DMM stops all debugger writes to this range Reading in this range is done as physical memory type r w protected this sets the memory as read and write protected Reading and writing to this memory range is fully blocked by the DMM physical this sets the memory range as physical i e with linear 16 bit address bus access as performed by the CPU when reading and writing the onchip memory banked this type handles the PPAGE register when accessing the Program page banked data typically program code in onchip Flash in 8000 BFFF address range window Registers This type cares of the I O Registers block and Memory Expansion Registers changes including I O Registers block moving HCS12X Core 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 a same priority as no memory range can be moved to overlap another memory range lowest debugger a low debugger priority that
271. application HC S 12 X Debugger Manual 467 HC S 12 X Flash Programming Automated Application Programming Figure 18 1 Flash Programming Loader Warning Dialog Box LOADER WARNING x The debugger is going to mass erase the non volatile memory eeprom and flash of the current device then program the application Aa Do not display this message anymore for this project Pressing the OK button launches backgrounded flash commands described later in this section to arm programming load program an application file then disarm programming Checking the Do not display checkbox removes the Warning message definitely for the current project saved in project under the project variable AEFWarningDialog FALSE Setup The Open and Load Code Executable File dialog box is opened when you choose the Load menu entry in the debugger main window s connection menu Figure 18 2 Open and Load Code Options Dialog Box Open and Load Code Options IV Automatically erase and program into FLASH and EEPROM Checking the above option engages the automated device mass erasing and application programming into non volatile memory i e Flash and or Eeprom To set this option permanently the setup should be performed in the debugger Preferences window s Load tab File menu Configuration entry Figure 18 3 Preferences Window Load Tab Preferences xi Environment Load IV Automatically erase a
272. ar uuuuuu uuuuuuuu 2 000000 MHz D HC12D128 done Acmdisimulator postload cmd ZA Figure 2 22 Window Menu Options SubMenu v Autosize v Component Menu Figure 2 23 Window Menu Layout SubMenu Load Store Table 2 7 on page 33 specifies the Window Menu entries 32 HC S 12 X Debugger Manual Debugger Interface Debugger Main Window Table 2 7 Window Menu Description Menu entry Description Cascade Option to arrange all open windows in cascade so they overlap Tile Option to display all open windows in tile format non overlapping Arrange Icons Arranges icons at the bottom of windows Options Autosize Component windows always fit into the debugger window whenever you modify the debugger window size Options Component Menu When a component window is selected the associated menu is displayed in the main menu For example if you select the Source window the Source menu is displayed in the main menu Layout Load Store Option to Load Store your arrangements from a HWL file NOTE Autosize and Component Menu are checked by default Help Menu This is the Debugger Main window Help menu Figure 2 24 on page 33 Table 2 8 on page 33 shows menu entries Figure 2 24 Help Menu Help Topics About Table 2 8 Help Menu Description Menu entry Description Help Topics Choose Help Topics in the menu for online help or if you need
273. arching 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 Figure 3 72 Find Dialog Box Find what fto_find M j Direction Cancel Match case C Up Down This dialog box allows you to specify the following options Match whole word only If this box is checked only strings separated by special characters will be recognized Match case If this box is checked the search is case sensitive NOTE Ifan item single word or source section has been selected in the Source component window before opening the Find dialog the first line of the selection will be copied into the Find what edit box 120 HC S 12 X Debugger Manual Debugger Components General Debugger Components Find Procedure The Find Procedure dialog box shown in Figure 3 73 on page 121 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 Figure 3 73 Find Procedure Dialog Box Find Procedure x Enter Procedure Name 050
274. as been selected RESET This message is generated when the debugger has been reseted on user request The menu entry Abatron BDI Reset or the Reset icon in the tool bar has been selected or the command Reset has been used Stepping and Breakpoint Messages Stepping and breakpoint messages are described in the following sections STEPPED Execution of the application has been stopped after a single step on source level The menu entry Run Single Step or the Single Step icon in the tool bar has been selected STEPPED OVER Execution of the application has been stopped after a step over a function call The menu entry Run Step Over or the Step Over icon in the tool bar has been selected STOPPED Execution of the application has been stopped after a step out from function call The menu entry Run Step Out or the Step Out icon in the tool bar has been selected TRACED Execution of the application has been stopped after an single step on assembler level The menu entry Run Assembly Step or the Assembly Step icon in the tool bar has been selected BREAKPOINT Execution of the application has been stopped because a breakpoint has been reached HC S 12 X Debugger Manual Abatron BDI Connection Terminal Emulation WATCHPOINT Execution of the application has been stopped because a watchpoint has been reached Terminal Emulation The Abatron BDI Connection supports the emulation of a terminal The BDI interface sup
275. asm version Some bytes ca 3 larger than C version when asm F ifdef HCS 08 LDHX startupData toCopyDownBeg toCopyDownBeg ffs taw PEPEES E PE i eee eee Tn E Y OEN E E R T T ET Component Files Each component is a windows file with a wnd extension Component Windows Object Info Bar The object info bar of the debugger window as shown in Figure 2 27 on page 36 provides information about the selected object HC S 12 X Debugger Manual 35 Debugger Interface Component Associated Menus Figure 2 27 Object Info Bar of Debugger Component Windowss ii Data 1 Ioj Xx Address 800 Size 2 fibo c Auto Symb Global fiboCount 4181 unsigned int counter 20 unsigned int zj Component Popup Menu The popup menu is a dynamic context sensitive menu It contains entries for additional facilities available in the current component Depending on the position of the mouse in the window and what is being pointed to popup menu entries will differ Figure 2 28 Example of Component Popup Menu D Profiles R THO2c My DocumentssnextunNsourcesNStart 8 Loe Al Delete Breakpoint amp j Disable Breakpoint 4 Run To Cursor LI Show Breakpoints Pi Show Location LI pr SetMarkpoint LI Show Markpoints s Open Source File pe Gopy circ Go To Line Ctrl G Find Ctrl F Find Procedure Ctrl I Folding v Marks ToolTips For example if you click the mouse on a breakpoint menu opt
276. ata component Displays user defined expression variables are erased NOTE Ifthe data component mode is not automatic entries are greyed 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 could 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 Figure 3 22 Format Submenu Selected gt All gt Table 3 10 on page 69 describes the Format submenu entries Table 3 10 Format Sub Menu Entries Selected The changes will be applied to the selection only All The changes will be applied to all items HC S 12 X Debugger Manual 69 Debugger Components General Debugger Components Format Selected amp All Sub Menu The Format Selected amp All Submenu is activated by highlighting this entry on the Data Component menu Figure 3 23 Format Selected amp All Submenus v Symbolic Hex Oct Bin Dec UDec BitReverse Table 3 11 on page 70 describes the Format Selected Mode amp Format All Mode Sub Menu entries Table 3 11 Format Selected amp All Sub Menu Menu entry Description Symbolic Select the Symbolic display format depends on the variable type display format This is the default display Hex Select the hexadecimal data display format Bin
277. aterate to 3 seconds HC S 12 X Debugger Manual 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 HC S 12 X Debugger Manual 593 Debugger Engine Commands Debugger Commands WAIT The WAIT command pauses command file execution for a time in tenths of second or TD pauses until the target is halted when the option ss 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
278. ation Usage EXIT Components Debugger engine Example in gt EXIT The Debugger application is closed FILL Description 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 File Memory dialog is available from the Memory popup menu and by selecting Fill or Memory gt Fill menu entry Example in gt FILL 0x8000 0x8008 OxFF The memory range 0x8000 0x8008 is filled with the value OxFF HC S 12 X Debugger Manual 535 Debugger Engine Commands Debugger Commands FILTER Description 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 lt range gt Options moduleslfunctionsllines Components Coverage component Example in coverage FILTER functions 25 75 536 HC S 12 X Debugger Manual FIND Description 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 sear
279. ation bound to the MCU environment on the board RAM ROM PIA ACIA etc Each of these files is very specific Running the ABATRON Configuration Tool The configuration program e g B10C12 EXE for CPUI2 processor with BDI1000 B20MCORE EXE for the M CORE with BDI2000 BDIHSHCI EXE for CPU16 CPU32 with BDI HS etc can also be run within the debugger on the condition that you browse for it choosing the menu entry Abatron BDI Configure BDI Box or specify the tool path in the Abatron BDI Setup dialog Setup dialog Otherwise run the configuration tool directly from the File Manager or the Explorer Example with B10C12 EXE Configuration Tool NOTE Please refer first to the ABATRON User Manual for further details about the BDI interface and BDI setup 430 HC S 12 X Debugger Manual Abatron BDI Connection BDI Interface Software Setup Figure 15 2 BDI1000 Setup for CPU12 Dialog Box im Untitled BDI1000 Setup for CPU12 OF x Bs ta S Ml Ose N Firmware Loading In the dialog box shown above select Setup Firmware to open the firmware dialog Figure 15 3 BDI Update Setup Dialog Box BD1I1000 Update Setup oeer Borrect 255255255255 7 285 255 258 255 7 Lok im HC S 12 X Debugger Manual 431 Abatron BDI Connection BDI Interface Software Setup In the dialog box shown above set the communication port and the baud rate according to your installation and press the Connect butto
280. ator Serial Communication Interface 0 and PortB Figure 11 12 Set Derivative Dialog Box MC9S12DP256B bd The MCU ID of this derivative is 0x3C6 Full Chip Simulation is supported Please choose the preferred derivative in the combo box above The MCUID can be found in the description field below the combo box Cancel Help The current mode of Simulation SAMPLE CORE or MCU derivative can be seen in the statusbar To access the Set Derivative dialog it is also possible to double click on the FCS support entry in the statusbar Please see Debugger Status Bar with Full Chip Simulation on page 260 HC S 12 X Debugger Manual 275 HC S 12 X Full Chip Simulation Connection Supported Derivatives Supported Derivatives Supported derivatives are listed here below To simulate unlisted derivatives either use a derivative with similar on chip peripherals or use the SAMPLE or CORE mode of Table 11 4 Supported Derivatives 276 the FCS Derivative Name MC9S12A32 Modules Analog to Digital Converter on page 288 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Ser
281. atron BDI Connect If communication with the BDI Interface could not be established an error message is displayed followed by the Communictaion Debice Specification dialog box Figure 15 12 Communication Device Specification Dialog Box Communication Device Specification In this dialog box you can modify the device specification e g Communication Port and baud rate These settings are saved in the current project and will be used again in future sessions 436 HC S 12 X Debugger Manual Abatron BDI Connection Abatron BDI Connection Menu Entries Abatron BDI Connection Menu Entries After loading the Abatron BDI Connection the Target menu item is replaced by Abatron BDI Figure 15 13 Debugger Abatron BDI Menu p True Time Simulator amp Real Time Debugger File View Run BDIK Component Data MWindov ET Load Ctrl L Reset Ctrl R Communication Setup Configure BDI Box Set Bank Command Files Help no source referer The Set Bank menu entry is available if the connected target processor is a CPU12 HC12 derivative If the connection to the target has failed the entry Communication of menu Abatron BDI is replaced with Connect The different entries of the Abatron BDI menu are described below Load Select Abatron BDI Load to load the application to debug i e a ABS file Reset The menu entry Abatron BDI Reset executes the Reset Command File
282. attern FINDPROC ON PAGE 538 ProcedureName Opens a procedure file FOLD on page 540 Folds a source block FRAMES on page 542 number Sets the maximum number of frames GRAPHICS on page 547 onloff Switches graphic bars on off INSPECTOROUTPUT on page 549 name subname Prints content of Inspector to Command window INSPECTORUPDATE on page 549 Updates content of Inspector LS on page 557 symbol I CIS Displays the list of symbols NB on page 560 base Sets the base of arithmetic operations OUTPUT on page 564 fileName Redirects the coverage component results PTRARRAY on page 567 onloff Switches on off the pointer as array display RECORD on page 569 onloff Switches on off the frame recorder SLINE on page 577 linenumber Shows the desired line number SAVE on page 574 range fileName offset A Saves a memory block in S Record format SETCOLORS on page 576 Name Background Cursor Grid Line Text 494 Changes the colors attributes of the Name channel from the Monitor component HC S 12 X Debugger Manual Table 20 5 List of Component Specific Commands continued Command Syntax SREC on page 582 fileName offset Short Description Loads a memory block in S Record format TUPDATE on page 588 onloff Switches on off time update for statistics UNFOLD on page 591 Unfolds a
283. ay format Dec Selects the signed decimal register display format UDec Selects the unsigned decimal register display format 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 32 on page 107 contains the drag actions possible from the Register window 106 HC S 12 X Debugger Manual Debugger Components General Debugger Components Table 3 32 Register Component Drag Possibilities Destination Component Action Window Assembly Assembly component receives an address range scrolls up to the corresponding instruction and highlights it Memory Dumps memory starting at the address stored in the selected register The corresponding address is selected in the memory component Command Line The address stored in the pointed to register is appended to the current command Drop Into Table 3 33 on page 107 shows the drop actions possible into the Register component Table 3 33 Register Component Drop Possibilities Source Component Action Window Assembler Loads the destination register with the PC of the selected instruction Data Dragging the name loads the destination register with the s
284. b Menu 0 00 00 0005 70 Mode Subimenu cees Uses eee dene 24 eee dare de date ep 70 Options Submenu 0 0 eee ee eee eee 72 Zoom and Sort Submenus 2 0 0 0 cee ee eee 74 Associated Popup Menu 0 cece eee een ences 74 Memory Component 0 0 0 cee cece eee nee 78 Memory Operations 79 HC S 12 X Debugger Manual 3 Table of Contents Memory Mentas ui tie eee Aq RS TES MEN ACE 79 Display Submenu errre eee e ee cee eee 82 Full Memory 606s Ren Ree REFER PREIS etde UE etwas 83 Display Address si cscs ei RR ER ea ole ke 83 CopyMem Submenu 00 e eee 85 Search Pattern eteerinen rA PER EVE E v LI DER OPES eid 85 Update Rate cepe PEN ee dU Eres 86 Associated Popup Menu ssssseeee eee 87 MicroC Component i ces ve ege Ree rd RR e kates 90 MicroC Link Menu 0 0 cee eee eee 90 MicroC DLEs 2 ge ERR LEUR MUERE URN aes 91 Module Component 00 cee eee e 94 Module Operations sees aroraa aan e E eee eee 94 Module Men 3 iieo oi cei AE hee di E R 94 Procedure Component llsseseseeeee ene 96 Procedure Operations o isses suse Re Rye RR E 96 Procedure Men sinon RR bi eed ee eve mee 96 Profiler Components 4 24 oxi Tu dae hh ees Pies Pee S URL 98 Profiler Operations 0 0c eee cee eee 99 Profiler Output File Functions eese 100 Recorder Component 0 0 0 0 eee cee cee eee 102 Rec
285. be specified in hexadecimal e g 0x35 for HC812A4 OxFF for HC912DG128 0x30 for MC9S12DP256B The number of pages must be specified in decimal e g 0 to 256 for HC812AA 8 for HC912DG128 64 for the MC9S12DP256B Figure 15 18 Banked Memory Location Window DPage Tab Banked Memory Location x PPage DPage EPage Various Start Address hex 7000 Register Address hex 35 End Address hex FFF Number of pages dec 256 v Enable Banked Memory Area Cancel Help 448 HC S 12 X Debugger Manual Abatron BDI Connection HC12 and HCS12 Banked Memory support DPAGE Tab The DPAGE index tab of this window lets you set up the DPAGE banked memory area Once you have enabled DPAGE memory banking by checking the Enable Banked Memory Area check box you must set the start address and the end address of this memory range The number of pages must be specified in decimal e g 0 to 256 for HC812A4 The DPAGE register address must be specified in hexadecimal e g 0x34 for HC812A4 Figure 15 19 Banked Memory Location Window EPage Tab Banked Memory Location x PPage DPage EPage Various Start Address hex 400 Register Address hex 35 End Address hex FF Number of pages dec 1256 v Enable Banked Memory Area Cancel Hep EPAGE Tab The EPAGE index tab of this dialog box lets you set up the EPAGE banked memory area Once you have enabled EPAGE memory banking by checking the Enable
286. bit 4M Mode Simulated bit 3 WAKE Wakeup by Address Mark Idle Not simulated bit 2ILT Idle Line Type Simulated bit 1 PE Parity Enabled Not simulated bit 0 PT Parity Type Not simulated SCOCR2 SC1CR2 SCI Control Register 2 bit 7 TIE Transmit Interrupt Enable Simulated bit 6 TCIE Transmit Complete Interrupt Enable Simulated bit 5 RIE Receive Interrupt Enable Simulated bit 4 ILIE Idle Line Interrupt Enable Simulated bit 3 TE Transmitter Enable Simulated bit 2 RE Receiver Enable Simulated bit 1 RWU Receiver Wake Up Control Not simulated bit 0 SBK Send Break Simulated SCOSRI SCISRI SCI Status Register 1 bit 7 TDRE Transmit Data Register Empty Flag Simulated HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives bit 6 TC Transmit Complete Flag Simulated bit 5 RDRF Receive Data Register Full Flag Simulated bit 4 IDLE Idle Line Detection Flag Simulated bit 3 OR Overrun Error Flag Simulated bit 2 NF Noise Error Flag Not simulated bit 1 FE Framing Error Flag Not simulated bit 0 PF Parity Error Flag Not simulated SCOSR2 SC1SR2 SCI Status Register 2 bit 7 1 unused bit O RAF Receiver Active Flag Simulated SCODRH SCIDRH SCI Data Register High bit 7 R8 Receive Bit 8 Simulated bit 6 T8 Transmit Bit 8 Simulated SCODRL SCIDRL SCI Data Register Low contains the Receive Transmit Data Bits 7 0 SCIInput This is a non memory mapped register that sends a character to
287. bject is available no input or output happens It is possible to check through the Inspector component if the environment currently provides an Sci0 object 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 the flag IOB NotifyAnyChanges should be used Otherwise only the first of two identical characters are received Itis also possible to configure the terminal to use another object in the Object Pool instead of Sci0 with which to communicate Please refer to Configure Terminal Connections on page 366 on page 369for informations 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 11 65 on page 369 Figure 11 65 Size of the Cache Dialog Box Size of the Cache x WV Number of lines to be cached 1
288. ble Address hex FFCC Age Daea Analyze the FLASH content and find the parameters below The user section of the FLASH will be erased Vectors reserved by Monitor Comma seperated list Monitor Start Address hex Fcoo v Enable Vector Table Mirroring Vector Table Mirroring Tab Using the Vector Table Mirroring tab it is possible to set the Vector Table Mirroring feature See the Vector Redirection section of Freescale Serial Monitor for MC9SO8GB GT Application Note AN2140 D for all details The HCS12 Monitor start address is given in the Monitor Start Address edit box The real vector table address is given in the Vector Table Address edit box The list of vectors reserved by the HCS12 Serial Monitor is given in the Vectors reserved by Monitor edit box NOTE Inthe 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 HCS12 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 HCS12 Serial Monitor To enable this feature check the Enable Vector Table Mirroring checkbox then press the Auto Detect button
289. ble in the Data window and holding down the left mouse button press the S key The Watchpoints tab of the Controlpoints Configuration window is displayed 2 Select the watchpoint you want to define as a counting watchpoint from the list 3 From the dropdown box select the type of access you want to track 4 In the interval field specify the interval count for the watchpoint Close the window by clicking OK A counting watchpoint is defined for the selected variable If you continue program execution the Current field is decremented each time an appropriate access on the variable is detected When Current is equal to 0 the application HC S 12 X Debugger Manual 167 Control Points Setting Watchpoints 168 stops Current is reloaded with the value stored in the interval field to enable the counting watchpoint again Defining a Conditional Watchpoint A condition can be associated with any type of watchpoint described previously read write read write The Debugger provides two ways to define a conditional watchpoint Using the Data Popup Menu 1 Point at a variable in the Data window and right click The Data Popup Menu is displayed Choose Set Watchpoint from the Popup Menu A Read Write Watchpoint is defined Point in the Data window and right click The Source Popup Menu is displayed Choose Show WatchPoints from the Popup Menu The Controlpoints Configuration window Watchpoints tab is displayed Select the
290. bles Debugger Files Table 22 2 Debugger File Extensions 654 File Extension Description 10 l O s simulation file for example sample11 io 1SU Uninstall Application File PJT Debugger configuration Settings File for example Project pjt INI Debugger configuration Settings File for example Project ini LST Assembler Listing File for example fibo Ist MCP Freescale CodeWarrior IDE project file MAK Make file for example demo mak MAP Mapping file for example macrodem map MEM Memory Configuration file for example 000p4v01 mem MON Firmware loading file for allowing to load a specified target for example Firm0508 mon O Object file code for example Fibo o PDF Portable Document Format file PRM Linker parameter file for example ibo prm Project Ini Debugger Project Initialization File REC Recorder File REG Register Entries files for example mcu081e reg SIM CPU Awareness file for example st7 sim SX S Record file for example fibo sx TXT General Text Information file TGT Target File for the Debugger for example xtend g3 tgt WND Debugger Window Component File for example recorder wnd XPR Debugger User Expression file for example Fibo xpr HC S 12 X Debugger Manual 23 Connection specific Environment Variables Some of the environment variables that can be used in the debugging
291. bles and the application is started and stopped at the breakpoint Listing 3 2 Record File Example at at at at at at 4537 load C Freescale D 9424 bs 0x1040 P 11917 Assembly attribu EMO fibo abs tes code on 14481 Assembly lt attribu tes adr on 20540 Data 1 lt attributes scope local 24425 g wait s HC S 12 X Debugger Manual 103 Debugger Components General Debugger Components Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations Only 20 commands are recorded and replayed 104 HC S 12 X Debugger Manual Debugger Components General Debugger Components Register Component The Register window shown in Figure 3 59 on page 105 displays the content of registers and status register bits of the target processor Figure 3 59 Register Window il Register OF x HC08 CPU Cycles 1165708 ts HX 14D SP l4c SR 62 Status VHINZC PC FOSE Register values can be displayed in binary or hexadecimal format These values are editable Status Register Bits Set bits are displayed dark whereas reset bits are displayed grey Double click a bit to toggle it During program execution contents of registers that have changed since the last refresh are displayed in red except for status register bits The Object Infor bar of the window contains the number of CPU cycles as well as the processor s name Editing Registe
292. bles or disables logging of information in the Command Line component window and to logfile when it as been opened with an LF on page 550 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 about 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 about ERRORS Errors are displayed in red in Command Line component Protocol messages are not errors about 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 HC S 12 X Debugger Manual 553 Debugger Engine Commands Debugger Commands 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 CMDLIN on Error messages are not recorded in the Log File Commands entered in the Command Line component window are recorded More About Logging of IF FOR WHILE and REPEAT When commands executed from a command file are logged all execute
293. bo raa On the Next Source Instruction The Debugger provides two ways of stepping to the next source instruction 1 Choose Run gt Single Step 2 Click the Single Step icon from the Debugger tool bar 3 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 HC S 12 X Debugger Manual 197 How To How To Step in the Application 198 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 Step Over a Function Call Flat Step The Debugger provides two ways of stepping over a function call 1 Choose Run gt Step Over 2 Click the Step Over icon from the Debugger tool bar z STEPPED OVER STEPOVER on page 585 or STOPPED STOP on page 586 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 applicat
294. bugger Components Visualization Utilities DILSwitch Instrument The DILSwitch instrument is also known as Dual in Line Switch Figure 3 89 on page 140 It is mainly used for configuration purpose You can use it for viewing or setting bits of one to four bytes Figure 3 89 DILSwitch Instrument OILSwitch instrument attributes are listed in the Table 3 50 on page 140 Table 3 50 DILSwitch Instrument Attributes CO Display 0 1 When enabled displays the value of the bit under each plot of the DILSwitch instrument Switch Color Specifies the color of the switch Knob Instrument The Knob instrument is normally known as an adjustment instrument For example in can simulate the volume control of a radio Figure 3 90 on page 140 Figure 3 90 Knob Instrument Knob instrument attributes are shown in the Table 3 51 on page 140 Table 3 51 Knob Instrument Attributes Attribute Description Low Display Value Defines the zero point of the indicator The values below this definition will not be displayed High Display Value Defines the highest position of the indicator It defines the value on which the indicator reads 100 140 HC S 12 X Debugger Manual Debugger Components Visualization Utilities Table 3 51 Knob Instrument Attributes continued Aeae oreet Ooo Indicator Color Defines the color and the width of the pen used to draw the indicator Knob Color Defines the color of the knob
295. c Interrupt Timer PIT on page 299 Pulse Width Modulator PWM on page 299 S12X INT on page 291 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 XGATE on page 291 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 4 Supported Derivatives continued Derivative Name MC9S12XDT512 Modules Analog to Digital Converter on page 288 Clock and Reset Generator CRG on page 294 Debug Module DBG on page 291 External Bus Interface EBI on page 292 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Module Mapping Control MMC on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Periodic Interrupt Timer PIT on page 299 Pulse Width Modulator PWM on page 299 S12X INT on page 291 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 XGATE on page 291 Communication Modules Byteflight BF The I O device Byteflight BF is not simulated J1850 Bus BLCD The I O device J1850 Bus BLCD is not simulated Motorola Scalable CAN MSCAN The I O device Motorola Scalable CAN MSCAN is not simulated HC S 12 X Debugger Manual 285 HC S 12 X Full Chip
296. ccess Details Dialog Box Figure 11 7 on page 268 shows the Access Details dialog box which lets you change read and write access values for seven types Figure 11 7 Memory Configuration Dialog Box Access Details Dialog Box Memory Configuration x r Configuration Memory Check IV Stop if no memory IV Stop on read undefined Mode Ac Details Read Write Symbolic representation allow delay AUTO RO 0 16 AUTO RA Byte Iv Iv HL 0800 0803 0 16 Auto Segn ROM 0810 08C1 0 16 Auto Sean Word Iv Vv et TT RAM OBOO OBFE 0 16 Auto Segn FFFE FFFF Auto Segn Word misaligned V ira IFREI Long xI xI E E E LE Eb El be xI TTE EE Ub k Eb b Eb El E Long misaligned 1 Name Jauro ROM Type Start fr End Wait state fo Access Details Set Up c width mE pd Cancel Help Q s C 8bits VV Allow misaligned acce Add Update Delete OK Cancel Help Follow this guidance to use the Access Details dialog box xI xI Long misaligned 2 xI ba ha kal kal Long misaligned 3 A check box indicates if an access kind is allowed or not To modify the value of each read or write type change the value of the associated spin box The lowest possible value is 0 268 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection The highest possible value is 127
297. ch are used by the connection are described as shown in the following table HC S 12 X Debugger Manual Debugger Connection specific Commands Abatron BDI Connection Commands Table 21 2 Command Descripton Parameters Topic Description Short Description Provides a short description of the command Syntax Specifies the syntax of the command in a EBNF format Description Provides a detailed description of the command and how to use it Example Small example of how to use the command The following sections describe each command related to the Banked Memory Location available for the connection The variables are listed in alphabetical order BANKWINDOW Short Description Specify a banked memory area and its status enable disable Syntax BANKWINDOW bank OFF ON range reg numofpages bank PPAGE DPAGE EPAGE BANKWINDOW VARIOUS DLGATCONNECT NODLGATCONNECT Description The command BANKWINDOW allows to set up the debugger to work in banked memory model Three different Banked Memory Area can be defined DPAGE EPAGE and PPAGE Each banked memory area has an associated bank register which is displayed in the Register component Using BANWINDOW PPAGE command will have the same effect than using the PPAGE index tab in the Banked Memory Location Window Using BANWINDOW DPAGE command will have the same effect than using the DPAGE index
298. ch 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 grey Equivalent Operation You can select Source Find or open the Source popup menu and select Find to open the Find dialog Usage FIND string B EMC EWW Where string is the pattern to match It has to be enclosed in double quotes See the example below B the search is backwards default is forwards MC match case sensitive is set WW match whole word 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 HC S 12 X Debugger Manual 537 Debugger Engine Commands Debugger Commands 538 FINDPROC Description 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 popup menu and select Find Procedure to open the Find Procedure dialog Usage FINDPROC procedureName Components
299. change the content of indexes accumulators or bit registers Modify Index or Accumulator Register Content Double click a register The current register content is highlighted and may be edited Figure 6 5 Modifying Index or Accumulator Register Content E Register i D Xx HCO8 CPU Cycles 1165708 y laps sp HX l4C SR 62 Status HINZC PC FOSE 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 will be set to 0x10 16 2 To validate the input value you can either press the Enter or Tab key or select another register HC S 12 X Debugger Manual 203 How To How To Work on the Register 3 If an input value has been validated by the Tab key the content of the next register in the component is automatically highlighted This register can also be edited 4 Torestore the previous register content press the Esc key Modify Bit Register Content In a bit register each bit has a specific meaning a Status Register SR or Condition Code Register CCR Mnemonic characters for bits that are set to 1 are displayed in black whereas mnemonic characters for bits that are reset to 0 are displayed in grey Single bits inside the bit register can be toggled by double clicking the corresponding mnemonic character Start Memory Dump at Address Where Register
300. cimal 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 unselects 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 HC S 12 X Debugger Manual 505 Debugger Engine Commands Debugger Commands 506 n Frozen mode value from memory words displayed in the Memory component are not updated when the target is stopped n 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 on page 592 command NOTE Also refer to SMEM on page 578 SPC on page 580 and SMOD on page 579 command descriptions for more detail about these commands Equivalent Operations ATTRIBUTES FORMAT Select menu Memory gt Format ATTRIBUTES WORD Select menu Memory Word Size ATTRIBUTES ADR Select menu Memory gt Display gt Address ATTRIBUTES ASC Select menu Memory gt Display gt ASCII ATTRIBUTES ADDRESS Select menu Memory gt Addr
301. closed as soon as command execution is complete If the Close command is applied to this Command component the Command component is closed as soon as command execution is complete Command Menu Figure 3 8 on page 56 shows the Command menu which is identical to the Command Popup menu Figure 3 8 Command Menu 56 Execute File lapy Paste Cache Size Clicking Execute File opens a dialog where you can select a file containing Debugger commands to be executed Theses files generally have a cmd default extension Selected text in the Command Line window can be copied to the clipboard by selecting the menu entry Command gt Copy pressing the CTRL C key clicking the Bz button in the toolbar The Command gt Copy menu entry and the S button are only enabled if something is selected in the Command Line window HC S 12 X Debugger Manual Debugger Components General Debugger Components The first line of text contained in the clipboard can be pasted where the caret is blinking end of current line by Selecting the menu entry Command gt Paste Pressing CTRL V simultaneously clicking the e icon in the toolbar 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 on page 57 Figure 3 9 Cache Size Dialog Box Size of the Cache x Number of lines to be cached 1000
302. cludes command files that match the Freescale board default settings an MPFB1632 board with 2 pseudo ROM RAMs of 32k no SRAM and no FLASH These files are appropriate as well for MPB332AB boards that support the MC68332 which has 2kB internal RAM and for an MPB16Y1B board that supports an HC16Y1 which also has 2kB internal RAM HC S 12 X Debugger Manual Debugger Connection specific Commands ICD 12 Commands Examine the command files in your installation directory Text below is a short explanation of the most important system registers Refer the your MCU manual for a detailed description NOTE Each MCU version has its own memory map Software and hardware chip selects must correspond to the MCU hardware and to external hardware that is ROM pseudo ROM RAM such as FLASH or SRAM and so forth HC S 12 X Debugger Manual 607 Debugger Connection specific Commands NVMC Commands NVMC Commands The following Flash Comands can be issued through the debugger Command component window as shown in the figure below Figure 21 1 NVMC Commands In Command Window im Command BEES in gt FLASH FLASH parameters loaded for M68HC912DG128 from G HC12_D PROG FPP mcu03C4 fpp MCU clock speed Module Name FLASH_4000 FLASH_PAGEO FLASH C000 FLASH PAGEl FLASH PAGE2 FLASH PAGE3 FLASH PAGE4 FLASH PAGES FLASH PAGE6G FLASH PAGE7 HALTED in FLASH Short Descrip 8019000 Address 4000 8000 cooo 18000 28000 3800
303. command or from address 0x0000 for the first DB on page 523 DW on page 529 DL on page 528 command of a session Components Debugger engine Example HC S 12 X Debugger Manual 529 Debugger Engine Commands Debugger Commands in DW 0x8000 4 8000 FE80 45FD 8043 2710 The content of 4 words starting at 0x8000 is displayed as word 2 bytes values 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 OIDIXICIB 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 in define in e a b in 34 a 0x12 b 0x10 530 The addition o
304. 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 addresslrange 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 on page 529 DL on page 528 command of a session Components Debugger engine Examples in gt DB 0x8000 0x800F 8000 FE 80 45 FD 80 43 27 10 35 ED 31 EC 31 69 70 83 p E C 5 lilipf 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 amp TCR 0012 SAZ HC S 12 X Debugger Manual 523 Debugger Engine Commands Debugger Commands 524 displays the byte that is at the address of the TCR I O register I O registers are defined in
305. command files startup cmd reset cmd preload cmd and postload cmd are Debugger system command files All these command files do not exist automatically They could be installed when installing a new connection However the Debugger is able to recognize these command files and execute them startup cmd is executed when a connection is loaded the target defined in the project ini file or loaded when you select Component gt Set Connection e reset cmd is executed when you select Connection Name gt Reset in the menu Connection Name is the real name of the connection such as MMDS0508 etc preload cmd is executed before loading a ABS application file or Srecords file when you select Connection Name gt Load in the menu e postload cmd is executed after loading a ABS application file or Srecords file when you select Connection Name gt Load in the menu Depending on the connection used other command files can be recognized by the Debugger Refer to the appropriate connection manual for information and properties of these command files HC S 12 X Debugger Manual 207 How To About startup cmd reset cmd preload cmd postload cmd 208 HC S 12 X Debugger Manual CodeWarrior Integration This chapter provides information on how to use and configure the Simulator Debugger within CodeWarrior using the following software CodeWarrior IDE HC12 version 4 5 or later Click the following l
306. configuration files View Contains entries to configure the toolbar Run Contains entries to monitor a simulation or debug session Connection Contains entries to select the debugger connection Once a connection has been selected the name of this heading changes Component Contains entries to select and configure extra component window Data Contains entries to select Data component functions Window Contains entries to set the component windows Help A standard Windows Help menu File Menu The File menu shown in Figure 2 7 on page 15 is dedicated to the debugger project 14 HC S 12 X Debugger Manual Debugger Interface Debugger Main Window Figure 2 7 File Menu True Time Simulator amp Real Time Debugger D Profiles RTHO2c My Documents MyProj Simulator ini File View Run Simulator Component Memory Window Help New GH Load Application Ctrl E Assembly E D Profiles RTHOZc My Documents MyProj bin Simulator abs Open Configuration Ctri o Save Configuration CALL 0x8004 0x00 Save Configuration As CALL 0x8000 0x00 Configuration BGND Startup Configuration BGND SUBB 17 1 Simulator ini 25 2 D Profiles RTHOZc My Documents thirdun MONO8_P amp E_Multilink_CyclonePro ini 3 D Profiles RTHO2c My Documents Bingo HC508_Serial_Monitor ini 4 D Profiles RTHO2c My Documents eighth HC08_Full_Chip_Simulator ini CPU Cycles 0 Exit DDF A DF B DFDF IY DFDF cooo PC c
307. connected derivative is a Freescale HC12 CPU12 or HCS12 The Banked Memory Location window can be opened by selecting the menu entry TargetName Set Bank In this section Target Name is the name of the connection like Abatron BDI ICD 12 etc Using some connections the Banked Memory Location window automatically pops up when the connection is used with a Freescale HC12 or HCS12 derivative that supports banking In this case it also pops up when the banked memory area locations are not defined in the project file of the current project directory In this window you can define which banked memory you want to use and its location The PPAGE DPAGE and the EPAGE indexes are supported if they are available on the currently connected HC12 or HCS12 derivative HC S 12 X Debugger Manual 447 Abatron BDI Connection HC12 and HCS12 Banked Memory support Figure 15 17 Banked Memory Location Window PPage Tab Banked Memory Location x PPage DPage EPage Various Start Address hex zum Register Address hex 35 End Address hex pFFF Number of pages dec le v Enable Banked Memory Area Cancel Help PPAGE Tab The PPAGE tab of the Banked Memory Location window lets you set up the PPAGE banked memory area Once you have enabled PPAGE memory banking by checking the Enable Banked Memory Area check box you must set the start address and the end address of this memory range The PPAGE register address must
308. connection NOTE When a connection cannot be loaded the combo box displays the path where you should install missing dll 4 Click OK to load connection in debugger NOTE For more information about which connection to load and how to set reset a connection refer to the Debugger connection books in Sections II and III of this manual Window Menu In this menu shown in Figure 2 21 on page 32 you can set the component windows general arrangement The Submenu Window gt Options is shown in Figure 2 22 on page 32 and the Submenu Window gt Layout in Figure 2 23 on page 32 HC S 12 X Debugger Manual 31 Debugger Interface Debugger Main Window Figure 2 21 Window Menu True Time Simulator amp Real Time Debugger D Profiles RTHO2c Documents MyProj Simulator File View Run Simulator Component Assembly Window Help Cascade a i 3 8 zej gt gt ES EE D Profiles RTHO2c My Documents MyProj SourcesS Line 1 include lt hidef h gt common del include mc68hc912dgl28 h ation pragma LINK INFO DERIVATIVE mc68hc y 2 Assembly CALL 0x8000 0x00 3 Procedure BGED Memory BGND slid SUBB 17 void main void A SUBB 25 put your own code here BGND EnableInterrupts BGND BGND fort 3 ffe 3i wait forever H Procedure Startup I Auto Symb uuuuun startupData 6 _tagStartup uuuu u u E SEG END SSTACK 0 array 0 of signed ch
309. ct Figure 9 1 DA C Project Options Window Directories Tab 214 Project Options HC S 12 X Debugger Manual Synchronized Debugging Through DA C IDE Configuring DA C IDE for Freescale Tool Kit Project Root Directory This text box determines the project root directory The full path is expected or a single dot can be entered which stands for the same directory where the project file resides All files that belong to the project are considered relative to the Project root directory if the full path of the file is not given In our case keep the single dot for the project root directory Referential Project Root Directory If not empty this text box specifies an alternate Project Root Path for searching files not found in the original project path Filenames in the original path with referential extensions are tried before those in the referential path Specified path may be either full or relative to project root and it may not specify a subdirectory in the project root directory tree Leave this field empty Database Directory This text box determines the directory where the symbols and software metrics database will be saved This directory can be absolute or relative to the Project Root Directory Leave this field empty User Help File This text box determines the user help file for example compiler help file The hot key for User Help File can be defined in the Keyboard definition file default
310. ct menu Data Mode Periodical ATTRIBUTES COMPLEMENT Select menu Data Format ATTRIBUTES NAMEWIDTH Select menu Data Options Name Width 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 In the Memory Component The ATTRIBUTES command allows you to set the display and state options of the Memory component window The WORD command selects the word size of the memory dump window The word size number can be 1 for byte format 2 for word format 2 bytes or 4 for long format 4 bytes The ADR command ON or OFF displays or hides the address in front of the memory dump lines The ASC command ON or OFF displays or hides the ASCII dump at the end of the memory dump lines The ADDRESS command scrolls the corresponding memory dump window and displays the corresponding memory address lines memory WORD is not selected SPC show pc SMEM show memory and SMOD show module commands scroll the Memory component accordingly to display the code location given as argument and select the corresponding memory area SPC selects an address SMEM selects a range of memory and SMOD selects the module name whom global variable would be located in the window The FORMAT command selects the format for the list of variables The format is one of the following binary octal hexadecimal signed de
311. d window debugger default 272 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Example in warning setup none in warning setup clmsg in warning setup status WARNING SETUP STATUS CLMSG WARNING SETUP MSGBOX A message box pops up on warning Pressing Cancel stops the FCS Pressing OK resumes the FCS Figure 11 11 FCS Warning Message Box A FCS Warning ID 12 reading from unimplemented register at pc 0x400a L Value 0x0 Memory Address 0x106 FLASH CONTROL module not implemented Cancel Example in gt warning_setup none in gt warning_setup msgbox in gt warning_setup status WARNING_SETUP STATUS MSGBOX WARNING SETUP NONE clears all kind 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 several times the command toggles on and off the setup HC S 12 X Debugger Manual 273 HC S 12 X Full Chip Simulation Connection 274 MESSAGE HIDE ID Command The MESSAGE HIDE ID command hides a message of a specific ID Components Debugger engine Usage MESSAGE HIDE ID lt message number ID gt 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
312. d Rate Control 0x0200 SCCR1 Serial Communication Control Register 0x0201 SCCR2 Serial Communication Control Register 0x0202 SCSR Serial Communication Status Register 0x0203 SCDR Serial Communication Data Register 0x0204 In the Serial Communication Status Register the bits used are described in Table 11 23 on page 360 Table 11 23 TestTerm Serial Communication Status Register TDRE Transmit Data Register Empty 0x80 RDRF Receive Data Register Full 0x20 360 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities However reading and writing in the BAUD SCCRI 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 When reading a value from the SCDR register the RDRF flag is cleared in the SCSR register Also when the user enters a character on the keyboard while TestTerm is active the RDRF flag is set in the SCSR register and the ASCII code of the typed key is put into the SCDR register Conceptually when a new value is written in the SCDR register by the target application the TDRE flag is cleared in SCSR When the transmission is finished the T
313. d Registers Table 11 7 TIM Simulated Registers Register Register Initial Remarks Name Address Value TIOS 0x0080 0x00 CFORC 0x0081 0x00 OC7M 0x0082 0x00 OC7D 0x0083 0x00 TCNT_H 0x0084 0x00 TONT L 0x0085 0x00 TSCR 0x0086 0x00 TSWAI The Full Chip Simulation does not support the CPU Clock stop so setting this bit has no effect TSBCK The Full Chip Simulation does not simulate background mode so this bit of the TSCR register has no effect TQCR 0x0087 0x00 TCTL1 0x0088 0x00 TCTL2 0x0089 0x00 TCTL3 0x008A 0x00 TCTL4 0x008B 0x00 TMSK1 0x008C 0x00 304 HC S 12 X Debugger Manual Table 11 7 TIM Simulated Registers HC S 12 X Full Chip Simulation Connection Supported Derivatives HC S 12 X Debugger Manual Register Register Initial Remarks Name Address Value TMSK2 0x008D 0x30 TPU This bit controls a pull up resistor or a pin But the Full Chip Simulation does not have real pins so setting this bit has no effect TDRB This bit controls the output drive of a pin But the Full Chip Simulation does not have real pins so setting this bit has no effect TFLG1 Ox008E 0x00 TFLG2 0x008F 0x00 TCO_H 0x0090 0x00 TCO_L 0x0091 0x00 TC1_H 0x0092 0x00 TC1_L 0x0093 0x00 TC2_H 0x0094 0x00 TC2_L 0x0095 0x00 TC3_H 0x0096 0x00 TC3_L 0x0097 0x00 TC4_H 0x0098 0x00 TC4_L 0x0099 0x00
314. d and to the Control Points on page 147 chapter Usage SAVEBP onloff Components Debugger engine Example content of the FIBO BPT file savebp on BS amp fibo BS amp fibo BS amp fibo BS amp fibo 0x800 Tae B c c 9 c Fibonacci 19 P E cond fibo gt 10 E cdSz 47 srSz 0 Fibonaccit 31 P E cdSz 47 srSz 0 main 12 P E cdSz 42 srSz 0 main 21 P E cond fiboCount 5 E cmd Assembly lt spc cdSz 42 srSz 0 ie za HC S 12 X Debugger Manual 575 Debugger Engine Commands Debugger Commands 576 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 OxOObbggrr Cursor is the new color for the channel cursor the format is OxO0bbggrr Grid is the new color for the channel grid the format is OxO0bbggrr Line is the new color for the channel lines the format is OxO0bbgerr Text is the new color for the chan
315. d commands that are in a IF block are logged That is a command file executed with the CF or CALL command without the NL option and with CMDFILE flag of the LOG command set to TRUE All commands in a block that are not executed because the corresponding condition is false are also logged but preceded with a Example 6699 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 Idefine truth 1 LIF truth bckcolor blue at 2000 bckcolor white lelse bckcolor yellow 554 HC S 12 X Debugger Manual 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 Example2 When executing the following file define i 1 FOR 1 2 1 3 ls ENDFOR The following log file is generated Idefine i 1 IFOR 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 acommand
316. d in the Command Line window and not to log file when a file has been opened with an LF on page 550 command even if the CMDFILE type is set to ON see also the LOG on page 553 command Components Debugger engine Examples in CF commands txt The COMMANDS TXT file is executed It should contain debugger commands like those described in this chapter Example Without C Option if a command1 txt file contains bckcolor green cf command2 txt HC S 12 X Debugger Manual 517 Debugger Engine Commands Debugger Commands bckcolor white if a command2 txt file contains bckcolor red Execution in cf command1 txt executing command1 txt bckcolor green Icf command2 txt executing command2 txt 1 bckcolor red 1 1 done command2 txt bckcolor white I done command1 txt Example With C Option if a command1 txt file contains bckcolor green cf command2 txt C bckcolor white if a command2 txt file contains bckcolor red Execution in cf command1 txt executing command1 txt Ibckcolor green Icf command2 txt C executing command2 txt 1 bckcolor red 1 518 HC S 12 X Debugger Manual 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 Exa
317. d 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 gt Inspect lt ATTRIBUTES EXPAND 3 in gt INSPECTOROUTPUT Object Pool Swap Swap Name Value Address Init IOReg 1 0x0 0x1000 0x0 IOReg 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 gt INSPECTORUPDAT Lj HC S 12 X Debugger Manual 549 Debugger Engine Commands Debugger Commands 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 on page 562 command is executed When the LF command is entered with no filename the Open File Dialog is displayed to specify a filename Use the logging option LOG on page 553 command to specify information
318. d tool to evaluate and display information about the operating system its state its performance the different task states the different operating system objects etc ORTI File and Filename The ORTI file name has the same name as the application file name but with the extension ort For instance if the application file name is winLift_demo abs the ORTI file name is winLift demo ort Otherwise the debugger cannot use the correct ORTI file HC S 12 X Debugger Manual 183 Real Time Kernel Awareness OSEK Kernel Awareness The ORTI file contains dynamic information as a set of attributes that are represented by formulas to access corresponding dynamic values Formulas for dynamic data access are comprised of constants operations and symbolic names within the target file The given formula can then be evaluated by the debug tool to obtain internal values of the required OS objects Figure 5 1 ORTI Aware Debugging System 184 Two types of data are made available to the CodeWarrior 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 CodeWarrior 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 CodeWarrior is represented in a text ORTI File The fil
319. date manually Multi Core HCS12X and XGATE in RAM The created project will contain source code for the HCS12X and the XGATE The HCS12X code copies the XGATE code from FLASH into RAM and then configures the XGATE Multi Core HCS12X and XGATE in FLASH The created project will contain source code for the HCS12X and the XGATE The XGATE will execute out of the FLASH Note that this setup does not work with the LC40 mask set of the MC9S12XPDS512 HC S 12 X Debugger Manual 239 HC12 Debugging First Steps Debugging First Steps Using the Wizard Figure 10 4 Language Support Screen New Project Wizard Page 4 freescale 9 Selectthe Language format by checking its checkbox then clicking the Next button to proceed You can make multiple selections creating the code in multiple formats Selecting any of the options results in the following conditions Assembly If only Assembly is selected you can later choose to use absolute single file assembly application or relocatable assembly C This will set up your application with an ANSI C compliant startup code doing initialization of global variables e C This will set up your application with an ANSI C startup code doing global class object initialization 240 HC S 12 X Debugger Manual Figure 10 5 PC Lint Support Screen New Project Wizard Page 5 freescale 10 Unless you wish to create a project set up for PC lint select No by checking
320. de volatile static byte pwmChannel 1 volatile static unsigned int pwmRatio 6939 void main void Processor Expert internal initialization DON T REMOVE THIS CODE PE low level init End of Processor Expert internal initialization KKK Write your code here for pwmChannel 0 PTP_PTPO void PWM8_SetRatiol6 pwmRatio Processor Expert end of main routine DON T MODIFY THIS CODE for Processor Expert end of main routine DON T WRITE CODE BELOW End of main routine DO NOT MODIFY THIS TEXT Step 10 Run The application is now finished and we can launch it Make sure you have chosen the Full Chip Simulation connection Select the Debug icon in the Project Manager window or the menu bar Project gt Debug or F5 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Select Component gt Open in the debugger and open the VisualizationTool component In the following text we will create a nice visualization for our propose All has to be done in the VisualizationTool window Make sure that you are in the Edit mode switch with Right mouse click gt Edit Mode or Ctrl E Right mouse click gt Properties VisualizationTool Properties Select for Refresh Mode CPU Cycles Select
321. de File This text box determines the name of the file that will be included automatically at the beginning of every source module during analysis in the same way as if include string were present in the first line The preinclude file can be used to specify predefined macros and variable and function declarations for a particular compiler which are not set by default in DA C analysis We have selected the one corresponding to our example M68k preinclude file adapt it to your needs Adding Files to Project In the Project Window the Explorer View Tab replaces the Window s Explorer and supplies you with additional information on directories containing project files It also gives you the option to add files into the project For example we will now set all files needed to run the fibo example In the Explorer View browse to the gt Freescale gt WORK gt lt processor gt c directory of your Freescale installation and select fibo c file Then right click mouse button and choose Add to Project The file is now added in the current project and a green mark appears in front of it Figure 9 4 on page 218 Figure 9 4 Adding Files to Project Using Explorer Tab ie Project iof x E Explorer View C Folder View Logical View zy flesim C Hiware W ork MB8kc Egg Hiware Name Size T Modified Demo fibo abs 817 10 14 99 m Docu Fibo c 1017 CSourceFile 5 20 98 8 amp Sg Lib v myproject dcp 1 07KB Developme 11
322. default format is hexadecimal Ident is a known identifier its content will define the port address Components Programmable parallel Couplers component Example in CPORT 0x100 0x200 0x300 The ports of the Programmable parallel Couplers will be defined at addresses 0x100 0x200 and 0x300 DELCHANNEL The DELCHANNEL command is used to delete a specific channel for the Monitor component Usage DELCHANNEL Name Name is the name of the channel to delete Components Monitor component Example in DELCHANNEL Leds Port Register bit 0 The channel Leds Port Register bit 0 will be deleted in the Monitor component 620 HC S 12 X Debugger Manual Debugger Connection specific Commands Full Chip Simulator Commands ITPORT The ITPORT command is used to set the line and column port addresses of the IT Keyboard component Usage ITPORT address ident address ident address ident Address locates the port address value of the component various formats are allowed the default format is hexadecimal Ident is a known identifier its content will define the port address Components IT Keyboard component Example in gt ITPORT 0x100 0x200 0x300 Ports of the IT Keyboard are now defined at addresses 0x100 0x200 and 0x300 ITVECT The ITVECT command is used to set the interrupt vector port address of the IT Keyboard component Usage ITVECT address ident Addr
323. 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 gt SREC DUMP SX The DUMP SX file is loaded into memory HC S 12 X Debugger Manual 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 gt STEPINTO STEP INTO TRACI ED TRACED in the status line indicates that the application is stopped by an assembly step function HC S 12 X Debugger Manual 583 Debugger Engine Commands Debugger Commands 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 AII 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
324. dresses A read operation where the coupler is in input mode activates this input during all the read steps A write operation where 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 This configuration can be modified during program execution The first step in the test program is to configure the used couplers Programmable IO Ports Menu Figure 11 48 on page 352 shows the Programmable IO Ports menu and its entry is described in Table 11 19 on page 352 Figure 11 48 The Programmable IO Ports Menu Setup Table 11 19 Programmable IO Ports Mmenu Description Opens the Programmable IO Ports Port Address dialog 352 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Port Address The Port Address dialog box shown in Figure 11 49 on page 353 allows you to set the port address and control port address Figure 11 49 Port Address Dialog Box Setup Ports address x port hex x B port hex 1202 C port hex 204 Cancel D Port hex 1206 E Port hex 1208 Help Control port hex 20a You can enter the address for the 5 ports A B C D E and the address for the Control port Click OK to validate The coupler Control register allows you to configure the port type for each port set a bit to 1 to configure the port as output and se
325. dropped in Demo Version Limitations Only 5 items can be expanded at each location For remaining items an icon with the text Demo Limitation is displayed as shown in Figure 3 84 on page 131 Figure 3 84 Inspector Component Demo Version Limitations imi Inspect i OF XI 4 Exceptions ES Object Pool SE TargetObject Z Inter Basic id Swap id Leds Demo Limitation Demo Limitation Demo Limitation VisualizationTool Component The VisualizationTool component is a very convenient tool for presenting your data For software demonstration or for your own debugging session take advantage of all its virtual instruments The VisualizationTool window shown in Figure 3 85 on page 132 consists of a plain workspace that can be equipped with many different instruments HC S 12 X Debugger Manual 131 Debugger Components Visualization Utilities Figure 3 85 VisualizationTool Window 132 VisualizationT ool EditMode Sle mg smx ee Sum pals hae p Rati uel additive anspor gien Temperature Diesel f w ND Y N d ir Elapsed time mn Wheel speed ttt D1 011 010 Injection Config 9 EN Pressure Edit Mode and Display Mode The VisualizationTool may operate in two modes Display mode or Edit mode The Edit mode is for designing the workspace to suit your needs In the Displa
326. e Syntax UTMP 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 NOTE This is an environment variable at the system level global environment variable It CANNOT be specified in a default environment file DEFAULT ENV hidefaults Example TMP C V TEMP See also The Current Directory on page 635 HC S 12 X Debugger Manual USELIBPATH Using LIBPATH Environment Variable Tools Compiler Linker Debugger Synonym None Syntax USELIBPATH OFF ON NO YES Arguments ON YES The environment variable LIBRARYPATH include lt File gt Path on page 648 is used to look for system header files lt h gt NO OFF The environment variable LIBRARYPATH include lt File gt Path on page 648 is not used Default ON Description This environment variable allows a flexible usage of the LIBRARYPATH include File Path on page 648 environment variable because LIBRARYPATH include File Path on page 648 may be used by other software f
327. e Active Comment 00000022 00000023 DBGTBH DBGTBL fifo registers 00000000 0O00003FF yes Registers physical 00000000 O0003FFF yes Ram physical 00004000 00007FFF yes Unbanked flash 4000 i DODOCODO DODO FFFF yes Unbanked flash CODD OO000000 O0003FFF yes Lnbanked flash 0000 00008000 O000BFFF yes flash window 00308000 0O03FBFFF yes Banked flash banked 00018000 002FBFFF no Banked memory New Modify Delete Revert to Default Information A memory range from 0x22 to 0x23 is Read protected Important This predefined module is handled internally by the Trigger Module S rr The DMM GUI shows a list of memory address ranges also called in this manual Modules defined to access the device chip memory A memory range from Ox0 to Ox3ff is of Registers type matching onchip internal HCS12 10 Registers In the Type column 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 mapped by the DMM If No the DMM considers the range is if it was not defined at all NOTE Note that all which is NOT defined is considered by the DMM as NOT accessible not implemented The debugger will display some in the Memory window in that case and for sure the DMM will NEVER try attempt to read or write unimplemented memory The Comment column contains a text information
328. e 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 executable file but its extension is ort ORTI File Structure The ORTI file structure builds on top of the structure of the OSEK OIL file It consists of the following parts Version Section This section describes the version of the ORTI standard used for the current ORTI file Implementation Definition Section This section describes the method that should be used to interpret the data obtained for the value This section may also detail the suggested display name for a given attribute Application Definition Section This section contains information on all objects that are currently available for a given system This section also describes the method that shall be used to reference or calculate each required attribute This information shall either be supplied as a static value or else a formula that shall be used to calculate the required value OSEK RTK Inspector Component OSEK awareness is described through the Code Warrior RTK Inspector component as shown in Figure 5 2 on page 185 Inspector window is displayed by clicking on Component gt Open menu
329. e specific to individual debugger connections This book is divided into the following chapters Chapter 4 1 Debugger Engine Commands on page 487 Chapter 4 2 Debugger Connection specific Commands on page 599 HC S 12 X Debugger Manual 485 Book IV Contents 486 HC S 12 X Debugger Manual 20 Debugger Engine Commands 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 component that you can read in each component window title 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 you will read Register or Memory If you open a second Memory component window the initial one will be renamed Memory 1 and the new one wi
330. e 431 BDI Initialization List 432 BDI Startup Init List 432 BDI Working Mode 434 BDI1000 427 BDICONF 656 BDI HS 427 BDIK BDIK Flash Programming with BDI 445 BDIK Target Interface Dialogs 438 439 440 BDIK Terminal Emulation with BDI 443 Menu Entries 437 BDIK Command Files 438 BDIK Communication 437 439 BDIK Connect 437 439 BDIK Help 438 BDIK Load 437 438 BDIK Reset 437 BDIK Set Bank 438 BDIK Setup 440 BDIK Flash Programming with BDI 445 BDIK Target Interface Dialogs 438 439 440 BDIK Terminal Emulation with BDI 443 BDM connector port 429 BDM port 236 428 Bin 70 81 106 200 Binary 200 203 Bit Reverse 82 106 Bitnumber to Display 141 blank 472 473 BLCD 285 Blocks 470 Bottom 135 Bounding Box 137 Box configuration 430 BREAKPOINT 442 Breakpoint 49 112 BREAKPOINT 442 Checking condition 151 Command 160 Conditional 158 176 Counting 157 176 Definition 147 Deleting 159 Multiple selection 151 HC S 12 X Debugger Manual Permanent 147 Position 154 Temporary 147 155 breakpoint 441 659 Breakpoint banked hardware 441 Breakpoint with Register Condition 158 159 Breakpoints 23 BRLD 320 BS 513 BSPL 320 BTST 320 Bus Trace 422 Byte 81 Byteflight 285 C C 10 CALL 317 515 Call Chain 96 Capture 318 Capture Compare Timer 319 Capture Stimulation 318 Cascade 33 CD 516 CF 517 CFORC 319 CLOCK 519 Clock and Reset Generator 294 Clone Attributes 135 CLOSE 519 Cmd 10 CMDFILE 5
331. e 587 address count Traces program instructions at the specified address WB on page 595 range list Writes bytes WL on page 597 range lis Writes longwords WW on page 597 range list Writes words Environment Commands Simulator Debugger environment commands are used to monitor the debugger environment specific component window layouts and framework applications and targets Table 20 3 on page 491 contains all available Environment commands Table 20 3 List of Environment Commands Command Syntax ACTIVATE on page 498 component Short Description Activates a component window AUTOSIZE on page 509 onloff Autosizes windows in the main window layout BCKCOLOR on page 511 color Sets the background color CLOSE on page 519 component HC S 12 X Debugger Manual Closes a component 491 Debugger Engine Commands Commands Overview Table 20 3 List of Environment Commands continued Command Syntax DDEPROTOCOL on page 525 ONIOFFISHOWIHIDEISTATUS Short Description Configures the Debugger Simulator DDE protocol FONT on page 540 fontName size color Sets text font LOAD on page 551 applicationName Loads a framework application code and debug information LOADCODE on page 552 applicationName Loads the code of a framework application LOADSYMBOLS on page 552 applicationName Loads debugging inf
332. e Clock and Reset Generator CRG The simulated parts of the CRG are the PLL RTI and COP Additional features of the CRG such as hardware failures of the oscillator system are not simulated The PLL output clock frequency PLLCLK 2 OSCCLK SYNR 1 REFDV 1 The PLL block is considered as a frequency converter other functionality of the PLL in the hardware have been ignored Reference Clock The reference clock of the CRG module is CLK24 given at the output The CLK3 and CLK23 clocks are not simulated When PLLSEL is set to 0 the oscillator clock frequency used by the RTI and COP is the same as the reference clock frequency When PLLSET is set to 1 OSCCLK frequency CLK24 REFDV 1 2 SYNR 1 As some systems might not work for a CLK24 frequency less than the OSCCLK frequency on the hardware the simulation does not accept it and a warning message is generated Any OSCCLK frequency set to be greater than the CLK24 frequency will have the same frequency as the CLK24 Blocks PLL Phase lock Loop The clock divider functionality of the PLL are simulated this includes the REFDV and the SYNR registers and the PLLSEL bit in the CLKSEL register HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Changing the value of the PLLSEL bit will automatically update the COP and the RTI events this may cause cycle irregularities as described in the manual For proper use
333. e Coverage component is closed or if you open the split view Popup 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 53 on page 99 shows the Profiler Menu entries with the Details submenu and the Base submenu Figure 3 54 on page 99 shows the Profiler Output File submenu Entries are described in Table 3 28 on page 99 Figure 3 53 Profiler Menu and Submenus Besse l Source Details gt Assembly Base gt v Total Code wv Graphics Modus Timer Update Output File gt Figure 3 54 Profiler Output File Submenu Filter Save As Table 3 28 Profiler Menu Entries Description Menu Entry Description Reset Resets all statistics Details Sets a split view in the chosen component Source or Assembly Base Sets the base of percentage total code or module code Graphics Toggles the display from graphics bar HC S 12 X Debugger Manual 99 Debugger Components General Debugger Components Table 3 28 Profiler Menu Entries Description continued Timer Update Switches on off the periodic update of the Coverage component If activated statistics are updated each second Output File Setup the Profiler Output File Functions on page 100 Split View Associated Popup Menu Figure 3 5
334. e View Run HCS12FCS Component Memory Window Help mr Load Ctri L Reset Ctrl R Set Derivative D Profiles RTH Configure void main pecet RAM put y Reset MEM Reset Statistic Zt ini puerum r leave this function P a Close IOs Clock Frequency Command Files Bus Trace IP Procedure I9 A AAA A A AX IX col IP 130800 HC S 12 X Debugger Manual 259 HC S 12 X Full Chip Simulation Connection Table 11 1 Simulator Menu Entry Description Menu Entry Description Load Opens the Load Executable Window menu Reset Resets the Full Chip Simulation Set Derivative Selects the current simulated derivative Configure Opens the Memory Configuration on page 263 Window Reset Ram Resets the RAM to undefined Reset Mem Resets all configured memory to undefined Reset Statistic Resets the statistical data Load I Os Opens I O components Close I Os Closes I O components Clock Frequency Open the Clock Frequency Setup on page 269dialog box to set the Real Time clock of the Full Chip Simulation Command Files Opens the Command File Window on page 262 Bus Trace Opens the Bus Trace on page 270 dialog box to enable instructions and memory accesses recording and display recording captures Debugger Status Bar with Full Chip Simulation The status bar Figure 11 2 on page 260 and Fig
335. e data component The same variables are always displayed in the data component Update Rate Dialog Box The Update Rate dialog box shown in Figure 3 25 on page 72 allows you to modify the default update rate using steps of 100 ms HC S 12 X Debugger Manual 71 Debugger Components General Debugger Components Figure 3 25 Update Rate Dialog Box Update Rate x Rate 100 ms Cancel Options Submenu The Options Submenu is activated by highlighting the Options entry on the Data menu Figure 3 26 Options Submenu Pointer As Array Name Width Pointer as Array Option In the Data menu s Options submenu choose Options gt Pointer as Array to open the dialog box shown in Figure 3 27 on page 72 Figure 3 27 Pointer as Array Dialog Box 72 Pointer As Array x M Display Pointer As Array fd Number of Items in Array 1 1000 Cancel Hep 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 Name Width Option In the Data Menu s Options submenu choose Options gt Name Width to open the dialog box shown in Figure 3 28 on page 73 HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 2
336. e memory mapping However the usage of these commands should be limited to special debugging purposes as the default mapping is typically sufficient and a script setup being complex and possibly leading to debugger disfunctions ADD parameters EL module handle DELETEALLMODULES D SAVE lt mcuid gt R ELEASECACHES CACHINGON CACHINGOFF HCS12MERHANDLINGON HCS12MERHANDLINGOFF D D D D D D D D D BBEBEBEBEEB BS OPENGUI mcuid DMM Command Syntax DMM Purpose Displays in the Command window the current DMM Memory Types Overlap Priorities and memory memory ranges DMM ADD command Syntax DMM ADD lt comment gt lt address gt lt size gt lt handle gt lt type gt lt cache locking gt lt priority gt lt mapping gt lt access while running gt with on lt comment gt a string for Comment field must be used for space lt address gt the start address of the memory range lt size gt the size of the memory range lt handle gt a long value for the DMM to handle the memory range duplicated handled is not allowed HC S 12 X Debugger Manual Debugger Connection specific Commands DMM Commands WARNING User defined handles must be a value superior or equal to 100 type a value corresponding to a memory type handle as given listed with the DMM command cache locking a 0 or 1 value 0 forcing t
337. e register Simulated TCNT timer count register Simulated TCTL4 and TCTL2 timer control register output Simulated TCTL3 and TCTL4 timer control register input Simulated TMSK1 timer interrupt mask Simulated TMSKz2 timer interrupt mask Simulated bits TOI overflow interrupt TCRE timer counter reset enable PR2 PR1 PRO prescaler TFLG1 main timer interrupt flag Simulated TFLG2 main timer interrupt flag Simulated TCO to TC7 timer input capture output compare registers Simulated HC S 12 X Debugger Manual 319 HC S 12 X Full Chip Simulation Connection Supported Derivatives 320 Serial Communication Interface SCI This I O Device simulates the two SCI signals SCIO and SCI1 The non memory mapped registers SCIInput SCIInputH and SerialInput send characters to the SCI Module The non memory mapped registers SCIOutput SCIOutputH and SerialOutput contain the characters sent from the SCI Module Related registers SCOBDH SCIBDH SCI Baud Rate Register High bit 7 BTST Reserved for test functions Not simulated bit 6 BSPL Reserved for test functions Not simulated bit 5 BRLD Reserved for test functions Not simulated bit 4 0 SBR SCI Baud Rate Simulated SCOBDL SC1BDL SCI Baud Rate Register Low bit 7 0 SBR SCI Baud Rate Simulated SCOCR1 SC1CR1 SCI Control Register 1 bit 7 LOOPS LOOP Mode Not simulated bit 6 WOMS Wired Or Mode Not simulated bit 5 RSRC Receiver Source Not simulated
338. e setup dialog in the Debugger by clicking on the DA C Link component and choose DA C Link gt Setup from the main menu The Connection Specification dialog box is opened Figure 9 18 on page 230 Figure 9 18 DA C Connection Specification Dialog Box Connection Specification Ea HIWARE HI WAVE 6 0 OK o cmn Hee Compare the Debugger Name from this dialog box with the selected Debugger in DA C IDE Options gt Debugger as shown in Figure 9 19 on page 231 230 HC S 12 X Debugger Manual Synchronized Debugging Through DA C IDE Troubleshooting Figure 9 19 DA C Debugger Options Dialog Box Debugger Options f HIWARE HI WAVE 6 0 CAHIWARESWORKSMESKCS fibo abs Both must be the same If it s not the case change it in the Debugger Connection Specification and click OK This implies a new connection to be established and the Connection Specification to be saved in the current Project ini file in the section shown in Listing 9 4 on page 231 Listing 9 4 DA C Section in Project File DA C DEBUGGER NAME HI WAVE 6 0 SHOWPROT 1 HC S 12 X Debugger Manual 231 Synchronized Debugging Through DA C IDE Troubleshooting 232 HC S 12 X Debugger Manual Book Il HC S 12 X Debug Connections 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
339. e simulator as a connection HC S 12 X Debugger Manual 93 Debugger Components General Debugger Components Module Component The Module window shown in Figure 3 48 on page 94 gives an overview of source modules building the application Figure 3 48 Module Window i Module oj x calc c terminal c termport c inout c startup c 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 25 on page 95 shows the drag actions possible from the Module component 94 HC S 12 X Debugger Manual Debugger Components General Debugger Components Table 3 25 Module Component Drag Possibllities Destination Component Action Window Data Global Displays the global variables from the selected module in the data component Memory Dumps memory starting at the address of the first global variable in the module The memory area where this variable is located is selected in the memory component Source Displays the source code from the selected module Drop Into
340. e toolbar is hidden Title bars can be shown or hidden with the following syntax Hidetitle 01 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 NOTE Target specific environment variables can also be defined in the PROJECT INT file Refer to the specific target manual for details Ini File Activation When a project file PROJECT INT is activated the following occurs from first action to last The old Project file is closed Target Component is unloaded The environment variable Path is added from the Project file Select HI WAVE section to retrieve value from e if an entry Windows0 or Target can be retrieved from section HI W AVE then use HI WAVE e else if an entry Windows0 or Target can be retrieved from section DEFAULTS then HC S 12 X
341. e you close the dialog box you can load your application and start a simulation Open Memory Block Click the Open button to load a memory blocks file The Open Memory blocks standard dialog box appears Select a memory map file then click the OK button The dialog box closes and the system loads the memory blocks file The Mode combo box changes to indicate the mode contained in the memory map file The list box lists the memory blocks loaded from the file selecting the first memory block Appropriate data appears in the fields Name Type Start End Wait state Bus width and Access Details Save Memory Block Click the Save button to store the current memory blocks configuration The Save Memory blocks standard dialog box appears Enter a file name then click the OK button The dialog box closes and the system stores the memory block configuration into the file Memory Check Options The Memory Check group box consists of three checkboxes all checked when you bring up the Memory Configuration dialog box Stop if no memory Check this box to have the Full Chip Simulation stop upon an access to non existent memory If you do not want the Full Chip Simulation to stop clear this checkbox Stopon read undefined Check this box to have the Full Chip Simulation stop upon a read of undefined memory If you do not want the Full Chip Simulation to stop clear this checkbox Stop on write protected Check this box t
342. ebugger D Profiles RTHO2c My Documents MyProji Simulator ini File View Run Simulator Component Source Window Help pisaj e 2 s see 9 lal xi a D Profiles RTHO2c My Documents WMyProiNS ources main c ILine 1 include lt hidef h gt common defines and macros 3 8 include mc68hc912dg128 h derivative information C003 CALL 0x8004 0x00 pragma LINK INFO DERIVATIVE mnc68hc912dgl28 coo CALL Ox8000 0x00 COOB BGND cooc BGND COOD SUBB 17 void main void A COOF SUBB 25 put your own code here EnableInterrupts ECE fort i SMa mait forever HCI2 CPU Cyce 0 o por a Dr m IX DFDF IY DFDF IP cooo pc cooo PPAGE 0 SP DFDD CCR SXHINZYC Startup I I Auto Symb Global startupData lt 6 gt _tagStartup 00080 00 00 uu wu 00 00 E SEG END SSTACK 0 array 0 of signed char 00088 00 00 00 00 00 00 00090 00 00 00 00 00 00 00098 00 00 00 00 00 00 I Auto Symb HC S 12 X Debugger Manual 13 Debugger Interface Debugger Main Window NOTE You can select menu commands by pressing the ALT key to select the menu bar then pressing the key corresponding to the underlined letter in the menu command Table 2 1 on page 14 describes menu entries available in the menu bar Table 2 1 Description of the Main Menu Toolbar Entries Menu Entry Description File Contains entries to manage debugger
343. ebugger Manual 631 Book V Contents 632 HC S 12 X Debugger Manual 22 Debugger Engine Environment Variables This chapter describes the environment variables that the Debugger uses Other tools such as the Linker also use some of these environment variables For more information about other tools see their respective manuals Click any of the following links to jump to the corresponding section of this chapter Debugger Environment on page 634 Local Configuration File usually project ini on page 637 ABSPATH Absolute Path on page 644 DEFAULTDIR Default Current Directory on page 645 ENVIRONMENT Environment File Specification on page 646 GENPATH include File Path on page 647 LIBRARYPATH include lt File gt Path on page 648 OBJPATH Object File Path on page 649 TMP Temporary directory on page 650 USELIBPATH Using LIBPATH Environment Variable on page 651 Search Order for Source Files on page 652 Debugger Files on page 652 HC S 12 X Debugger Manual 633 Debugger Engine Environment Variables Debugger Environment Debugger Environment Various parameters of the Debugger may be set using environment variables The syntax is always the same Parameter KeyName ParamDef NOTE Do not use blanks in the definition of an environment variable For example GENPATH C INSTALL LIB D PROJECTS TESTS usr local lib home me my_project
344. ebugger to display the procedure activation stack in a symbolic way 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 Datal window AII the usual debugging functions are also available to inspect this task now including displaying the register contents Task Description Language 178 To perform debugging on any task a file named OSPARAM PRM has to be created and must be stored in one of the directories specified in GENPATH include File Path on page 647 The file OSPARAM PRM describes the algorithm to collect the context information for a specific task the PC SP DL SR and registers HC S 12 X Debugger Manual Real Time Kernel Awareness Task Description Language The following syntax has to be used to specify the algorithm in EBNF StatSequence Statement Statement Statement Assignment Err
345. ecified it looks for or edits the file in the current project directory i e when no path is specified the default directory is the project directory HC S 12 X Debugger Manual 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 gt 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 HC S 12 X Debugger Manual 497 Debugger Engine Commands Debugger Commands 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
346. ected FLASH_C000 C000 FFFF Enabled Blank Protected Unselected FLASH PAGE1T 18000 1BFFF Enabled Blank Protected Unselected FLASH PAGE2 28000 2BFFF Enabled Blank Unselected FLASH PAGE3 38000 3BFFF Enabled Blank Protected Unselected FLASH PAGEA 48000 4BFFF Enabled Blank Unselected FLASH PAGE5 58000 5BFFF Enabled Blank Unprotected Unselected FLASH PAGE6 68000 6BFFF Enabled Blank Unselected FLASH PAGE7 78000 7BFFF Enabled Blank Protected Unselected The updated display shows that FLASH PAGES is unprotected Select FLASH PAGES for programming in flash select 7 Arm for programming in gt flash arm Arm FLASH for loading Now you can load your application in load a my_page5 sx RUNNING Stop loading and disarm in gt flash disarm FLASH disarmed Halted 612 HC S 12 X Debugger Manual Debugger Connection specific Commands NVMC Commands Use the FLASH command to display the final state of the modules Listing 21 5 Display Module Final State in gt flash MCU clock speed 8025000 Module Name Address Range Status FLASH_4000 4000 7FFF Enabled Blank Unselected FLASH PAGEO 8000 BFFF Enabled Blank Unselected FLASH_C000 C000 FFFF Enabled Blank Protected Unselected FLASH PAGE 18000 1BFFF Enabled Blank Protected Unselected FLASH PAGE2 28000 2BFFF Enabled Blank Unselected FLASH PAGE3 38000 3BFFF
347. ected 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 HC S 12 X Debugger Manual first address selected Instructions corresponding to the selected memory area are greyed in the source component 41 Debugger Interface Highlights of the User Interface Dragging from Procedure Component Window Table 2 13 on page 42 summarizes dragging from the Procedure Component Table 2 13 Dragging from the Procedure Component Window Destination Action Component Window Data Local Displays local variables from the selected procedure in the data component Source Displays source code of the selected procedure Current instruction inside the procedure is highlighted in the Source component Assembly The current assembly statement inside the procedure is highlighted in the Assembly component Dragging from Register Component Window Table 2 14 on page 42 summarizes dragging from the Register Component Window Table 2 14 Dragging from the Register Component Window Destination Component Window Action Assembly Assembly component receives an address range scrolls to the corresponding instruction and highlights it Memory Dumps memory starting at the address stored in the selected register The corresponding address is selec
348. ection Environment Variables lees eus 655 Example dice I aspe eU peer diets 658 Banked Memory Location associated Environment Variables 660 ICD 12 Environment sses 0 0 0 0 cee I E E 663 ICD 12 Environment Variables 0 0 00 c eee eee eee eee 663 ICDPORT Variable 2 ere See eek ER RS ederet eus 663 BMDELAY Variable sleeeeeeeee e 664 Index 665 24 HC S 12 X Debugger Manual Introduction Manual Contents The HC S 12 X Debugger Manual consists of the following books Book 1 Debugger Engine defines the HC12 HCS12 and HC S 12 X common and base features their functionality and a description of the components that are avilable in the debugger Chapter 1 1 Introduction on page 5 Chapter 1 2 Debugger Interface on page 7 Chapter 1 3 Debugger Components on page 45 Chapter 1 4 Control Points on page 147 Chapter 1 5 Real Time Kernel Awareness on page 177 Chapter 1 6 How To on page 191 Chapter 1 7 CodeWarrior Integration Chapter 1 8 Debugger DDE Capabilities e Chapter 1 9 Synchronized Debugging Through DA C IDE Book 2 HC S 12 X Debugger Connections defines the connections available for debugging code written for HC12 CPUs Chapter 2 1 HC12 Debugging First Steps on page 235 Chapter 2 2 HC S 12 X Full Chip Simulation Connection on page 259 Chapter 2 3 P amp E Multilink
349. ector Priority ArbPrio Name Assignment ObjectId ObjectField Expression Name character Expression a standard ANSI C expression The expression accepts object identifiers previously defined ObjectSpec and ObjectField Time a number which represents a number of cycle ObjectSpec the name of an object as defined in Requirement specification for Object Pool Vector the exception vector number Priority the exception priority number ArbPrio the arbitration priority of the exception Start the number of cycle when the periodical event must be called for the first time after the initial time NbTimes the number of time the periodical event has to be called 0 infinity Remarks If bitRange is omitted all bits of the object register are affected If bitRange is specified the mask defined by this bitRange applies to the value calculated with the Expression Only the bits of the object register defined in the bitRange are affected by this value HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection True Time I O Stimulation Bits are numbered from right to left in a byte bit 7 is the most left bit So in bitRange noOfBits is always less or equal than StartBit 1 ObjectSpec is defined in Requirement specification for Object Pool as below ObjectSpec ObjectName FieldName ObjectName Ident Index FieldName IdentNum IdentNum
350. ed Derivatives Register Block Table 11 5 on page 302 shows the register block functionality You can move all I O registers according to the INITRG Register Block Mapping at offset 11 inside of the register block Table 11 5 MC68HC12A4 Register Block Register Register Initial Name Address Value 302 Lite Integration Module The Full Chip Simulation simulates many functions of the Lite Integration Module LIM including nterrupt handling Watchdog Periodic Interrupt General restrictions The Full Chip Simulation does not distinguish normal from special mode Accordingly it allows all write accesses as if the chip were in special mode Table 11 6 on page 303 includes restrictions relative to special registers and single bits of registers LIM Simulated Registers Table 11 6 on page 303 shows the LIM Simulated Registers HC S 12 X Debugger Manual Table 11 6 LIM Simulated Registers HC S 12 X Full Chip Simulation Connection Supported Derivatives Register Register Name Address Initial Value Remarks CLKCTL 0x0047 0x00 LCKF PLLON PLLS BCSC BCSB BCSA These CLKCTL bits control settings of the PLL But the Full Chip Simulation does not simulate the PLL so values of these bits have no effect RTICTL 0x0014 0x00 RSWAI The Full Chip Simulation does not support the CPU Clock stop so this bit of the RTICTL register has no effect RSBCK The Full Chip S
351. efer to the inDART HCS12 In Circuit Debugger Programmer for Freescale HCS12 Family FLASH Devices User s Manual from SofTec for communication hardware requirements and SofTec product installation ICD 12 Considerations In order to use the P amp E Cable 12 or P amp E BDN Multilink the drivers from P amp E must be installed on the host computer A parallel cable should be used for communication between the P amp E Cable 12 or BDM Multilink and the host computer The communication protocol between the P amp E cable 12 or BDM Multilink and the host is fully handled by the unit 12z dll target driver which is automatically loaded with the ICD 12 connection BDIK Considerations Ensure that your hardware target board incorporates a Background Debug Mode BDM port for CPU background interfacing with the BDI interface and the debugger Please check the technical specifications provided by the ABATRON User Manuals and Freescale One free serial communication port of your computer is required to communicate with the BDI interface You may need to set it up even if you will be using an Ethernet communication instead of an RS 232 serial communication 236 HC S 12 X Debugger Manual Debugging First Steps Using the Wizard To take the first steps toward debugging with CodeWarrior IDE using the stationery Wizard 1 Run the CodeWarrior IDE with the shortcut created in the program group 2 Choose the menu File New to create a new projec
352. efined 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 596 HC S 12 X Debugger Manual 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 that should be modified 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 OxOFFFFFOF This command fills up memory starting at address 0x2000 with the OxOFFFFFOF longword value The addresses 0x2000 to 0x2003 will be modified in WL 0x2000 2 OxOFFFFFOF This command fills up the memory area 0x2000 to 0x2007 with the longword value OxOFFFFFOF WW The WW command sets a specified block of memory to a speci
353. elow Figure 10 11 Component Menu Component Data Window Help Set Connection Fonts Background Color The Set Connection dialog box now appears HC S 12 X Debugger Manual 247 HC12 Debugging First Steps Loading the Full Chip Simulation Connection Figure 10 12 Set Connection Dialog Box Set Connection sens 5 0 d Abatron BDI HCS12 Serial Monitor 2 Set the Processor as HC12 and the Connection as Full Chip Simulation 3 Press the OK button The Debugger main menu entry bar for the connection now changes to HCS12 FCS Figure 10 13 HCS12 FCS Menu True Time Simulator amp Real Time Debugger D Profiles RTHO2c My Documents You have successfully switched connections to the FCS connection The values and use of each HCS12 FCS menu entry is explained in the Full Chip Simulation chapter of this manual 248 HC S 12 X Debugger Manual Loading the ICD 12 Connection To load the ICD 12 connection from within an existing project take the following steps 1 From the Debugger main menu select Component Set Connection as shown below Figure 10 14 Component Menu Component Data Window Help Open Fiserez NN EM Fonts Background Color The Set Connection dialog box now appears Figure 10 15 Set Connection Dialog Box Connection Menu Set Connection E Processor Connection Ps Multilink Cyclone Pro Cancel
354. en the computer and the BDI Syntax COMDEV COMn baudrate where n is the COM port number like 1 2 3 etc and where baudrate is 9600 19200 38400 57600 115200 according to the setup done in the ABATRON configuration application For the communication via an Ethernet COMDEV NETWORK ip_address port where ip_address is the IP address of the BDI box or bdiNet in the form XXX XXX XXx xxx and port is the bdiNet port usually 1 for BDI1000 and BDI2000 Default The default valueis COM1 57600 Description This variable defines the communication device between the computer and the BDI It is set according to the Communication Device edit box of the Communication Device Specification Dialog Box on page 436 HC S 12 X Debugger Manual 657 Connection specific Environment Variables Abatron BDI Connection Environment Variables Example COMDEV COM1 57600 COMPRESS Short Description Sets data transfer compression Syntax COMPRESS 1 0 Default The default value is 1 Description This variable sets the BDI download mode with data compression By default data compression is enabled for asynchronous communication channels With older computers it is possible that download speed is faster without data compression It is set according to the Use Data Compression check box of the Setup Dialog Box on page 440 Example COMPRI B SS 1 SHOWPROT 658 Short Description Set
355. ent 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 hexlbinldecludecloct VSCROLLPOS vposition HSCROLLPOS hposition COMPLEMENT nonelone Where vposition expression and hposition expression Example in gt Register lt ATTRIBUTES FORMAT BIN Contents of registers are displayed in binary format in the Register component window in gt Register lt ATTRIBUTES VSCROLLPOS 3 Scrolls 3 positions down The third line of registers is displayed on the top of the register component in gt Register lt ATTRIBUTES VSCROLLPOS 0 Returns to the default display The first line of registers is displayed on the top of the register component EFINE vpos 5 in gt Register lt ATTRIBUTES HSCROLLPOS vpos 502 Scrolls 5 positions right The second column of registers is displayed on the left of the register component in gt Register lt ATTRIBUTES HSCROLLPOS 0 Returns to the default display The first column of registers is displayed on the left of the register component in gt Register lt ATTRIBUTES COMPLEMENT One Sets the first complement display option All registers are displayed in reverse bit
356. ent 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 Delete button to remove the currently selected breakpoint Update button to Update all modifications in the dialog Add button to add new breakpoints specify the Address in hexadecimal when Hex format is checked or as an expression when Hex format is unchecked OK button to validate all modifications Cancel button to ignore all modifications Help button to open related help information Multiple Selections in List Box The list box allows you to select multiple consecutive breakpoints by clicking the first breakpoint then pressing the Shift key and clicking the last breakpoint you want to select The list box allows you to select multiple breakpoints that are not consecutive by clicking the first breakpoint then pressing the Ctrl key and clicking another breakpoint When multiple breakpoints are selected in the list box the name of the group box Breakpoint is changed to Selected Breakpoints When selecting multiple breakpoints the Address hex Name Condition Disable for condition Command Current and Interval controls are disabled When multiple breakpoints are selected the Disable and Temporary controls in the Selected breakpoints group box are
357. entries are described in Table 3 1 on page 50 HC S 12 X Debugger Manual 49 Debugger Components General Debugger Components Figure 3 4 Assembly Menu True Time Simulator amp Real Time Debugger D XProfilesxRTHO2cVMy Documents MyProj Simulator ini File View Run Simulator Component Assembly Window Help Startup COOC BGND COOD SUBB 17 COOF SUBB 25 COll BGND C012 BGND C013 BGND C014 BGND fod lea sele epe 9 laa el C003 CALL 0x8004 0x00 COO CALL 0x8000 0x00 COOB BGND Code Symbolic v Address v Absolute Address Format Freeze oooco 00 O4 OO 00 CO 00 00 00 oo0c s 00 04 00 00 CO 00 O0 00 OOODO uu uu uu uu uu uu uu 000D8 ANARA imi mmi mi mmi mi mmi mmi wm Table 3 1 Assembly Menu Description 50 Menu Entry Description Address Opens a dialog box prompting for an address Show PC Display Code Displays machine code in front of each disassembled instruction Display Symbolic Displays symbolic names of objects Display Address Displays the location address at the beginning of each disassembled instruction Display Absolute In a branch instruction displays the absolute address at the end Address of the disassembled instruction Setting Breakpoints Breakpoints can be set edited and deleted when using the popup menu Right click on any statement in the Source compone
358. enu True Time Simulator amp Real Time Debugger D Profiles RTHO2c My Do File View Run Simulator Component Data Window Help olea ele Zo Scope Mode gt Symb Global BE startupData 6 _tagSt Format E SEG END SSTACK 0 array Options B char Sort gt Table 3 8 Data Menu Entry Description Menu Entry Description Zoom Zooms in or out of the selected structure The member field of the structure replaces the variable list Scope Opens a variable display submenu Format Symb Hex hexadecimal Oct octal Bin binary Dec signed decimal UDec unsigned decimal display format Mode Switches between Automatic Periodical Locked and Frozen update mode Options Opens an options menu for data for example Pointer as Array facility Sort Opens a Sort Submenu from which you select criteria by which data can be sorted Scope Submenu The Scope Submenu is activated by highlighting the Scope entry on the Data menu 68 HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 21 Scope Submenu v Global Local User Table 3 9 on page 69 describes the Scope submenu entries Table 3 9 Scope Submenu Entries Menu Entry Description Global Switches to Global variable display in the Data component Local Switches to Local variable display in the Data component User Switches to User variable display in the D
359. ep 1 init all vars Usage TESTBOX lt String gt 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 onloff Components Profiler and Coverage components Example in gt TUPDAT on Lj 588 HC S 12 X Debugger Manual 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 on page 589 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 tes UNDEF test t 1 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 NOTE See also examples of the DEFINE on page 526 command 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 t
360. er 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 This can be used to speed up project application loading and programming from the IDE debug run The Flash Programmer will NOT check if blocks are programmed or erased FLASH SKIPSTATUSOFF removes the SKIPSTATUSON mode and therefore diagnostics are performed again FLASH NVMFREQUENCY frequency in Hz specify the Non Volatile Memory programming frequency in Herz typically the device bus speed after reset When used the Flash Programmer does not try to evaluate this speed and the debugger will gain 2 3 seconds at application loading time A value of 0 engages back the speed detection FLASH NVMIF2RELOCATE address informs the flash programmer that flash driver must be loaded in ram to a different place than default default is start of onchip ram This will provide more flexibility for EB386 Example 1 Layout device ram memory relocation The data to program buffer follwos the same address translation This command is Legacy and the FLASH NVMIF2WORKSPACE is more user friendly and performs a secured relocation A value of 0 resets the relocation FLASH NVMIFZWORKSPACE address address informs the flash programmer that flash driver must be loaded in ram
361. eral topics Table 23 1 Variable Description Parameters Topic Description Short Description Provides a short description of the variable Syntax Specifies the syntax of the variable in a EBNF format Default Shows the default setting for the variable Description Provides a detailed description of the variable and how to use it Example Small example of how to use the variable BDICONF Short Description Defines the ABATRON configuration tool file and path Syntax BDICONF ConfigurationToolFileNameandPath where ConfigurationToolFileNameandPathis the ABATRON configuration tool file name and path Default The default value does not exist The string Enter here the path to the ABATRON configuration tool is displayed in the edit box 656 HC S 12 X Debugger Manual Description This variable defines the communication device between the computer and the BDI It is set according to the BDI Box Configuration Tool Path edit box of the Setup Dialog Box The BDI Box Configuration Tool Path edit box can be set up with the path and application name of the configuration tool from ABATRON The application tool is automatically browsed when selecting the Abatron BDI Configure BDI Box menu entry and browsing for the application Otherwise press the Browse button to look for the tool Example BDICONF C tmp B10c12 exe COMDEV Short Description Defines the communication device betwe
362. es Anoutput 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 is connected to the ADC visualization screen Visualization Screen The visualization screen is a 200 point horizontal resolution screen The sinus signal period is deployed by default in red in the upper part of the screen shown in Figure 11 20 on page 331 and the signal generated by the DAC is displayed in blue in the lower part ADC The ADC is an 8 bit resolution converter generating unsigned values As we can see in Figure 11 21 on page 332 its entry is directly connected to the signal generator On the other hand the conversion order will be given by a timer not connected to the data bus it can not be set by software At the end of a conversion it sets the state bit This bit is automatically reset after read HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities DAC Also an 8 bit resolution converter whose output is connected to the visualization screen Its use is simplified we only have 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 it is useless to send more than 200 bytes to the converter ADC DAC Menu The ADC DAC menu shown in Figure 11 22 on page 333 contains all functions associated with the Adc Dac comp
363. es Step 4 Bean Selector Window The Bean Selector window offers the developer a list of beans to add to the project Some of the beans may not be usable with the version of CodeWarrior installed The Standard and Professional Editions offer a wider range of hardware and software beans than the Special Edition HC S 12 X Debugger Manual 391 HC S 12 X Full Chip Simulation Connection FCS Tutorials Select Bean Categories gt CPU internal peripherals gt Communication gt AsynchroSerial Figure 11 77 Bean Selector Window Selection of AsynchroSerial Bean Bean Selector Me x Bean Categories On Chip Peripherals Quick help gt amp CPU E CPU external devices Ej amp CPU internal peripherals Ej Communication S AsynchroMaster 59 amp sunchroSeriaf 8 Intemaliac 8 SPimaster 8 SynchroMaster 8 SynchroSlave Filter all CPU Licensed 8 o MotorolaCAN Help on Bean Help on Bean Selector 8 o AsynchroSlave Ma Ra RR Co ons S8 Intema 2C Delete Selected Template Step 5 Project Panel Window The Project Panel window shows and keeps track of the beans that have been created for this application This Panel is a tab of the Project Manager window A click on the next to a bean shows a list of methods and or events related to the bean A green tick indicate if the named methods or event is selected and a red cr
364. es 0x800 16 are highlighted In the Register Component The ATTRIBUTES command allows you to set the display and state options of the Register component window The FORMAT command sets the display format of register values The VSCROLLPOS command sets the current absolute position of the vertical scroll box the vposition value is in lines each register and bitfield have the same height which is the height of a line vposition is the absolute vertical scroll position The value 0 represents the first position at the top 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 unselects 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 HC S 12 X Debugger Manual 501 Debugger Engine Commands Debugger Commands in Dl Equival
365. eseeeeeeee ee 45 HC S 12 X Debugger Manual 2 Table of Contents Connection Components 0 0 cece es 46 Loading Component Windows 0 000 eee eee eee eee ee 46 General Debugger Components 0 0000 c eee eee eee 48 Assembly Component lees 49 Assembly Menu socle e y ee RR 49 Setting Breakpoints 0 0 0 eee eee 50 Associated Popup Menu 2 0 0 0 eee eee 51 Command Line Component 0 0 eee eee 54 Command Menu iuc iue e Ee eR Ee add eae dale 56 Cache SIZex cce ght ee bed oh ede he notes 57 Coverage Component speca ne a e a o a a eee eens 58 Coverage Operations 59 Coverage Mentis oos ctescet Reb egies PER ERA E TRI 59 Output Fe one LR ea ore eL uet Anis 60 Split View Associated Popup Menu 000 61 DA C Link Component s o rrererserero rii ritip eee eee 63 DA C Link Operation 0 0 0 I 63 DA C Link Ment eI ci vie ak ee eee ek See Bae PS 63 Drag Qut eee ox We i Se ee Sas EN 64 Drop Into cerko oie eee oe bes eee ORI ys ne OPER els 64 Demo Version Limitations 64 Data Component leue ee LER HR ee eee Ged 65 Data Operations 5 ss exei hu ges eee bee RI RON 65 Expression Editor i s esse ed es EY 66 Expression Command file 0 0 0 0 0 00 cee eee eee 67 Data Menu oom IRE eges esee que Oe de S 68 Scope S bm nu 4 chem IR pete e Rp 68 Format Submenu 0 0 0 0 eee cee ee 69 Format Selected amp All Su
366. ess ATTRIBUTES COMPLEMENT Select menu Memory gt 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 gt Mode ATTRIBUTES UPDATERATE Select menu Memory gt Mode gt Periodical Usage ATTRIBUTES list where list command command command FORMA T binloctlhexlsignedlunsigned WORD number ADR ONIOFF ASC ONIOFF ADDRESS address SPC address SMEM range SMOD module MODE automaticlperiodicall frozen UPDATERATE rate COMENT NONEIONE Example Memory lt ATTRIBUTES ASC OFF ADR OFF ASCII dump and addresses are removed from the Memory component window HC S 12 X Debugger Manual In the Inspector Component The ATTRIBUTES command allows you to set the display and state of the Inspector component window Usage ATTRIBUTES list where list2command command command COLUMNWIDTH columnname columnfield columnsize EXPAND name subname deep COLLAPSE name subname l SELECT name subname SPLIT pos MAXELEM ON OFF number FORMAT HexlInt 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 nterrupts interrupt list SymbolTableFunction function in
367. ess ENTER Figure 9 7 on page 221 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 DA C IDE Here you are able to add your own bitmap Figure 9 7 DA C Compiler Settings User Defined Actions XIf zzHasModuleE xt CunFile Message Not a module filel zzCancel 5 aveall c hiware prog cm68k exe CunFile if E xist edout zz Message No Messages found z Cancel XEmClr Compiler XErmGet edout Compiler Reset zCurrFile HC S 12 X Debugger Manual 221 Synchronized Debugging Through DA C IDE Configuring DA C IDE for Freescale Tool Kit Now fill in the Action Script field in order to associate related compiler actions Copy the following lines shown in Listing 9 1 on page 222 in the Action Script field and change the directory to where the compiler is located Listing 9 1 Script for Compiler Action Association SIf HasModuleExt CurrFile Message Not a module file Cancel SaveA11 c Freescale prog cm68k exe CurrFile Sif SExist edout Message No Messages found Cancel SErrClr Compiler sErrGet edout Compiler Reset CurrFile Click on OK to validate these settings Select Fibo c file Click on the Compiler button or from the main menu of DA C select
368. ess locates the port address value of the component various formats are allowed the default format is hexadecimal Ident is a known identifier its content will define the port address Components IT Keyboard component Example in gt ITVECT 0x400 The interrupt vector port address of the IT Keyboard is now defined at address 0x400 HC S 12 X Debugger Manual 621 Debugger Connection specific Commands Full Chip Simulator Commands 622 KPORT The KPORT command is used to set the line and column ports addresses of the Keyboard component Usage KPORT address ident address ident address ident Address locates the port address value of the component many formats are allowed The default format is hexadecimal Ident is a known identifier its content will define the port address Components Keyboard component Example in gt KPORT 0x100 0x200 0x300 The ports of the Keyboard are now defined at addresses 0x100 0x200 and 0x300 LCDPORT Description The LCDPORT command is used to set the data port and the control port address of the Lcd component Usage LCDPORT address ident address ident address ident Address locates the port address value of the component many formats are allowed the default format is hexadecimal Ident is a known identifier its content will define the port address Components Lcd component Example in gt LCDPORT 0x100 0x200 T
369. expression in the Data window as if it was entered through the Expression Editor of the Data component Refer to Data Component on page 65 Expression Editor on page 66 Module Displays the global variables from the selected module in the data component Demo Version Limitations Only 2 variables can be displayed Only 2 members of a structure are visible when unfolded Only 1 expression can be defined Associated Commands ADDXPR on page 499 ATTRIBUTES on page 499 DUMP on page 529 PTRARRAY on page 567 SMOD on page 579 SPROC on page 581 UPDATERATE on page 592 ZOOM on page 598 HC S 12 X Debugger Manual 77 Debugger Components General Debugger Components Memory Component The Memory window shown in Figure 3 32 on page 78 displays unstructured memory content or memory dump i e continuous memory words without distinction between variables Figure 3 32 Memory Window 78 imi Memory Ioj x Init 8000 802C 00008018 FE 80 47 EC G m 0000801C 31 27 OD ED 1 00008020 31 18 OA 30 1 0 00008024 00008028 0000802C Various data formats byte word double and data displays hexadecimal binary octal decimal unsigned decimal can be specified for the display and edition of memory content Watchpoints can be defined in this component NOTE Refer to Control Points on page 147 for more information about watchpoints Memory areas can be initialized with a fill pattern using t
370. f the new features that come of the latest release of the communication DLL from I Logix HC S 12 X Debugger Manual 91 Debugger Components General Debugger Components To ensure proper communication between Rhapsody in MicroC and the external debugger HI WAVE from Freescale formerly HIWARE two files have to be installed in the prog subdirectory of the CodeWarrior installation microc wnd This is the HI WAVE component that has to be loaded in order to configure the communication parameters and mode of operation This component requires the amc communication dll dll to be loaded properly if this DLL is missing there will be an error message that a library is missing amc communication dll dll This DLL implements the actual protocol over TCP IP This DLL is delivered together with the RiMC and has to be copied into the prog subdirectory of the CodeWarrior installation this DLL will not be installed with the CodeWarrior product The Product Version of this DLL has to be RiMC 3 0 of higher Changes and New Features The new DLL from I Logix allows now implementing the Graphical Back Animation with fewer resources on the target system so only one single breakpoint is required in synchronous mode and even none in asynchronous mode There are now two modes of operation Synchronous This mode corresponds to the legacy implementation and lets RiMC update the state whenever a change of state is detected on the tar
371. f we send a 48 character string after initialization the bytes will be stored 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 are displayed Sending Information to the Display Two steps are necessary to send a character to the display 1 Put the bits E and RS at 1 and the bit R W at 0 control word 00000100b 2 Write the character ASCII code on the data port Put bit E at 0 this validates bits d7 d0 For an instruction only step 2 is different the Byte to write on the data port is the instruction code the display controller should execute Instruction Listing Figure 11 33 on page 341 lists the instructions available for the LCD component 340 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 33 LCD DisplayComponent Instruction Listing ode Instruction Description gems a ae a Te s 0 0 0 Clear Display EGOS Erases the display and put AC at 0 Puts the address 00h into AC and re init Return Home the display Entry Mode Set Fixes the moving direction of the cursor Lights on or off the display and shows or Display On Off Control not the cursor Cursor or Display Shift Moves the cursor and shifts the display Set DDRAM Address Fixes the AC value Fixes the data exchange width and the Function Set li
372. fied 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 HC S 12 X Debugger Manual 597 Debugger Engine Commands Debugger Commands Components Debugger engine Example in WW 0x2000 0x200F OxAF00 This command fills up the memory range 0x2000 0x200F with the OxAFOO 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 on page 591 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 NOTE This command is relevant when C source debugging Usage ZOOM address inlout Where address is the address of the structure or pointer variable that should be zoomed in or zoomed out respectively Components Data component Example in gt ZOOM Ox1FEO in
373. fined in the file MCUTOOLS INI located in the Windows directory Defining the Default Directory in the MCUTOOLS INI When starting from the desktop or Start menu the working directory can be set in the configuration file MCUTOOLS INI The working directory including the path is defined in the environment variable DefaultDir in the Options group or WorkDir WorkingDirectory 192 HC S 12 X Debugger Manual How To How To Start the Debugger How To Start the Debugger This section describes various ways to start the Debugger From WinEdit The Debugger can be started by selecting Project gt Debug or clicking the Debugger icon bug in WinEdit tool bar when configured The Window looks like Figure 6 1 on page 193 Figure 6 1 Debugger After Startup True Time Simulator amp Real Time Debugger D ProfilesRTHO2cMy DocumentsMyProj Simulator ini File View Run Simulator Component Memory Window Help 5 c e 5 B5 s ziej gt xz se e Hsec E aa D Profiles RTHO2c My Documents MyProj Sources main c Line 1 include lt hidef h gt common defines and macros CODO E 48 include mc68hc912dg128 h derivative information 8004 0x00 pragma LINK INFO DERIVATIVE mc68hc912dg128 coo CALL Ox8000 0x00 COO0B BGND cooc BGND COO0D SUBB 17 void main void E COOF SUBB 25 put your own code here BIET fort 3 SMA wait forever HC12 CPU Cycles 0 Auto D pFbF a DF B DF IX
374. ft mouse button 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 156 HC S 12 X Debugger Manual Control Points Setting Breakpoints 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 Setting Counting Breakpoints Counting breakpoints can only be set using the Controlpoints Configuration Window Breakpoints Tab on page 150 There are two ways to set a counting breakpoint A Holding down the left mouse button pressing the S key 1 Point at a C statement in the Source window and holding down the left mouse button 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 B Using the Source Popup Menu 1 Po
375. g its checkbox and clicking the Next button to proceed You can make multiple selections which makes multiple connections available in the Debugger Main Screen later Selecting any of the options results in the following conditions Full Chip Simulation Connects to Freescale Full Chip Simulation with simulation of on chip peripherals With this selection you can switch to hardware debugging later in the debugging session P amp E Multilink Cyclone Pro Connects to the P amp E BDM Multilink USB and Parallel or to P amp E Cyclone Pro USB Serial and TCP IP Choose this connection for ICD 12 debugging Softec HCS12 Connects to any of the USB based SofTec Microsystems tools for the HC12 in Dart HCS 12 etc Abatron BDI Connect to the hardware board using Abatron hardware BDI HS or BDI 1000 through the BDM connection HCS12 Serial Monitor Connect to a board through the Freescale HCS12 Serial Monitor The Freescale HCS12 Serial Monitor must be on the board before you connect HC S 12 X Debugger Manual 245 HC12 Debugging First Steps Debugging First Steps Using the Wizard 15 Click on the Finish button the IDE opens 16 In the IDE main window toolbar Project menu choose Project gt Make 17 Now choose Project Debug to start the debugger Figure 10 10 Your Project in Debugger Main Window True Time Simulator amp Real Time Debugger 1 File View Run Simulator Component Source Window Help seal e x
376. g paragraphs Full Chip Simulation Considerations The Full Chip Simulation FCS connection runs a complete simulation of all processor peripherals and I O on the user s PC No development board is required Each derivative has a totally different simulation engine to accurately simulate the memory ranges I O and peripherals for any given derivative HCS12 Serial Monitor Considerations The 8 16 bit debugger and then the CodeWarrior IDE might be connected to HCS12 hardware using the HCS12 Serial Monitor connection This connection supports communication specifications described in the application note from Freescale When the debugger runs the HCS12 Serial Monitor connection it can communicate and debug hardware running the HCS12 Serial Monitor in full compliance with the Freescale HC S 12 X Debugger Manual 235 HC12 Debugging First Steps Technical Considerations Application Note specifications Please refer to this Application Note for communication hardware requirements SofTec HCS12 Considerations The 8 16 bits debugger and then the CodeWarrior IDE might be connected to HCS12 hardware using the SofTec HCS12 When the debugger runs the SofTec HCS12 connection it can communicate and debug CPUI2 HCS12 core based hardware connected throught the SofTec in circuit debugger programmer units i e SofTec Microsystems HCS12 ISP Debuggers Programmers inDART Series and Starter Kits AK SK PK ZK and newer Series Please r
377. ger engine Example in mem Type Addresses Comment IO 0 3F PRU or TOP TOP board resource or the PRU NONE A0 AF 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 558 HC S 12 X Debugger Manual 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 on page 595 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 OxFF The memory range between addresses 0x1000 and Ox100F is filled with the OxFF value HC S 12 X Debugger Manual 559 Debugger Engine Commands Debugger Commands 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
378. ger is located Then rename it to Ndapi d11 Debugger Properties Configuration In the DA C main menu choose Options gt Debugger the dialog box shown in Figure 9 11 on page 226 is opened Figure 9 11 DA C Debugger Options Dialog Box Debugger Options ALLLLUIAES 00 0 CAHIWARENSWORKNMBSKCMIbo abs 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 on page 227 is opened 226 HC S 12 X Debugger Manual Synchronized Debugging Through DA C IDE Debugger Interface Figure 9 12 DDE Debugger Setup Dialog Box Generic DDE Debugger Setup HIWARE HI WAYE 6 0 Ed Program to start C HIWARESPROGShiwave exe Specify the path to the hiwave exe file or use the Browse button then click on OK Debugger Project File Configuration Before configuring the project file close DA C Open Debugger for example from a shell and select File gt Open Project from the main menu bar Select the Project ini file from the currently defined working directory in our case C Freescale WORK lt processor gt c project ini We will now add in the layout of the project the Debugger DAC component dac wnd In the Debugger select Component gt Open from the main menu bar and choose Dac as shown in Figure 9 13 on page
379. get system This is implemented by setting a breakpoint on the target on a function that is called whenever that state of the application is changed When hit the state is sent to RiMC and the application is resumed immediately By concept this procedure will slow down execution of the target application dramatically Compared to the previous releases only one single breakpoint is required for this mode Asynchronous This is a new mode introduced in this release The state of the application will only sampled from time to time Thus this mode allows the application to run at full speed but will not update RiMC about each change of state Also it does not require any resources on the target system except that the target memory has to be accessible while the application is running The connections that support this mode are the HC S 12 X Freescale Full Chip Simulator and any Host connection HTI that uses the BDM of features dual ported RAM The Setup dialog was extended to reflect that additional modes 92 HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 47 Communication Specification Communication Specification E x m Link Parameters MicroC Host HostNamd These parameters have to match the definition in ID 6666 Rhapsody in MicroC RiMC Show Protocol use for troubleshooting only m State Reporting Mode Synchronous whenever a state changes it is reported back t
380. gging 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 amp 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 Demo Version Limitations on Components When the Debugger is started in demo mode or with an invalid engine license then all components that are protected with FLEXIm are in demo mode The limitations of all components are described in their respective chapter HC S 12 X Debugger Manual Debugger Interface This chapter describes the Debugger Graphic User Interface GUI Click any of the following links to jump to the corresponding section of this chapter ntroduction on page 7 Application Programs on page 7 Starting the Debugger on page 8 Debugger Main Window on page 11 Component Associated Menus on page 34 Highlights of the User Interface on page 37 Introduction The CodeWarrior IDE ma
381. ghlighted in the Assembly component Register Loads the destination register with the PC of the first instruction selected Data A selection in the Source window is considered as an expression in the Data window as if it was entered through the Expression Editor of the Data component please see Data Component on page 65 or Expression Editor on page 66 122 HC S 12 X Debugger Manual Debugger Components Visualization Utilities Drop Into Table 3 39 on page 123 shows the drop actions possible into the Source component Table 3 39 Source Drop Possibilities Source Component Action Window Assembly Source component scrolls to the source statements corresponding with the pointed to assembly instruction and highlights it Memory Displays high level language source code starting at the first address selected Instructions corresponding to the selected memory area are greyed in the source component Module Displays source code from the selected module Demo Version Limitations Only one source file of the currently loaded application can be displayed Associated Commands ATTRIBUTES on page 499 FIND on page 537 FOLD on page 540 FINDPROC on page 538 SPROC on page 581 SMOD on page 579 SPC on page 580 SMEM on page 578 UNFOLD on page 591 Visualization Utilities Besides components that provide the Debugger engine a well defined service dedicated to the task of
382. gister It connects the SCI to the terminal window but does not support the ninth bit A write access to SerialOutput has no specified meaning bit 7 0 data sent from SCI to terminal window HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities FCS 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 T O devices program variables and so forth The following components of the continuously growing set of visualization utilities belong to the standard Debugger installation WARNING The following visualization components can only be used with the Full Chip Simulation connection Analog Meter Component The Analog Meter window shown in Figure 11 13 on page 324 is a component that can be used as a basis for user provided debugger extension components It displays several input and output controls that can be manipulated with the mouse NOTE For legacy reasons the Analog Meter component is called Template HC
383. gital Converter on page 288 J1850 Bus BLCD on page 285 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 MC9S12DJ64 HC S 12 X Debugger Manual Analog to Digital Converter on page 288 J1850 Bus BLCD on page 285 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 281 HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 4 Supported Derivatives continued 282 Derivative Name MC9S12DP256B Modules Analog to Digital Converter on page 288 J1850 Bus BLCD on page 285 Clock and Reset Generator CRG on page 294 Enhanced
384. gram text is displayed as if the program block was empty When the folded block is unfolded the hidden program text reappears AII 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 Description FONT sets the font type size and color Equivalent Operation The Font dialog is available by selecting the Component Fonts Usage FONT FontName size color Components Debugger engine Example FONT Arial 8 BLUE The font type is Arial 8 points and blue menu entry HC S 12 X Debugger Manual FOR Description The FOR loop allows you to execute all commands up to the trailing ENDFOR on page 533 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 on page 526 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
385. he Fill Memory on page 83 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 on page 35 contains the procedure or variable name structure field and memory range matching the first selected memory word uu memory value means not initialized 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 HC S 12 X Debugger Manual Debugger Components General Debugger Components 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 ra
386. he help topic for this dialog Show Protocol NOTE If problems exist refer to the Troubleshooting on page 229 section in the DA C documentation Drag Out Nothing can be dragged out Drop Into Nothing can be dropped into the DAC Component window Demo Version Limitations None 64 HC S 12 X Debugger Manual Debugger Components General Debugger Components Data Component The Data window shown in Figure 3 18 on page 65 contains the names values and types of global or local variables Figure 3 18 Data Window i Data 1 OF Xx Address 803D Size 24 startup c Auto S Symb Ja startupData lt flags n Eee int E nain 0x8084 PFunc stack ffset 8190 unsigned int nofzero uts l unsigned int El pZero ut Ox804f Range E pZeroOut lt 4 gt Range E toCopyDownBeg Ox80ae Copy nofLibInits 32851 unsigned int 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 on page 35 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
387. he lower procedure is selected in the Source Window and Assembly Window Procedure Menu Figure 3 50 on page 97 shows the Procedure menu and its entries are described in Table 3 26 on page 97 HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 50 Procedure Menu v Show Values Show Types Table 3 26 Procedure Menu Description Menu Entry Description Show Values Switches to the display of function parameter values in the procedure component Show Types Toggles to the display of function parameter types in the procedure component Drag Out Table 3 27 on page 97 shows the drag actions possible from the Procedure component Table 3 27 Procedure Component Drag Possibilities Destination Component Action Window Data Local Displays the local variables from the selected procedure in the data component Source Displays source code of the selected procedure Current instruction inside the procedure is highlighted in the Source component Assembly The current assembly statement inside the procedure is highlighted in the Assembly component Drop Into Nothing can be dropped into the Procedure component Demo Version Limitations Only the last two procedures are displayed Associated Commands ATTRIBUTES on page 499 FINDPROC on page 538 HC S 12 X Debugger Manual 9 Pw Debugger Components General Debugger Components
388. he memory range to be refreshed after each debugger halting priority a value corresponding to an overlap priority handle value as given listed with the DMM command lt mapping gt a 0 or 1 value 1 enabling the memory range mapping lt access while running a 0 or 1 value 1 enabling the memory range access while running This last parameter can be internally disabled of no use depending to the memory type capability Purpose insert a new memory range in the DMM as if added via the DMM dialog user interface DMM DEL Command 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 DMM SAVE Command Syntax DMM SAVE lt mcuid gt with lt mcuid gt 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 DMM DELETEALLMODULES Command Syntax DMM DELETEALLMODULES Purpose removes all current DMM memory range modules Useful to start a scripted DMM setup HC S 12 X Debugger Manual 615 Debugger Connection specific Commands DMM Commands 616 DMM RELEASECACHES Command 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 DM
389. he ports of the Lcd are now defined at addresses 0x100 0x200 and 0x300 HC S 12 X Debugger Manual Debugger Connection specific Commands Full Chip Simulator Commands LINKADDR The LINKADDR command is used to set the components internal ports addresses used with the Programmable Couplers as memory buffers Usage LINKADDR address ident address ident address ident Address locates the port address value of the component many formats are allowed the default format is hexadecimal Ident is a known identifier its content will define the port address Components Couplers Adc Dac Keyboard IT Keyboard IO Led Lcd Push Buttons 7 segments display Wagon Example in LINKADDR 0x100 0x200 0x300 0x400 0x500 Now all components working with the Programmable Couplers have PortA set to 0x100 PortB set to 0x200 PortC set to 0x300 PortD set to 0x400 and PortE set to 0x500 PBPORT Description The PBPORT command is used to set the port address of the Push Buttons component Usage PBPORT address ident Address locates the port address value of the component various formats are allowed the default format is hexadecimal Ident is a known identifier its content will define the port address Components Push Buttons component Example in gt PBPORT 0x100 0x200 The ports of the Push_Buttons are now defined at addresses 0x100 and 0x200 HC S 12 X Debugger Manual 623 Debugger Connecti
390. he symbol has been replaced several times in gt DEFINE apple 0 in gt LS apple 0x0 0 apple is equal to 0 in gt DEFINE apple apple 1 in gt LS HC S 12 X Debugger Manual 589 Debugger Engine Commands Debugger Commands apple 0x1 1 apple is equal to 1 in DEFINE apple apple 1 in LS apple Ox2 2 apple is equal to 2 in UNDEF apple in LS apple no longer exists In the next example we assume that the FTBO 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 Ox1 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 gt undef counter 590 HC S 12 X Debugger Manual in LS User Symbols there is no user symbol Application Symbols fiboCount 0x800 counter 0x802 _startupData 0x84D Fibonacci 0x867 main 0x896 Init 0x810 Startup 0x83D 2048 2050 2125 2151 2198
391. his 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 will not be 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 lightgrey 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 gt BCKCOLOR LIGHTCYAN The background color of all currently open component windows is set to Lightcyan To return to the original display enter BCKCOLOR WHITE HC S 12 X Debugger Manual 511 Debugger Engine Commands Debugger Commands 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
392. hort Description Provides a short description of the variable Syntax Specifies the syntax of the variable in a EBNF format Default Shows the default setting for the variable Description Provides a detailed description of the variable and how to use it Example Small example of how to use the variable The following sections describe each variable available for the connection The variables are listed in alphabetical order BANKWINDOWn Short Description Contains a BANKWINDOW Command Line command to be used to set up the Banked Memory support Syntax BANKWINDOWn one BANKWINDOW Command Line command Default All available banked memory area are disabled by default The default PPAGE memory banked area is 0x8000 to OxBFFF 8 pages allowed with PPAGE register at address 0x35 The default DPAGE memory banked area is 0x7000 to Ox7FFF 256 pages allowed with PPAGE register at address 0x34 The default EPAGE memory banked area is 0x400 to Ox7FF 256 pages allowed with PPAGE register at address 0x36 The default settings for the VARIOUS page is that the bank window dialog is displayed automatically when connecting when settings are not done HC S 12 X Debugger Manual 661 Connection specific Environment Variables Abatron BDI Connection Environment Variables 662 Description The BANKWINDOWmn variable specifies a command file definition using BANKWINDOW Command Line command Three or four of those entrie
393. i T ann in ann x b 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 Associated Menus 34 Vaious Debugger Component windows are shown in Figure 2 3 on page 12 Each component window loaded by default or that you have loaded has two menus One menu is in the main menu and the other one is a popup menu also called Associated Popup Menu that you can open by right clicking in a window component Note that before right clicking the component window has to be active HC S 12 X Debugger Manual Debugger Interface Component Associated Menus Component Main Menu This menu shown in Figure 2 26 on page 35 is always between the Component entry and the Window entry of the Debugger main window toolbar It contains general entries of the current active component You can hide this menu by unchecking Window Options Component Menu Figure 2 26 Example of Component Main Menu File View Run PEDebug Component Source Window Help osal X 83 amp 9 X Open Source File Copy Ctrl C D Profiles RTHO2c My Documents nextun Go To Line Ctri G Line 209 BRA Loopo Find Ctrl F Find Procedure Ctrl I finished Folding a Marks a ToolTips else optimized
394. iable name from the Data Component to Memory component Holding down the left mouse button and pressing the A key 1 Point to a variable name in a Data Component 2 Hold the left mouse button down and press the A key The memory component scrolls until it reaches the address where the selected variable is allocated The memory range corresponding to the selected variable is highlighted in the memory component Load an Address Register with the Address of a Variable The Debugger allows you to load a register with the address where a variable is allocated 1 Drag a variable name from the Data Component to Register component The destination register is updated with the start address of the selected variable HC S 12 X Debugger Manual How To How To Work on the Register How To Work on the Register This section describes how to work with the Register component Change Format of Register Display The Debugger allows you to display the register content in hexadecimal or binary format 1 Right click in the Register component The Register Popup Menu is displayed on the screen 2 Choose Options from the Popup Menu The pull down menu containing the possible formats is displayed 3 Select either binary or hexadecimal format The format selected is valid for the Register component The contents from all registers are displayed according to the selected format Modify a Register Content The Debugger allows you to
395. ial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 MC9S12A64 Analog to Digital Converter on page 288 J1850 Bus BLCD on page 285 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on page 290 Flash FTS on page 290 Inter IC Bus IIC on page 286 Multiplexed External Bus Interface MEBI on page 293 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Voltage Regulator VREG on page 290 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 4 Supported Derivatives continued Derivative Name MC9S12C32 Modules Analog to Digital Converter on page 288 Clock and Reset Generator CRG on page 294 Flash FTS on page 290 Multiplexed External Bus Interface MEBI on page 293 Motorola Scalable CAN MSCAN on page 285 Port Integration Module PIM on page 294 Pulse Width Modulator PWM on page 299 Serial Communication Interface on page 286 Serial Peripheral Interface on page 288 Timer Module TIM on page 301 Voltage Regulator VREG on page 290 MC9S12D32 HC S 12 X Debugger Manual Analog to Digital Converter on page 288 Clock and Reset Generator CRG on page 294 Enhanced Capture Timer ECT on page 296 EEPROM EETS on
396. ial features of the Debugger The Introduction on page 5 Chapter introduces the Debugger concept The Debugger Interface on page 7 Chapter provides all details about the Debugger user interface environment i e menus toolbars status bars and drag and drop facilities The Debugger Components on page 45 Chapter contains descriptions of each basic component and visualization utility The Control Points on page 147 Chapter is dedicated to the control points and associated windows The Real Time Kernel Awareness on page 177 Chapter contains descriptions of the Real Time concept and related applications The How To on page 191 Chapter provides answers for common questions and describes how to use advanced features of the Debugger The CodeWarrior Integration chapter explains how to configure the Debugger for use with CodeWarrior The Debugger DDE Capabilities on page 211 describe the debugger DDE features The Synchronized Debugging Through DA C IDE on page 213 chapter explains the use of tools with the DA C IDE from RistanCase Book Contents 4 HC S 12 X Debugger Manual Introduction This section is an introduction to the Debugger from Freescale used in 8 16 bit embedded applications 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 indu
397. iated with specific components Table 20 5 on page 493 contains all available Component Specific commands Table 20 5 List of Component Specific Commands Command Syntax ADDXPR on page 499 expression Short Description Adds a new expression in the data component ATTRIBUTES on page 499 list Sets up the display inside a component window BASE on page 510 code I module Sets the Profiler base BD on page 512 Displays a list of all breakpoints CF on page 517 fileName LC ENL Executes a command file CLOCK on page 519 frequency Sets the clock speed COPYMEM on page 520 Source addr range dest addr Copies memory CYCLE on page 521 onloff Switches cycles and milliseconds in SofTrace component DETAILS on page 527 assemblylsource Sets split view DUMP on page 529 HC S 12 X Debugger Manual Displays data component content 493 Debugger Engine Commands Commands Overview Table 20 5 List of Component Specific Commands continued Command Syntax E on page 530 expression OIDIXICIB Short Description Evaluates a given expression EXECUTE on page 534 fileName Executes a stimulation file FILL on page 535 range value Fills a memory range with a value FILTER on page 536 Options lt range gt Selects the output file filter options FIND on page 537 string B MC EWW Finds and highlights a p
398. ic Selects Automatic mode default memory dump is updated when the connection is stopped Periodical Selects the Periodical mode memory dump is updated at regular time intervals when the connection 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 see below 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 37 on page 82 you can set the memory display address ascii Table 3 20 on page 83 describes the menu entries Figure 3 37 Display Submenu wv Address v ASCII 82 HC S 12 X Debugger Manual Debugger Components General Debugger Components Table 3 20 Display Submenu Description Address Allows you to toggle the display of address dump ASCII Allows you to toggle the display of ASCII dump Fill Memory The Fill Memory dialog box shown in Figure 3 38 on page 83 allows you to fill a memory range from Address edit box and to Address edit box with a bit pattern value edit box Figure 3 38 Fill Memory Dialog Box imi Memory Pl x 00000800 A3 A3 A3 A3 rem Memory a 00000808 00000810 A3 A3 A3 A3 from ddress 800 hee 00000818 A3 43 A3 3 00000820 A3 A3 3 3 to Address 1830 hex 00000828 3 43 A3 AS 00000830 43 18 OA 30 i Value 143 hex
399. icals must be validated for each customer application by customer s technical experts Freescale Semiconductor does not convey any license under its patent rights nor the rights of others Freescale Semiconductor products are not de signed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failure of the Freescale Semi conductor product could create a situation where personal injury or death may occur Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application Buyer shall indemnify and hold Freescale Semiconductor and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part How to Contact Us Corporate Headquarters Freescale Semiconductor Inc 7700 West Parmer Lane Austin TX 78729 U S A World Wide Web http www freescale com codewarrior Technical Support http www freescale com support Table of Contents Table of Contents Introduction Mantial Contents 3265
400. ick The Data Popup Menu is displayed 2 Choose Set Watchpoint from the Popup Menu A Read Write Watchpoint is defined 3 Point in the Data Component Window and right click The Source Popup Menu is displayed 4 Choose Show WatchPoints from the Popup Menu The Controlpoints Configuration window Watchpoints tab is displayed 5 Select the watchpoint you want to define as write access from the list 6 Select the Write type in the dropdown box 7 A write access watchpoint is defined for the selected variable Using the Left Mouse Button and Pressing the W Key 1 Point at a variable in the Data window and holding down the left mouse button press the W key 2 A write access watchpoint is defined for the selected variable Once a write access watchpoint has been defined you can continue program execution The application stops after the next write access on the variable Write access watchpoints remain active until they are disabled or deleted Defining a Read Write Watchpoint A yellow vertical bar is displayed in front of a variable associated with a read write access watchpoint The Debugger provides two ways to define a read write access watchpoint Using the Data Popup Menu Point at a variable in the Data window and right click The Data Popup Menu is displayed 2 Choose Set Watchpoint from the Popup Menu A Read Write Watchpoint is defined HC S 12 X Debugger Manual Control Points Setting Watchpoints
401. igh Display Value Defines the highest position of the indicator It defines the value on which the indicator reads 100 Indicatorlength Defines the length of the small indicator The minimal value is set to 20 Indicator Defines the color of the indicator The default color is red Marks Defines the color of the marks The default color is black Bar Instrument Using the Bar instrument values are displayed by a bar strip This instrument See Figure 3 87 on page 138 may be used as a position state of a water tank Figure 3 87 Bar Instrument Bar instrument attributes are shown in the Table 3 48 on page 138 Table 3 48 Bar Instrument Attributes Attribute Description Low Display Value Defines the zero point of the indicator The values below this definition will not be displayed High Display Value Defines the highest position of the indicator It defines the value on which the indicator reads 100 Bardirection Sets the desired direction of the bar that displays the value Barcolor Specifies the color of the bar Default color is red 138 HC S 12 X Debugger Manual Debugger Components Visualization Utilities Bitmap Instrument You can use the Bitmap instrument to give a special look to your visualization or to display a warning picture Figure 3 88 Bitmap Instrument PO C i f J i rreescaie semiconductor Additionally it can also be used as a bit
402. iles also include code applet descriptions of flash operations later text of this manual includes these descriptions You also may use the Command Line component to handle flash operations The VVMC Commands section explains the corresponding commands The NVMC dialog box has buttons for commands you can apply to each block These buttons are dynamic active if the operation is possible for at least one selected item disabled if the operation is not possible Select All Unselect All The Select All button selects all modules in the list box When the button got pressed the button changes to Unselect All that can be pressed to remove all current selections Enable Disable The Enable button enables all selected modules currently disabled The Disable button disables all selected modules currently enabled The possibility of enabling or disabling a flash module depends on the MCU features and context Protect Unprotect The Protect button protects all selected modules currently unprotected The Unprotect button unprotects all selected modules currently protected The possibility of protecting or unprotecting a flash module depends on the MCU features and context NOTE For some MCUs protection is possible only for the Boot section and boot routines not for the entire module Please see Hardware Considerations on page 478 for protection information about your CPU derivative Erase The Erase button rem
403. imulation does not simulate background mode so this bit of the RTICTL register has no effect RTIFLG 0x0015 0x00 COPCTL 0x0016 OxOF CME FCME FCM The Full Chip Simulation does not support these COPCTL bits writing to these bits has no effect COPRST 0x0017 0x00 INTCR Ox001E 0x60 The Full Chip Simulation does not distinguish normal from special mode IRQE The implementation allows any write access In normal mode there should be only one write to this register In special mode the system should ignore the first write access HPRIO 0x001F OxF2 The system may write to the HPRIO register if the mask in the CPU condition code register CCR is set The Full Chip Simulation does not simulate this fact Standard Timer Module TIM All functions of the timer module TIM are simulated General restrictions HC S 12 X Debugger Manual 3038 HC S 12 X Full Chip Simulation Connection Supported Derivatives The HPRIO register 001F may be written to if the I mask in the CPU condition code register CCR is set This fact is not simulated The external timer output occurs at the PORTT register This is done for testing purposes only and will be disabled in future versions Restrictions considering special registers and single bits of registers are mentioned in Table 11 7 on page 304 TIM Simulated Registers Table 11 7 on page 304 shows all TIM Simulate
404. in the file init cmd after loading the layout or project file Calling the command file from the project file Listing 6 2 on page 194 The project file where the layout and connection component can be saved File gt Save is a normal text file that contains command line commands to restore the context of a project This file once created by the save command can be extended by a call to the command file CALL INIT CMD When this project is loaded by the File gt Open command or by the corresponding entry in the Project file commands in this file are executed Listing 6 2 Calling a Command File from the Project 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 will execute the command file STARTUP CMD once the connection component is loaded and initialized By adding the call command file in 194 HC S 12 X Debugger Manual How To How To Load an Application this file for example CALL INIT CMD it will automatically execute when the connection component is loaded NOTE Refer to section How To Start the Debugger on page 193 How To Load an Application Choose Simulator gt Load The LoadObjectFile dialog box is opened MN Select an application for example FIBO ABS pa Click OK The dialog box is closed and the application is loaded in the Debugger Listing 6
405. in window acts as a container for windows of all the 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 windoe icons Application Programs The CodeWarrior installer places executable programs in the prog subdirectory of the CodeWarrior installation directory For example if you installed the CodeWarrior IDE software in C Freescale you would find all program files in the folder C Freescale prog The following list is an overview of files that CodeWarrior uses for C C debugging hiwave exe Debugger executable file HC S 12 X Debugger Manual 7 Debugger Interface Starting the Debugger hibase dll Debugger main function dll elfload dll Debugger loader dll wnd Debugger component tgt Debugger target file cpu Debugger CPU awareness file Starting the Debugger This section explains how you can start the debugger from within the Codewarrior IDE or from a DOS command line Starting from within the IDE There are two ways t
406. inDART HCS12 gt User s Manual option to open the inDART HCS12 In Circuit Debugger Programmer for Freescale HC12 Family FLASH Devices User s Manual from SofTec About Option Select the inDART HCS12 About option to display the About Dialog Box This dialog box belongs to the SofTec GDI DLL and provides information about the inDART_HCS12 dll release and version Figure 13 4 About Dialog Box Visit our website for more product information http www softecmicro com Model In Circuit Debugger Programmer for Freescale HCS12 Family Devices Version v 1 07 2 Copyright 2003 2005 SofTec Microsystems 416 HC S 12 X Debugger Manual 14 HCS12 Serial Monitor Connection Serial This section guides you through debugging with CodeWarrior and the HCS12 Serial Monitor connection It does not replace all the additional documentation provided in this manual but gives you a good start Monitor Technical Considerations The 8 16 bit debugger and then the CodeWarrior IDE might be connected to HCS12 hardware using the HCS12 Serial Monitor connection This connection supports communication specifications described in the application note from Freescale When the debugger runs the HCS12 Serial Monitor connection it can communicate and debug hardware running the HCS12 Serial Monitor in full compliance with the Freescale Application Note specifications Please refer to this Application Note for communication hardwa
407. indow the Connection heading has been renamed MultilinkCyclone Pro Click on this heading to display its menu with the list of options Figure 12 4 MultilinkCyclone Pro ICD 12 Menu e Time Simulator amp Real Time Debugger D Profiles RTHO2c My Documents Debbie P amp E Mult iew Run MultilinkCyclonePro Component Source Window Help Load Ckri L 1 Reset Ctrl R aes oxi Set Derivative Set Communication Speed Command Files sembly 1 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 MultilinkCycloneProl Reset triggers a reset of the connection and executes the command file reset cmg The menu selection MultilinkCyclonePro Connect takes you to the P amp E ICD 12 Multilink Cyclone Pro dialog box The two tabs of this dialog box allow you to set the Communications and Special Setup parameters for the P amp E Multilink Cyclone Pro connection Figure 12 5 P amp E ICDE 12 Multilink Cyclone Pro Connection Dialog Box Communication Special setup Communication Special setup den es T Set CLKSW bit in BDM control register MC9S12 only Communication Device eri 7 I Tat creci ihe A I IURE hol elonesrel At connection detect if the target is running Disable maskable ISA s when stepping When running insert controlpo
408. initializes the timer which gives the conversion orders Figure 11 24 Conversion Parameters Dialog Box Conversion parameters i Now you can start the conversion with Start conversion menu entries 334 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Display Properties Dialog Box This dialog box shown in Figure 11 25 on page 335 allows you to modify the display properties form the Adc Dac component The Up and Down buttons allow you to define the vertical position of the input and output curves Two control buttons allow you to change the axes scales Figure 11 25 Display Properties Dialog Box Moves the curve up Display properties Lx Moves The input curve The output curve Vertical position nput C Dulpul Down Moves the curve down Increases or decreases the number of period displayed Axis scales Increases or decreases Horizontal the graphic amplitude Quit the display Vertical settings _ ee ADC DAC Operations To convert a signal from an example application Load the application and the ADC DAC component Choose the ports address Define the input signal frequency Define the sampling frequency Start the application Nu P amp G T LP Choose Start Conversion Drag Out Nothing can be dragged out Drag Into Nothing can be dragged in HC S 12 X Debugger Manual 335 HC
409. ink to jump to the corresponding section of this chapter Debugger Configuration on page 209 Debugger Configuration To configure the Real Time Debugger and True Time Simulator in the CodeWarrior IDE open the Target Settings Panel by clicking on the Targets panel of the IDE main window then double clicking on the name of your target in the list displayed in this panel Then select Build Extras as shown in Figure 7 1 on page 210 In the Build Extras pane check the Use External Debugger checkbox 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 In the Arguments field type the arguments for example targetFilePath Target sim in the Argument field Click on Apply to validate these changes HC S 12 X Debugger Manual 209 CodeWarrior Integration Debugger Configuration Figure 7 1 IDE Target Window Build Extras Panel GB60E B LCD Demo Settings Target Target Settings Access Paths Runtime Settings File Mappings Source Trees Assembler for HCOS Bumer for HCOS Compiler for HC08 Importer for HC08 Linker for HCOS EF Editor Compiler progshiwave exe se Custom Keywords B Debugger ePath w Prodeflash ini instance BDM_HCS08 fe Other Executables Debug Stig 210 HC S 12 X Debugger Manual 8 Debugger DDE Capabilities Introduction The DDE is
410. int at a C statement in the Source window and right click The Source Popup Menu is displayed 2 Choose Set BreakPoint from the Popup Menu A breakpoint is defined on the selected instruction 3 Point in the Source window and right click again 4 Choose Show Breakpoints from the Popup Menu The Controlpoints Configuration Window Breakpoints Tab on page 150 is displayed 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 HC S 12 X Debugger Manual 157 Control Points Setting Breakpoints 158 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 1M Setting Conditional Breakpoints Conditional breakpoints can only be set from the Controlpoint Configuration window s Breakpoints tab There are two way
411. int from Popup Menu 1 In the Data window point to a variable where a watchpoint has been defined and right click The Data Popup Menu is displayed 2 Select Delete Watchpoint from the Popup Menu The watchpoint is deleted and the vertical bar in front of the variable is removed Using the Left Mouse Button and Pressing the D Key Point at a variable in the Data window and holding down the left mouse button press the D key The Watchpoints tab of the Controlpoints Configuration window is displayed 2 The watchpoint is deleted and the vertical bar in front of the variable is removed Choosing Show Watchpoints from Data Popup Menu Point in the Data window and right click The Data Popup Menu is displayed 2 Choose Show Watchpoints from the Popup Menu The Watchpoints tab of the Controlpoints Configuration window is displayed 3 Select the watchpoint you want to delete 4 Click Delete The selected watchpoint is removed from the list of defined watchpoints 5 Click OK to close the window The watchpoint is deleted and the vertical bar in front of the variable is removed Associate a Command with a Watchpoint Each watchpoint type read write read write counting or conditional can be associated with a debugger command This command can be specified in the Watchpoints tab of the Controlpoints Configuration window To open this window Choosing Show Watchpoints from Data Popup Menu 1 Point in the Data Componen
412. interrupt 10 times Starts execution 100000 cycles after the start of the simulation 10000 a 128 assigns 128 to a 10000 cycles after each start of the periodical event 30000 RAISE 7 3 test interrupt raises an interrupt with priority 3 with vector number 7 40000 cycles after each start of the periodical 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 of the periodical block The block is looped again after finishing So the loop restarts after 10000 30000 40000 cycles 1000000 RAISE 7 3 test interrupt raises the interrupt for the last time This instruction marks the terminating point of the Stimulation if there are no pending periodical events left HC S 12 X Debugger Manual 379 HC S 12 X Full Chip Simulation Connection True Time I O Stimulation 380 Stimulation Input File Syntax StimulationFile IdDeclaration TimedEvent PeriodicEvent IdDeclaration def ObjectId ObjectField ObjectField ObjectSpec BitRange BitRange StartBit NoOfBits TimedEvent d Time AssignmentList AssignmentList Assignment Exception PeriodicEvent PERIODICAL Start NbTimes PerTimedEvent END PerTimedEvent Time AssignmentList Exception RAISE V
413. ints to hardware onchip break module without halting the cpu When running discard all memory read accesses I Resynchronize from COP watchdog reset Show Protocol HC S 12 X Debugger Manual 409 P amp E Multilink Cyclone Pro Connection Loading the P amp E Multilink Cyclone Pro Connection The menu selection MultilinkCyclonePro Set Derivative takes you to the Set Derivative dialog box This dialog box allow you to choose the target MCU for the P amp E Multilink Cyclone Pro connection Figure 12 6 Set Derivative Dialog Box ST xi ac9si2xDT512 The menu selection MultilinkCyclonePro Set Communication Speed lets you control the various factors associated with communication speed for the P amp E Multilink Cyclone Pro connection Figure 12 7 Set Communication Speed Dialog Box Set Communication Speed xj r IQ DELAY COUNT 0 as clock divider Search IV Auto detect Use Search to find a valid IQ DELAY COUNT for CABLE12 16 oscillator frequency in MHz for CABLE12HS MULTILINK CYCLONE PRO 200 oscillator frequency in MHz 1 for USB 2 0 MULTILINK rev B 240 7 oscillator frequency in MHz 1 Cancel Help 410 HC S 12 X Debugger Manual P amp E Multilink Cyclone Pro Connection Default Connection Setup The menu selection MultilinkCyclonePro Command Files takes you to the Command Files window with its six tabs Figure 12 8 P amp E Multili
414. ion Environment Variables VERIFY 660 Short Description Sets data transfer verification Syntax VERIFY 0 1 2 3 with 0 for no verification at all fastest mode 1 for first byte verification only 2 for all data read back verification and 3 for only verification no write Default The default value is 1 Description This variable sets the BDI download mode with data verification By default use Verify only first option If necessary you can set a different option to improve transfer speed or security It is set according to the Data Transfer Verification radio buttons of the Setup Dialog Box on page 440 Example VERIFY 1 Banked Memory Location associated Environment Variables The following sections describe the Banked Memory Location environment variables which are used by the Abatron BDI connection These variables are BANKWINDOWn on page 661 These variables are stored in the targetName section from the project file Example of the BDIK target section from a project file BDIK BANKWINDOWO BANKWINDOW PPAGE ON 0x8000 0xBFFF 0x30 64 BANKWINDOW1 BANKWINDOW DPAGE OFF 0x7000 0x7FFF 0x34 256 BANKWINDOW2 BANKWINDOW EPAGE OFF 0x400 0x7FF 0x36 256 The Banked Memory Location environment variables which are used by the connection are described as shown in the following table HC S 12 X Debugger Manual Table 23 2 Variable Description Parameters Topic Description S
415. ion code The RS bit defines the status of bits d7 dO LCD Operation The LCD Display device can display 1 or 2 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 HC S 12 X Debugger Manual 339 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities This RAM can be seen as organized in 2 lines the first one starting at the address 00h ending at 1Fh and the second one starting at 40h ending at 5Fh Figure 11 32 on page 340 illustrates this arrangement Figure 11 32 The DDRAM Controller Position om the 3 5 7 31 32 pcm LIEGE JE 1 07 Femenil 40 41 42 43 44 45 46 7 3E 5F sciL ey gay ECHELLE 0 05 LER E ESI rmm E d 23 51 42 43 44 45 46 47 48 TSF 40 Aer aright hit qu LIE TESTS 92 05 98 65 OST ID TIE sr 4o 1 42 86 45 6 5D 5E The Address Counter AC is an internal register of the display controller pointing at the current address In the default configuration AC is initialized at 00h and is increased when an ASCII character is stored at the address AC is pointing to When AC is equal to 1Fh the next increased value will not be 20h but 40h For example i
416. ion 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 Step Out from a Function Call The Debugger provides two ways of stepping out from a function call 1 Choose Run gt Step Out 2 Click the Step Out icon from the debugger tool bar 2 STOPPED STOP on page 586 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 HC S 12 X Debugger
417. ions Area The checkboxes and buttons of this area of the Load Executable File window offer the dollowing options 26 HC S 12 X Debugger Manual Debugger Interface Debugger Main Window An Automatically erase and program into FLASH and EEPROM checkbox A Verify memory image after loading code checkbox with two radio buttons that let you define the memory image Run after successful load checkbox A Stop at Function checkbox with a textbox that lets you define the function Command Buttons OK Changes are confirmed and saved in current project file Cancel Closes dialog box without saving changes Help Opens the help file Connection Command File Window From the Connection menu choose Command File to open the Connection Command File window Each tab of this window shown in Figure 2 18 on page 27 corresponds to an event on which a command file can be automatically run from the See the Startup Command File on page 28 Reset Command File on page 28 Preload Command File on page 28 and Postload Command File on page 29 sections that follow Figure 2 18 Connection Command File Window Simulator HC12 Target Interface Command Files x Startup Reset Preload Postload Setcpu The Startup command file is executed to set up the target system right after the connection has been established cmd simulator startup cmt Browse v Enable Command File Cancel Help The c
418. ions allow you to delete enable or disable the breakpoint 36 HC S 12 X Debugger Manual Debugger Interface Highlights of the User Interface Highlights of the User Interface This section describes some of the the main features of the Debugger user interface Activating Services with Drag and Drop You can activate services by dragging objects from one component window to another This is known as drag and drop an example is shown in Figure 2 29 on page 37 Figure 2 29 Drag and Drop Example i Source Iof xX E DEMO ibo c Line 26 i 2 l while i lt n M fibl fib2 fibo return fibo E When the destination of a dragged item is not possible 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 on page 38 HC S 12 X Debugger Manual 37 Debugger Interface Highlights of the User Interface Figure 2 30 Dragging Procedure Name from Coverage to Source Component Window 38 igi Source O x E DEMO termport c Line 26 uc while IEIJTE amp Ox80 wait for ou SCI SCDR ch E B terminal c E termport c 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 T
419. ip select control registers Currently not simulated 315 HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 13 Register Block Address Map 316 Register Description Remarks Block Address 0040 0043 PLL divider Currently not simulated registers 0044 0046 reserved 0047 Clock Control Completely simulated Register 0048 005F Reserved 0060 0069 Analog to Currently not simulated Digital Converter 006A 006E Reserved 006F PORTAD Currently not simulated 0070 007F ADRxH Currently not simulated reserved 0080 009F Timer Completely simulated Registers 00A0 00A3 Pulse Completely simulated Accumulator Control Registers 00A4 00AC Reserved 00AD 00AF Timer Test Completely simulated Timer Port 00B0 00BF reserved 00C0 00C7 SCIO Completely simulated 00C8 00CF SCI1 Completely simulated 00D0 00D3 SPI Completely simulated 00D4 Reserved 00D5 00D7 SPI PORTS Completely simulated HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 13 Register Block Address Map Register Description Remarks Block Address 00D8 00EF Reserved 00F0 00F3 EEPROM Currently not simulated Control 00F3 01FF Reserved Related Documentation The following documents are available from Motorola MOTOROLA SEMICONDUCTOR TECHNICAL
420. is already halted command file execution is not halted time delay is ignored NOTE The Wait instruction ends as soon as the PC is changed Usage WAIT time s Components Debugger engine Example WAIT 100 T 594 Pauses for 10 seconds before executing the T Trace instruction HC S 12 X Debugger Manual 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 on page 559 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 OxFF This command fills up the memory range 0x0205 0x0220 with the OxFF byte value HC S 12 X Debugger Manual 595 Debugger Engine Commands Debugger Commands 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 d
421. isplay Component Demo Version Limitations No limitations 344 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Monitor Component The Monitor window shown in Figure 11 38 on page 345 is a basis oscilloscope that can display the result of debugger objects Figure 11 38 Monitor Window il Monitor The purpose of this component is to display in a graphical format similar to an oscilloscope the results of debugger objects observation The monitor component can save the list of state modifications and associated time in a file Monitor Menu Figure 11 39 on page 345 shows the Monitor menu and its entries are described in Table 11 17 on page 345 Figure 11 39 Monitor Menu Add Channel Delete Channel Show Control Change Colors Table 11 17 Monitor Menu Description Menu Entry Description 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 Change Colors Changes colors from the selected Channel HC S 12 X Debugger Manual 345 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Add Channel The Add Channel dialog box shown in Figure 11 40 on page 346 allows you to create a new Channel in the monitor Figure 11 40 Add Channel Dial
422. its checkbox and clicking the Next button to proceed While Lint tools can find common programming mistakes or suspicious lines in surce code by anayzing it you need the PC lint software from Gimpel installed in order to use the CodeWarrior plugin You can enable PC lint later by manually cloning a target and changing the linker to PC lint linker Selecting the Yes option results in the following conditions This will add an additional target to the project with the name PC Lint A professional license is required to use the PC lint plugin HC S 12 X Debugger Manual 241 HC12 Debugging First Steps Debugging First Steps Using the Wizard Figure 10 6 Startup Code Level Screen New Project Wizard Page 6 freescale 11 This screen lets you select the level of startup code you wish to produce Selecting the minimal startup code option produces the best code density However selecting either of the options then clicking on the Next button results in the following conditions 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 gl
423. ject 210 B PERIODICAL 200000 10 100000 RAISE 7 3 test_interrupt END 10000000 RAISI 7 3 test interrupt Lj 376 In the first line the stimulated object is defined The interrupt is raised periodically 10 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 take a look at the interrupt vector map in the technical data manual of the matching MCU Using an editor open the 1o 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 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection True Time I O Stimulation VECTOR 7 Interrupt Function set vector on Interrupt 7 If the interrupt vector address is not specified in the prm file the Full Chip Simulation will stop when interruption is generated The exception mnemonic matching the interrupt vector number is displayed in the status bar of the Full Chip Simulation 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 10 periodical interrupts are generated every 100 000 CPU cycles from 200 000 100 000 3007000 to 172007000 CPU cycles A last one is generated when
424. l G ck Find Find Procedure Ctrl I Ctrl F Folding v Marks ToolTips Table 3 36 Associated Pop Up Menu Description Menu Entry Set Breakpoint Description Appears only in the Popup 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 Delete Breakpoint Appears only in the Popup Menu if a breakpoint is set or disabled at the nearest code position visible with marks When selected deletes this breakpoint Enable Breakpoint Appears only in the Popup Menu if a breakpoint is disabled at the nearest code position visible with marks When selected enables this breakpoint Disable Breakpoint 116 Appears only in the Popup Menu if a breakpoint is set at the nearest code position visible with marks When selected disables this breakpoint HC S 12 X Debugger Manual Menu Entry Run To Cursor Debugger Components General Debugger Components Table 3 36 Associated Pop Up Menu Description continued Description When selected sets a temporary breakpoint at the nearest code position and continues program execution immediately If there is a disabled breakpoint at this position the temporary breakpoint will also be dis
425. le in SCI 0 connects SCI 0 to terminal window Only support 8 bits Serial Peripheral Interface SPI Table 11 10 on page 310 describes the SPI interface Table 11 10 SPI interface Abbr Full Name Implemented Meaning Control Register 1 SPIE Interrupt Enable Implemented SPE System Enable If set the Full Chip Simulation supports SPI functions SWOM Port S Wired OR Mode Not simulated as no physical transmission takes place MSTR Master Slave Mode Select Master or Slave mode select CPOL Clock Polarity Not simulated as no physical transmission takes place CPHA Clock Phase Not simulated as no physical transmission takes place SSOE Slave Select Output Enable Not simulated as no physical transmission takes place LSBF LSB First Enable Not simulated as no physical transmission takes place Control Register 2 PUPS 310 Pull Up Port S Enable Not simulated as no physical transmission takes place HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Table 11 10 SPI interface Full Name Supported Derivatives Implemented Meaning Reduce Drive of Port S Not simulated as no physical transmission takes place Serial Pin Control 0 Selects Normal or Bidirectional transmission mode Baud Rate Register Baud Rate Register Baud rate of the SPI transmission
426. lear feature The Full Chip Simulation use non memory mapped registers to simulate SCI connection to the outer world The Full Chip Simulation buffers all values sent to the input registers then simulates receipt from another SCI with maximum speed and no transmission errors If the buffer contains no values the Full Chip Simulation simulates an empty input line All these sent values are available in the output registers which Table 11 9 on page 309 lists Other modules can subscribe to these registers to receive the sent values Table 11 9 Input Output Serial Output Registers Meaning Comment Input InputH meaning Adds a value to be received The system takes the 9th bit from the last value written to Read has no specified InputH before Input meaning 9th Input bit must be written Read has no specified Output Contains the last value sent A notification is sent every time a new value is written Write has no specified meaning OutputH HC S 12 X Debugger Manual 9th Output bit Must be read immediately after Output Write has no specified meaning 309 HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 9 Input Output Serial Output Registers Meaning Comment Seriallnput Alias for Input for SCI 0 Only available in SCI 0 connects SCI 0 to terminal window Only supports 8 bits SerialOutput Alias for Output for SCI 0 Only availab
427. letes 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 popup 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 ibo 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 addressl 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 HC S 12 X Debugger Manual Example1 in gt 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 Example2 in gt BC amp FIBO C Fibonacci In t
428. lignment 144 Horizontal Size 135 How To 191 How to Load 477 I I O 428 443 ICLAT 318 IDF 211 IDLE 321 Idle 445 IF 548 554 HC S 12 X Debugger Manual ILIE 320 I LOGIX 90 ILT 320 inDART HC08 gt About 416 inDART HC08 gt MCU Configuration 414 inDART HC08 gt User s Manual 416 Indicatorcolor 138 141 Indicatorlength 138 init cmd 194 Initialization List 432 INITRG 317 Input 318 INSPECTORUPDATE 549 Instance currentTargetName 10 Instruction Syntax 488 Inter IC Bus 286 interruption 336 IPATH 649 ITPORT 621 ITVECT 621 J J1850 Bus 285 K keyword DAC True Time Simulator and Real Time Debugger project file 227 Kind of Port 137 KPORT 622 L Layout 7 639 Layout Load Store 33 LCDPORT 622 Left 135 LF 550 LIBPATH 651 LIBRARYPATH 648 Line Continuation 642 LINKADDR 623 List Transmission 434 LOAD 551 Load 445 Load Application 15 Load Layout 134 Load Target 25 260 670 Load 437 LOADCODE 552 Loading an Application 195 Loading an application 437 Loading error 476 Loading problems 476 Loading the BDIK Target Interface 434 LOADSYMBOLS 552 Local 69 Local Variable Displaying 199 Locked 68 71 LOG 553 LOOPS 320 Low Display Value 138 140 145 LS 557 Lword 81 M M 320 MainFrame 639 Manual Configuration 265 Marks 118 MC9S12A32 276 MC9S12A64 276 MC9S12C32 277 MC9S12D32 277 MC9S12D64 278 MC9S12DB128A 278 MC9S12DB128B 279 MC9S12DG128B 279 MC9S12DG256B 280 MC9S12DJ
429. linecolor 142 OUTPUT 564 Output 318 P P 565 Parallel port 405 Paste 135 PATH 641 Pause 102 PAUSETEST 566 PBPORT 623 PE 320 Percentage 58 98 Periodic Interrupt Timer 299 PERIODICAL 358 Periodical 68 82 PF 321 pins 318 PIXO 318 PIX1 318 PIX2 318 Play 102 Pointer as Array 68 72 PORT 624 HC S 12 X Debugger Manual Port 405 Port Integration Module 294 Port to Display 137 PORTT 318 PORTTBitx 318 Postload command file 29 postload cmd 207 PPAGE 318 448 PPAGE Banked Memory Area 448 PRO 319 PRI 319 PR2 319 Preference panel 17 Preferences dialog 16 Preload command file 28 preload cmd 207 PRINTF 567 Procedure Chain 96 Prod 10 Profiling 428 Program loading 475 programmed 472 Project 639 PROJECT INI 24 638 project ini 474 475 637 Properties 134 protected 472 Protecting 473 PROTOCOL 601 PSMODE 624 PT 320 PTRARRAY 567 Pulse Width Modulator 299 PVCS 651 R R8 321 RAF 321 RAMs 430 RD 568 RDRF 321 RE 320 real time 5 Real Time Kernel Awarness 177 Real Time Kernels 177 RECORD 569 Record 102 672 REGBASE 625 Register 105 Register Block 317 Register values 158 159 168 Registration 34 Relative Mode 145 Remove 134 REPEAT 554 569 Replay 103 Requirements 428 RESET 442 570 602 Reset 437 Reset command file 28 Reset Target 25 260 reset cmd 207 RESETCYCLES 625 RESETMEM 626 RESETRAM 627 RESETSTAT 627 RESTART 570 Restart 22 RETURN 571 RHAPSODY 90 RIE 320
430. ll be 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 and if the command is not redirected to a specific component all components will be affected Also a mismatch could occur due to the fact that a command s parameters could differ for different components HC S 12 X Debugger Manual 487 Debugger Engine Commands Commands Overview 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 Available Command Lists Commands described on the following pages are sorted into 5 groups according to their specific actions or targets However these groups have no relevance in the use of these commands A list of all commands in their respective group is given below 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 20 1 on page 488 contains
431. llowing links to jump to the corresponding set of instructions How To Configure the Debugger on page 192 How To Start the Debugger on page 193 Automating Debugger Startup on page 194 How To Load an Application on page 195 How To Start an Application on page 196 How To Stop an Application on page 196 How To Step in the Application on page 197 How To Work on Variables on page 199 How To Work on the Register on page 203 Modify Content of Memory Address on page 205 How to Consult Assembler Instructions Generated by a Source Statement on page 205 How To View Code on page 206 How to Communicate with the Application on page 207 About startup cmd reset cmd preload cmd postload cmd on page 207 HC S 12 X Debugger Manual 191 How To How To Configure the Debugger How To Configure the Debugger If you have installed the Debugger under Windows 95 98 NT 4 0 and Windows2000 or higher the Debugger can be started from the CodeWarrior IDE from the desktop from the Start menu or from an external editor WinEdit CodeWright etc In order to work efficiently find all requested configuration and component files the Debugger must be associated with a working directory For Use from Desktop Win 95 Win 98 Win NT4 0 or Win2000 When starting the Debugger from Windows 95 or Windows NT V4 0 for example without WinEdit the working directory can be de
432. log box shown in Figure 11 4 on page 261 allows you to open an I O device peripheral simulation The Browse button allows you to specify a location for the I O Figure 11 4 Open IO Component Dialog Box Open IO Component xi HC S 12 X Debugger Manual 261 HC S 12 X Full Chip Simulation Connection NOTE TO simulation components are either designed by Freescale and delivered with the tool kit installation or designed by the user with the Peripheral Builder separate product Demo Version Limitations Only 2 I O components can be loaded at a time Command File Window Figure 11 5 Full Chip Simulation Connection Command Files Window 262 Full Chip Simulation Connection Command Files Startup Reset Preload Postload Setcpu The Startup command file is executed to set up the target system right after the connection has been established Semd Full Chip Simulation startup cmd Browse v Enable Command File Cancel Help Setcpu Command File The Setcpu command file is a specific command file to the Full Chip Simulation and is executed by the Debugger after a CPU has been set or modified in the Full Chip Simulation this occurs when the setcpu command is used or when an application is loaded in the Full Chip Simulation and the corresponding cpu is not set The Setcpu command file full name and status enable disable can be specified either with the CMDFILE SETCPU Comm
433. lp 5xHocc huwnanhfanm hyN3i ziu eoet cPu mmm uglx MyGuessTheNumber mcp E Simulator m v B e Files Link Order Targets Processor Expert Q BB readme txt C Startup Code 9 3 Pm H Linker Map Libraries C3 Debugger Project File g Debugger Cmd Files Q al E E ig PE7_XCLK5_NOAG PE7 XCLKS NOAC none E 101x Bean Categories On Chip Peripherals Quick help CPU extemal devices CPU internal peripherals Q sw Step 3 Target CPU Window The Target CPU window in the center shows a footprint of the processor selected for the development In the device we see the different on chip modules such as CPU Timer A D converter Modules with an icon attached to them are modules used by the application The pins that are used to connect external functions are indicated by a line and an icon symbol of the function attached CPU and Port A 390 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Figure 11 76 Target CPU Window EEM e slp arget CPU Cpu MC9S12DP256BCP Tf ij r ger TFI TNT Lt Ao occ occ ES Jion ES unb G ubb ub P none General purpose parallel IO port P A Optional Place the cursor of the mouse on the pins to see a description of their functions Enlarge the Target CPU window and you will see different on chip modul
434. lso possible to specify in the Virtual SCT section which ports will be taken as virtual SCI ports This enables you to make a connection to any port in the Full Chip Simulation framework Input and Output File It is also possible to take a file as an input stream for the terminal component or redirect the output to a file If you want to use a file as an input stream make sure that there exists at least one connection from the input file to any output device Then you can open an input file by simply choosing Input File from the context menu As soon as you press the OK button in the File Open dialog input from the file will start The file will be closed as soon as the end of file is reached or you choose Close Input File from the context menu When the input file has reached its end a CTRL Z character ASCII code 26 decimal will be sent to all output devices receiving characters from the input file to notify them that the file transfer has been finished If you want to redirect some input devices to an output file you have to proceed similarly Make sure that you have chosen your connections from input devices to the output file Then you can open or create your output file by choosing Output File from the context menu If the file does not exist it will be created Otherwise you can choose to overwrite or append the existing file To stop writing to the output file you can choose Close Output File from the context menu
435. lways occurs in the last line of the Command component Characters can be input or pasted on the edit line 54 HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 7 Command Line Window ii Command OF x in Keying In Commands You can type Debugger commands after the in gt terminal prompt in the Command Line Component window Recalling a Line from the Command Line History To recall a command in the DOS window use either the up or down arrow of the F3 funtion key to retype the previous command Scrolling the Command Component Window Content Use the left and right arrow keys to move the cursor on the line the HOME key to move the cursor to the beginning of the line or the END key to move the cursor to the end of the line To scroll a page use the PgDn scroll down a page or PgUp keys scroll up a page Clearing the Line or a Character of the Command Line Selected text can be deleted by pressing the left arrow To clear the current line press the ESC key Command Interpretation The component executes the command entered 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 c
436. m the SCIInputH register A read access to SCIInput has no specified meaning Bit 7 0 character send to the SCI SClInputH This is a not memory mapped register and will serve to send a character to the SCI It contains the ninth bit This register must be written before the SCIInput register A read access to SCIInputH has no specified meaning Bit 0 ninth bit send to the SCI SClOutput This is a not memory mapped register and will serve to receive a character which is sent from the SCI The value received in the SCIOutput is triggered through a write access to the SCDR The ninth bit is written to the SCIOutputH register A write access to SCIOutput has no specified meaning Bit 7 0 character send from the SCI SClOutputH This is a not memory mapped register and will serve to receive a character which is sent from the SCI It contains the ninth bit A write access to SCIOutput has no specified meaning Bit 0 ninth bit send from the SCI Seriallnput This not memory mapped register is a alias for the SCIInput register and serve to connect the SCI to the terminal window The ninth bit is not supported A read access to SerialInput has no specified meaning Bit 7 0 data from terminal window to SCI SerialOutput This not memory mapped register is a alias for the SCIOutput register and serve to connect the SCI to the terminal window The ninth bit is not supported A write access to SerialOutput has no specified meaning
437. map animation Its attributes are shown in the Table 3 49 on page 139 Table 3 49 Bitmap Instrument Attributes 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 following condition has to be true port memory amp ANDmask EQUALmask A practical example about using the AND and EQUAL masks is following example You want to show in the visualization a taillight of a car for this you need bitmaps e g from a digital camera of all possible states of the taillight 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 if a lamp is on or not E g bit 0 says that the flasher is on where bit 1 says that the brake light is on So for your simple application you need 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 HC S 12 X Debugger Manual 139 De
438. memory even while the CPU is running single step run stop the CPU set breakpoints and watchpoints not all CPUs in the code NOTE Unconcerned Components As the code is executed by an external processor memory statistics are not available with the Abatron BDI Connection Profiling Coverage analysing and I O simulation are not available with the Abatron BDI Connection 428 HC S 12 X Debugger Manual Abatron BDI Connection Interfacing Abatron BDI and Your System Interfacing Abatron BDI andYour System NOTE BDI Structure Configuration Connection to the Host Connection to the Target Configuration and Working Modes are described in ABATRON User Manuals The BDI interface is connected to the host computer either by a serial communication link or by a Ethernet connection Any available communication port of your host system can be used The communication protocol between the BDI and your target system is fully handled by the BDI Target driver automatically loaded with the Abatron BDI Target Component However you can adapt your target system to the BDI interface The BDI to target system communication uses a single wire serial connection The target system has to be equipped with a BDM connector port see the BDI User Manual from ABATRON Make sure that your hardware target board is has been designed with a Background Debug Mode BDM port for CPU background interfacing with the BDI interface and the debugger Please check the
439. mmands 608 Disabling 473 Enabling 473 Loading 475 Module 471 Module selecting 473 Operations 473 Protecting 473 HC S 12 X Debugger Manual Select 471 Unprotecting 473 Unselect 471 Flash 290 Flash programming 445 FLASH SELECT 474 FLASH UNSELECT 474 Flash Erase 445 Flash Idle 445 Flash Load 445 FLASH 4000 479 FLASH B32 478 FLASH C000 479 FLASH PAGEO 479 FLASH PAGEI 479 FLASH PAGE2 479 FLASH PAGE3 480 FLASH PAGEA 480 FLASH PAGES 480 FLASH PAGE6 480 FLASH PAGE7 480 FLEXIm 6 Float 106 FOCUS 539 FOLD 540 Fold 122 Fold All Text 122 Folding 114 Mark 114 Folding Menu 121 Foldings 118 FONT 540 Fonts 30 FOR 541 554 Format 80 200 203 Format mode 144 Format 68 FPP Browse 475 FPP directory 474 FPRINTF 542 FRAMES 542 Frames 108 Frozen 68 71 82 G G 543 GENPATH 647 649 669 Global 69 Global Variable Displaying 199 GO 544 Go to Line 117 119 120 Graphic bar 59 98 GRAPHICS 547 Grid Color 136 Grid Mode 136 Grid Size 136 GUI Graphical User Interface 470 H Halt 22 HALTED 442 Hardware 5 478 hardware breakpoint 441 659 HC08 Full Chip Simulation 259 HC12B32 478 HC12D60 478 HC12DG128 479 HCS08 Serial Monitor Connection 467 Height 136 HELP 547 Help 438 Help Topics 33 Hex 69 70 81 106 200 203 Hexadecimal 200 203 206 Hide Headline 18 Hide Tile 18 HIENVIRONMENT 646 High Display Value 138 140 145 Highlights 427 HIPATH 647 HiTOP Ready 441 Horiz Text A
440. mmands si 22 2 VN ea A ae ey 497 AOL esto e wad PRA T ein ep al bree ede eee doeet 498 ACTIVATE geb RR E e edes ete eei 498 ADD XPR vt CeEDOME RAN ee UR SR D Ead 499 AETRIBUTES e iced toed ace 4 er ers e ELI EXPE dat 499 In the Command Component 0 000 202 eese 499 HC S 12 X Debugger Manual 18 Table of Contents In the Procedure Component 0 0 0 0 eee eee eee eee 500 In the Assembly Component 00 00 20 eee 500 In the Register Component 0 0 0 0 00 0 ee eee eee ee 501 In the Source Component 0 00 00 eee eee ee eee 503 In the Data Component 0 0 0 c eee eA 504 In the Memory Component 00 0 0 0 0 eee 505 In the Inspector Component 0 0 0 2 e eee ee eee 507 ALD sp fetal vas D MD SEC E UAR d eee me ete EN M 509 AUTOSIZE is isd ss sos siuaiedectes Mack ex ERG p COE ON RR EE 509 BASE o nelbeIepbRPLu RR ene ENERO 510 BG ox ceokgemevau eps cc a la ikke ees ui ees 510 BCKCOEOR ret reique cae ate ex dede seb OR RE 511 BD opel ER AGBS Ge Gals PRSE LU NEQUORE REESE me 512 BS iehsisueeesheteteseRU eB DOR eb pens 513 CALD zs Red vede e ete unes 515 CDs see dan hb teh RUE UG MER ORBE RA ERR CR Rr pa aes 516 CE LlisimeenheeerneeeeBbVCMpRe PA Up PE HP ERPUEEMIS 517 CLOCK sai soe ki a se Panes ih eal esp exe Ee 519 CLOSE CI eESEEPIWUQGS Oa Meo dpud hd ai arpa 519 COPXMEM eph A Gee ahd DOEPV CDU RBURELS des pele ed
441. modes The Full Chip Simulation does not implement this mapping in special expanded narrow mode with MODE Register bit EMD set Memory Mapped Page Registers Table 11 12 on page 313 describes the Memory Mapped Page Registers Table 11 12 Memory Mapped Page Registers Abbr Full Name Implemented Meaning Port F Register CS Chip Select General Purpose IO Bit 0 6 Not implemented as there are no physical outputs Port G Register ADDR Memory Expansion General Purpose IO Bit 0 5 Not implemented as there are no physical outputs Port F Data Direction Register DDRF Data Direction Register Port F Bit 0 6 Not implemented as there are no physical outputs Port G Data Direction Register HC S 12 X Debugger Manual 313 HC S 12 X Full Chip Simulation Connection Supported Derivatives Table 11 12 Memory Mapped Page Registers Full Name Implemented Meaning Data Direction Not implemented as there are no physical Register Port G Bit outputs 0 5 Data Page Register Data Page Selects the data page Program Page Register Program Page Selects the program page Extra Page Register Extra Page Selects the extra page Window Defition Register Data Window Enables paging of data space Enable Program Window Enables paging of program space Enable Extra Window Enables paging of extra space Enable Memory Exp
442. mple in gt 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 gt CLOSE Memory The Memory component window is closed unloaded HC S 12 X Debugger Manual 519 Debugger Engine Commands Debugger Commands 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 gt copymem 0x3FC2A0 0x3FC2B0 0x3FC300 The memory from 0x3FC2A0 to OX3FC2BO is copied to the memory at 0x3FC300 to Ox3FC310 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 ONIOFF Command File Full Name gt Components Simulator target engine Example in cmdfile postload on c temp myposloadfile cmd The myposloadfile command file will be executed after loading the absol
443. mponent 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 gt Assembly lt SPC 0x8000 The Assembly component window is scrolled to the address 0x8000 and the associated instruction is highlighted HC S 12 X Debugger Manual 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 This command is relevant when C source debugging 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 gt Source SPROC 1 This command displays the source code associated with the caller function in the Source component window HC S 12 X Debugger Manual 581 Debugger Engine Commands Debugger Commands 582 SREC The SREC command initiates the loading of Freescale S Records from a specified file NOTE If no path is specified the
444. n Simulator Component Memory Window Help the Control Reset Set Derivative D Profiles RTH Configure include lt efines and macros CODO LDS include lt derivative information C003 CALL 0x8004 0x00 pragma LI c912dglz8 C007 CALL 0x8000 0x00 COOB BGND COOC BGND COOD SUBB 17 void main Ls COOF SUBB 25 put y EnableIn Register toris C HC12 CPU Cycles 0 H Procedure D mF a DF B 1x DFDF ry DFDF tsi cC000 PC C000 PPAGE SP DFDD CCR SXHINZVC Startup AE E Memory DF o E startupData X6 _tagStartup 00080 00 00 uu uu 00 00 00 uu E SEG END SSTACK 0 array 0 of signed char 00088 00 00 00 00 00 00 00 00 00090 00 00 00 00 00 00 00 00 00098 00 00 00 00 00 00 00 I Auto Symb Global Auto Auto Symb Local 24 HC S 12 X Debugger Manual Debugger Interface Debugger Main Window Table 2 5 on page 25 describes the Connection Menu entries Table 2 5 Connection Menu Common Option Description Load Loads a connection Reset Resets the current connection Loading a Connection Use the Connection menu to load a debugger connection 1 Choose Connection gt Load The Load Executable File window shown in Figure 2 17 on page 26 is displayed Load Executable File Window From the Connection menu choose Load to open the Load Executable File window shown in Figure 2 17 on page 26 then set the lo
445. n If the connection is passed the current BDI firmware logic is displayed If unknown is displayed for the Current firmware logic you must load new firmware by pressing the Update button If you plan to use a Ethernet communication between your computer and the BDI interface set the IP address reserved for the BDI then press the Transmit button Quit the dialog by pressing the Ok button Initialization List Startup Init List Loading Select File Open from the File menu to load a configuration file e g HC912DA128 BDI Figure 15 4 File Menu im Untitled BDI1000 Setup for CPU12 File Setup Tools View Help Ctrl N v Open Ctrl O zr Save Ctrl S Save As Recent rile Exit Figure 15 5 Setup Menu im Untitled BDI1000 Setup for CPU12 File Setup Tools View Help Di Firmware Select Setup Init List tfrom the Setup menu o see and edit if necessary the content if this configuration file The Startup Init List configuration file is displayed in the Startup Init List dialog box You can edit add remove etc memory write instructions in this dialog box to configure your MCU and MCU environment 432 HC S 12 X Debugger Manual Figure 15 6 Startup Init List Dialog Box Startup Init List Ox000000F1 Ox000000FF Ox000000F5 Ox000000FF Ox000000F5 Ox000000FF Ox000000F5 Ox000000FF Ox000000F5 0x00000010 Abatron BDI Connection BDI Interface Software Setup JNITEE Map EEPROM to
446. n Preload and Postload Command Files The legacy FLASH commands created by the project wizard to program automatically an application is given here below In xxxx Preload cmd file reset the device to get default settings RESET initialize flash programming process FLASH HC S 12 X Debugger Manual select the flash modules FLASH SELECT erase the flash modules FLASH ERASE arm the flash for programming FLASH ARM In xxxx Postload cmd file The following commands must be enabled to terminate the programming process with the ICD12 disarm the flash modules FLASH DISARM unselect the flash modules FLASH UNSELECT reset the target board RESET TIP This Legacy implementation can be replaced by the Automated Application Programming feature discussed at the beginning if this manual section Simply clean or disable both command files then engage the Automatically erase and program option in debugger Preferences HC S 12 X Debugger Manual 483 HC S 12 X Flash Programming Hardware Considerations 484 HC S 12 X Debugger Manual Book IV Commands 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 Debugger Commands defines the HC12 HCS12 and HC S 12 X Commands both those commands used by the debugger engine and thos
447. n 3 is pressed a read access at the address of the component port will return the value 00001000b 08h Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Demo Version Limitations No limitations HC S 12 X Debugger Manual 351 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Programmable IO Ports Component The Programmable IO Ports window shown in Figure 11 47 on page 352 consists of 5 IO Ports with 8 configurable bits in input or output In the default configuration all couplers are in input The graphical interface suggests the state of each one Figure 11 47 Programmable IO Ports Window mio pons port B port C port D port E port Input Input Input Input Input The data exchange between the processor and peripherals are done by the intermediary of some circuits called input output couplers The peripherals are connected to the data bus and are in parallel in an electrical point of view A concerned output circuit will catch information on the data bus and save it in a latch until the next data reception The input output couplers are perceived by the processor as memory cases with a wired fixed address The capability exists to do input output actions at a known address In the C language access is done by forced pointers to these ad
448. n File usually project ini Default Layout Configuration PROJECT INI The default layout activated when starting the Debugger is defined in the PROJECT INI file located in the project directory as shown in Listing 22 1 on page 638 All default layout related parameters are stored in section DEFAULTS Listing 22 1 Example Content of PROJECT INI HI WAVI E Window0 Source 0 0 60 30 Windowl 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 638 Target Specifies the target used when starting the Debugger loads the file lt target gt with a tgt extension for example Target Sim for HC S 12 X Freescale Full Chip Simulator or Target Motosil Target Bdi Window lt n gt Specifies coordinates of the windows that must be open when the Debugger is started The syntax for a window is Window lt n gt lt component gt lt XPos gt YPos width height where n is the index of the window This index is incremented for each window and determines the sequence windows are opened This index is relevant in case of overlapping windows because it determines which window will be on top of the other Values for the index have to be in the range 0 99 component specifies the type of component that should be opened for example Source Assembly etc XPos
449. n bank window 0x8000 OxBFFF equivalent to cf Technical Summary 01FEE Flash even page 2 module name FLASH PAGE3 module number 5 16 KBytes paged Flash accessed in bank window 0x8000 0xBFFF equivalent to cf Technical Summary 01FEE Flash odd page 3 boot sector unprotectable protectable 8 KBytes in range 0xA000 0xBFFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register module name FLASH PAGEA module number 6 16 KBytes paged Flash accessed in bank window 0x8000 OxBFFF equivalent to cf Technical Summary 10FEE Flash even page 4 module name FLASH PAGES module number 7 16 KBytes paged Flash accessed in bank window 0x8000 0xBFFF equivalent to cf Technical Summary 10FEE Flash odd page 7 boot sector unprotectable protectable 8 KBytes in range 0xA000 0xBFFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register module name FLASH PAGE6 module number 8 16 KBytes paged Flash accessed in bank window 0x8000 0xBFFF equivalent to cf Technical Summary 11FEE Flash even page 6 Also equivalent to FLASH 4000 module module name FLASH PAGE7 module number 9 16 KBytes paged Flash accessed in bank window 0x8000 0xBFFF equivalent to cf Technical Summary 11FEE Flash odd page 7 Also equivalent to FLASH C000 module boot sector unprotectable protectable 8 KBytes in range 0xA000 0xBFFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register
450. n on access auto configuration on load or user defined Depending on your settings the Full Chip Simulation component initializes the Full Chip Simulation memory as Table 11 2 on page 265 explains 264 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Table 11 2 Memory Configuration Modes Mode Description Auto Configuration on Access Defines the Full Chip Simulation memory as RAM of Standard Configuration unlimited size The Mode combo box displays auto on access Auto Configuration on Load Defines the Full Chip Simulation memory as RAM and default ROM 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 not implemented locations result in error messages The Mode combo box displays auto on load Manual Configuration User Defines the Full Chip Simulation memory as RAM Defined ROM non 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 Memory Configuration Settings Depending on the configuration mode the Memory Configuration dialog box lets you redefine memory settings within certain limits You always must set I O devices manually Standard Configuration
451. n the Debugger and in the Service field in the DDEClient type HI WAVE 2 Inthe Topic field type Command HC S 12 X Debugger Manual 211 Debugger DDE Capabilities 3 Push the Connect button of the DDEClient The following message will appear in DDECLient Connected to HI WAVElCommand 4 Inthe 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 you ll see a new recorder component 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 212 HC S 12 X Debugger Manual 9 Synchronized Debugging Through DA C IDE This chapter provides information on how to use and configure Freescale tools within the Development Assistant for C DA C IDE For more information on DA C refer to the Development Assistant for C documentation v 3 5 You must be running DA C version 3 5 build 555 or later Development Assistant for C RistanCASE Click any of the following links to jump to the corresponding section of this chapter Configuring DA C IDE for Freescale Tool Kit on page 213 Debugger Interface on page 224 Synchronized Debugging on page 229
452. nal h is used to send such commands from a target via SCI to the terminal The source code in terminal c is given in Listing 11 5 on page 368 LES Listing 11 5 TERM Direct Source Code void TERM Direct TERM DirectKind what const char fileName sets direction of the terminal if what TERM TO WINDOW what TERM APPEND FILE return j TERM Write 1l TERM Write if what TERM WriteString fileName TERM Write CR ESC TERM Write h c har what 0 TERM TO WINDOW amp amp what TERM FROM KEYS In the example the parameter what is one of the following constants TERM TO WINDOW send output to terminal window TERM TO BOTH send output to file and window TERM TO FILE send output to file fileName TERM FROM KEYS read from keyboard close input file TERM FROM FILE read input from file fileName TERM APPEND BOTH append output to file and window TERM APPEND FILE append output to file fileName See also terminal h for further details 368 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities How to Use Virtual SCI In its default Virtual SCI configuration the terminal component accesses the target through the Object Pool interface To make the terminal component work in this default configuration the target must provide an object with the name Sci0 If no Sci0 o
453. nd has the following syntax lt Object gt lt Action gt lt parName gt lt parameterValue gt Description The BDI command executes any ABATRON direct command ABATRON direct commands are described in the User Manual for your CPU from ABATRON They are commonly used to download to non volatile memory areas please see also the Flash Programming section Example BDI FLASH ERASE addr 8000 size 8000 sram 0800 BANKREG 600 Short Description Sets banked memory handling for HC12 CPU12 derivatives Syntax BANKREG PPAGE PPAGE register adrs DPAGE DPAGE register adrs EPAGE EPAGE register adrs Description CAUTION This command is still available but for compatibility only However it should not be used The Banked Memory Location Window handles the banked memory handling when debugging on HC12 CPUI2 derivatives HC S 12 X Debugger Manual Debugger Connection specific Commands Abatron BDI Connection Commands The BANREG command lets you define if paging is used like PPAGE HC912DG128 HC812A4 DPAGE HC812A4 or EPAGE HC812A4 This command must be inserted in the Startup Command File of your project directory As soon as the command is executed the specified registers are displayed in the Register component window Example for HC812A4 BANKREG PPAGE 0x35 DPAGE 0x34 EPAGE 0x36 for HC912DG128 BANKREG PPAGE 0xFF PROTOCOL Short Descri
454. nd program into FLASH and EEPROM To specify affected memory block click here Advanced 468 HC S 12 X Debugger Manual Advanced Options Preventing Erasing Pressing the Advanced button in the Load tab of the debugger Preferences window opens the NVM Programming Selection list box Figure 18 4 NVM Programming Selection List Box NVM Programming Selection x Please select in the list below the modules you do NOT want to be automatically erased before programming FLASH 4000 FLASH Co00 PAGED EEPROM_COO EEP_PAGED Cancel The list box lists all the Non Volatile Memory modules registered by the debugger for the current selected processor device Clicking once on a line selects an item highlighted in blue and clicking another time on a selected item unselects it Erasing is skipped for all selected modules If all modules are selected the debugger will simply program the application without erasing at all any non volatile memory the device CAUTION The debugger cannot care about pre programmed modules and the user must care about reprogramming limitations risks and impossibility The NVM Programming Selection list box does not give many details about the listed blocks More information can be displayed when typing the FLASH command in the Command window or when opening the Non Volatile Memory Control dialog box The NVM Programming Selection list box is tightly associated t
455. ndow When the breakpoint is detected the command is executed and the application stops The Continue check button of the Controlpoints Configuration window allows the application to continue after the command is executed Demo Version Limitations Only 2 breakpoints can be set 160 HC S 12 X Debugger Manual Control Points Watchpoints 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 on page 163 This window can be opened through the Memory or Data component window popup menu as described below To open the Controlpoints Configuration window with the Watchpoints tab exposed l 2 3i 4 Position your cursor in either the Memory
456. ne number to display Clear Display Completely fills the DDRAM with the code 20h space character e 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 e AC 00h and re initialize the display Puts the cursor in position 1 on the display first line The DDRAM is unchanged Entry Mode Set Increases AC if I D 1 or decreases AC if I D 0 after an ASCII code is written into RAM e Moves the cursor to the right if ID 1 or to the left if I D 0 Display On Off Control The display is on if D 1 and off if D 0 data still stay in RAM IfC 1 the cursor will be shown Cursor or Display Shift Doesn t change the DDRAM content HC S 12 X Debugger Manual 341 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities AC is unchanged in case of a screen shift Moves and or shifts the cursor to the right or left The cursor goes to the second line if it exceeds the 32nd position of the first line It also goes to the first line when it exceeds the 32nd position of the second line During a screen shift the two lines only move horizontally the first line will never pass to the second one Figure 11 34 on page 342 describes how to choose the moving direction Figure 11 34 Left Right Choice 342 O 0 Moves the cursor to the left decreases AC
457. ned as RAM so in this case the command RESETMEM has the same effect as RESETRAM 626 HC S 12 X Debugger Manual Debugger Connection specific Commands Full Chip Simulator Commands RESETRAM This command marks all RAM as uninitialized undefined NOTE Inthe memory configuration Auto on Access the full memory is defined as RAM so in this case the command RESETMEM has the same effect as RESETRAM Usage RESETRAM Components Simulator component Example in gt RESETRAM After the RESETRAM command the content of RAM is initialized as undefined RESETSTAT This command resets the statistics read and write counters to zero Usage RESETSTAT Components Simulator component Example in gt RESETSTAT After the RESETSTAT command all counters are initialized to zero HC S 12 X Debugger Manual 627 Debugger Connection specific Commands Full Chip Simulator Commands 628 SEGPORT The SEGPORT command is used to set the display selection port and segment selection port addresses of the 7 Segments display component Usage SEGPORT display selection port address ident segment selection address ident Address locates the port address value of the component many formats are allowed the default format is hexadecimal Ident is a known identifier its content will define the port address Components 7 Segments display Example in gt SEGPORT 0x100 0x200 The ports of the 7 Segments
458. nel is a subset of the other one and has fewer registers and in some registers less bits are used The simulation is accurate up to one instruction this limitation is due to the different pipelining of instruction in the hardware and in the simulation However the simulation strictly respects the period and the duty time of the generated pulses Changing control registers while the counters are running causes irregularities on the hardware outputs and cycle duration Irregularities are present in the simulation as well but these irregularities might differ from the one encountered in the hardware For proper use of the module channels should be disabled PWME register and the counter reset PWMCNTNX registers before modifying the corresponding control register clock selection period settings etc as described in the manual Clock Select Scalers and prescalers are simulated for the clock selection Changing clock control bits while channels are operating can cause irregularities that affects the time until the next end of a period and duty and the value displayed in the PWN counter registers Polarity Duty and Period It is important to note the information given in the inspector component concerning the various events The two types of event used in the PWM module are the Duty and Period events In left aligned mode HC S 12 X Debugger Manual 299 HC S 12 X Full Chip Simulation Connection Supported Derivatives
459. nel text the format is OxO0bbggrr Components Monitor component Example in gt SETCOLORS Leds Port Register bit 0 0x00123456 0x00234567 0x00345678 0x00456789 0x00567891 The color attributes from the channel Leds Port Register bit 0 will be changed with these new values HC S 12 X Debugger Manual 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 hwlfileinthe 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 will scroll 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 should 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 HC S 12 X Debugger Manual 57 NX Debugger Engine Commands Debugger Commands 578 SMEM In the Source component the SMEM command l
460. nges 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 33 on page 80 provides access
461. ning Accumulated elapsed time will not be affected and a new cycle time is applied to next simulated instructions in real time The Clock Frequency Setup dialog Simulator gt Clock Frequency menu entry can be opened to set enter edit either the oscillator frequency or the CPU frequency However the project saved frequency is the oscillator one Two radio buttons allow choosing between cycles or true time display in debugger status bar HC S 12 X Debugger Manual 269 HC S 12 X Full Chip Simulation Connection Unchecking reset cycles time will simply make the debugger cumulate cycles time other CPU reset The true time unit is the microsecond The TRUETIME debugger command line command gives the time as a number in microseconds The OSCFRI Bus Trace The Full Chip Simulation is able to record all executed instructions and memory accesses in the Trace component this up to one million of frames Enabling recording can be done EQUENCY variable displays sets the oscillator frequency in the Trace menu context sensitive popup menu after opening the Trace component NOTE Please refer to the HCS12 or HCS12X Onchip DBG Module manual for the Trace window common functionality and common menu entries Figure 11 9 Trace Window Popup Menu Trace Mme Ei R Frame core address Instruction pata 999973 999974 999975 999976 999977 999978 999979 999980 999981 999982 999983 999984
462. nk Cyclone Pro Connection Command Files Window xj P amp E Multilink Cyclone Pro Connection Command Files Startup Reset Preload Postload Vppon Vppoff Unsecure The Startup command file is executed to set up the target system right after the connection has been established emdi P amp E Multilink CvclonePro startu cmd Browse v Enable Command File Default Connection Setup As with any connection you can use the Connection menu to load the P amp E Multilink Cyclone Pro connection component or you can set the ICD 12 connection as a default in the PROJECT INI file This file should be in the working directory Listing 12 1 Example of PROJECT INT file Window0 Source 0 0 60 30 Windowl Assembly 60 0 40 30 Window2 Procedur 0 30 60 25 Window3 Register 60 30 40 30 Window4 Memory 60 60 40 40 Window5 Data 0 55 60 23 Window6 Command 0 78 60 22 Target ICD HC S 12 X Debugger Manual 411 P amp E Multilink Cyclone Pro Connection Default Connection Setup 412 HC S 12 X Debugger Manual 13 Softec HCS12 Connection This section guides you through the SofTec HCS12 connection It does not replace all the additional documentation provided in this manual but gives you a good starting point Technical Considerations The 8 16 bits debugger and then the CodeWarrior IDE might be connected to HCS12 hardware using the SofTec HCS12 When the debugger runs the SofTec HCS12 connection it
463. ns Exceptions are pending interrupts 126 HC S 12 X Debugger Manual Debugger Components Visualization Utilities Figure 3 80 Inspector Window Exceptions Icon E Inspect E Components Stack Real Time Interrupt 83 Symbol Table CB Events 4 Exceptions S Object Pool Events are only used in the HC S 12 X 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 81 on page 127 is a pool of objects It can contain any number of Objects which can communicate together and also with other parts of the Debugger Figure 3 81 Inspector Window Object Pool imi Inspect CB Events wood Exceptions Port Register 0x210 Object Pool Data Direction Register 0x0 0x212 TargetObject id Leds i id Swap Agi Swap a 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
464. nt Register Dumps memory starting at the address stored in the selected register The corresponding address is selected in the memory component Module Dumps memory starting at the address of the first global variable in the module The memory area where this variable is located is selected in the memory component Demo Version Limitations No limitation Associated Commands ATTRIBUTES on page 499 FILL on page 535 SMEM on page 578 SMOD on page 579 SPC on page 580 UPDATERATE on page 592 HC S 12 X Debugger Manual Debugger Components General Debugger Components MicroC Component The MicroC window shown in Figure 3 44 on page 90 is an interface module for RHAPSODY in MicroC the analysis design and implementation tool for embedded systems and software developers from I LOGIX Figure 3 44 MicroC Window The MicroC component establishes a communication with Rhapsody in MicroC to activate its design level debugging capabilities Rhapsody in MicroC drives its debugging animation that communicates with the Debugger environment over TCP IP This allows you to execute stop and run the application to set step commands breakpoints events and idle states to perform control over the application Communication is realized by selecting the Connect entries of the MicroC Link menu The Setup entry allows you to define the connection parameters The functions available allow you to start the currently loaded application
465. nt variable It CANNOT be specified in a default environment file DEFAULT ENV hidefaults Example ENVIRONMENT Freescale prog global env 646 HC S 12 X Debugger Manual GENPATH include File Path Tools Compiler Linker Decoder Burner Debugger Synonym HIPATH Syntax GENPATH lt path gt Arguments lt path gt 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 lt File gt Path on page 648 NOTE Ifa directory specification in this environment variable starts with an asterisk the whole directory tree is searched recursively All subdirectories and their subdirectories are searched Within one level in the tree search order is random Example GENPATH sources include headers usr local lib See also Environment variable LIBPATH HC S 12 X Debugger Manual 647 Debugger Engine Environment Variables Environment Variables LIBRARYPATH include lt File gt Path 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
466. nt window then choose Set Breakpoint Delete Breakpoint etc NOTE For information on using breakpoints see Control Points on page 147 chapter HC S 12 X Debugger Manual Debugger Components General Debugger Components Show PC Dialog Box If a hexadecimal address is entered in the Show PC dialog box shown in Figure 3 5 on page 51 memory contents are interpreted and displayed as assembler instructions starting at the specified address Figure 3 5 Show PC Dialog Box Show PC x Associated Popup Menu To open the popup menu right click in the text area of the Assembly component window The popup menu contains default menu entries for the Assembly component It also contains some context dependent menu entries described in Table 3 2 on page 52 depending on the current state of the debugger Figure 3 6 Assembly Popup Menu Set Breakpoint Run To Cursor Show Breakpoints Show Location Set Markpoint Show Markpoints Address Display Format b Freeze HC S 12 X Debugger Manual 51 Debugger Components General Debugger Components Table 3 2 Assembly Popup Menu Description 52 Menu Entry Set Breakpoint Description Appears only in the popup menu if no breakpoint is set or disabled on the pointed to instruction When selected sets a permanent breakpoint on this instruction When program execution reaches this instruction the program is halted and the current program sta
467. ntTargetName If you attempt to start the debugger again the existing instance of the debugger is brought to the foreground Prod lt fileName gt This option specifies the project directory and or project file to be used at start up For example c Freescale prog hiwave exe Prod c demoproject test pjt Nodefaults Debugger will not load the default layout see section 4 of the Project file Activation For example c Freescale prog hiwave exe nodefaults Cmd lt Command gt n This option specifies a command to be executed at start up cmd example characters For c Freescale prog hiwave exe cmd open recorder C lt cmdFile gt This option specifies a command file to be executed at start up For example c Freescale prog hiwave exe c c temp mycommandfile txt HC S 12 X Debugger Manual Debugger Interface Debugger Main Window ENVpath Env Environment Variable z Variable Setting This option sets an environment variable This environment variable may be used to overwrite system environment variables For example c Freescale prog hiwave exe EnvOBJPATH c sources obj NOTE Options are not case sensitive 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 Load lt exeFile gt if available and start running unle
468. nter should be displayed as an array Usage PTRARRY onloff nb Where on displays pointers as arrays e 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 5 items HC S 12 X Debugger Manual 567 Debugger Engine Commands Debugger Commands 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 will 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 ag
469. nu 1 Point at a C statement in the Source window and right click The Source Popup Menu is displayed 2 Choose Run To Cursor from the Popup Menu The application continues execution and stops before executing the statement You have executed a temporary breakpoint B Holding down the left mouse button pressing the T key Point at a C statement in the Source window and holding down the left mouse button press the T key 2 Atemporary breakpoint is defined 3 Choose Run To Cursor from the Popup 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 will no longer stop on the statement that contained the temporary breakpoint HC S 12 X Debugger Manual 155 Control Points Setting Breakpoints Permanent Breakpoints Permanent breakpoints are activated each time the instruction is executed A permanent breakpoint is recognized by the following icon H Setting Permanent Breakpoints A Using the Source Window Popup Menu 1 Point at a C statement in the Source window and right click The Source Popup Menu is displayed 2 Select Set BreakPoint from the Popup Menu A permanent breakpoint mark is displayed in front of the selected statement B Holding down the left mouse button pressing the P key 1 Point at a C statement in the Source window and holding down the le
470. nual 15 Table of Contents HALTED sie Sale 5 ste Ree heb este 2 vy hase ot boni eite ee 442 RESET ic E Ue ge geli evuieseeutesteg ees 442 Stepping and Breakpoint Messages 0 000 000 ee ee eee 442 STEPPED kr seneni a haces cease ea ee aa E RAE 442 STEPPED OVER iiL 44 Saas CDU wees 442 STOPPED erepti PUR yr peta eee DSUEASTE DIET RE 442 TRACED eee cuve uei 4 qu BER Hu 442 BREAKPOINT 25 zie UR MOERORE ae 442 WNATGHPOINT z coe ride coe ee 4 hateacgiie es dotate d 443 Terminal Emulation cole pe ENE EIER 443 Example for CPUI2 Targets 0 00 0 eee eee ee eee 443 Flash Programming 1 0 0 0c cece eee nee 445 Examples of HC12 CPU12 Direct Commands 445 Abatron BDI Connection Environment 0 0000005 447 Default Connection Setup sels 447 HC12 and HCS12 Banked Memory support 000 447 Banked Memory Location Window 0 eee ee ences 447 PPAGE TaD zu na EE EDEN eee eee Ue d DES 448 DPAGE Fab zc RII RW See PLA NU eS 449 EPAGEB Tab ace sen ee gee RU eEERA bE eR eles See as 449 Various Tab Not For All Connections 00 cee eee 450 Book Ill HC S 12 X Debug Connections Common Features Book M Contents obi um ERR eae kare DP ULP glee de dene Bae 451 HC S 12 X Debugger Manual 16 Table of Contents 15 HCS12 On chip DBG Module 453 16 HCS12X On chip DBG Module 455 17 Debugging Memory Map 457 Introduc
471. o Drag and Drop an Object To drag an object from one component window to another 1 Select the component containing the object you want to drag 2 Make sure the destination component window where you want to drag the object is visible 3 Select the object you want 4 Pressing and holding the left mouse button drag the object into the destination component window and then release the mouse button HC S 12 X Debugger Manual Debugger Interface Highlights of the User Interface Drag and Drop Combinations Dragging and dropping objects is possible between different component windows and are introduced in each component description section See below the possible combinations of drag and drop between components and associated actions When additional components are available new combinations might be possible and described in the component s information manual Dragging from Assembly Component Window Table 2 9 on page 39 summarizes dragging from the Assembly Component Table 2 9 Dragging from the Assembly Component Window Destination Component Action Window Command Line The Command Line component appends the address of the pointed to instruction to the current command Memory Dumps memory starting at the selected instruction PC The PC location is selected in the memory component Register Loads the destination register with the PC of the selected instruction Source Source component scrolls up t
472. o RiMC This mode requires a breakpoint to be set on the target system and slows down execution of the target application dramatically C Asynchronous reporting the state is done at regular intervals as defined below This mode requires access to the target memory while the target is running 500 ms rounded to next 100ms boundary ces In Asynchronous mode the interval for updating the state can be specified in increments of 100ms All the settings from this dialog are saved in the current project file and will be used in future sessions automatically There are now command line commands to setup the communication parameters MCPROTOCOL ON OFF Switched on and off the protocol to the Command window when open at all MCMODE SYNC ASYNC interval Sets the reporting mode to synchronous or asynchronous If asynchronous is specified the interval can be specified too If the interval is not specified the previous value will be maintained MCCONNECT HostName portNumber This command tries to connect to RIMC The name of the computer where RiMC is expected and or its port number can be can be specified If not specified the previous value will be used Each of these commands will close any pending communication and re establish communication with the new parameters In Synchronous mode the states are reported not faster than every 10ms This will avoid overruns in the communication to RiMC when using th
473. o have the Full Chip Simulation stop upon a write to read only write protected memory If you do not want the Full Chip Simulation to stop clear this checkbox Memory Configuration Module Startup Memory configuration is a dynamically loaded facility That is the new entry Configure appears in the Simulator menu upon loading of the Full Chip Simulation the Full Chip Simulation dll Selecting Configure opens the Memory Configuration dialog box so that you can configure memory HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Memory Block Setting You must set memory blocks within the available memory each block must cover a certain range The start address and end address define each memory block Memory Block Properties Table 11 3 on page 267 lists the properties you may specify for a memory block Table 11 3 Memory Block Properties Item Description name Name of the memory block type RAM ROM FLASH EEPROM or I O start Start address of the memory block end End address of the memory block wait state Time used for reading or writing a specific number of bytes bus width Width of the bus that accesses the memory 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 di
474. o start the debugger from within the IDE from a Project window icon or from the IDE Main Window menu bar Starting Debug from the Project Window To start the debugger from the Project window click the Debug icon Figure 2 1 on page 8 at the top of the Project window Figure 2 1 Project Window Make and Debug Icons I xd MyProj mcp Simulator MESI i pd RZ A Files Link Order Targets Mak Icon Debug Idon b lu B readme txt a AB tips txt n a na m Sources 189 De m 3 Startup Code 52 GE m Pm 0 D zi 23 Linker Map 0 0 a Libraries 7K 2K m 23 Debugger Project File 0 0 a C3 Debugger Cmd Files 0 0 mn 8 HC S 12 X Debugger Manual Debugger Interface Starting the Debugger Starting Debug from the Main Window Menu Bar You can also start the debugger from the main menu bar of the CodeWarrior IDE To start the debugger from the main menu bar select Debug from the Project menu Project Debug Figure 2 2 Main Window Project Menu File Edit View Search Project Debug Processor Expert Window Help sno fe Window B Hacda E d maia Crote Group MyProj mcp Create Target Create Seament Overlay A0 Simulator Create Design Files Link Order Tar Check Syntax cee Preprocess Ele Precemplle Bi readme txt Compile Cisy piw Disassemble CESHE Ca Startup Code Gem Bring Up To Date E C Linker Map
475. o the FLASH AEFSKIPERASING command of the debugger TIP When using this feature make sure to also select modules that could cover include all other modules listed modules usually called PAGED EEP_PAGED ALL_PPAGES ALL_EPAGES ALL_xxx etc HC S 12 X Debugger Manual 469 HC S 12 X Flash Programming NVMC Graphical User Interface NVMC Graphical User Interface The NVMC utility is integrated into the Debugger as an extension of certain debugger connections If the NVMC utility is available your connection menu includes a Flash selection as shown below Figure 18 5 SDI Connection Menu Options 470 Component Commi Load Reset Communication Set MCU Type Set MCU Speed Memory Map Flash Modules and Module States In following sections the expression available modules means all the FLASH or EEPROM on chip modules that the NVMC dialog box lists The module definitions track with the CPU derivative technical summary and special technical considerations If an onchip module consists of several independent blocks the NVMC dialog box might list all of these blocks however it would typically group the entire non volatile onchip blocks under one single listed module and separate relevant and important non volatile memory blocks like mirrored non banked memory range and provide an indivual selective module for these NOTE Please see Hardware Considerations on page 478 for more informa
476. o the source statements and highlights it Dragging from Data Component Window Table 2 10 on page 40 summarizes dragging from the Data Component HC S 12 X Debugger Manual 39 Debugger Interface Highlights of the User Interface Table 2 10 Dragging from the Data Component Window Destination Component Window Command Line Action 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 Memory Dumps memory starting at the address where the selected variable is located The memory area where the variable is located is selected in the memory component 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 Source Dragging the name of a global variable in the source Windows display the module where the variable is defined and the source text is searched for the first occurrence of the variable and highlighted NOTE Itis not possible to drag an expression defined with the Expression Editor The forbidden cursor is displayed Dragging from Source Component Window Table 2 11 on page 40 summarizes dragging from the Source Component Table 2 11 Dragging from the Source Component Window 40
477. oad 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 VERIFYOPTIONS displays the Code Verification Options group in the Load Executable File dialog If this option is missing the group is not displayed However the verification mode can still be specified with options above SYMBOLSOPTIONS displays the Load Options group in the Load Executable File dialog If this option is missing the group is not displayed However the code symbols mode can still be specified with options CODEONLY and SYMBOLSONLY NOTE By default the LOAD command is code symbols with no verification HC S 12 X Debugger Manual 551 Debugger Engine Commands Debugger Commands 552 NOTE Ifthe SYMBOLSONLY parameter is passed verification parameters are ignored and NO verification is performed Components Debugger engine Example LOAD F
478. oads 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 gt Memory SMEM 0x8000 8 The Memory component window is scrolled and specified memory addresses are highlighted HC S 12 X Debugger Manual 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
479. obal variables objects and calls the applicaiton main routine 242 HC S 12 X Debugger Manual Figure 10 7 Floating Point Selection Screen New Project Wizard Page 7 X HC12 Select the floating point format supported Select None for best code density f None float is IEEE32 double is IEEE32 float is IEEE32 double is IEEEB4 Don t use floating point support for the HC12 freescale 12 Select the floating point format by checking its checkbox and clicking the Next button to proceed Selecting any of the options results in the following conditions None Don t use floating point for the HC12 Float is IEEE32 double is IEEE32 All float and double variables are 32 bit IEEE32 for the HC12 Float is IEEE32 double is IEEE64 Float variables are 32 bit IEEE32 Double variables are 64 bit IEEE64 for the HC12 HC S 12 X Debugger Manual 243 HC12 Debugging First Steps Debugging First Steps Using the Wizard Figure 10 8 Memory Model Selection Screen New Project Wizard Page 8 E xj Which memory model shall be used C Small Banked C Large freescale memory model however all far objects and E Back Cancel 13 Select the Memory Model by checking its checkbox and clicking the Next button to proceed Selecting any of the options results in the following conditions Small The Small memory model is best used if both the code and the data fit into the 64kB add
480. of the COP and RTI these modules should be enabled after changing PLLSEL A stabilization time is simulated for the PLL it ranges from 100 to 1500 clock cycles after REFDV or SYNR registers have been modified Setting PLLSEL to 1 before this stabilization time elapses will generate a warning message The Full Chip Simulation will operate properly but the corresponding program might not work on the hardware RTI Real Time Interrupt and COP The reference clock for theses event is CLK24 if OSCCLK is different from CLK24 the RTI and COP period will be adapted to the clock difference Registers SYNR CRG Synthesizer Register SYNS5 SYN4 SYN3 SYN2 SYNI and SYNO are simulated REFDV CRG Reference Divider Register REFDV3 REFDV2 REFDV1 and REFDVO are simulated CRGFLG CRG Flags Register RTIF is simulated CRGINT CRG Interrupt Enable Register RTIE is simulated CLKSEL CRG Clock Select Register PLLSEL is simulated PLLCTL CRG PLL Control Register Is not simulated RTICTL CRG RTI Control Register RTR6 RTR5 RTR4 RTR3 RTR2 RTRI and RTRO are simulated The RTDEC is also simulated if the derivative supports it COPCTL CRG COP Control Register WCOP RSBCK CR2 CRI and CRO are simulated HC S 12 X Debugger Manual 295 HC S 12 X Full Chip Simulation Connection Supported Derivatives 296 ARMCOP CRG COP Timer Arm Reset Register Is simulated Enhanced Capture Timer ECT This I O
481. of your toolkit installation contains the latest information about FPP files HC12 CPU12 CPU devices HC12B32 fpp file name mcu03cl fpp number of Flash modules 1 applet code currently not relocatable loaded at 0x800 using 0x400 bytes module name FLASH B32 module number 0 32 KBytes flash located in 0x8000 OxFFFF or 0x0000 0x7FFF both handled according to MAPROM bit in MISC register boot sector unprotectable protectable 2 KBytes in range OxF800 0xFFFF or 0x7800 Ox7FFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register flash enable disable via ROMON bit in MISC register HC12D60 fpp file name mcu03c3 fpp number of Flash modules 2 applet code currently not relocatable loaded at 0x400 using 0x400 bytes module name FEE28 module number 0 HC S 12 X Debugger Manual 28 KBytes flash located in 0x1000 0x7FFF or 0x9000 OxFFFF both handled according to MAPROM bit in MISC register boot sector unprotectable protectable 8 KBytes in range 0x6000 0x7FFF or OxE000 OxFFFF via BOOTP bit in FEE28MCR register and LOCK bit in FEE28LCK register flash enable disable via ROMON28 bit in MISC register module name FEE32 module number 1 32 KBytes flash located in 0x8000 OxFFFF or 0x0000 0x7FFF both handled according to MAPROM bit in MISC register boot sector unprotectable protectable 8 KBytes in range OXE000 OxFFFF or 0x6000 Ox7FFF via BOOTP bit in FEE32MCR register and
482. og Box Add Channel x Object to monitor Cancel Help 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 11 41 on page 347 allows you to change the time base Select the object name in the list enter in the Ticks field a CPU timer proportional value and a number of pixels in the Pixels field to define the horizontal scale Click OK to validate or Cancel to exit 346 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 41 Settings Dialog Box Settings mm DIXIE fLedsPot Register bt gl Leds Port_Register bit 7 v Lancel Hep Change Colors The Change Colors dialog sbox shown in Figure 11 42 on page 347 allows you to change the colors from the selected Channel Figure 11 42 Change Colors Dialog Box Change colors Select the intended element in the categories field and click Change to open the standard color selection dialog click on OK to validate or Cancel to exit HC S 12 X Debugger Manual 347 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations No limitations 348 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Vis
483. oints 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 may be set in a Source or Assembly component window Positions Where a Breakpoint Is Definable A compound statement is one that can be split into several base instructions When using a high level language some compound statements can be generated as shown in the following example Figure 4 3 Source and Assembly Windows I Source iz E xd il Assembly OF x E DEMO fibo c Fibonacci fibl 0 y 5 X 1 n n while i lt n E Bl Mibo lt fibl fib2 fibl fib2 fib2 fibo i a return fibo KKK KK KKK KKK The Debugger helps you detect all positions where you can set a breakpoint 154 HC S 12 X Debugger Manual Control Points Setting Breakpoints 1 Right click in the Source component The Source Popup Menu is displayed on the screen 2 Choose Marks from the Popup Menu All statements where a breakpoint can be set are identified by a special red inverted check mark Pi 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 41 Setting Temporary Breakpoints A Using the Source Window Popup Me
484. ommand 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 HC S 12 X Debugger Manual 27 Debugger Interface Debugger Main Window 28 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 are stored for subsequent debugging sessions in the Simulator section of the PROJECT file using the variable CMDFILEO NOTE When a CPU is set the settings performed in this dialog are stored for subsequent debugging sessions in the Simulator XXX where XXX is the processor section of the PROJECT file using variables CMDFILEO CMDFILEI CMDFILEn Startup Command File The Startup command file is executed by the after the connection has been loaded The Startup command file full name and status enable disable can be specified either with the CMDFILE STARTUP Command Line command or using the Startup property tab of the Connection Command File Window on page 27 By default the STARTUP CMD file located in the current project directory is enabled as the current Startup command file Reset Command File The Rese
485. omponent 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 on page 519 command is applied to this Command Line component for HC S 12 X Debugger Manual 55 Debugger Components General Debugger Components example from another Command Line component the component is closed as soon as command execution is finished Variable Checking in the Command Line When specifying a single name as an expression in the command line this expression is first checked as a local variable in the current procedure If not found it is checked as a global variable in the current module If not found it is checked as a global variable in the application If not found it is checked as a function in the current module If not found it is checked as a function in the application finally if not found an error is generated Closing the Command Line during an execution When a command is executed from a Command Line component it cannot be closed If the Command Line component is closed with the close button or with the Close entry of the system menu the following message is displayed Command Component is busy Closing will be delayed and the Command component is
486. omponent 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 532 HC S 12 X Debugger Manual ENDFOR Description The ENDFOR keyword is associated with the FOR on page 541 command Usage ENDFOR Components Debugger engine Example fot i 1 5 define multi5 5 i endfor After the ENDFOR instruction i is equal to 5 ENDIF Description The ENDIF keyword is associated with the IF on page 548 command Usage ENDIF Components Debugger engine Example if CUR CPU 12 DW amp counter else DB amp counter endif HC S 12 X Debugger Manual 533 Debugger Engine Commands Debugger Commands ENDWHILE Description The ENDWHILE keyword is associated with the WHILE on page 596 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 Description 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 gt EXECUTE stimu txt 534 HC S 12 X Debugger Manual EXIT Description In the Command line component the EXIT command closes the Debugger applic
487. omponent window and right click That window s popup menu is displayed Choose Show Markpoints from the Popup Menu The Markpoints Tab of the Controlpoints Configuration Window is displayed In this tab s List box select the markpoint s you want to delete Click Delete The selected markpoint is removed from the list of defined watchpoints HC S 12 X Debugger Manual 175 Control Points Halting on a Control Point 5 Click OK to close the window The markpoint is deleted and the blue letter L in front of the variable memory range or code line is removed Halting on a Control Point Code execution is halted when the program reaches either a breakpoint or a watchpoint if the conditions specified in the definition of the breakpoint or watchpoint have been reached Code execution is NOT halted when the program reaches a markpoint Counting Control Point If the interval property is greater than 1 a counting control point has been defined When the Debugger is running each time the control point is reached its current value is decremented and the Debugger will halt when the value reaches zero 0 When the Debugger stops on the control point a command will be executed if defined and enabled Conditional Control Point If a condition has been defined and enabled for a control point that halts the Debugger a command will be executed if defined and enabled Control Point with Command When the Debugger halts on the control point
488. on specific Commands Full Chip Simulator Commands PORT Description In the Led components the PORT command sets the port Led location Usage PORT address Components Led component Example in PORT 0x210 PSMODE This command changes the power save mode The STOP option places the CPU in is lowest power consumption mode all internal CPU processing is halted The WAIT option places the CPU in low power consumption all internal CPU processing is halted however the internal clock the programmable timer SPI and SCI remain active for more detail see the HC05 manual This option consumes more power than the Stop option The WAKEUP option turns off the low power consumption mode the processor resumes normal processing Usage PSMODE STOP WAIT WAKEUP Components HI WAVE engine Example in PSMODI P 5 STOP The processor is completely stopped in gt PSMOD WAKEUP The processor is out of power save mode 624 HC S 12 X Debugger Manual Debugger Connection specific Commands Full Chip Simulator Commands REGBASE This command allows you to change the base address of the I O registers or to set Reset this address to 0 Usage Regbase Address R Where Address is an address to define the base address of the I O registers the R option sets this address to 0 Reset Components Debugger engine Example in regbase 0x500 Ox 500 is now
489. on 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 174 Setting a Source Markpoint A blue letter L is displayed in front of a code line associated with a markpoint To define a markpoint in source code Use the Source Popup Menu 1 Point at a code line in the Source window and right click The Source Window Popup Menu on page 171 is displayed Choose Set Markpoint from the Popup Menu A markpoint is defined at the beginning of the line Point in the Source window and right click The Source Popup Menu is displayed Choose Show WatchPoints from the popup menu The Controlpoints Configuration Window Markpoints Tab is displayed Make any modifications to the markpoint you have installed or any other markpoints listed Click OK to close the window Setting a Data Markpoint A blue letter L is displayed in front of a variable associated with a markpoint To define a data range markpoint Use the Data Popup Menu 1 Point at a variable in the Data window and right click The Data Popup Menu on page 172 is displayed Choose Set Markpoint from the popup menu A markpoint is defined at the beginning of the data range selected Point in the Data window and right click The Data Popup Menu is displayed Choose Show WatchPoints from the pop
490. on 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 gt BS 8000 This command sets a permanent breakpoint at the address 0x8000 BS amp 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 amp 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 gt BS Fibo c main 3 Sets a breakpoint at the 3rd mark of the procedure main where main is a function of the FIBO C module in gt BS amp counte
491. one via terminal window The produced application will run on real hardware as well Step 1 Environment Setup The tutorial is using Processor Expert you can get a free Processor Expert licence Special Edition from www codewarrior com n order to run the produced example on real hardware you will need a serial cable This cable must connect COMI PC with the SCIO Hardware Board Step 2 Creating the project Launch the CodeWarrior IDE n the CodeWarrior menu Select File gt New Make sure the Project tab is active Select HC S 12 New Project Wizard Enter a project name like MyGuessTheNumber Change the directory if you want Location Set Click OK The project wizard opens to let you select the device language etc Select a derivative like MC9S12DP256B and click Next Select C for the language and click Next Select Yes for Processor Expert support and click Next Select No for PCLint support and click Next Select float is IEEE 32 and double is IEEE 32 and click Next Select Full Chip Simulation and click Finish HC S 12 X Debugger Manual 389 HC S 12 X Full Chip Simulation Connection FCS Tutorials A new project is created using the wizard and the Processor Expert is available Several windows should be visible Figure 11 75 Created Project Metrowerks CodeWarrior ni xl File Edit View Search Project Debug ProcessorExpert Window He
492. onent These entries are described in Table 11 14 on page 333 Figure 11 22 ADC DAC Menu Setup Reset Conversion parameters Start conversion Display properties Table 11 14 ADC DAC Menu Description Menu Entry Description Setup Opens the ADC DAC Setup dialog box allowing you to set the port addresses Reset This function erases the visualization screen and re initializes the display properties Conversion Opens the Conversion Parameters dialog box allowing you to Parameters set the signal frequency Start Conversion Runs the conversion process Display Properties Opens the Display Properties dialog box allowing you to set the display properties ADC DAC Setup Dialog Box This dialog box shown in Figure 11 23 on page 334 allows you to define the port and address or select one port of the five proposed These are used when this component functions with the Programmable IO Ports Component on page 352 component HC S 12 X Debugger Manual 333 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 23 ADC DAC Setup Dialog Box JADC DAC Setup pono po m a co Port B Port C Port E Conversion Parameters Dialog Box This dialog box shown in Figure 11 24 on page 334 allows you to choose the analog signal frequency generated by the sinus generator and the sampling frequency The choice of these two frequencies internally
493. ooo PPAGE DFDD CCR SXHINZVC I Aut Symb Global E startupData 6 tagStartup 00 00 uu uu 00 00 E SEG END SSTACK 0 array 0 of signed char 00 00 00 00 00 00 00 00 DO 00 00 00 00 00 00 00 00 00 00 00 00 00 Auto Symb 2 000000 MHz 0 Table 2 2 on page 15 describes File Menu entries Table 2 2 File Menu Entry Description Menu Entry Description New Creates a new project Load Application Loads an executable file or debugger connection if nothing is selected restart abs Recent applications list await abs 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 HC S 12 X Debugger Manual 15 Debugger Interface Debugger Main Window Table 2 2 File Menu Entry Description Menu Entry Description Save Configuration Saves the project file Save Project As Opens the debugger project window to save the project file under a different path and name and format PJT INI Configuration Opens the Preferences window to set environment variables for current p
494. or example version management PVCS Example USELIBPATH ON See also Environment variable LIBRARYPATH include lt File gt Path on page 648 HC S 12 X Debugger Manual 651 Debugger Engine Environment Variables Search Order for Source Files Search Order for Source Files This section describes the search order from first to last used by the debugger H In the Debugger for C Source Files c Cpp Path coded in the absolute file abs Project file directory where the pjt or ini file is located Paths defined in the GENPATH environment variable from left to right et a a Abs File directory In the Debugger for Assembly Source Files dbg 1 Path coded in the absolute file abs 2 Project file directory where pjt or ini file is located 3 Paths defined in the GENPATH environment variable from left to right 4 Abs File directory In the Debugger for Object Files H ILOADER Path coded in the absolute file abs Abs File directory Project file directory where pjt or ini file is located Path defined in the OBJPATH environment variable Paths defined in the GENPATH environment variable from left to right wR OD Om Debugger Files The Debugger comes with several program application configuration files and examples These files and file extensions are listed in the following table 652 HC S 12 X Debugger Manual Table 22 2 Debugger File Extensions
495. orMsg If Assignment Ident Expression ErrorMsg MSG String IfStatemen 5 IF BoolExpr THEN StatSequence ELSIFPart ELSEPart END ELSIFPart ELSIF BoolExpr THEN StatSequence ELSEPart ELSE StatSequence String ri charpy 1t BoolExpr Expression RelOp Expression Expression Term Op Term Term Ident Function Number Tdent a z ROO R31 Du SP SR Pc STATUS B Function E CMB Mw MD MAS CI Expression Relop SEN ILILILI Op tae teh The terminal symbols have the following meaning B is the given reference to the task descriptor initialized upon start a z are variables for intermediate storage MB gets value of memory BYTE at given address MW gets value of memory WORD at given address MD gets value of DOUBLE WORD at given address MA gets value at given address interpreted as DOUBLE WORD PC is the program counter to be set SP is the stack pointer to be set SR is the status register value to be set DL is the dynamic link data base to be set if not available same as SP STATUS is the error number to be set refer to manual Rnn processor registers to be set mapping to CPU registers see manual MSG is the error message has to be specified if N gt 1000 On activation of the task debugging command the file OSPARAM PRM is opened and the selected address is stored in variable B Then the commands in the file are
496. order Operations 0 0 00 c eee eee eee 102 Recorder Men s v emeskE Rex eRHEE EATA Se eal eae 103 Register Component ssc ess re e eee eee 105 Status Resister Bits oy ssw ee bee ne ae oe ie ue ee AE 105 Editing Registers ose eter ss 105 Register Menu Format Submenu 00 2 ee ee eee 106 Drop Into ierre fat iaes a Dans was eau ete bees dieere 107 SoftTrace Component 0 0 0 eee ee 108 SoftTrace Operations llle 108 SoftIrace Menu oue RAP RIEN EISE Glin 108 Associated Popup Menu sssseeeee eee 109 Source Component essei isea es rade RR eR RE 111 Folding and Unfolding 0 0 0 eee eee eee 114 Source Menus os es Sa A ae eee baa ih Sats 115 HC S 12 X Debugger Manual 4 Table of Contents OpenSource File sd eU TU See Be ees 119 Go to Line co sah a uer ORG EAM dds eed See 119 Find Operations 04 4 0 esee eR Ree eh mee 120 Find Procedure o cie ERR ERE LRER E E SES 121 Foldiftige Menu iaaea e i e RR ERE REUS 121 Visualization Utilities lees 123 Inspector Component 0 0 eee ee e 124 Inspector Operations vs ies e le oe ee ee RE a 128 Inspector Ment amp 2 cede ate ea ean wala Ghee hoe es Goda tas 129 Associated Popup Menu 0 0 0 0 c eee eee eee 129 VisualizationTool Component 00 0 ce eee eee eee 131 Edit Mode and Display Mode 00 0002 esee 132 VisualizationTool Menu 00 0 0 eee eee eee 133 As
497. ormation of a framework application OPEN on page 563 component x y width height ilmax Opens a Windows component SET on page 576 targetName Sets a new target SLAY on page 577 fileName Saves the general window layout Component Commands Component common commands are used to monitor component behaviors They are common to more than one component and for better usage they should be redirected as explained in the introduction to this chapter Table 20 4 on page 492 contains all available Component commands Table 20 4 List of Component Commands Command Syntax CMDFILE on page 520 Short Description Specify a command file state and full name EXIT on page 535 Terminates the application HELP on page 547 Displays a list of available commands RESET on page 570 Resets statistics SMEM on page 578 range Shows a memory range SMOD on page 579 module 492 Shows module information in the destination component HC S 12 X Debugger Manual Table 20 4 List of Component Commands Command Syntax SPC on page 580 address Short Description Shows the specified address in a component window SPROC on page 581 level Shows information associated with the specified procedure VER on page 593 Displays version number of components and engine Component Specific Commands Component specific commands are assoc
498. ory address will be set to 0x10 16 2 Once a value has been allocated to a memory word it is validated and the next memory address is automatically selected and can be edited 3 To stop editing and validate the last input value you can either press the Enter or Tab key or select another variable 4 To stop editing and restore the previous memory value press the Esc key How to Consult Assembler Instructions Generated by a Source Statement The Debugger provides an on line disassembly facility which allows you to disassemble the hexadecimal code directly from the Debugger code area Online disassembly can be performed in one of the following ways Using Drag and Drop 1 In the Source component select the section you want to disassemble 2 Drag the highlighted block to the Assembly component Holding down the left mouse button and pressing the R key 1 In the Source component window point to the instruction you want to disassemble 2 Hold down the left mouse button and press the R key HC S 12 X Debugger Manual 205 How To How To View Code The disassembled code associated with the selected source instruction is greyed in the Assembly component How To View Code The Debugger allows you to view the code associated with each assembler instruction Figure 6 7 Viewing Code Associated with Assembler instruction E Assembly OF x Fibonacci Set Breakpoint Run To Cursor Show Breakpoints Show Location
499. ory to where the maker is located Listing 9 3 Script for Maker Action Association c Freescale prog maker exe fibo mak Sif SExist edout Message No Messages found Cancel SErrClr SErrGet edout HC S 12 X Debugger Manual 223 Synchronized Debugging Through DA C IDE Debugger Interface Figure 9 9 DA C Maker Settings User Defined Actions 21 xj Menu Start Actions Menu File Version Control Systems Actions New Delete Rename E F E Down r Menu r Tool bar C None ri s a Picture Make BMP Browse r Action script c hiware prog maker exe fibo mak 4if Exist edout 4Message No Messages found Cancel XErClr EnGet edout Debugger Interface DA C v3 5 is currently integrating a DAPI interface Debugging support Application Programming Interface Through this interface DA C is enabled to exchange messages with the Debugger The advantages of such connection show that it is possible 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 is following 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 an efficient use of this Debugger Interface Installation of communication DLL Configura
500. oss that code has not been generated 392 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Figure 11 78 Project Window Processor Expert Tab IMyGuessTheNumber mcp x Simulator ia v A E E Files Link Order Targets Processor Expert aS Configurations lt amp 112pin Ee CPUs B Cpu MC9S12DP256BCPY E Beans 4S1 AsynchroS erial EED ocumentatiorg x PESL 7 Under Beans you should find the previously created bean with the name AS1 AsynchroSerial Step 6 Bean Inspector AS1 AsynchroSerial Window In this window you can modify the behavior of the bean to your needs In the tab Properties you will find general settings Software drivers are found under the tab Methods and Events Select Properties tab Enter a proper baud rate If you want to run it on real hardware check your board manual for the right value If you want to run it on the Full Chip Simulation only you can enter 9600 HC S 12 X Debugger Manual 393 HC S 12 X Full Chip Simulation Connection FCS Tutorials Figure 11 79 Bean Inspector Window Bean Inspector AS1 AsynchroSerial lt Bean Items Visibility Help Properties Methods Events Comment Channel SCIO v Interrupt service event Disabled mone xl il Parity I Stopbt 13 M TxD PS1_TxDO SCI output mode Normal X Anitiaization O OOOO oo BAS
501. ossible with Windows 95 or with Windows 3 1x with Win32s Under Windows NT a driver that evaluates the port address must handle access to a port so you cannot specify a port address First try to define the Icd Port by name LPT1 or LPT2 If that does not work define the communication port by address Examples ICDPORT LPT2 Name of the port ICDPORT 0x378 Address of the port Default ICDPORT LPT1 HC S 12 X Debugger Manual 663 Connection specific Environment Variables ICD 12 Environment 664 NOTE ICDPORT 0x378 is the MS DOS first parallel printer port address ICDPORT 0x278 is the MS DOS second parallel printer port address Under some Win 3 x installations it could be necessary to specify the ICD 12 port by address BMDELAY Variable This variable slows down the communication speed of the serial link the ICD 12 cable The MCU clock speed is the maximum speed available but the PC also affects the communication speed So if your target MCU clock speed is slower than 1 MHz you may need a delay that is greater than 0 Syntax BMD ELAY x where x communication delay The x value 0 yields the fastest communication speed Example BMD You ELAY 9 may have to work down from a high x value such as 150 or 100 until you find the optimal value for your system Default The default x value is 0 HC S 12 X Debugger Manual Index Symbols ABS 437 abs file 45
502. oves any programming from all selected Flash modules That is it assigns the value OxFF 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 the modules HC S 12 X Debugger Manual 473 HC S 12 X Flash Programming NVMC Graphical User Interface 474 NOTE You merely 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 Debugger Connection specific Commands on page 599 MCU Speed Information The displayed MCU speed is the device bus speed clock sensed by the Flash Programmer the same value as the one returned by the FLASH command CAUTION A non relevant displayed speed is symptomatic of a Flash Programmer diagnostic problem In that case please close the dialog check the hardware set again the connection Configuration FPP File Loading When the dialog box is open the NVMC utility loads the F PP configuration file acco
503. ow on page 447 Command Files Select the entry Abatron BDI Command Files to display the Target Interface Command Files Window Help Select the entry Abatron BDI Help to open the Abatron BDI Connection Help File Abatron BDI Connection Windows Edit and Dialog Boxes 438 This section describes the dialog boxes which are specific to the Abatron BDI Connection Those dialogs are The Communication Device Specification Edit Box on page 439 The Setup Dialog Box on page 440 The Banked Memory Location Window on page 447 available only if the connected derivative is a Freescale HC12 that supports banking HC S 12 X Debugger Manual Abatron BDI Connection Abatron BDI Connection Windows Edit and Dialog Boxes Communication Device Specification Edit Box The Communication Device Specification edit box pops up automatically if the Abatron BDI Connection could not establish the communication with the BDI box interface However this dialog box can be opened by selecting the menu entry Abatron BDI Communication or Abatron BDI Connect If the connection to the target has been successfully achieved dialog opened using menu entry Abatron BDI Communication it is not possible to modify the Communication Device edit box Only the Show Protocol check box can be modified Figure 15 14 Communication Device Specification Edit Box Communication Device Specification Communication Device COM1 5
504. ox FLASH programming error x N No programming voltage If programming voltage is not available the following error message is displayed Figure 18 10 FLASH Writing Error Message Box FLASH Writing Error gt a IN The FLASH PAGEO module is not armed Cannot write at address 0x00009000 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 476 HC S 12 X Debugger Manual Preparing Loading an Application in Flash Use either The NVMC dialog box which the NVMC Dialog Box section explains Flash commands within a command file Debugger Connection specific Commands on page 599 explains these commands If necessary link your application with the appropriate memory model The example below shows a PRM file for an HC12DG128 application The default ROM is in pages 2 and 4 the application uses the banked memory model Make sure that your code location is within a Flash address range Listing 18 1 Loading an Application in Flash LINK my appli abs NAMES my appli o ansib lib start12b o END SECTIONS MY RAM READ WRITE 0x2010 TO 0x23FF MY ROM READ ONLY 0xC000 TO OxFEFF PAGE 2 READ ONLY 0x28000 TO Ox2BFFF PAGE 4 READ ONLY 0x48000 TO Ox4BFFF PLACEMENT _PRESTART STARTUP ROM_VAR STRINGS NON_BANKED COPY INTO MY
505. peration 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 on page 550 and LOG on page 553 command descriptions HC S 12 X Debugger Manual ELSE The ELSE keyword is associated with the LF on page 550 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 on page 548 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 HC S 12 X Debugger Manual 531 Debugger Engine Commands Debugger Commands 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 c
506. ports this emulation for CPU12 This allows the target application to write into the debugger Terminal component Also characters typed on the host s keyboard can be directed to the target application In order to use the terminal emulation the Terminal component has to be opened in the debugger Choose Component Open Terminal to open the Terminal component In order to simulate the terminal I O a work space of 4 bytes is needed The address of this work space has to be configured with the setup program from ABATRON For more information see the section Terminal in the User Manual from ABATRON and check the termbgnd c source file for communication primitives on the installation disk for BDI from ABATRON Refer to the section Terminal Component in the debugger core manual Example for CPU12 Targets The following structure is located in unpaged data memory on the target 0x00 RX Flag Byte 0x01 RX Char Byte 0x02 0x03 TX String Pointer Word The address of this structure is defined during BDI box setup The TermData structure address 0x0800 must match with the software setup of the BDI and exactly match the Terminal Address in the BDI Working Mode dialog of the ABATRON tool Refer to the BDI Interface Software Setup on page 430 section While the target is running the BDI periodically checks if the TX String Pointer is not zero Received characters from the host are written to RX Char and the RX
507. ption Switch on off the Show Protocol functionality Syntax PROTOCOL ON OFF Description If this command is used all the messages sent to and received from the debugger are reported in the Command Line window of the debugger The Show Protocol facility can also be switched on off using the corresponding check box in the Communication Device Specification Dialog Box The state of the Show Protocol is stored in the BDIK section of the project file using variable SHOWPROT Example PROTOCOL ON NOTE The Show Protocol is a useful debugging feature if there is a communication problem HC S 12 X Debugger Manual 601 Debugger Connection specific Commands Abatron BDI Connection Commands RESET 602 Short Description Reset of the target board Syntax RESET Description Use this command to reset the target from the Command Line component of the debugger The Reset Command File is also executed and the BDI interface automatically processes the initialization list startup init list stored in the interface Example RESET Banked Memory Location associated Commands The following sections describe the Banked Memory Location Command Line commands which are used by the Abatron BDI Connection These variables are BANKWINDOW on page 603 Those commands can be entered in the Abatron BDI Connection Command Files or in the Command Line component of HI WAVE The Banked Memory Location commands whi
508. r Kind of Port Variable e Select for Port to Display pwmRatio e Select for High Display Value 65535 Leave all others on default Now lets leave the Edit mode and run the final application First we might save the window layout Right mouse click gt Edit Mode or Ctrl E Select the Save icon in debugger or the menu bar File gt Save Configuration to save the window layout Select the Debug icon in debugger or the menu bar Run gt Start Continue or F5 402 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Figure 11 81 Debugger Main Window Final Application True Time Simulator amp Real Time Debugger Development version C Documents and Settings pammann My Docum inl x RatioStore 9875 unsigned E PUMDTYO lt l gt volatile PWMDTYOSTR FH PIMPERN V wnlatile PWMPER STR HC S 12 X Debugger Manual 403 HC S 12 X Full Chip Simulation Connection FCS Tutorials 404 HC S 12 X Debugger Manual 12 P amp E Multilink Cyclone Pro Connection Introduction An advanced feature of the Freescale debugger for the embedded system development world is the ability to load different connections debugging targets This document introduces the P amp E Multilink Cyclone Pro Connection This connection formerly ICD 12 is an interface developed by P amp E Microcomputer Systems
509. r 5 cond fibl fib2 cmd bckcolor red HC S 12 X Debugger Manual Sets a breakpoint at the address of the variable counter 5 where the condition is fib1 gt fib2 and the command is bckcolor red in gt BS amp 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 HC S 12 X Debugger Manual 515 Debugger Engine Commands Debugger Commands 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 It should exist and be 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 When using the CD command all commands referring to a file with no path specified could be affected Usage CD path path The pathname of a directory that becomes the current working directory case insensitive Components Debugger engine
510. r pressing the button HC S 12 X Debugger Manual 145 Debugger Components Visualization Utilities 146 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 now 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 Demo Version Limitations If you work in demo mode you will only be able to load one VisualizationTool window The number of instruments is limited to three HC S 12 X Debugger Manual Control Points This chapter provides an overview of the debugger control points Breakpoints Watchpoints and Markpoints Click any of the following links to jump to the corresponding section of this chapter Introduction on page 147 Breakpoints on page 148 Setting Breakpoints on page 154 Watchpoints on page 161 Setting Watchpoints on page 165 Markpoints on page 171 Setting Markpoints on page 174 Halting on a Control Point on p
511. rame Show Location Forces open component windows to show the code corresponding to the pointed to frame Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations The number of frames is limited to 50 Associated Commands CLOCK on page 519 CYCLE on page 521 FRAMES on page 542 RECORD on page 569 RESET on page 570 110 HC S 12 X Debugger Manual Debugger Components General Debugger Components Source Component The Source window shown in Figure 3 64 on page 111 displays the source code of your program i e your application file Figure 3 64 Source Window i Source Oy x EDEMOMfibo c Line 18 unsigned int Fibonacci unsigned int n al e unsigned fibl fib2 fibo int 1 fibl fib2 fibo i 2 0 1 n while i lt n BH fibo fibl fib2 i EB fibl fib2 fib2 fibo return fibo E void main void m 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
512. rding to this algorithm 1 The utility reads the NV PARAMETER FILE entry from the connection specific section of the project ini file Motorola ESL is sucha connection specific section Example Motorola ESL NV_PARAMETER_FILE C MYINSTALL PROG FPP mcu03C4 fpp If the utility retrieves a valid FPP file name it loads the file If the utility cannot find a valid FPP file name it displays an appropriate error message If the utility does not find an entry or if it finds an empty entry the utility automatically checks the Auto select according to MCUID checkbox Then the utility loads the parameter file from the F PP subdirectory of the METROWERKS installation according to the MCUID If the utility finds a file that has the wrong format it displays an appropriate error message The utility always displays the MCUID if the Id is available from the connection HC S 12 X Debugger Manual Another way to load an FPP parameter file is 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 any error during loading the utility displays an appropriate message Figure 18 7 Open Dialog Box Open Look in Gare sg jen e E sj Mcu03c3 fpp amp Mcu 3c4 fpp amp McuDe33 fpp
513. re activated after the instruction has been executed a certain number of times Conditional breakpoints which are activated when a given condition is TRUE HC S 12 X Debugger Manual Control Points Breakpoints Breakpoints are controlled through the Breakpoints tab of the Controlpoints Configuration window This window can be opened through the Source Window Popup menu as described below Figure 4 1 Source Window Popup Menu Source lal x D Profiles RTHO2c My Documents nextun sources Start08 c Line 288 El endi Set Breakpoint void Startup void r parameter file Run To Cursor purpose 1 4 2 i Show Breakpoints i c Show Location wn init dat etc Ir 3 p called from _PRE Set Markpoint tj z Show Markpoints ifdef ELF OBJECT F Open Source File DisableInterrupts is done in the pre endif Copy Gre for BH forz M ams call the root t if startupDat GoTo Line Ctrl G INIT SP 0 initialize t Find Ctrl F INIT SP FROM ST FindProcedure Ctrl I a SS Init Folding startupData ma E end loop for Marks B ToolTips e Linker 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 on page 150 is opened The Breakpoints tab of this window is shown in Figure 4 2 HC S 12 X Debugger Man
514. re details about commands refer to Debugger Engine Commands on page 487 Coverage Component The Coverage window shown in Figure 3 10 on page 59 contains source modules and procedure names as well as percentage values representing the proportion of executed code in a given source module or procedure Please note that in cases where in cases of advanced code optimizations like linker overlapping ROM code areas the coverage output data is affected In such a case it is recommended to switch of such linker optimizations HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 10 Coverage Window ime Coverage ojx B calc c E terminal c E 3s pps GetChar PutChar Putstring InitTermIO E inout c 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 on page 59 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 popup menu Figure 3 11 Split Views i 2 while i lt n m fibo fibl tival fibl fib2 fibo Coverage Operations Click the folded unfolded icons HIE to unfold fold the source module and display hide the functions defined Coverage Menu The Coverage menu and submenus are sho
515. re requirements CodeWarrior and Serial Monitor Connection There are two seperate paths that may be followed to take the first steps toward debugging with Codewarrior and the HCS12 Serial Monitor connection The differences between the two paths hinge on the starting point for the steps Using the Stationary Wizard at the start of the project From within an existing project These paths are explained in the Getting Started chapter of this manual HC S 12 X Debugger Manual 417 HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface HCS12 Serial Monitor Interface To utilize the HCS12 Serial Monitor connection take the following steps 1 Run the CodeWarrior IDE with the shortcut created in the program group 2 Create a project see the Getting Started chapter of this manual 3 Choose the menu Project Make and Project Debug to start the debugger Debugger Main window opens Figure 14 1 Debugger Main Window Component Menu 418 c s e 2 0 e 5 True Time Simulator amp Real Time Debugger D Profiles RTHO2c My Docu File View Run MONITOR HCS12 Component Source Window Help Set Connection rn A M Fonts Background Color Are poL 4 Inthe debugger main window from the Component menu you can choose Component Set Connection if you wish to select another connection
516. re the file types 216 Configuring 213 Configuring the tools 221 Database directory 215 Debugger Interface 224 Debugger name 230 IDE 213 library path 216 Ndapi dll 229 new project 214 Preprocessor Header Directories 217 Preprocessor Preinclude file 218 Project root directory 215 Referential project root directory 215 Requirements 213 rue Time Simulator and Real Time Debugger project file 227 Source 217 Synchronized debugging 229 Troubleshooting 229 User help file 215 working directories 214 667 DASM 522 Data compression 441 658 DB 523 DDE HI WAVE server 211 DDEPROTOCOL 525 Debug Module 291 Debugger Start Option C 10 Debugger Start Option Cmd 10 Debugger Start Option ENVpath 11 Debugger Start Option Instance currentTargetName 10 Debugger Start Option Nodefaults 10 Debugger Start Option Prod 10 Debugger Start Option T 9 Debugger Start Option Target 10 Debugger Start Option W 10 Debugger starting 8 Debugging 5 Debugging Memory Map 457 Dec 70 81 106 200 Decimal 200 Decimalmode 142 Default target 447 DEFAULT ENV 634 635 645 646 650 default mem 263 DEFAULTDIR 645 DefaultDir 192 DEFINE 526 DELCHANNEL 620 Delete Breakpoint 52 116 Demo Version Limitations 338 DETAILS 527 Dialog 471 472 Direct commands 445 Disable Breakpoint 52 116 disabled 472 Disabling 473 Display 80 Display Absolute Address 50 Display Adress 50 Display Adress Dialog 83 Display Bank Memory Location dialog
517. rects automatic computation of read and write accesses allow misaligned access Flag that allows Word misaligned and Long misaligned block type USER_DEF block you define AUTO_GEN block automatically generated AUTO_MEM master block for standard configuration AUTO_RAM RAM master block for auto configuration or AUTO_ROM ROM master block for auto configuration Memory Configuration Dialog Box Command Buttons The command buttons of the Memory Configuration dialog box are Add Fills a new memory block according to the current data of the Name Type Start End Bus width and Access Details controls This new memory block appears at the end of the list box If there are any errors in this new block such as an HC S 12 X Debugger Manual 267 HC S 12 X Full Chip Simulation Connection improper field value the system generates a message box that informs you of the problem Update Updates the current memory block according to the current data of the Name Type Start End Bus width and Access Details controls Delete Removes the currently selected memory block from the list box The list box contents adjust to reflect this deletion OK Closes the dialog box and validates the list of modified memory blocks The parent class can access this list updating its own list Cancel Closes the dialog box canceling your modifications Help Opens the dialog box help file A
518. res llsleleeee esee 181 RTK Awareness Register Assignments 000000002 eee eee 182 OSEK Kernel Awareness ienei naira ea eee eee 183 OSBK ORTE EEUU te edited ape hada nik I ege e 183 ORTI File and Filename lt ii poa it paai aaa i a a ee eee 183 HC S 12 X Debugger Manual 6 Table of Contents ORH File Struct r Tosi bik Re et eer Le SERE ERES UE 184 OSEK RTK Inspector Component sleseeeeee eee 184 Inspector Task ecce eme e eee RES eed 185 InspectorStack sce a naa ea Se EA eG E E 187 Inspector SystemTimer 0 0 0 cee eee eee 187 Inspector Alarm seger co nat eee tee ga sets At Pet E eee ss 188 Inspector Messages saia eurei e eet a cee eee eee 189 6 HowTo 191 How To Configure the Debugger 00 0 0 cee eee eee 192 For Use from Desktop Win 95 Win 98 Win NT4 0 or Win2000 192 Defining the Default Directory in the MCUTOOLS INI 192 How To Start the Debugger 0 0 00 eee ee ee eee 193 From WinEdit nera ta Se a teat eee 193 Automating Debugger Startup 0 00 0 cee eee eee eee 194 How To Load an Application 00 00 cee eee eee 195 How To Start an Application 0 0 eee eee eee 196 How To Stop an Application 0 0 00 cee eee eee eee 196 How To Step in the Application eee eee ee eee ee 197 On Sou rce Eevel scierie Sab erp eer DPEQURPLUNPERPSEERDC 197 On the Next Source Instruction eee 197
519. resents a set of different components that are introduced in the Typical Component Window Display on page 19 section Set Connection Sets the Debugger connection Fonts Opens a standard Font Selection dialog where you can set the font used by Debugger components Background Color Opens a standard Color Selection dialog where you can set the background color used by the Debugger component windows NOTE Fora readable display we recommend using a proportional font e g Courier Terminal etc Select Component gt Open to load an extra component window that has not been loaded by the Debugger at startup The popup dialog presents a set of different components that are introduced in Debugger Components on page 45 Select Component gt Set Connection and the Set Connection dialog box shown in Figure 2 20 on page 31 is opened HC S 12 X Debugger Manual Debugger Interface Debugger Main Window Figure 2 20 Set Connection Dialog Box Set Target xj Processor Simulator Target Interface Y BDIK Target Interface HC512 Serial Monitor T arget Interface Hel ICD12 Target Interface ad Simulator T arget Interface Target Interface Cancel GDI Target Interface SofTec HCS12 Target Interface 2 Use the Processor list popup to select the desired processor 3 Use the connection list popup to select the desired connection A text panel displays information about the selected
520. ress 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 Banked Banked memory model uses banked function calls by default but the default data access is still 16 bit Because the overhead of the far funtion call is not very large this memory model suits all applications with more than 64k code Data paging can be used however all far objects and pointers to them have to be specially declared Large The Large memory model supports both code banking and data paging by default But data paging causes an especially large volume of overhead and should therefore be used with care Overhead is significant with respect to both code size and speed If it is possible to manually use far accesses to any data which does not fit into the 64 bit address space then the banked memory model should be used instead 244 HC S 12 X Debugger Manual Figure 10 9 Connection Selection Screen New Project Wizard Page 9 a x Please choose the connections you want You can select multiple connections Full Chip Simulation P amp E Multilink Cvclone Pro SofTec HCS12 Abatron BDI HCS12 Serial Monitor nnect to any of the USB based SofTec icrosystems tools for HCS12 inDART HC512 etc freescale 14 Select the connection by checkin
521. ression x Cancel Example With 2 variables variable 1 variable 2 expression entered variable 1 variable 2 O0xFF lt 0x1000 results in a boolean type expression entered variable 1 variable 2 0x1000 will result in an integer type NOTE Itis not possible to drag an expression defined with the Expression Editor The forbidden cursor is displayed Expression Command file The Expression Command file is automatically generated when a new application is loaded or exiting from the Debugger User defined expressions are stored in this command file The name of the expression command file is the name of the application with a xpr extension XPR file When loading a new user application the debugger executes the matching expression command file to load the user defined expression into the data component Example When loading ibo abs the debugger executes Fibo xpr HC S 12 X Debugger Manual 67 Debugger Components General Debugger Components Data Menu Figure 3 20 on page 68 shows the Data component menu the Zoom submenu is shown in Figure 3 29 on page 74 the Scope submenu is shown in Figure 3 21 on page 69 the Format submenu in Figure 3 22 on page 69 the Mode submenu in Figure 3 24 on page 71 the Options submenu in Figure 3 26 on page 72 and the Zoom and Sort submenus in Figure 3 29 on page 74 Data Menu entries are described in Table 3 8 on page 68 Figure 3 20 Data M
522. rl 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 The syntax of the expression will be checked when you select another watchpoint in the list box or by clicking OK If a syntax error has been detected a message box is displayed Incorrect Condition Do you want to correct it Click OK to correct the error in the condition edit box HC S 12 X Debugger Manual Control Points Setting Watchpoints Click Cancel to clear the condition edit box Setting Watchpoints Watchpoints may be set in a Data or Memory window NOTE Due to hardware restrictions the watchpoint function might not be implemented on hardware connections Setting a Read Watchpoint A green vertical bar is displayed in front of a variable associated with a read access watchpoint The Debugger provides
523. rmat UDec Variable values are displayed in unsigned decimal format Bin Variable values are displayed in binary format Symbolic Displayed format depends on variable type Values for pointer variables are displayed in hexadecimal format Values for function pointer variables are displayed as function name Values for character variables are displayed in ASCII character and decimal format Te eger Values for other variables are displayed in signed or unsigned decimal format depending on the variable being signed or not HC S 12 X Debugger Manual How To How To Work on Variables Format menu is activated as follows 1 Right click in the Data component The Data Popup Menu is displayed on the screen 2 Choose Format from Popup Menu The list of all formats is displayed on the screen The format selected is valid for the whole Data component Values from all variables in the data component are displayed according to the selected format Modify a Variable Value The Debugger allows you to change the value of a variable as shown in Figure 6 4 on page 201 Figure 6 4 Modifying a Variable Value im Data 2 Iof X Fibonacci Auto Symb Local n EI Fio int signed int fibl 987 fib2 1597 unsigned int fibo 1597 unsigned int 1 l8 int The Debugger allows you to change the value of a variable Double click on a variable The current variable value is highlighted and can be edited 1 Formats for the input value
524. roject 1 Project ini Recent project file list 2 Test ini 3 Exit Quits the Debugger You can shortcut some of these functions by clicking toolbar icons refer to the Debugger Main Window Toolbar on page 12 section Preferences Window Open the Preferences window by selecting Configuration from the Files menu With this window Figure 2 8 on page 17 it is possible to set up environment variables for the current project New variables are saved in the current project file when you clickthe OK button NOTE The corresponding menu entry File gt Configuration is only enabled if a project file is loaded 16 HC S 12 X Debugger Manual Debugger Interface Debugger Main Window Figure 2 8 Preferences Window x Environment Header File Path Various Environment Variables Add EES Delete Up Down Compilerib hc12c C Compilertlibshel 2chinclude Compilertlibshel 2c lib Compiler lib xgatec sre Compilerllib gatec include Compilertlib xgatec lib The Preferences Window contains the following controls A list box containing all available environment variables You can select a variable with the mouse or Up Down buttons Command Line Arguments are displayed in the text box You can add delete or modify options and specify a directory with the browse button e A second list box contains the arguments for all of the environment variables defined in the corresponding
525. roject Manager s window of DA C select the Logical View Tab shown in Figure 9 6 on page 220 and unfold all fields you will now have the overview of your project Figure 9 6 Logical View Tab A DA C myproject Project JO x Eile Edit Search Browse Graph Metrics Start Project Options Window Help l x E Explorer View 7 Folder View Logical View a a vem Symbols Messages Version Info Dependencies DA C Properties efault folders B E Project Root Vesper D detault env i B counter 0 fibo mak fibt 9 Fibo prm 3 ad Bi myproject dep 15 fiboCount LJ project ini Readme t t Egg Dac E g Pinclude O HIWARE M68xxx CPU32 V5 0 h Ei fg Drive C Ei gg HIWARE Eg LIB Gg MEBKC B include Q Hidef h Stddef h O Stdtypes h B Default types B C Source Files O Fibo c Assembler Source Files Header Files Document Files E Miscellaneous Files detault env fibo mak O Fibo prm myproject dep Lj project ini Readme t t CAPS NUM Double click on Fibo c file to open it 220 HC S 12 X Debugger Manual Synchronized Debugging Through DA C IDE Configuring DA C IDE for Freescale Tool Kit Configuring The Tools We will now configure the compiler and maker into DA C IDE Procedures are defined in Project gt User Defined Actions from the main menu of DA C Compiler Configuration In Menu Start Actions click on new and fill in the New Action box with C amp ompile then pr
526. rs 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 Contents of Source Assembly and Memory component windows change 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 HC S 12 X Debugger Manual 105 Debugger Components General Debugger Components Register Menu Format Submenu The Register menu contains the items shown in Figure 3 60 on page 106 Table 3 31 on page 106 describes the menu entries Figure 3 60 Register Menu Be Bin Oct Dec UDec Float Auto BitReverse Table 3 31 Register Menu Description Menu Entry Description Hex Selects the hexadecimal register display format Bin Selects the binary register display format Oct Selects the octal register displ
527. rt an address in hexadecimal to select the Wagon position Predefined ports are fixed when the component operates with the Programmable IO Ports Component on page 352 Control Bits Configuration The 2 bytes sent to the 7 segments must be composed as shown in Figure 11 69 on page 371 Figure 11 69 Wagon Control Bits Description Motor port Motorport b7 b6 t5 b4 b3 2 b1 60 Sensor port Sensorport E T Esse ee stjsp fr To move the wagon to the right set bit r and 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 START button is clicked with left mouse button and sets stp when STOP button is clicked HC S 12 X Debugger Manual 371 HC S 12 X Full Chip Simulation Connection True Time I O Stimulation True Time I O Stimulation The Full Chip Simulation I O Stimulation component is a facility to trigger I O events With the Stimulation component loaded interrupts and register modifications invoked by the hardware can be simulated In this tutorial examples of stimulation files are introduced and explained Click any of the following links to jump to the corresponding section of this chapter Stimulation Program Examples on page 372 Stimulation Input File Syntax on page 380 Stimulation Program Examples Running an
528. running Memory access while running is possible in physical memory ram registers Figure 17 3 Edition Dialog Box Type Dropdown List MC9S12E256 Debugging Memory Map x IV Enable memory module Start 0 End 3FFF hex Type physical IV refresh memory when halting read protected write protected 1 w protected jhysical banked memory range from Ox0 to Ox3fff is of physical type therefore accessed directly in device physical memory Ox0 Oxffff Each time the debugger is stopped or reset the memory data is retrieved from hardware Priority no memory access while running Commen Information i 460 HC S 12 X Debugger Manual A minor fiction has been created to simplify the GUI read protected write protected and r w protected types should be outside the Type selection as individual options Indeed these are not memory types These protection types are based on a physical type but the goal was to provide to the user I O Registers protections that are typically accessed as physical memory NOTE CPU core specific memory types and Priorities are listed at the end of this manual section Priorities The Priority drop down list provides all of the memory overlap priority available for a type of processor core The debugger can have a higher priority highest debugger to setup an upper address range that can overlap an on chip address range this to make
529. ry Context Description Update All items All displayed information is updated Items that no longer exist are removed and new items are added Max Elements Allitems To display large arrays element by element the maximum number can be configured It is also possible to display a dialog that prompts the user Format All items Numerical values can be displayed in different formats Close singleselected Closes the corresponding component Component only Drag Out Items that can be dragged depends on which icon is selected Table 3 42 on page 130 gives a brief description Table 3 42 Inspector Component Drag Possibilities Dragging Item Description Components The components cannot be dragged Stack The Stack Icon itself cannot be dragged All subitems can be dragged the same way as the Symbol Table subitems described below Symbol Table The Symbol Table icon cannot be dragged out Subitems can be dragged depending on their type Modules Modules can be dragged to the source and global data window to specify a specific module Functions Functions can be dragged to display the function or code range Variables Variables can be dragged to display their content in memory Indirections Indirections can be dragged to display their content in memory 130 HC S 12 X Debugger Manual Debugger Components Visualization Utilities Drop Into Nothing can be
530. ry is enabled as the current Postload command file Component Menu The Component menu is shown in Figure 2 19 Component Menu on page 29 Figure 2 19 Component Menu ime Simulator amp Real Time Debugger Profiles RTHO2c My Documents MyProj Simulator ini File View Run Simulator Component Memory Window Help Open Set Target D Profiles RATHO2c My Do Fonts Background Color include hidef h emer es and macros E include mc68hc912dg128 h derivative information C003 CALL 0x8004 0x00 pragma LINK INFO DERIVATIVE mnc68hc912dgl28 C007 CALL 0x8000 0x00 COOB BGND COOC BGND COOD SUBB 17 void main void A COOF SUBB 25 put your own code here EnableInterrupts foris fill wait forever H Procedure IY DFDF PC C000 PPAGE cer sxuzuzvc Startup B E Memory I Auto Symb Global I Auto startupData X6 tagStartup 00080 00 00 uu uu 00 00 00 uu E SEG END SSTACK 0 array 0 of signed char 00088 00 00 00 00 00 00 00 00 00090 00 00 00 00 00 00 00 00 00098 00 00 00 00 00 00 00 00 Aut Symb Local Table 2 6 on page 30 describes the Component Menu entries HC S 12 X Debugger Manual 29 Debugger Interface Debugger Main Window Table 2 6 Component Menu Description 30 Menu entry Open Description Loads an extra component window that has not been loaded by the Debugger at startup The popup dialog p
531. s NOTE The Seven segments display component is much slower than its real equivalent So in simulation you don t need 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 Demo Version Limitations No limitations HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities 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 on page 372 section describes in detail and with example how to take advantage of this component The Stimulation window shown in Figure 11 56 on page 357 is a window component that 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 Figure 11 56 Stimulation Window E Stimulation Iof x TargetObject 1FaA0 TargetObject 1FB0 TargetObject 1FCO B 7 3 gt Stimulation Popup Menu Figure 11 57 on page 357 shows functions associated with the Source component Table 11 21 on page 357 describes these functions Figure 11 57 Stimulation Popup Menu Open File Execute v Display Cache Size
532. s When selected disables this markpoint Show Markpoints Opens the Controlpoints Configuration Window Markpoints Tab and displays list of markpoints defined in the application refer to Control Points on page 147 Address For a description of the remaining popup menu entries see Table 3 1 Assembly Menu Description on page 50 HC S 12 X Debugger Manual Debugger Components General Debugger Components Retrieving Source Statement Point to an instruction in the Assembly component window drag and drop it into the Source component window The Source component window scrolls to the source statement generating this assembly instruction and highlights it Left clicking the mouse and clicking the L 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 Drag Out Table 3 3 on page 53 shows the drag actions possible from the Assembly component Table 3 3 Assembly Component Drag Actions Destination Component Window Command Line Action The Command Line component appends the address of the pointed to instruction to the current command Memory Dumps memory starting at the selected instruction PC The PC location is selected in the memory component Register Loads the destination register with the PC of the
533. s should be present in the project file depending on the connection Those variables are used to store the Banked Memory Location definition range address number of pages and status enable disable specified either with the BANKWINDOW Command Line command the Banked Memory Location Window PPage Tab on page 448 Example BANKWINI BANKWINI BANKWINI BANKWINI DOW0 BANKWINI DOW1 BANKWINI DOW2 BANKWINI DOW3 BANKWINI DOW PPAGI DOW DPAGI n p OFF 0x8000 0xBFFF 0x30 64 OFF 0x7000 0x7FFF 0x34 256 DOW EPAGE OFF 0x400 0x7FF 0x36 256 DOW VARIOUS DLGATCONNECT HC S 12 X Debugger Manual ICD 12 Environment As with any HI WAVE program you can set ICD 12 connection component parameters in the DEFAULT ENV file This file should be in the working directory In normal use you set these parameters in the DEFAULT ENV file once interactively during installation You use these parameter values in subsequent debugging sessions ICD 12 Environment Variables The following sections introduce the environment variables associated with the ICD 12 connection ICDPORT Variable This variable specifies to the host computer the parallel communication port to which the ICD 12 connects Syntax ICDPORT LPTn ICDPORT LPTn ICDPORT portAddr where n number of the printer port 1 2 portAddr address of the printer port 1 2 Specifying the printer port address is only p
534. s the Auto Detect button to make the debugger search for the vector table address and vectors reserved by the HCS12 Serial Monitor 10 Once the autodetection succeeded press the OK button to start debugging HC S 12 X Debugger Manual 257 HC12 Debugging First Steps Switching to HCS12 Serial Monitor Connection 258 HC S 12 X Debugger Manual 11 HC S 12 X Full Chip Simulation Connection The Full Chip Simulation FCS connection runs a complete simulation of all processor peripherals and I O on the user s Personal Computer No development board is required Each derivative has a totally different simulation engine to accurately simulate the memory ranges I O and peripherals for a given derivative for more information on selecting a specific derivative please see the Select Device section below This section guides you through the first steps toward debugging with CodeWarrior and the HC S 12X Full Chip Simulation connection It does not replace all the additional documentation provided in this manual but gives you a good starting point Full Chip Simulation Menu This menu shown in Figure 11 1 on page 259 is associated with the Full Chip Simulation connection and allows you to load an application in the Full Chip Simulation Table 11 1 on page 260 describes the Full Chip Simulation menu entries Figure 11 1 HCS12 FCS Menu True Time Simulator amp Real Time Debugger D Profiles xRTHO2cMy Documents Switche Fil
535. s 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 of a memory range Range boundaries are always limited to an overlapped range with a bigger priority For example if 2 bytes have been defined in a range which overlaps another range accessing HC S 12 X Debugger Manual 459 Debugging Memory Map Debugging Memory Map GUI these 2 bytes will be performed using the type and rules of this 2 byte range The memory on both sides of these 2 bytes will be 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 will always read with rules of the range with the highest priority Types The Type drop down list provides all kinds of memory type 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 internally rules to read and write a kind of memory For examples the HCS12 banked type requires to set first a register called PPAGE to read the memory then to restore this value as it was before reading Also this banked type does not physically provide a memory access while
536. s to set a conditional breakpoint A Holding down the left mouse button pressing the S key 1 Point at a C statement in the Source Component window and holding down the left mouse button press the S key 2 The Controlpoints Configuration Window Breakpoints Tab on page 150 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 B Using the Source Window Popup Menu 1 Point at a C statement in the Source Component window and right click The Source Popup Menu is displayed 2 Select Set BreakPoint from the Popup Menu A breakpoint is defined on the selected instruction 3 Point in the Source Component window and right click The Source Popup Menu is displayed 4 Select Show Breakpoints from the Popup Menu The Controlpoints Configuration Window Breakpoints Tab on page 150 is opened and a new breakpoint is inserted in the list of breakpoints defined in the application 5 Select the breakpoint you want to modify by clicking on the
537. scrollbars on off or sets it to automatic mode Display Headline Switches the headline on or off Backgroundcolor Specifies the background color of the VisualizationTool 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 Grid Color Specifies the color of the grid points Refresh Mode Specifies the way the window will be refreshed 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 AII instruments have the common attributes shown in Table 3 46 on page 136 Table 3 46 Instruments Properties Attributes 136 Attribute Description X Position Specifies the X coordinate of the upper left corner Y Position Specifies the Y coordinate of the upper left corner Height Specifies the instruments height HC S 12 X Debugger Manual Debugger Components Visualization Utilities Table 3 46 Instruments Properties Attributes continued Attribute Width Description Specifies the in
538. sed when the component works with the Programmable IO_Ports Component on page 352 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 Demo Version Limitations No limitations 338 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities LCD Component The LCD Display component message box shown in Figure 11 30 on page 339 is the LCD utility which can display 1 or 2 lines of 16 characters and show or hide the position cursor Figure 11 30 LCD Display Message Box E LCD Display x Ready The display module consists of 2 eight bit width parallel couplers a data port and a control port as shown in Figure 11 31 on page 339 These ports communicate with the mainframe Figure 11 31 The LCD Display Module Ports Data Port Start data read write 4 Control Port Select read or write 0 Write in the RAM Select register 1 Read from the RAM U Byte dydy will be considered as an instruction 1 Byte dzd will be considered as an ASCII code This version doesn t allow the read access The R W should never worth 1 The bits d7 d0 represent an ASCII code to display characters or an instruct
539. ser can click a LED to toggle its state The underlying value is changed accordingly LED Operations If you click an LED its state toggles between green 0 and red 1 The corresponding bit in the underlying value is changed as well When you right click within the component window a popup 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 11 17 on page 327 Figure 11 17 LED Setup Dialog Box Led Setup x Specify location In the text field the user can specify which value should be displayed by the LED bar The location is specified with a string in the form object value Possible objects and their values can be listed in the Inspector component HC S 12 X Debugger Manual 327 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities 328 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 Demo Version Limitations No limitation HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Phone Component The Phone window shown in Figure 11 18 on page 329 is an input u
540. setup program from the ICD driver setup folder in your Freescale installation group or choose this command sequence from the Windows Start menu Start Programs Freescale ICD driver setup Win NT driver Interfacing Your System and P amp E Multilink Cyclone Pro Use a parallel printer cable for communication between the P amp E Multilink Cyclone Pro connection and the host computer The connection hardware must be equipped with a BDM connector that the cable will link with the host Communication to the connection is serial as shown in the following figure Figure 12 1 System P amp E Multilink Cyclone Pro Connection Interface LPTn parallel communication ICD 12 Link Printer Cable mm a TITITEITRTTITTTRTTTTTT ICD cable Connection Host Comp uter ena e unaibatidn Creating an ICD 12 project in the IDE stationery Wizard includes loading the P amp E Multilink Cyclone Pro connection driver The P amp E Multilink Cyclone Pro connection driver fully handles the communication protocol between the ICD 12 and the host computer NOTE To prevent communication problems use the shortest possible cable between the host and the connection hardware 406 HC S 12 X Debugger Manual P amp E Multilink Cyclone Pro Connection Loading the P amp E Multilink Cyclone Pro Connection Loading the P amp E Multilink Cyclone Pro Connection Usually the PROJECT INI file specifies the connection Target Icd The P
541. shed and we can launch it Make sure you have chosen the Full Chip Simulation connection Select the Debug icon in the Project Manager window or the menu bar Project gt Debug or F5 Select Component gt Open in the debugger and open the Terminal component e Select the Save icon in debugger or the menu bar File gt Save Configuration to save the window layout Select the Debug icon in debugger or the menu bar Run gt Start Continue or F5 Figure 11 80 Debugger Main Window Final Application True Time Simulator amp Real Time Debugger Development version C Documents and Settings pammann My Documents o es File View Run Simulator Component Terminal Window Help neja e 2 ne 5 z 2 s 4 2 E Source iBixl 2101 xd C Documents and Settings pammann My Documents MyGuessTheNumber C Line 71 for 77 BH unsigned char c coo3 NOP if ASI1 RecvChar amp c ERR OK A C004 LDAB PutChar c PutChar C006 STAB ifte lt 0 c gt 9 IH C008 STAB PutString not a number try again n COOA STAB A else if c ran 0 0 PutString nCongranailation _You_have_found_the mmh Terminal Number EntryPoint C000 PPAGE 0 cr SXHINZVC i Cpu C CpuMode 0 unsigned char E INITRM lt l gt volatile INITF E INITEE lt l gt volatile INITE IE Command EntryPoint Auto Symb Local Loading symbols of MyGuessTheNumber C
542. siderations 1 2 0 0 eee ee eee ee 235 Full Chip Simulation Considerations 0 0000 235 HCS12 Serial Monitor Considerations llle essel 235 SofTec HCS12 Considerations eee esee 236 ICD 12 Considerations 236 BDIK Considerations 0 0 0 eee e 236 Debugging First Steps Using the Wizard 0 0000 237 Switching Connections 247 Loading the Full Chip Simulation Connection 0 247 Loading the ICD 12 Connection lsleleeeeeee eene 249 Switching to SofTec HC12 sseseeeeeeeeee ee 253 Switching to HCS12 Serial Monitor Connection 255 11 HC S 12 X Full Chip Simulation Connection 259 Full Chip Simulation Menu 0 0 00 eee eee 259 Debugger Status Bar with Full Chip Simulation 260 Open I O Component Dialog Box 0 00 00 00008 261 Command File Window leseeeeeee eee 262 Memory Configuration 0 0 00 cee eene 263 Memory Configuration Dialog Box Features 263 Access Details Dialog Box 0 0 0 eee eee 268 Output 15455 ye Gi ds adnate en eS 269 Clock Frequency Setup 0 2c eee eee eee eee 269 Bus Trace uoce um a ee ee HR a eee ae 270 HC S 12 X Debugger Manual 9 Table of Contents Full Chip Simulation Warnings 271 WARNING SETUP Command 0000s 272 MESSAGE HIDE ID Command 0 0000
543. sistant for C from RistanCASE GmbH and the IDE allowing synchronized debugging features Figure 3 15 DA C Link Window DAC Link Ea DA C Link Operation When you load the DA C Link component communication is established with DA C if open in order to exchange synchronization information The Setup entry of the DA C Link main menu allows you to define the connection parameters NOTE For related information refer to the Chapter Synchronized Debugging Through DA C IDE on page 213 DA C Link Menu Selecting Setup from the DA C Link menu opens the Connection Specification dialog box Figure 3 16 DA C Link Menu DA C Link Setup Table 3 7 DA C Link Menu Description Opens the Connection Specification dialog box Connection Specification Dialog Box In the Connection Specificaton dialog box you can set the DA C debugger name HC S 12 X Debugger Manual 63 Debugger Components General Debugger Components Figure 3 17 Connection Specification Dialog Box Connection Specification x Debugger Name HIWARE HI WAVE 6 0 Cancel Help 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 t
544. sociated Popup Menu 0 00 c eee eee eee 134 VisualizationTool Properties 0 0 0 eee eee ee eee 136 Instruments 5 296 esse Soa te Seat testa REFERRE bales a E A E al ES 136 4 Control Points 147 Introd ction coser ad de Rex RR Bas ARS Melee pa RC 147 Breakpoints soe ERU ER up a a uM Ee MEDRPG 148 Breakpoints Tab ell ule ERI ea RR ERE eek e n 150 Multiple Selections in List Box 151 Checking Expressions 22 co Re ha ea eae ea Sadia es 151 Saving Breakpoints 0 0 eee cece ee ees 152 Setting Breakpomts c ces ees ee Os he we NOME PER ERAT ee 154 Positions Where a Breakpoint Is Definable 0 154 Temporary Breakpoints 0 0 0 0 eee eee eee eee 155 Setting Temporary Breakpoints 0 0 00 000000000 155 Permanent Breakpoints 0 0 0 0 eee eee eee eee 156 Setting Permanent Breakpoints 0 0000 156 Counting Breakpoints 0 0 0 eee ec eee 157 Setting Counting Breakpoints 00 0 000020000 157 Conditional Breakpoints llle 158 Setting Conditional Breakpoints 00 0 0000 158 Deleting Breakpoints 0 0 0 cee eee eA 159 HC S 12 X Debugger Manual 5 Table of Contents Associate a Command with a Breakpoint 00 0 160 Demo Version Limitations 0 000 002 eee eee 160 Watchpoints i ineeeentk m e big Ses da obs ee heen eee Meda nes 161 Watchpoints Tab
545. source block UPDATERATE on page 592 rate Sets the data and memory update mode ZOOM on page 598 address inlout HC S 12 X Debugger Manual Zooms in out a variable 495 Debugger Engine Commands Commands Overview 496 Command Syntax Terms address A number matching a memory address This number must be in the ANSI format i e or Ox for hexadecimal value 0 for octal etc Example 255 0377 OxFF FF NOTE address can also be an expression if constant address is not specially mentioned in the command description An expression can be Global variables of application I O registers defined in DEFAULT REG definitions in the command line numerical constants Example DEFINE IO PORT 0x210 WB IO PORT OxFF range A composition of 2 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 Ox2FO00 0x2FFF Refers to the memory range starting at 0x2F00 and ending at 0x2FFF 256 bytes Example Ox2F00 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 V or slash as a directory delimiter The parser is case insensitive If no path is sp
546. 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 HC S 12 X Debugger Manual 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 lt LayoutName gt 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 NOTE If Layout is defined in PROJECT INT the Layout parameter overwrites any Window lt n gt definition describing the default windows layout e tis possible to load a previously saved project from a file by inserting the following line in your PROJECT INT file
547. ss option I W was specified Execute command file lt cmdFile gt if specified Execute command if specified ph des sph ho Start running unless option I W was specified NOTE In version 6 0 of the debugger the loaded program is started after all command and command files are executed NOTE The function Open in the File menu will interpret any file without an ini extension as a command file and not a project file Example C Freescale PROG DEMO TEST ABS w d Debugger Main Window Once you start the Debugger the True Time Simulator amp Real Time Debugger window opens in the right side of the IDE Main Window HC S 12 X Debugger Manual 11 Debugger Interface Debugger Main Window Figure 2 3 Debugger Main Window True Time Simulator amp Real Time Debugger D Profiles RTHO2c My Documents MyProj Simulator ini File View Run Simulator Component Source Window Help cjela e e o s e FERE inis D Profiles RTHO2c My Documents MyProj S ources main c Line 1 include lt hidef h gt common defines and macros cooo LDS include lt mc68hce912dg128 h gt derivative information C003 CALL pragma LINK INFO DERIVATIVE nc68hc912dgl28 void main void A coo CALL COOB BGND COOC BGND COOD SUBB COOF SUBB 0x8004 0x00 0x8000 0x00 17 25 put your own code here EnableInterrupts HC12 CPU Cycles 0 pr a pr DF I farisei SMa wait forever
548. ssing 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 Usage DASM addresslrange 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 gt dasm 0xf04b OOFO4B LDHX 0x0450 OOFO4E TXS OOFO4F CLRH 00F050 CLRX 00F051 STX 0x80 00F053 INC 0x80 00F055 LDX 0x80 00F057 JSR OxFO000 00F05A STX 0x82 OOFO5C STA 0x81 00F05E LDA 40x17 00F060 CMP 0x80 00F062 BEQ 20 abs F050 00F064 BRA eS 119 abs F053 522 HC S 12 X Debugger Manual 00F066 DI ECX 00F067 DECX NOTE Depending on the target the above code may vary Disassembled instructions are displayed in the Command Line component window Therefore it is necessary to open the Command Line component before executing this command to see the dumped code DB The DB
549. ssociated with this dialog If Hex Format is checked all given values are in Hexadecimal Format You don t need to add Ox For instance type 1000 instead of 0x1000 NOTE Ifyou 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 41 on page 86 allows you to search memory or a memory range for a specific expression HC S 12 X Debugger Manual 85 Debugger Components General Debugger Components Figure 3 41 Search Pattern Dialog Box Search Pattern Update Rate This dialog box shown in Figure 3 42 on page 86 allows you to modify the update rate in steps of 100ms Figure 3 42 Update Rate Dialog Box Update Rate NOTE Periodical mode is not available for all hardware connections or some additional configuration may be required in order to make it work 86 HC S 12 X Debugger Manual Debugger Components General Debugger Components Associated Popup Menu Figure 3 43 Memory Popup Menu Set Watchpoint Delete Watchpoint Show Watchpoints Set Markpoint Show Markpoints Show Location Word Size Format Mode Display Ow vor Fill Address Copymem Search Pattern The Memory popup menu entries shown in Table 3 21 on page 87 allow you to execute memory associated commands Table 3 21 Memory Popup Menu Description Menu Entr
550. ster Register Name Size bit RO A 8 high byte of D R1 B 8 low byte of D R2 CCR 8 R6 D 16 concatenation of A B R7 X 16 R8 Y 16 R9 SP 24 concatenation of xPAGE SP if in banked area R10 PC 16 R11 PPAGE 8 182 HC S 12 X Debugger Manual Real Time Kernel Awareness OSEK Kernel Awareness Table 5 1 HC12 RTK Awareness Register Assignments Register Register Name Size bit R12 EPAGE 8 R13 DPAGE 8 R14 IP 24 concatenation of PPAGE PC if in banked area OSEK Kernel Awareness OSEK Kernel provides a framework for building real time applications OSEK Kernel awareness within the debugger allows you to debug your application from the operating system perspective The CodeWarrior Debugger supports OSEK ORTI compliant real time operating systems and offers dedicated kernel awareness using the information stored in your application s ORTI file With CodeWarrior OSEK kernel awareness you can monitor kernel task information semaphores messages queues resources allocations synchronization communicating between tasks etc ORTI describes the applications in any OSEK implementation A set of attributes for system objects A method for interpreting the data obtained OSEK ORTI The OSEK Run Time Interface ORTI is an interface for development tools to the OSEK Operating System It is a part of the OSEK standard refer to www osek vdx org The ORTI enables the attache
551. strial 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 Stimulation 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 they should 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 HC S 12 X Debugger Manual 5 Introduction Debugger Features Debugger Features True 32 bit application Powerful features for embedded debu
552. struments width Bounding Box Specifies the look of the bounding box Available displays are No Box Flat outline only Raised Sunken Etched and Shadowed Backgroundcolor Defines the color of the instrument s background The checkbox enables 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 Display Defines the location of the value be used for the instrument s 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 86 on page 137 represents the classical pointer instrument also known as speedometer voltage meter Figure 3 86 Analog Instrument AV lly d x E DB Analog instrument attributes are shown in the Table 3 47 on page 138 HC S 12 X Debugger Manual 137 Debugger Components Visualization Utilities Table 3 47 Analog Instrument Attributes Attribute Description Low Display Value Defines the zero point of the indicator The values below this definition will not be displayed H
553. t do not set the system environment variable Defaultdir lf 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 HC S 12 X Debugger Manual 641 Debugger Engine Environment Variables Local Configuration File usually project ini 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 V 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 N TEXTFILE Ntxt Will result in GENPATH TEXTFILE Ntxt To avoid such problems use a semicolon at the end of a path if there is a V at the end GENPATH V TEXTFILE txt 642 HC S 12 X Debugger Manual 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 the following table Environment Variable Details on page 643 Table 22 1 Environment Variable Details Topic Tools Description Lists of other tools that are using this variable Synonym Fore some environment variables a synonym also exists The synonyms ma
554. t Window and right click The Data Popup Menu on page 172 is displayed 2 Select Show Watchpoints from the Popup Menu The Watchpoints tab of the Controlpoints Configuration window is displayed 3 Click on the corresponding entry in the list of defined breakpoints to select the watchpoint you want to modify HC S 12 X Debugger Manual 169 Control Points Setting Watchpoints 4 Youcan enter the command in the Command field The command is a single debugger command At this level the commands G on page 543 GO on page 544 and STOP on page 586 are not allowed A command file can be associated with a watchpoint using the commands CALL on page 515 or CF on page 517 Example CF breakCmd cmd 5 Click OK to close the window 6 When the watchpoint is detected the command is executed and the application will stop at this point The Continue check button allows the application to continue after command execution Demo Version Limitations Only two watchpoints can be set 170 HC S 12 X Debugger Manual Control Points Markpoints 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 on page
555. t command file is executed by the after the reset button menu entry or Command Line command has been selected The Reset command file full name and status enable disable can be specified either with the CMDFILE RESET Command Line command or using the Reset property tab of the Connection Command File Window on page 27 By default the RESET CMD file located in the current project directory is enabled as the current Reset command file Preload Command File The Preload command file is executed by the before an application is loaded to the target system through the connection The Preload command file full name and status enable disable can be specified either with the CMDFILE PRELOAD Command Line command or using the Preload property tab of the Connection Command File Window on page 27 HC S 12 X Debugger Manual Debugger Interface Debugger Main Window By default the PRELOAD CMD file located in the current project directory is enabled as the current Preload command file Postload Command File The Postload command file is executed by the after an application has been loaded to the target system through the connection The Postload command file full name and status enable disable can be specified either with the CMDFILE POSTLOAD Command Line command or using the Postload property tab of the Connection Command File Window on page 27 By default the POSTLOAD CMD file located in the current project directo
556. t from a stationery the HCS12 New Project Wizard first screen appears Figure 10 1 New Window Project Tab Project File Object HC S 12 New Project Wizard Project name HCS12 Stationery NewProf SS Location JD Profiles RTHO2c My Docum Set rJ Addita Project Project ei 3 In the list box on theleft of the screen select HC S 12 New Project Wizard 4 In the Project Name textbox type the name of your new project 5 Click the OK button to proceed HC S 12 X Debugger Manual 237 HC12 Debugging First Steps Debugging First Steps Using the Wizard Figure 10 2 Select Derivative Screen New Project Wizard Page 2 MC68HC812A4 MC68HC912B32 MC68HC912D60 MC68HC912D60A MC68HC912DG128 MC68HC912DG128A MC68HC912DT128 MC68HC912DT128A MC9512A128B MC9512A256B MC9512B128 freescale MC9512B64 x MC9512C128 6 Inthe list box on the screen select the HC12 MCU you are targeting 7 Click the Next button to proceed 238 HC S 12 X Debugger Manual Figure 10 3 XGATE Support Screen New Project Wizard Page 3 freescale 8 Unless you need XGATE support select the Single Core format by checking its checkbox and clicking the Next button to proceed Selecting any of the options results in the following conditions Single Core HCS12X The created project will only contain source code for the HCS12X However it is possible to add XGATE support at a later
557. t in some codes in a split view Drop Into Nothing can be dropped into the Profiler Component window Demo Version Limitations Only modules are displayed and the Save function is disabled Associated Commands GRAPHICS on page 547 TUPDATE on page 588 DETAILS on page 527 RESET on page 570 BASE on page 510 HC S 12 X Debugger Manual 101 Debugger Components General Debugger Components Recorder Component The Recorder window shown in Figure 3 57 on page 102 provides record and replay facilities for debug sessions Figure 3 57 Recorder Window igi Recorder Ed 102 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 O Record m Stop ju Pause An animation occurs during recording replaying and pausing The current action record play or pause and path of the involved file are displayed in the Object Infor bar of the window 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 havea
558. t 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 CTRL G HC S 12 X Debugger Manual Opens a dialog box to scroll the window to a number line see chapter below 117 Debugger Components General Debugger Components Table 3 36 Associated Pop Up Menu Description continued 118 Menu Entry Find CTRL F Description 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 see chapter below Find Procedure Opens a dialog box for searching a procedure see chapter CTRL I below Foldings Opens the folding window see chapter below Marks Toggles the display of source positions where breakpoints may be set If this switch is on these positions are marked by small triangles ToolTips Allows you to enable or disable the source tool tips feature to set up the tool tip mode and tool tip format HC S 12 X Debugger Manual Debugger Components General Debugger Components 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 b
559. t to 0 to configure the port as input as shown in Figure 11 50 on page 353 Figure 11 50 Coupler Control Register Control register Way Bits b7 b6 b5 b4 b3 b2 bl bO Input 0 Ports E D C B A Output 1 Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations No limitations HC S 12 X Debugger Manual 353 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities 7 Segments Display Component The 7 Segments Display window shown in Figure 11 51 on page 354 consists of 8 7 segment display systems Figure 11 51 7 Segments Display Window 7 segments displa ix Operation of the Seven segments display component is based on the display scanning principle Only one display can be activated simultaneously for the purpose of limiting consumption of the set Common connection of the segments is the power of the component the other connections serve as code input so the same code is applied to all seven as shown in Figure 11 52 on page 354 Scanning consists of selecting a display and activating its segments with adequate code to the input terminals and then attend to the next display Figure 11 52 7 Segments Display Component Constitution SELAFF ba p o 2 5 5 o cy Ed pns m a o m E ps m a 354 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities 7
560. tab in the Banked Memory Location Window HC S 12 X Debugger Manual 603 Debugger Connection specific Commands Abatron BDI Connection Commands Using BANWINDOW EPAGE command will have the same effect than using the EPAGE index tab in the Banked Memory Location Window Using BANWINDOW VARIOUS command will have the same effect than using the Various index tab in the Banked Memory Location Window A banked memory area is defined by its start address end address and the address of the Bank register The maximum number of pages parameter allows to see in the memory component only the available pages The status of the banking mechanism in the debugger is also monitored through this command a command can be defined but the debugger banking mechanism can be disabled Consider the command BANKWINDOW PPAGI I E ON 0x8000 0xBFFF 0x30 64 This command allows to use the banked memory model in the debugger using the MC9S12DP256B This commands means the PPAGE register located at address 0X3 0 must be used to build the PC address when the code is located in banked memory area from 0x8 000 to OxBFFF The 64 first page in the memory map are visible page 0x3F is the last one The PPAGE register located at address 03 0 will be displayed in the register component The bank settings are stored in the targetName section of the PROJECT file using variable BANKWINDOWn BANKWINDOW Examples The Banking status
561. tart address of the selected variable Dragging the value loads the destination register with the value of the variable Source Loads the destination register with the PC of the first instruction selected Memory Loads the destination register with the start address of the selected memory block Demo Version Limitations No limitation Associated Commands ATTRIBUTES on page 499 HC S 12 X Debugger Manual 107 Debugger Components General Debugger Components SoftTrace Component The SoftTrace window shown in Figure 3 61 on page 108 records and displays instruction frames and time or cycles Figure 3 61 SoftTrace Window i SoftTrace Iof x 7426 frames Fibonacci cycles cycles cycles cycles cycles cycles cycles cycles cycles cycles cycles cycles a F098 F09 F 9D FOSE Foao F0A2 Foa4 Foa6 F086 F088 FOSA F 8C Tor INC BNE TST BMI BNE LDA CMP BLS LDHX AIX STHX PSHX murr 1 X l 26 38 l X 0x19 34 0x82 1 0x82 The window s Object Bar displays the number of recorded frames and the name of the function where the selected frame is located SoftTrace 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
562. tasks OS DATA This structure should be defined so as to fit the same layout as the operating system used It might be necessary to introduce filler variables to get the correct alignment This segment has to be placed by the linker to the correct address by using the PRM file shown in Listing 5 4 on page 181 Listing 5 4 Linker PRM File NAMES rtk o END SECTIONS RTK SEC NO INIT 0x1040 TO OxlF80 HC S 12 X Debugger Manual 181 Real Time Kernel Awareness RTK Awareness Register Assignments 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 You should not open the terminal window during testing Errors detected during reading of a PRM file are written to this window RTK Awareness Register Assignments Table 5 1 on page 182 show the register assignments for the RTK awareness for the HC12 processor Table 5 1 HC12 RTK Awareness Register Assignments Regi
563. te 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 will represent 0 Values below this definition will appear as an error ERROR High Display Value Fixes the maximal value that will represent 100 Values above this definition will appear as an error ERROR Relative Mode Switches between percent and permill Command With this instrument mode you can specify a command that will be executed by clicking on this field For more information about commands read the chapter Debugger Commands Command mode attributes are shown in the Table 3 59 on page 145 Table 3 59 Command Attributes A 0 00 0 n f Field Description Contains the text that will be displayed on the button Command Contains the command line command to be executed after pressing the button CMD Callback This mode is the same as command but with one difference The returned value will be shown as text instead of Field Description Its attributes are shown in Table 3 60 on page 145 Table 3 60 CMD Callback Attributes Attribute Description Field Description Warning there is no use to fill out his field as the text will be overwritten the first time you execute the specified command Command Contains the command line command to be executed afte
564. te is displayed in all window components Delete Breakpoint Appears in popup menu if a breakpoint is set or disabled on the specified instruction When selected deletes this breakpoint Enable Breakpoint Appears only in popup menu if a breakpoint is disabled on an instruction When selected enables this breakpoint Disable Breakpoint Appears in the popup menu if a breakpoint is set on an instruction When selected disables this breakpoint Run To Cursor When selected sets a temporary breakpoint on a specified instruction and continues execution of the program If there is a disabled breakpoint at this position the temporary breakpoint will also be disabled and the program will not halt Temporary breakpoints are automatically removed when they are reached Show Breakpoints Opens the Controlpoints Configuration Window Brealpoints Tab and displays list of breakpoints defined in the application refer to Control Points on page 147 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 Popup Menu only if a markpoint is set at the nearest code position visible with mark
565. technical specifications provided by ABATRON User Manuals and MOTOROLA One free serial communication port of your computer is required to communicate with the BDI interface You may need to set it up even if later even if you use Ethernet communication instead of an RS 232 serial communication medium Figure 15 1 Your System Abatron BDI Interface RS232 or Ethernet Direct Connection to BDM Pins MEE Target System Host Computer HC S 12 X Debugger Manual 429 Abatron BDI Connection BDI Interface Software Setup BDI Interface Software Setup The Abatron BDI connection is delivered during installation and contains all required files demo projects to use the Abatron BDI debugger and some BDI setup init list files The drivers delivered with the BDI interface must be installed in order to make sure you use the latest drivers for the BDI interface These files are delivered on a disk from ABATRON You must set up the target MCU through the BDI interface according to your hardware configuration Copy all files from the ABATRON disk to a new directory on your computer ABATRON provides a EXE configuration application and a set of configuration files for specific evaluation boards and processors These files contain microprocessor microcontroller initialization data vectors chip selects for internal external ROMs RAMs running modes etc They contain information bound to the MCU and MCU version used and inform
566. ted in the memory component 42 HC S 12 X Debugger Manual Debugger Interface Highlights of the User Interface Dragging from Module Component Window Table 2 15 on page 43 summarizes dragging from the Register Component Table 2 15 Dragging from the Module Component Window Destination Component Action Window Data Global Displays global variables from the selected module in the data component Memory Dumps memory starting at the address of the first global variable in the module The memory area where this variable is located is selected in the memory component Source Displays source code from selected module Selection Dialog Box This dialog box is used in the Debugger for opening general components or source files You can select the desired item with the arrow keys or mouse and then the OK button to accept or CANCEL to ignore your choice The HELP button opens this section in the Help File This dialog box is used for the following selections Set Connection Open IO component Open Source File Open Module Individual component window HC S 12 X Debugger Manual Debugger Interface Highlights of the User Interface 44 HC S 12 X Debugger Manual Debugger Components This chapter explains how the different components of the Debugger work This chapter contains the following sections Component Introduction on page 45 Loading Component Windows
567. tem cancels the command and leaves the flash modules armed Listing 21 3 Flash Programming Example from Command Line in Component Window in gt flash FLASH parameters loaded for M68HC912DG128 from J HC12_EA PROG FPP mcu03C4 fpp MCU clock speed 8025000 Module Name Address Range Status FLASH_4000 4000 7FFF Enabled Blank Unselected FLASH_PAGEO 8000 BFFF Enabled Blank Unselected FLASH C000 C000 FFFF Enabled Blank Protected Unselected FLASH PAGE 18000 1BFFF Enabled Blank Protected Unselected FLASH PAGE2 28000 2BFFF Enabled Blank Unselected FLASH PAGE3 38000 3BFFF Enabled Blank Protected Unselected FLASH PAGEA 48000 4BFFF Enabled Blank Unselected FLASH PAGE5 58000 5BFFF Enabled Blank Protected Unselected FLASH PAGE6 68000 6BFFF Enabled Blank Unselected FLASH PAGE7 78000 7BFFF Enabled Blank Protected Unselected HC S 12 X Debugger Manual 611 Debugger Connection specific Commands NVMC Commands HALTED The FLASH command loads the applet that corresponds to the CPU derivative MCUID and displays the state of all modules If you want to program an application into module number 7 FLASH PAGES you must unprotect the module Listing 21 4 Unprotect Module in gt flash unprotect 7 MCU clock speed 8025000 Module Name Address Range Status FLASH 4000 4000 7FFF Enabled Blank Unselected FLASH_PAGEO 8000 BFFF Enabled Blank Unsel
568. 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 lt 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 HC S 12 X Debugger Manual 507 Debugger Engine Commands Debugger Commands 508 To expand all subitems of TargetObject in the Object Pool up to 4 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
569. the base address of the I O registers RESETCYCLES This command sets the Simulator CPU cycles counter to the user defined value If not specified the value will be 0 The cycles counter is displayed in the Debugger status and Register Component This command does not affect the context Usage RESETCYCLES Value where Value is the desired cycles This command affects only the internal cycle counter from the Simulator Debugger Components Debugger engine Example in gt SHOWCYCLES 133801 in gt RESETCYCLES in gt SHOWCYCLES HC S 12 X Debugger Manual 625 Debugger Connection specific Commands Full Chip Simulator Commands in gt RESETCYCLES 5500 in gt SHOWCYCLES 5500 The Showcycles command in the Command Line component displays the number of CPU cycles executed since the start of the simulation RESETMEM This command marks the given range of memory RAM ROM as uninitialized undefined Usage RESETMEM range Components Simulator component Example in gt RESETMEM After the RESETMEM command all configured memory is initialized to undefined in gt RESETMEM 0x100 0x110 This command resets the memory between 0x100 and 0x110 if configured to undefined in gt RESETMEM 0x003F This command resets the memory location 0x003F if configured to undefined NOTE Inthe memory configuration Auto on Access the full memory is defi
570. the common attributes to all selected one instruments according to the last selected selection Shortcut Ctrl Enter gt Align At least two Gives access to a new menu for alignment selections Top Align Aligns the instruments to the top line of the last selected instrument Bottom Align Aligns the instruments to the bottom line of the last selected instrument Left Align Aligns the instruments to the left line of the last selected instrument Right Align Aligns the instruments to the right line of the last selected instrument Size Align Makes the size of all selected instruments the same as the last selected Vertical Size Align Makes the vertical size of all selected instruments the same as the last selected Horizontal Size Align Makes the horizontal size of all selected instruments the same as the last selected HC S 12 X Debugger Manual 135 Debugger Components Visualization Utilities VisualizationTool Properties Like other instruments the VisualizationTool itself has got Properties There are several configuration possibilities for the VisualizationTool shown in Table 3 45 on page 136 To view the property dialog box of the VisualizationTool use the shortcut lt CTRL P gt or double click on the background Table 3 45 VisualizationTool Properties Menu Entry Description Edit mode Switches from Edit mode to Display mode Display Scrollbars Switches the
571. tility that provides a graphical keyboard pad that allows you to interactively modify the value of a memory cell Figure 11 18 Phone Window EJ 3 Nee O 9 e 9 GIDL CCC The phone component displays the front panel of a cellular phone with a numeric keypad and LCD display Keys on the keypad can be clicked 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 HC S 12 X Debugger Manual 329 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities 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 popup 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 11 19 on page 330 In the text field of this dialog box the user can specify the address of the memory cell where keypad characters will be stored The location is specified with a hexadecimal number Figure 11 19 Phone Address Dialog Box 330 Phone Address x Hex Format Cancel Help Click OK to accept the specified address Click Cancel to discard changes and retain the previous address
572. tion Figure 10 19 Set Communication Speed Dialog Box Set Communication Speed o v The menu selection MultilinkCyclonePro Command Files takes you to the Command Files window with its six tabs Figure 10 20 Command Files Window P amp E Multilink Cyclone Pro Connection Command Files xj 252 HC S 12 X Debugger Manual Switching to SofTec HC12 To take the first steps toward debugging with CodeWarrior and setting the SofTec HCS12 connection from within an existing debugging project such as the Full Chip Simulation connection take the following steps 1 In the Debugger window menubar display the Component menu Figure 10 21 Component Menu Real Time Debugger D sProfilesRTHO2cCMy Documents Switcheri Full Chip Simulationini Component Memory Window Help Open Set Connection fi Assembly Fonts D NEN Background Color gt Dp pe ANDCC 239 308002 BRA 0 abs 308004 LDX OxcCooD 308007 LDY OxCOOB ode here t wait forever ire that you never leave this function UT Z EN ax EH Register HC12 CPU Cycles 41 A lia s3 eren cv ea 2 Choose Component Set Connection from this menu to select another connection in the Set Connection dialog box HC S 12 X Debugger Manual 253 HC12 Debugging First Steps Switching to SofTec HC12 Figure 10 22 Set Connection Dialog Box SofTec HCS12 Selection Set Connection
573. tion If levels duration are smaller then cycle time or smaller than cycles undersampling is performed in the signal file Up to 16 Signal Generators can be run at the same time Signal Description File EBNF Signal File Format FILELOOP INF nbr of file loops to perform signal block EOF Signal Block Description signal header signal data Signal Header Description LOOP INF nbr of file loops to perform TIMEUNIT lt NONE CYCLES SECONDS gt TIMEFACTOR lt double value gt GAIN lt double value gt DCOFFSET lt double value gt OPTION NORMAL ONLYPOSITIVE ONLYNEGATIVE ABSOLUTI p Signal Data Description level double value time double value duration in seconds or cycles HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins 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 L 220703e 004 3 051758e 005 L 525879e 004 3 051758e 005 L 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 0
574. tion s xe RC eot oo e RR ete utei 457 Debugging Memory Map GUI sssseseeeeeeee eee 458 Edition Dialos BOX epi t sete ee ed oe e ARE MY eR ee ee 459 DY POS shes d en Ro ee ai aetna e Reet ORC S P Cel on aN 460 Priofiti S voi teh eg See gee neo ae X RON ETUR Qs 461 Rematks s cesse cante tea ER doen tube eee 462 CPU Core Types and Priorities llle 462 HCI2 CPUJI2 Core 5 eR RREREPEPR REGE D RICE 462 PriofitieS to soe ep SC ext Eee VAM eet a i 462 Types e od vsti eh deren tah LB RPM LMERG 463 HCSI2 Core icv eee wie eere So ee egeta 464 PriofitieSu copre uERRMEERR ADS eV UE XU P ES n 464 PY POS ingrid abut a xe agere Re Re eb ead RA Ee ace 465 HC512X Core RUPEE RP ies 465 Proflli s ebzk t eh serial t RkEueeW4SerezeskmpE RUE ERI 465 DY POS tips Sater Hi Deam o poe use e aA voe quitte UR UR seats 465 DMM Commands Leges ERES E Se Soi hs EATER 466 18 HC S 12 X Flash Programming 467 Non volatile Memory Control Utility Introduction 467 Automated Application Programming 0 002 eese 467 Set puc ct uses ose eR I qe bM UCESEUUETPLHEML BUB ee ee ay 468 Advanced Options Preventing Erasing 0005 469 NVMC Graphical User Interface 0 0 0 0 eee ee eee 470 Modules and Module States llle esee 470 NVMC Dialog Box ibm ERR E tese nies 471 Flash Module Handling 00 0 0 eee eee ee 473 MCU Speed Information
575. tion about the Flash modules of your CPU derivative Other important expressions are Enabled An enabled module is a module currently active on the chip It is possible to read as a ROM or program an enabled module Disabled A disabled module is not active on the chip so program and reading are not possible The usual control for enabling or disabling a module is setting clearing a flag in a special register Note that a few modules always must be active you may not disable such modules Blank A blank module is empty of code You can program its full address range Each blank byte contains the value OxFF or 0x00 depending on harware HC S 12 X Debugger Manual Programmed programmed module is partially programmed not all bytes contain OxFF or 0x00 You must keep track of the areas still available for programming if any Protected A protected module is partially protected from erasure or programming The usual control for protecting a module is setting clearing a flag in a special register Note that a few modules always must be unprotected you may not protect such modules Unprotected An unprotected module can be erased and programmed To select a module or other list item left click the module To unselect a module press the Ctrl key and left click For multiple selections or unselections use the Shift key NVMC Dialog Box The NVMC dialog box lists all the Flash or EEPROM modules
576. tion of Debugger properties Configuration of the Debugger project file 224 HC S 12 X Debugger Manual Synchronized Debugging Through DA C IDE Debugger Interface DA C IDE and Debugger Communication DA C and the Debugger are both Microsoft Windows applications and communication is based on the DDE protocol as shown in Figure 9 10 on page 225 The whole system contains DA C Debugger e cDAPI interface implementation DLL which is used by DA C Cdgen22 dll nDAPI communication DLL provided by DA C which is used by Debugger Debugger specific DLL for bridging its interface to debugging environment and DA C s nDAPI DAC wnd Figure 9 10 Communication between DA C IDE and Debugger HI WAVE Debugger Command messaging Dawnd HI WAVE DLL Cdgen32 dll DA C DLL NDAPI dll DA C DLL Notification messaging Communication DLL Installation As described previously the Debugger needs the nDAPI communication DLL provided by DA C IDE This dll called Ndapi dll is automatically installed during the Freescale HC S 12 X Debugger Manual 225 Synchronized Debugging Through DA C IDE Debugger Interface Tool Kit installation However if you install a new release of DA C you have to follow this procedure In the M Program directory of your DA C installation copy the Ndapi32 d11 Ndapi32 d11 version 1 1 or later and paste it in your current Freescale PROG directory where Debug
577. tion to Device Pins 382 Signal IO Component 0 0 0 eee ne 382 Signal Description File EBNF 0 00 0 00 ee eee eee ee 382 Signal File Format os creses sarian eee eee eee 382 File Example ere er ae oboe bee ehinnd Fete eae 383 File Example 2 uere REN OE eel sae eee ie wad 384 File Parameters sesen erudit rR DU OUT UE ices ee es EAE 384 Signal JO Usage e re e eet RE EN SEAN a eas 8 385 Signal Commands 0 0 0 ee eee eee eh 385 Remarks sc oc xe xRS ARR chats LEE b pni 386 Base Signal Files Provided 0 0 00 0 cee esee 386 Virtual Wire Connections with the Pinconn IO Component 387 Pinconn IO 5 eV aS REIR de 387 Command Set to Apply Signal on ATD Pin 0 00 388 PCS Tutorials esses edie RR RES RROUCEEREL RUD HER e lade ds 389 Guess the Number coena rerainan reeta ee 389 Step 1 Environment Setup 00 0 0 02 000000 389 Step 2 Creating the project 2 0 0 0 eee eee eee 389 Step 3 Target CPU Window 0 0 00 02 e eee eee 390 Step 4 Bean Selector Window 0 2 0 00 00 e eee 391 Step 5 Project Panel Window 0 00 0 002 eee ee ee 392 Step 6 Bean Inspector AS1 AsynchroSerial Window 393 Step 7 Generation of Driver Code 0 ese 394 Step 8 Verification of Files Created 00 394 Step 9 Entering User Code 0 0
578. to make the debugger search for the vector table address and vectors reserved by the HCS12 Serial Monitor Once autodetection has succeeded you can press the OK button to save and quit this window HC S 12 X Debugger Manual Derivative Selection Dialog Box Within this dialog box it is possible to select a specific derivative according to the System Device Identification Register SDIDH SDIDL also sometimes called PARTID returned by the silicon device Figure 14 10 Derivative Selection Dialog Box Derivative Selection xi The PARTID returned by the connected derivative matches with multiple derivatives Please select here the connected derivative MC9S08GB32 MC3508GB32 MCS3S08GT 32 As several silicon devices might return the same value a selection list is available to select the debugged derivative according to text reference written on the top of the silicon HC S 12 X Debugger Manual 425 HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface 426 HC S 12 X Debugger Manual 15 Abatron BDI Connection This document includes information on the Abatron BDI Connection and helps you understand how to use this debugger connection This document is divided into following sections The Abatron BDI Connection Introduction on page 428 section introduces the Abatron BDI Connection The Interfacing Abatron BDI andYour System on page 429 section contains information about the connection between the B
579. to memory commands Table 3 16 on page 80 describes the menu entries HC S 12 X Debugger Manual 79 Debugger Components General Debugger Components Figure 3 33 Memory Menu 5 True Time Simulator amp Real Time Debugger D Profiles RTHO2c My Do File View Run Simulator Component Memory Window Help Djela xele e v verse pods TMSKI TMSKI BITS CU ec ac Y O P 00080 00 00 uu uu 00 00 00 uu Fil 00088 oo o0 oo oo ffoo oo oo Address 00090 00 00 00 00 00 00 00 O0 Ceopymem 00098 00 00 00 OO 00 00 OO 00 Search Pattern ANNAN ana m3 im im 3 3 AN NN te ad Table 3 16 Memory Menu Description Menu Entry Description Word size Opens a submenu to specify the display unit size Format Opens a submenu to select the format to display items Mode Opens a submenu to choose the update mode Display Opens a submenu to toggle the display of addresses and ASCII dump Fill Opens the Fill Memory on page 83 to fill a memory range with a bit pattern Address Opens the memory dialog and prompts for an address CopyMem Opens the CopyMem dialog box that allows you to copy memory range values to a specific location Search Pattern Opens the Search Pattern dialog box Word Size Submenu With the Word Size submenu shown in Figure 3 34 on page 81 you can set the memory display unit Table 3 17 on page 81 describes the menu entries 80 HC S 12 X Debugger
580. to stop it to execute a single step in the application to set and clear a breakpoint to evaluate an expression and to quit the application interface NOTE For more information refer to the RHAPSODY in MicroC documentation from I Logix NOTE In order to work MicroC needs to have a copy of the amc communication dll d11inthe prog directory from the current installation MicroC Link Menu Figure 3 45 on page 90 shows the MicroC menu and its entries are described in Table 3 24 on page 91 Figure 3 45 MicroC Link Menu 90 MicroC Link Setup Connect HC S 12 X Debugger Manual Debugger Components General Debugger Components Table 3 24 MicroC Link Menu Description Setup Opens the communication setup Window Connect Establishes communication with RHAPSODY in MicroC MicroC Communication Specification Within the Communication Specification dialog box shown in Figure 3 46 on page 91 you can set the MicroC Host and ID for communication between the Debugger and RHAPSODY in MicroC A checkbox allows you to see the communication protocol Figure 3 46 Communication Specification Communication Specification Eq MicroC Host esc ID 11066 v Show Protocol Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations The MicroC Component is not available in demo mode MicroC DLLs The RiMC or MicroC wnd component has been updated to make use o
581. toolbar of the Debugger adding and removing component shortcuts and action shortcuts in this dialog box You can also insert separators to separate icons Almost all functions in View Run and Window menus are available as shortcut buttons as shown in Figure 2 10 on page 19 18 HC S 12 X Debugger Manual Debugger Interface Debugger Main Window Figure 2 10 Customize Toolbar Dialog Box Customize Toolbar HE Available buttons Toolbar buttons Move Dow 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 Demo Version Limitations The default toolbar cannot be configured Examples of View Menu Options Figure 2 11 on page 19 shows a typical component window display Figure 2 11 Typical Component Window Display include hidef h for EnableInterrupts macro include derivative h include peripheral declarations void main void A EnableInterrupts enable interrupts include your code here for 10 RESET WATCHDO0G feeds the dog EB loop forever please make sure that you never leave this function a zi Figure 2 12 on page 20 shows a component window without a title and headline HC S 12 X Debugger Manual 19 Debugger Interface Debugger Main Window Figure 2 12 Component Window without
582. ts Stack HiwaveBase Undefined 33 Symbol T able Inspect Window B Events ElfLoader Object File Loader Target Target Window A Exceptions ES Object Pool Di id TargetO bject iil Leds SOO 20288 PORT 66 DDR EB 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 83 on page 129 HC S 12 X Debugger Manual Debugger Components Visualization Utilities Figure 3 83 Changing Data Direction Register Value E Inspect i DE X Components Name Value Address Ini Stack Port Register TE 0x210 Ox 88 Symbol Table Data Direction Register Oxeb 0x212 Ox Events 4 Exceptions 2X5 Object Pool TargetObject Z Leds F A e i Der ie PORT 80 DDR EB Inspector Menu The Inspector menu contains entries described in Table 3 40 on page 129 Table 3 40 Inspector Menu Entries Update All displayed information is updated Items that no longer exist are removed and new items are added Associated Popup Menu Commands in the Inspector context menu depend on the selected item It can contain entries described in Table 3 41 on page 130 HC S 12 X Debugger Manual 129 Debugger Components Visualization Utilities Table 3 41 Inspector Popup Menu Entries Description Menu Ent
583. two ways to define a read access watchpoint Using the Data Popup Menu 1 Point at a variable in the Data window and right click The Data Popup Menu on page 162 is displayed 2 Choose Set Watchpoint from the Popup Menu A Read Write Watchpoint is defined 3 Point in the Data window and right click The Data Popup Menu is displayed 4 Choose Show WatchPoints from the Popup Menu The Controlpoints Configuration window Watchpoints tab is displayed 5 Select the watchpoint you want to define as read access from the list 6 Select the Read type in the dropdown box 7 Aread access watchpoint is defined for the selected variable Using the Left Mouse Button and Pressing the R Key 1 Point at a variable in the Data window and holding down the left mouse button press the R key 2 A read access watchpoint is defined for the selected variable Once a read access watchpoint has been defined you can continue program execution The application stops after detecting the next read access on the variable Read access watchpoints remain active until they are disabled or deleted HC S 12 X Debugger Manual 165 Control Points Setting Watchpoints 166 Setting a Write Watchpoint A red vertical bar is displayed in front of a variable associated with a write access watchpoint The Debugger provides two ways to define a write access watchpoint Using the Data Popup Menu Point at a variable in the Data window and right cl
584. ual HC S 12 X Full Chip Simulation Connection Supported Derivatives PWMCNTx PWM Channel Counter Registers 0 5 7 Is simulated PWMPERx PWM Channel Period Registers 0 5 7 Is simulated PWMDTYx PWM Channel Duty Registers 0 5 7 Is simulated PWMSDN PWM Shutdown Register PWMIF PWMIE PWMRSTRT PWMLVL PWM7IN PWM7INL and PWM7EN are simulated Not memory mapped registers PORTP Port P The functionality linking the PWM module and the port P have been simulated the register involved is PTP Port P I O Register PWMoutx As in the hardware writing to PTP has no effect The input pins are simulated as not memory mapped and can be accessed one by one through the object pool PWMout0 to PWMout7 Only the PWMout7 pin can be configured as an input Writing to the other pins has no effect Timer Module TIM This I O device simulates the Timer Module TIM This module can be viewed as a subset of the ECT module The TIM for example has only two Pulse Accumulator Count Registers and they are called PACNT_H and PACNT_L Both registers are simulated For more information see Enhanced Capture Timer ECT on page 296 Legacy HC12 CPU12 Derivatives Simulation MC68HC812A4 This section explains the simulated features of the MC68HC812A4 derivative The Full Chip Simulation implements onchip peripherals listed here below HC S 12 X Debugger Manual 301 HC S 12 X Full Chip Simulation Connection Support
585. ual The menu selection MultilinkCyclonePro Connect takes you to the P amp E ICD 12 Multilink Cyclone Pro dialog box The two tabs of this dialog box allow you to set the Communications and Special Setup parameters for the ICD 12 connection Figure 10 17 P amp E Multilink Cyclone Pro Connection Dialog Box P amp E ICD12 Cable12 Multilink Cyclone Pro Connections P amp E ICD12 Cable12 Multilink Cyclone Pro Connection X Communication Special setup Set CLKSW bit in BDM control register MC9512 only At connection the target is running hot plugging At connection detect if the target is running Disable maskable ISA s when stepping When running insert controlpoints to hardware onchip break module without halting the cpu When running discard all memory read accesses I Resynchronize from COP watchdog reset Communication Special setup Communication Device Len Show Protocol 5 The menu selection MultilinkCyclonePro Set Derivative takes you to the Set Derivative dialog box This dialog box allow you to choose the target MCU for the ICD 12 connection Figure 10 18 Set Derivative Dialog Box Set Derivative HC S 12 X Debugger Manual 251 HC12 Debugging First Steps Loading the ICD 12 Connection The menu selection MultilinkCyclonePro Set Communication Speed lets you control the various factors associated with communication speed for the ICD 12 connec
586. ual 149 Control Points Breakpoints Figure 4 2 Controlpoints Configuration Window Breakpoints Tab lI Controlpoints Configuration E AXI Breakpoints Watchpoints Markpoints r Breakpoint Address 1827 Disable IV Hex format Temporary Name _Startup r Condition Condition Disable r Command p OO 1 Disable Command Continue l r Counter i Current fi Interval fi Add Update Delete Genera 3 Ir Save amp Restore on load Show Location OK Cancel Help Lum one Breakpoints Tab The Controlpoints Configuration Window Breakpoints Tab on page 150 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 e 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 150 HC S 12 X Debugger Manual Control Points Breakpoints NOTE Curr
587. ualization Utilities Push Buttons Component The Push Buttons window shown in Figure 11 43 on page 349 is a basis input device Figure 11 43 Push Buttons Window E Push Buttons ERRENA Push Buttons Menu Figure 11 44 on page 349 shows the Push Buttons menu and its entry is described in Table 11 18 on page 349 Figure 11 44 Push Buttons Menu Setup Table 11 18 Push Buttons Menu Description Opens the Push Buttons Setup dialog box Push Buttons Setup The Setup dialog box shown in Figure 11 45 on page 350 allows you to specify in hexadecimal format the port address or select the port in the list HC S 12 X Debugger Manual 349 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 45 Setup Dialog Box Port Address Select a port or insert an address hex Cancel NOTE The port should be an output port for the LEDs component Use with IO Ports The address defined in the Push Buttons Setup dialog box is used when the component works with the Programmable IO Ports Component on page 352 Use with LEDs Component The Bytes sent to the LEDs component coming from the Push Button component are described in Figure 11 46 on page 350 Figure 11 46 Push Buttons Input port 350 Push Buttons Input Port b7 b6 b5 b4 b3 b2 b1 b0 Value 1 for a bit lights on the corresponding led on the LEDs device For example if butto
588. uct unsigned char BAUD unsigned char SCCR1 unsigned char SCCR2 unsigned char SCSR unsigned char SCDR SCIStruct define SCI SCIStruct 0x0200 char GetChar void while SCI SCSR amp 0x20 wait for input return SCI SCDR void PutChar char ch while SCI SCSR amp 0x80 wait for output buffer empty SCI SCDR ch void PutString char str while str PutChar str strt 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 11 60 on page 364 lets you set the Cache Size in lines of the TestTerm window in the dialog box shown in Figure 11 61 on page 364 HC S 12 X Debugger Manual 363 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 60 TestTerm Menu Cache Size Select Cache Size in the menu Figure 11 61 TestTerm Cache Size Dialog Box Size of the Cache x etevcnssnssssenssssensssecsssessssnesnssnsseueneens Number of lines to be cached 1000 Cancel Help Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations No limitation 364 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Terminal Component The Terminal window shown in Figure 11 62 on page
589. uency in a 0 to 5 Volts voltage range e sinus 8bit 0 5v 1kHz txt a sinus signal with a 8 bit sampling definition scaled on a 1000 Herz frequency in a 0 to 5 Volts voltage range e square 1 5v 1Hz txt a pure square signal scaled on a 1 Herz frequency with 1 volt at low level and 5 volts at high level e square 1 5v 1kHz txt a pure square signal scaled on a 1000 Herz frequency with 1 volt at low level and 5 volts at high level HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins Virtual Wire Connections with the Pinconn IO Component Pinconn IO The Pinconn IO component is used to create virtual links shortcuts between processor device pins like a simple wire The Pinconn component can be opened within Open I O Component Dialog Box on page 261 or with the openio pinconn command It can be released within the same dialog or with the close pinconn command WARNING Itis up to the user to properly connected input pins to output pins without bus level conflicts Pinconn Commands CONNECT Connects output pin to input Syntax CONNECT OutputPin lt InputPin gt Example CONNECT Pim PORTHPinO0 Pim PORTPPin3 DISCONNECT Removes connection between pins DISCONNECT OutputPin lt InputPin gt Example DISCONNECT Pim PORTHPin0O Pim PORTPPin3 CONNECT STA
590. ues and type Display Global Variable from a Module The Debugger provides two ways to see a list of global variables defined in a module Opening Module Component HC S 12 X Debugger Manual 199 How To How To Work on Variables 1 Choose Component gt Open The list of all available components is displayed on the screen 2 Double click the entry Module A module component is opened which contains the list of all modules building the application 3 Drag a module name from the Module component to a Data component with attribute Global Using Popup Menu 1 Right click in a Data component with attribute Global 2 Choose Open Module in Popup Menu A dialog box is opened which contains the list of all modules building the application Double click on a module name The Data component with attribute global which is neither frozen nor locked is the destination component The destination Data component displays the list of variables defined in the selected module with their values Change Format for Variable Value Display The Debugger allows you to see the value of variables in different formats This is set by entries in Format menu Table 6 1 on page 200 Table 6 1 Debugger Display Format 200 Menu entry Description Hex Variable values are displayed in hexadecimal format Oct Variable values are displayed in octal format Dec Variable values are displayed in signed decimal fo
591. ugger Manual 289 HC S 12 X Full Chip Simulation Connection Supported Derivatives 290 PORTAD Port Data Register 8 Channel PTAD7 PTAD6 PTADS PTAD4 PTAD3 PTAD2 PTADI PTADO are simulated PORTADO Port Data Register 16 Channel PTADIS PTAD14 PTADI3 PTAD12 PTADII PTADIO PTAD9 PTADS are simulated PORTAD1 Port Data Register 16 Channel PTAD7 PTAD6 PTAD5 PTAD4 PTAD3 PTAD2 PTADI PTADO are simulated ATDDRx ATD Conversion Result Registers Is simulated Not memory mapped Registers PADx This are eight not memory mapped registers that will serve to be the measured values for the ATD The format of each 4 bytes big PAD is IEEE32 To setup a PAD easier the following command can be used ATDx SETPAD CHANNEL VOLTAGE AS FLOAT Memory Modules EEPROM EETS The I O device EEPPROM EETS is not simulated Flash FTS The I O device Flash FTS is not simulated Miscellaneous Modules Voltage Regulator VREG The I O device Voltage Regulator VREG is not simulated HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported Derivatives Debug Module DBG The I O device Debug Module DBG is not simulated S12X INT Registers IVBR Interrupt Vector Base Register Is simulated INT XGPRIO XGATE Interrupt Priority Config Reg Is simulated INT CFADDR Interrupt Req Config Address Reg Are simulated INT CFDATAO 7 Interrupt Req Config
592. up menu The Controlpoints Configuration Window Markpoints Tab is displayed HC S 12 X Debugger Manual 5 6 Control Points Setting Markpoints Make any modifications to the markpoint you have installed or any other markpoints listed Click OK to close the window Setting a Memory Markpoint A blue letter L is displayed in front of a memory range associated with a markpoint To define a Memory markpoint Use the Memory Popup Menu 1 Point at a line in the Memory window and right click The Memory Popup Menu on page 172 is displayed Choose Set Watchpoint from the Popup Menu A Markpoint is defined Point in the Memory window and right click The Memory Popup Menu is displayed Choose Show WatchPoints from the Popup Menu The Controlpoints Configuration Window Markpoints Tab is displayed Make any modifications to the markpoint you have installed or any other markpoints listed Click OK to close the window Deleting a Markpoint To delete a markpoint Using the Left Mouse Button and Pressing the D Key 1 Point at the markpointed variable in the Data window the memory range in the Memory window or the codeline in the Source window Holding down the left mouse button press the D key The markpoint is deleted and the blue letter L in front of the variable memory range or codeline is removed Choosing Show Markpoints from Appropriate Popup Menu l Point in the Data Memory or Source c
593. ure 11 3 on page 260 shows status and other information As well as execution status it includes a context sensitive menu help line and connection specific information like the number of CPU cycles 64 bits or the elapsed time in hours minutes seconds milliseconds float format since the application started Figure 11 2 Debugger Status Bar with CPU Cycles For Help press F1 HHci2 8 000000 MHz 11 007 656 Figure 11 3 Debugger Status Bar with Elapsed Time For Help press F1 Hc12 8 000000 MHz 1927 06 04 341 202ms 260 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection The selected simulated derivative or simulated CORE or core SAMPLE is shown and also the current derivative CPU frequency in MHz NOTE Clicking on the CPU frequency opens the Clock Frequency Setup on page 269 NOTE PDouble clicking on the CPU cycles or true time resets the value NOTE Clicking on the displayed derivative or CORE or core SAMPLE opens the Set Derivative dialog box NOTE The first left hand side CPU information in the Status Bar like HC12 might be alternatively displayed with XGATE when an HCS12X core device is simulated The debugger indicates on which core thread the debugger is currently halted or currently stepping Open I O Component Dialog Box From the Simulator menu choose Load I Os to open the Open I O Component dialog box This dia
594. ures to describe the state of the system scheduling information queues timers Some of these data structures are interesting for the user of an operating system too and are described in this chapter HC S 12 X Debugger Manual 177 Real Time Kernel Awareness Task Description Language Inspecting Task State Each multitasking operating system stores the context of each task at a specific location usually called the task descriptor This context consists of the CPU context CPU registers and the content of the associated stack There is more information in the task descriptor depending on the specific implementation of the kernel The Debugger allows you to inspect the CPU registers and stack containing all procedure activation frames return addresses parameters local variables Therefore it has to get this information for each task to be debugged Since this information is specific to the kernel used there is a universal way to specify the location where and how to collect this data This information is read from a file with the name OSPARAM PRM which describes the algorithm of how to get all the needed data from the target memory from the task descriptors To describe this algorithm a simple procedural language is used The only parameter to the algorithm is an address specified by the user which identifies the task to be inspected The result is the CPU context CPU registers and status of the task which allows the d
595. 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 95 98 Windows NT 4 0 or 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 on page 645 may be used HC S 12 X Debugger Manual 635 Debugger Engine Environment Variables Debugger Environment Global Initialization File MCUTOOLS INI PC Only AII tools may store global data in MCUTOOLS INI The tool first searches for this file in the directory of the tool itself path of executable If there is no MCUTOOLS INI file in this directory the tool looks for the file in the MS Windows installation directory for example C
596. ute file 520 HC S 12 X Debugger Manual CR The CR command initiates writing records of commands to an external file Writing records continues until a close record file NOCR on page 562 command is executed NOTE Drag amp 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 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 onloff Components Softtrace component Example in gt CYCLI on Lj HC S 12 X Debugger Manual 521 Debugger Engine Commands Debugger Commands 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 pre
597. uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu uu ynam onm cm oc mo omma Delete Watchpaint Figure 4 9 Data Popup Menu 172 tchpoints HC S 12 X Debugger Manual Control Points Markpoints Figure 4 10 Controlpoints Configuration Window Markpoints Tab Controlpoints Configuration ix Breakpoints Watchpoints Markpoints r Markpoint Address Size v Hex format Name Type x General Save amp Restore on load Add Delete Update Show Location Cancel Help 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 HC S 12 X Debugger Manual 173 Control Points Setting Markpoints OK butt
598. 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 Memory Dumps memory starting at the address where the selected variable is located The memory area where the variable is located is selected in the memory component Source Dragging the name of a global variable in the source Window displays the module where the variable is defined and first occurrence of the variable is highlighted 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 76 HC S 12 X Debugger Manual Debugger Components General Debugger Components NOTE Itis important to distinguish between dragging a variable name and dragging a variable value Both operations are possible Dragging the name drags the address of the variable Dragging the variable value drags the value 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 on page 77 describes the drop actions possible in the Data component Table 3 15 Data Drop Possibilities Source Component Action Window Source A selection in the Source window is considered an
599. version result will be an image of the simulated input For the unsigned right justified 8 bit conversion the result displayed in the corresponding data register will be the exact image of the input Still the simulation is accurate on the conversion delays the modification that affect the input 8 10 bits left right justified signed unsigned the data registers in which the conversion results should be transferred and gives a precise image on how the ATD modules should be configured for proper conversion process Registers ATDCTL2 ATD Control Register 2 ADPU AFFC AWAI ETRIGLE ETRIGP ETRIGE ASCIE and ASCIF are simulated ATDCTL3 ATD Control Register 3 S8C S4C S2C and SIC are simulated ATDCTL4 ATD Control Register 4 SRES8 SMP1 SMPO PRS4 PRS3 PRS2 PRS1 and PRSO are simulated ATDCTL5 ATD Control Register 5 DJM DSGN SCAN MULT CC CB and CA are simulated ATDSTATO ATD Status Register 0 SCF ETORF FIFOR CC2 CC1 and CCO are simulated ATDSTAT1 ATD Status Register 1 CCF7 CCF6 CCF5 CCF4 CCF3 CCF2 CCF1 and CCFO are simulated ATDDIEN ATD Input Enable Register 8 Channel IEN7 IEN6 IENS IEN4 IEN3 IEN2 IEN1 and IENO are simulated ATDDIENO ATD Input Enable Register 16 Channel TEN15 IEN14 IEN13 IEN12 IEN11 IEN10 IEN9 and IENS are simulated ATDDIEN1 ATD Input Enable Register 16 Channel IEN7 IEN6 IENS IEN4 IEN3 IEN2 IEN1 and IENO are simulated HC S 12 X Deb
600. volatile Memory Control Utility Introduction Writing to Flash modules eeproms or other non volatile memory modules in modern MCUS requires special algorithms from microprocessor designers Before you write to Flash devices you must erase them Many Flash devices need initialization to become accessible some devices may need write protection removed This manual explains The Non volatile Memory Control NVMC utility an extension component that lets you control the on chip Flash devices for all Debugger connections As it supports many MCUs and Flash modules the NVMC utility is very flexible This flexibility comes from a generic Debugger component which calls a graphical user interface then loads an MCU specific module The module provides the appropriate information such as structure access algorithms and location for that MCU The NVMC utility lists all non volatile memory devices indicating their structure state and location You can change the state enabled disabled blank programmed protected unprotected and program data into the modules Automated Application Programming The debugger is able to program an application without making usage of the NVMC dialog GUI which remains useful for specific operations only Currently CodeWarrior wizard created projects might be programmed flashed immediately The debugger prompts by default a warning dialog to get a user acceptance before mass erasing then programming the
601. w The Term Direct function declared in terminal h is used to redirect an output The source code in terminal c is given in Listing 11 2 on page 362 Listing 11 2 Term Direct Source Code void Term Direct int what char fileName if what 1 amp amp what gt FROM FILE return Write ESC Write h Write what 0 if what TO_WINDOW amp amp what FROM_KEYS PutString fileName Write CR where what is one of the following items TERM_TO_WINDOW sends output to terminal window TERM_TO_BOTH send output to file and window TERM TO FILE send output to file fileName TERM_FROM_KEYS read from keyboard TERM FROM FILE read input from file fileName TERM APPEND BOTH append output to file and window TERM APPEND FILE append output to file fileName See also terminal h for more information Using TestTerm Listing 11 3 on page 362 shows the functions defined in termport h that can be called to access the TestTerm component Listing 11 3 Functions to Access the TestTerm Component char GetChar void void PutChar char ch void PutString char str void InitTermIO void Source code for the functions in termport c is given in Listing 11 4 on page 363 362 HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Listing 11 4 Functions to Access the TestTerm Component in termport c typedef str
602. w Vector Table Mirroring Tab Monitor Setup VEG eru TITO SEW VEGtoreleu XO GIESSTTTERIA 10 To enable this specific feature check the Enable Vector Table Mirroring checkbox 420 HC S 12 X Debugger Manual Figure 14 6 Monitor Setup Window Vector Table Mirroring Tab Monitor Setup 11 Press the Auto Detect button to make the debugger search for the vector table address and vectors reserved by the HCS12 Serial Monitor 12 Once the autodetection succeeded press the OK button to start debugging MONITOR HCS12 Menu Options Once the HCS12 Serial Monitor connection is set the MONITOR HCS12 menu entry is is set in the Debugger menu as shown below Figure 14 7 MONITOR HCS12 Menu Entries Connect Command Files HC S 12 X Debugger Manual 421 HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface Monitor Communication Select the MONITOR HCS12 gt Monitor Communications option to display the Monitor Setup Window Monitor Communication Tab Vector Mirroring Setup Select the MONITOR HCS12 gt Vector Mirroring Setup option to display the Monitor Setup Window Vector Table Mirroring Tab Erase Flash Select the MONITOR HCS12 gt Erase Flash option to force immediate mass erasure of the target processor flash Trigger Module Settings Select the MONITOR HCS12 gt Trigger Module Settings option to open the Trigger Module Settings dialog
603. ware Considerations 482 case the FPP driver will handle the EEPROM at the place it has been relocated by the user Partially Visible EEPROM in 400 7FF or 400 FFF The EEPROM is fully blankchecked If the EEPROM is not at the reset location the EEPROM size and location are automatically updated The EEPROM size in the NVMC dialog is automatically updated if the RAM does not overlap the EEPROM module EB386 Compliancy and RAM Moving NVMIF2 format new FPP drivers can be relocated in RAM This new format for HCS12 devices is based on PIC code runtimes Therefore the NVM handling runtime can be moved in RAM if necessary First the FLASH command must be type in a Command window to verify if the FPP file is NVMIF2 The FLASH NVMIF2WORKSPACE can be executed to relocate the driver workspace in RAM according to an eventual relocation of the RAM by the user via INITRM setup with a debugger WB command Please see the debugger FLASH commands section This can provide more flexibility for EB386 EB386 D Rev 3 07 2002 Engineering Bulletin Example 1 Layout device ram memory relocation However if the relocation is performed by the application itself the usage of the FPP relocation is useless as the programming is performed with the default location of the RAM CAUTION The FPP files drivers do not support HCS12 onchip Registers block moving from default reset position Legacy Flash Programming Commands i
604. watchpoint you want to define as a conditional watchpoint From the dropdown box select the type of access you want to track Specify the condition for the watchpoint in the Condition field The condition must be specified using the ANSI C syntax Example counter 7 Close the window by clicking OK A conditional watchpoint is defined for the selected variable Using the Left Mouse Button and Pressing the S Key 1 Point at a variable in the Data window and holding down the left mouse button press the S key The Watchpoints tab of the Controlpoints Configuration window is displayed Select the watchpoint you want to define as a conditional watchpoint 3 From the dropdown box select the type of access you want to track Specify the condition for watchpoint activation in the Condition field 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 Close the window by clicking OK A conditional watchpoint is defined for the selected variable If you continue program execution the condition is evaluated each time an appropriate access on the variable is detected When the condition is TRUE the application stops HC S 12 X Debugger Manual Control Points Setting Watchpoints Deleting a Watchpoint The Debugger provides three ways to delete a watchpoint Use Delete Breakpo
605. watchpoints or breakpoints How To Stop an Application There are two different ways to stop program execution 1 Choose Run gt Halt 2 Click on the Halt icon in the debugger tool bar i 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 196 HC S 12 X Debugger Manual How To How To Step in the Application How To Step in the Application The Debugger provides stepping functions at the application source level and assembler level Figure 6 3 on page 197 On Source Level Figure 6 3 Stepping on Source Level File View Run Simulator Component Data Window Help chsfa Hla ele elsziele 2 ej masen pr E DEMO fibo c Fibonacci i 2 2 while i lt n F fibl fib2 fibo return fi
606. ween the panes with the mouse ATTRIBUTES MAXELEM Select max Elements from the context menu HC S 12 X Debugger Manual 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 onloff Components Debugger engine Example in gt AUTOSIZE off Windows autosizing is disabled HC S 12 X Debugger Manual 509 Debugger Engine Commands Debugger Commands 510 BASE In the Profiler component the BASE command sets the profiler base to code total code or module each module code Usage BASE codelmodule Components Profiler component Example in gt BASE code BC BC de
607. with double quotes the Compiler searches in the current directory then in the directories given by GENPATH include File Path on page 647 and finally in directories given by LIBRARYPATH include lt File gt Path on page 648 NOTE Ifa directory specification in the environment variables starts with an asterisk the whole directory tree is searched recursively All subdirectories and their subdirectories are searched Within one level in the tree search order is random Example LIBRARYPATH sources include headers usr local lib See also Environment variable GENPATH include File Path on page 647 Environment variable USELIBPATH Using LIBPATH Environment Variable on page 651 648 HC S 12 X Debugger Manual OBJPATH Object File Path 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 on page 647 and finally in HIPATH Example OBJPATH sources obj HC S 12 X Debugger Manual 649 Debugger Engine Environment Variables Environment Variables 650 TMP Temporary directory Tools Compiler Assembler Linker Librarian Debugger Synonym Non
608. wn in Figure 3 12 on page 60 HC S 12 X Debugger Manual 59 Debugger Components General Debugger Components Figure 3 12 Coverage Menu Reset Source Details id Assembly v Graphics Timer Update Filter Output File gt Save As Table 3 6 Coverage Menu Description Menu Entry Description Reset Resets all simulator statistic information Details Opens a split view in the chosen component Source or Assembly Graphics Toggles the graphic bars Timer Update Switches the periodic update on off If activated statistics are updated each second Output File Opens the Output File options Output File You can redirect Coverage component results to an output file by selecting Output File Save As in the menu or popup menu Output File Filter Select Output Filter to display the dialog box shown in Figure 3 13 on page 61 Select what you want to display i e modules only modules and functions or modules functions and code lines You can also specify a range of coverage to be logged in your file 60 HC S 12 X Debugger Manual Debugger Components General Debugger Components Figure 3 13 Output File Filter Dialog Box Output File Filter x Content C Modules C Modules Functions Modules Functions Code Lines r Range to dump From o To 1100 Cancel Help Output File Save The Save As entry opens a
609. wnloading in Preload Command File BDI flash erase addr 08000 size 8000 BDI flash erase addr 28000 size 8000 BDI flash erase addr 48000 size 8000 BDI flash erase addr 68000 size 8000 BDI flash load After downloading in Postload Command File BDI flash idle HC S 12 X Debugger Manual Abatron BDI Connection Abatron BDI Connection Environment Abatron BDI Connection Environment Default Connection Setup As any other debugger connection the Abatron BDI Connection can be loaded from the Connection menu or can be set as a default target in the project file The target is setinthe Environment Variables section from your project file as shown above However if the target is not defined load the Abatron BDI Connection interactively Please refer to the Loading the Abatron BDI Connection on page 434 section Example of the Environment Variables section from your project file Environment Variables Target BDIK NOTE Please see the True Time Simulator and Real Time Debugger core manual for further information about the project file HC12 and HCS12 Banked Memory support You can define which banked memory format you want to use and its location in the memory of the Motorola HC12 or HCS12 derivative you are using The PPAGE DPAGE and the EPAGE formats are supported if available on the target HC12 or HCS12 derivative Banked Memory Location Window This Banked Memory Location window is available only if the
610. x e 4 9 EAFA ATAO MED OSTEN RES STS void main void A cooo E 1280 put your own code here C003 CALL 0x8004 0x38 EnableInterrupts COO CALL 0x8000 0x38 COOB BGND for BH E wait forever cooc BGND please make sure that you never leave this function B oxi HC12_ CPU Cycles 0 Auto prr a F B DF IX DFDF IY DFDF IEEE mixil 1r cooo pc cooo Prace o j menor __ inj Startup ee 000080 00 00 00 20 B 000084 05 00 00 00 nnnnaa nn nn nn nn zl E startupData X6 tagStartup E nofZeroOuts 0 unsigned int TE Comer EEE El pZeroDut OxcOll Range Postload command file correctly execu E toCopyDownBeq OxcOl5 Copy E SEG END SSTACK lt 0 gt array 0 of signed char 0 undefined signed char For Help press F1 2 000000MHz 0 MC9512DG128B done cmdisimulator_postload cmd p 246 HC S 12 X Debugger Manual Switching Connections Itis possible to switch connections from within an existing HC12 debugging project the following paragraphs give directions for accompliching this Loading the Full Chip Simulation Connection Because there is no actual hardware involved in switching from another project such as the SofTec in Dart HCS12 connection to the FCS connection the process is simple To load the FCS connection from within an existing project take the following steps 1 From the Debugger main menu select Component Set Connection as shown b
611. x106 FLASH CONTROL module not implemented FCS Warning ID 12 reading from unimplemented register at pc 0x400a L Value 0x0 Memory Address 0x106 FLASH CONTROL module not implemented STOPPING HALTED HC S 12 X Debugger Manual 271 HC S 12 X Full Chip Simulation Connection Warning message IDs belong usually to a group of registers from the same simulated block here above 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 volatile not saved in current project commands to hide specific ID messages or to stop the Full Chip Simulation automatically or pop up a warning message box The commands can be executed from a POSTLOAD command file 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 lt HALT CLMSG MSGBOX NONE STATUS gt WARNING SETUP STATUS displays the current warning setup status Example in warning setup status WARNING SETUP STATUS CLMSG WARNING SETUP HALT The FCS simply stops halts 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 are displayed in the Comman
612. y Set Watchpoint Description Appears in the Popup 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 Delete Watchpoint Appears in the Popup Menu only if a watchpoint is set or disabled on the selected memory range When selected deletes this watchpoint Show Watchpoints HC S 12 X Debugger Manual When selected brings up the Controlpoints Configuration Window Watchpoints Tab This is the interface through which watchpoints are controlled See Control Points chapter Debugger Components General Debugger Components Table 3 21 Memory Popup Menu Description continued Menu Entry Set Markpoint Description Appears in the Popup 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 Markpoints When selected brings up the Controlpoints Configuration Window Markpoints Tab This is the interface through which markpoints are controlled See Control Points chapter Show Location Forces all opened windows to display information about the Selected memory area
613. y be used for older releases of the Debugger and will be removed in the future A synonym has lower precedence than the environment variable Syntax Specifies the syntax of the option in EBNF format Arguments Describes and lists optional and required arguments for the variable Default Shows the default setting for the variable or none 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 See also Names related sections HC S 12 X Debugger Manual 643 Debugger Engine Environment Variables Environment Variables 644 ABSPATH Absolute Path 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 will store the absolute files it produces in the first directory specified If ABSPATH is not set the generated absolute files will be stored in the directory the parameter file was found Example ABSPATH sources bin headers usr local bin HC S 12 X Debugger Manual DEFAULTDIR Default Current Directory Tools Compiler Assembler Linker Decoder Librarian Maker Burner Debugger Synonym None Syntax DEFAULTDIR directory
614. y clicking and changing the state of one led will change the value of the byte at the DDR address If you want to change the color of the leds you must change the value of the byte at the PORT address in the Memory Component window The location is specified with a string in the form object value Possible objects and their values can be listed in the Inspector component lO LED Menu The IO LED Menu contains a single item Setup that opens the IO LED Setup dialog box shown in Figure 11 15 on page 326 which allows you to specify the PORT and DDR addresses HC S 12 X Debugger Manual 325 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 11 15 ILed Setup Dialog Box 326 Led Setup Associated Popup Menu Identical to menu Drag Out Nothing can be drag out Drop Into Nothing can be dropped into Demo Version Limitations No limitation HC S 12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities LED Component The LED window shown in Figure 11 16 on page 327 is a visual utility that displays an arbitrary 8 bit value by means of an LED bar Figure 11 16 LED Window i Led x PORT 4D 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 The u
615. y mode you can then use what you have done in the Edit mode that is to view values interact with your application and instruments press buttons etc To switch between these two modes you can use the toolbar the context menu or the shortcut Ctrl E Add New Instrument Use the context menu VisualizationTool Menu on page 133 on page 133 to add a new instrument Instrument Selection You can select a single instrument by left clicking the mouse on it and change the selection by pressing the tab key HC S 12 X Debugger Manual Debugger Components Visualization Utilities 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
616. y the compiler The entire procedure was not linked in the application because it is never used Open Source File The Open Source File dialog box shown in Figure 3 70 on page 119 allows you to open the Source File if a CPU is loaded A source file is a file that has been used to build the currently loaded absolute file Assembly file dbg is searched in the directory given by the OBJPATH and GENPATH variables C C files c cpp h are searched in the directories given by the GENPATH variable Figure 3 70 Open Source File Dialog Box Source Files Ed Go to Line This menu entry is only enabled if a source file is loaded It opens the dialog box shown in Figure 3 71 on page 120 In this dialog box enter the line number you want to go to in the source component the selected line will be displayed at the top of the source window If the number is not correct a message is displayed HC S 12 X Debugger Manual 119 Debugger Components General Debugger Components Figure 3 71 Go to Line Dialog Box Enter Line Number 2 Cancel Help 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 72 on page 120 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 se
617. ymbolic Information pata ra Tue Tin 5 cycues Symbol information EE80 R 3A01 R 2 4350657 SCIOHandler 8 xgate cxgate 2 4350657 Fibonacci main c c720 R 0002 w 0200 R 02 175 329ms 4350659 SCIOHandler xgate cxgate 0800 R E200 R 4A20 R 2 175 329ns 4350659 SCIOHandler B xgate cxgate 0028 R 02175 329ms 4350659 Fibonacci main c oca R 0007 R E201 R 4350662 SCIOHandler xgate cxgate 5420 R 2 31us 4350662 SCIOHandler xgate cxgate 0029 w C264 R 02 175 331ns 4350662 SCIOHandler 8 xgate cxgate 3401 R 02 4350662 SCIOHandler B xgate cxgate 02 4350662 Fibonacci main c 0200 R 2 175 331ns 4350663 SCIOHandler B xgate cxgate 4 T ap Full Chip Simulation Warnings By default the Full Chip Simulation generates warning messages when the application accesses onchip registers that are not implemented for the selected derivative These warnings are displayed in the Command window For example the following messages can be indefinitely repeated in the Command window FCS Warning ID 12 reading from unimplemented register at pc 0x400a L Value 0x0 Memory Address 0x106 FLASH CONTROL module not implemented FCS Warning ID 12 reading from unimplemented register at pc 0x400a L Value 0x0 Memory Address 0x106 FLASH CONTROL module not implemented FCS Warning ID 12 reading from unimplemented register at pc 0x400a L Value 0x0 Memory Address 0
Download Pdf Manuals
Related Search
Related Contents
Samsung UD55C-B Priručnik za korisnike csml: high-level bindings between C# and OCaml Acessórios padrão Controles operacionais principais - psn Vortex Optics Talon HD 8x32 VidyoSlate™ for iOS Quick User Guide Copyright © All rights reserved.
Failed to retrieve file