Home
S12(X) Debugger Manual - Freescale Semiconductor
Contents
1. IF condition Conditional execution PAUSETEST Displays a modal message box PRINTF Text value PRINT instruction REPEAT REPEAT loop instruction RETURN Returns from a CALL command TESTBOX Displays a message box with a string UNDEF symbol Undefines a user defined symbol UNTIL condition Condition of a REPEAT loop WAIT time s Command file execution pause WHILE condition WHILE loop instruction S12 X Debugger Manual 501 Debugger Engine Commands Commands Overview Base Commands Use Base commands to monitor the Simulator Debugger target execution These commands handle target input output files target execution control direct memory editing breakpoint management and CPU register setup Base commands can be executed independent of open components Table 22 2 contains all available Base commands Table 22 2 List of Base Commands 502 Command Syntax BC address Short Description Deletes a breakpoint breakpoint clear BS address function P T statel Sets a breakpoint breakpoint set CD path Changes the current working directory CR fileName A Opens a record file command records DASM address range OBJ Disassembles DB address range Displays memory bytes DL address range Displays memory bytes as longwords DW address range Displays memory bytes as words G address Starts execution of
2. Register Full Register Name Simulated Fields Acronym SCOCR1 SCI Control Register 1 M ILT SCOCR2 SCI Control Register 2 TIE TE TCIE RE RIE SBK ILIE SCOSR1 SCI Status Register 1 TDRE IDLE TC OR RDRF SCOSR2 SCI Status Register 2 RAF SCODRH SCI Data Register High R8 T8 SCODRL SCI Data Register Low R7 0 T7 0 Registers not Mapped to Memory Table 10 5 shows the SCI registers that are not mapped to memory Table 10 5 SCI Registers not Mapped to Memory Register SCIInput Description Sends a character to the SCI Value received from the SCI can be read via a read access to the SCDR Ninth bit is taken from SCIInputH register Read access to SCIInput has no specified meaning Bits 7 0 characters sent to the SCI SCIInputH Sends a character to the SCI containing the ninth bit associated with SCIInput Must be written before writing the SCIInput register Read access to SCIInputH has no specified meaning Bit 0 ninth bit sent to the SCI SClOutput 286 Receives a character sent from the SCI Value received in SCIOutput is triggered by a write access to the SCDR Ninth bit is written to the SCIOutputH register Write access to SCIOutput has no specified meaning Bit 7 0 characters sent from the SCI S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 5 SCI Registers not Mapped to Memory continued
3. S12 X Debugger Manual 253 Synchronized Debugging through DA C IDE Configuring DA C IDE for Freescale Tool Kit Configure Library Path You must define an additional configuration path to specify the location of library header files needed for DA C symbol analysis To do this choose Options Analysis for Symbols gt C Source in the main menu of DA C Use the window shown in Figure 9 3 to specify C source code analysis parameters Figure 9 3 Analysis for Symbols Options Window C Source Tab 254 Analysis for Symbols Options 2 x Genera C Source m Source Maximum identifier length 40 piwaRE MB8xxx CPU32 V5 0 a 2 Special table processing r Preprocessor Defines Control file ee Browse Header Directories JCSHIWARESLIB M 68K C include Browse Preinclude file T DA C PINCLUDESHIWARE MB8xxx CPU32 V5 0 h Browse Nested Comments M C Comments M Trad m Report these warnings when enabled Use the following parameters for fields in this window Source Select the supported C dialects of the C language used in the current project 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 to search for files named within the include directive A semicolon separates directories Only listed director
4. Component Use to select and configure extra component windows Data Use to select Data component functions Window Use to set the component windows Help Use to access a standard Windows Help menu S12 X Debugger Manual 29 Debugger Interface Debugger Main Window File Menu The File menu shown in Figure 2 5 is dedicated to the debugger project Figure 2 5 File Menu faim View Run HCS12FCS Component Memory Window Help Load Application Open Configurijtion Save Configur dn Save Configuration As Configuration 1Full Chip Simulation ini Ctri Ctrl 0 2 D Profiles b13819 Desktop MyGuessTheNUmber Full Chip Simulation ini 3D Profiles b 138 19 My Documents Project abc abc project ini 4D Profiles b 13819 My Documents testproject test project ini Exit Table 2 2 describes File menu entries Table 2 2 File Menu Entry Description 30 Menu Entry New Description Creates a new project Load Application Loads an executable file or debugger connection if nothing is selected Configuration As Recent Opens recently used applications Applications Open Opens debugger project window You can load a project file PJT Configuration or INI containing component names associated window positions and parameters window parameters connection name and ABS application file to load You can also load an existing HWC file corresponding to a debugger
5. 334 Signal IO Component 0 2c ee eee 335 Signal Description File EBNFE sleseseeeeeeeeeeeees 335 Base Signal Files Provided 0 0 0 ce eee eee eee eee 338 Virtual Wire Connections with the Pinconn IO Component 339 Command Set to Apply Signal on ATD Pin 0 339 BCS Tutorials ass sek hel denne tee bt dees sek hea et bet ERNEIEREN 339 Guess the Number ics rer em See ER IE 339 PWM ChannelO n ee Ier REPRE 347 11 P amp E Multilink Cyclone Pro Connection 353 P amp E Multilink Cyclone Pro Technical Considerations 353 Connection Menu 0 64 a eR ee PESE eed 353 HC12MultilinkCyclonePro Menu Options 0 0 354 12 OSBDM Connection 365 OSBDM Technical Considerations snuse eee eee eee eee 365 CodeWarrior Integration 365 Minimum Firmware Version 0 0 2 c eee eee e 365 8 S12 X Debugger Manual Table of Contents Support and Licensing 0 0 cee cee eee ee 366 13 SofTec HCS12 Connection 367 SofTec HCS12 Technical Considerations lllll lees ess 367 Connection Menu cilius ek A ud E Ide Idee edu 367 inDART HCS12 Menu Entries 0 00 c cee eee 367 14 HCS12 Serial Monitor Connection 373 Serial Monitor Technical Considerations 000 e cence 373 CodeWarrior IDE and Serial Monitor Connection 200 373 HCS12 Serial Monitor Interface
6. In Connection Mode section you can select Normal or Hot plug in non intrusive mode In Hot plug in mode debugger does not reset the target if target is running Setup Dialog Box Open the Setup dialog box using Abatron BDI Setup Figure 15 14 Setup Dialog Box 392 BDI Box Configuration Tool Path Enter here the path to the ABATRON configuration tool Browse Download Mode and Data Transfer Verification M Use Data Compression No verify at all fastest mode Verify only first byte of block C Read back all data from target memory C No write to target memory only verify it Use the debugger eeprom and flash programmer This option change takes effect only at next connection Cancel Help S12 X Debugger Manual Abatron BDI Connection Terminal Emulation The BDI Box Configuration Tool Path edit box is set up with the path and application name of the configuration tool from ABATRON Select Abatron BDI gt Configure BDI Box to automatically browse for the application tool Otherwise click the Browse button to look for the tool An example of the edit box contents is C tmp B10c12 exe In the Download Mode and Data Transfer Verification section you can set different options to transfer data from the computer to the BDI box The default setting is Verify only first byte of block Choose a different option to improve transfer speed or security By default data compression is enabled for asynchr
7. Selection Dialog Box This dialog box is used in the Debugger for opening general components or source files Select the desired item with the arrow keys or mouse and then click the OK button to accept or CANCEL to ignore your choice The HELP button opens this section in the Help File Use this dialog box to do the following 52 Set Connection Open IO component Open Source File Open Module Open individual component windows S12 X Debugger Manual Debugger Components This chapter explains how the different components of the Debugger work Debugger Kernel Components The Debugger kernel includes various components This section explains the types of components and their uses CPU Components CPU components handle processor specific properties such as register naming instruction decoding disassembling and stack tracing A specific implementation of the CPU module must be provided for each processor type supported in the debugger The CPU related component is not covered 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 automatically loads 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 Window Components The Debugger main wi
8. ToolTips You can set a trigger instead of setting a breakpoint Setting Trigger A Trigger B in various combinations and with various conditions increases programming and debugging flexibility see DBG Module Mode Setup Set TriggerAddress sets a trigger at the selected source location address Figure 17 4 l The number of available triggers depends on the device A B on S12 platform A B C on S12S P A B C D on S12X 404 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries Figure 17 4 Set Trigger Address B Option S12 True Time Simulator amp Real Time Debugger D Wrofiles SKrylov My DocumentsV roject 16W amp E Multilink Cyclone f Ix F e View Run Mub nkCydonePro Component Source Window Help Ea Sle Vine 5 zie 9 amp Source C Assembly D Profiles SKiylov My Documents VProsect 16 Sources vasi c man Set Breakpont E 3c8000 ANDCC ERE void main void 5 Run To Cursor 3C6002 BRA 0 zabs Ox3C6002 put your own cod 3 8004 LDX OxCO0D TUWWTUTTS 3C8007 LDY OxCOOB 3C800A BEQ 16 zabs Ox3CS01A for BB Set Trigger Address A 3C800C PSHY please make sure T Triggers Settings Open Trigger Settings Dialog O Procedure Wirit Verge Delete Markpoint Show Markpoints Set Program Counter w Data 1 Open Source File w Data 2 Breakpoint Trigger condbor Memory access at Address A The trigge
9. UNDEF testCase Display value of testCase DB testCase NOTE Also refer to examples given for the command UNDEF DETAILS The DETAILS command opens a profiler split view in the Source or Assembly component S12 X Debugger Manual 543 Debugger Engine Commands Debugger Commands Usage DETAILS assembly source Components Profiler component Example in gt DETAILS source DL The DL command displays the hexadecimal values of the longwords in a specified range of memory The command displays one or more lines depending on the address or range specified Each line shows the address of the first longword displayed in the line followed by the number of specified hexadecimal longword values When you specify a size in the range this size represents the number of longwords to display in the command line window Stop this command by pressing the Esc key NOTE Open the Command Line component before executing this command to see the dumped code Usage DL address range Omitting range displays the first longword taken from the address following the last longword displayed by the most recent DB DW or DL command or from address 0x0000 for the first DB DW DL command of a session Components Debugger engine Example in gt DL 0x8000 0x8007 8000 FE8045FD 80432710 544 S12 X Debugger Manual Debugger Engine Commands Debugger Commands Displays the content of the memory
10. Using ANSI C syntax enter a list of hexadecimal bytes separated by white spaces e g OxOF Ox2F 0x20 in the Find Expression text box The hexadecimal string entered must be at least one byte When you check the ASCII checkbox you can enter a text string in the text box e g my amp string Check the Range checkbox and enter a Start Expression and an End Expression in the text fields The string must be a hexadecimal value using ANSI C syntax e g OxF000 NOTE Checking Range and using a Start Expression and an End Expression is recommended Without these values the debugger searches through the entire device memory mapped in the Memory window The lower part of the dialog box displays the search results at the end of the search in the format SEARCHPATTERN Pattern my amp string Found at 20C0 L Click Search button to start the search or click Cancel to close the dialog box Refresh Select the Refresh menu entry to refresh the Memory window current data cache The debugger refreshes the data cache as if the debugger was halted or stepped S12 X Debugger Manual Debugger Components General Debugger Components Only memory ranges defined with the Refresh memory when halting option in the Debugging Memory Map DMM interface will be refreshed The Refresh menu entry addresses by DMM factory setup the volatile memory i e the RAM and on chip I O Registers TIP To refresh other memory ranges eit
11. ee NOTE Ifa directory specification in this environment variable starts with an asterisk the debugger searches the whole directory tree 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 LIBRARYPATH include lt File gt Path Tools Compiler ELF tools Burner Linker Decoder Synonym LIBPATH Syntax LIBRARYPATH lt path gt Arguments path Paths separated by semicolons without spaces Default Current directory Description If you include a header file with double quotes the Compiler searches in the current directory then in the directories given by GENPATH see GENPATH include File S12 X Debugger Manual 681 Debugger Engine Environment Variables Environment Variables Path and finally in directories given by LIBRARYPATH see LIBRARYPATH include lt File gt Path NOTE Ifa directory specification in the environment variable starts with an asterisk the Compiler searches the whole directory tree including subdirectories and their subdirectories recursively 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 Environment variable U
12. Deleting Breakpoints The Debugger provides three ways to delete a breakpoint Use Delete Breakpoint from Source Context Menu 1 Inthe Source component window point at a C statement where a breakpoint exists and right click This displays the Source context menu 2 Choose Delete Breakpoint from the context menu to delete the breakpoint Hold down the left mouse button click the D key 1 Point at a C statement in the Source component window where a breakpoint exists 2 Hold down the left mouse button and click the D key This deletes the breakpoint Choosing Show Breakpoints from Source Context Menu 1 Point in the Source component window and right click The Source context menu appears 2 Choose Show Breakpoints from the context menu The Breakpoints Setting dialog appears 3 In the list of defined breakpoints select the breakpoint to delete 4 Click Delete The selected breakpoint is removed from the list of defined breakpoints S12 X Debugger Manual Control Points Breakpoints 5 Click OK to close the Breakpoints Setting dialog box and remove the icon associated with the deleted breakpoint from the Source component Associate a Command with a Breakpoint Each breakpoint temporary permanent counting or conditional can be associated with a debugger command Specify this command in the Breakpoints tab of the Controlpoints Configuration window To open this window Choose Show Breakpoints from So
13. Pot I 0 amp C Timer Riter for MC9S12A512BCPV only Licensed 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 checkmark indicates whether the named methods or event is selected and a red cross indicates that code has not been generated Figure 10 27 Project Window Processor Expert Tab PE Test mcp 4 Ful Chip Simulation i ow gB y Fies Link Order Targets Processor Expert Ej Configurations Z ABT2BCPV Operating System CpuMC9S124512BCPV amp Y sPisswsPl Ei User Modules lt E PE Test c main amp C Generated Modules External Modules Documentation The Beans folder shows the previously created bean with the name AS1 AsynchroSerial S12 X Debugger Manual 343 HC S 12 X Full Chip Simulation Connection FCS Tutorials Bean Inspector AS1 AsynchroSerial Window In this window you can modify the behavior of the bean to your needs Use the Properties tab to make general settings Use the Methods and Events tabs to modify software drivers 1 Select the Properties tab 2 Enter a proper baud rate To run on real hardware check your board manual for the right value To run on FCS only enter 9600 Figure 10 28 Bean Inspector Window 344
14. void main void Processor Expert internal initialization DON T REMOVE THIS CODE PE_low_level_init End of Processor Expert internal initialization Write your code here GuessTheNumber Processor Expert end of main routine DON T MODIFY THIS CODE for an T Processor Expert end of main routine DON T WRITE CODE BELOW End of main routine DO NOT MODIFY THIS TEXT Run the Application 346 The application is now finished and we can launch it Make sure you have chosen the FCS connection 1 Select the Debug icon in the Project Manager window or the menu bar Project gt Debug or F5 2 Select Component Open in the debugger and open the Terminal component 3 Select the Save icon in debugger or the menu bar File Save Configuration to save the window layout 4 Select the Debug icon in debugger or the menu bar Run Start Continue or F5 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Figure 10 29 Debugger Main Window Final Application Terminal DER Guess a Number between 0 and 9 Number PWM Channel 0 We are going to create step by step the demo run in the executive tutorial The application makes use of the Pulse Width Accumulator PWM With the final application you will be able to change the period and duty time of the PWM and see
15. Data Dragging the name appends the variable address range 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 selected memory range to Command Line window Register Appends address stored in selected register to current command Demo Version Limitations Only 20 commands can be entered and the command component closes It is no longer possible to open a new command component in the same Debugger session NOTE Command files with more than 20 commands cannot be executed Associated Commands BD CF E HELP NB LS SREC SAVE NOTE For more details about commands refer to Debugger Engine Commands ComMaster Component The ComMaster component allows you to easily control one more debugger instance from the master debugger like you do it through the COM interface from within another application NOTE The ComMaster component is accessible through the debugger commands only Its window is always minimized and has no associated menus S12 X Debugger Manual Debugger Components General Debugger Components Associated Commands COM_START COM EXE COM EXIT Coverage Component The Coverage window shown in Figure 3 10 contains source modules and procedure names as well as percentage values representing the proportion of executed code in a given source module or procedure NOTE In ca
16. ErrClr sErrGet edout S12 X Debugger Manual 259 Synchronized Debugging through DA C IDE Configuring DA C IDE for Freescale Too Kit Figure 9 8 DA C Linker Settings User Defined Actions 2 x Menu Start Actions Menu File Version Control Systems Actions New Delete Rename r Menu B C amp ompiler tne Up Use compiler template Down r Tool bar C None C Text mum Picture Jlinker BMP Browse Action script c hiware prog linker exe fibo prm Zaif E wist edout zz Message No Messages found z Cancel E CI EnGet edout Maker Configuration Now configure the maker as shown in Figure 9 9 1 Inthe Menu Start Actions click on New The New Action box appears 2 Type amp Make into the New Action box 3 Click ENTER Set the corresponding Maker bitmap 1 Copy the code from Listing 9 3 into the Action Script field 2 Change the directory in the code to your maker directory 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 260 S12 X Debugger Manual Synchronized Debugging through DA C IDE Debugger Interface Figure 9 9 DA C Maker Settings User Defined Actions x Menu Start Actions Menu File Version Control Systems Actions New Delete Rename Up Use co
17. Memory Access at Address A and Value on Data Bus Match Description Use to set a trigger on a program instruction read or write of a specific matching byte value at Address A memory location Uses trigger B address as a match value rather than an address location If you select this trigger type using a context menu without setting the match value an error message prompts for the match value Replaces the standard trigger editing dialog box with Triggers Address Settings dialog box see Figure 17 7 Match Value edit boxes replace Trigger Editing dialog Memory Access at Address A and Value on Data Bus Mismatch Use to set a trigger on a program instruction read or write of a non matching byte value at Address A memory location Uses trigger B address as a mismatch value rather than an address location If you select this trigger type using a context menu without setting the match value an error message prompts for the match value Replaces the standard trigger editing dialog box with Triggers Address Settings dialog box see Figure 17 7 Match Value edit boxes replace Trigger Editing dialog Instruction at Address A Is Executed Use to set a trigger on a program instruction execution program counter occurring at Address A Instruction at Address A or Address B Is Executed Use to set a trigger on a program instruction execution program counter occurring at either Address A or B Instruction Exe
18. NOTE The menu changes slightly for a project that uses an XGATE coprocessor Table 10 1 Simulator Menu Entry Description Menu Entry Description Load Opens the Load Executable Window menu Reset Resets the FCS Set Derivative Selects the current simulated derivative Configure Opens the Memory Configuration 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 Opens the Clock Frequency Setup dialog box to set the FCS real time clock Command Files 272 Opens the Command Files Window S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu Table 10 1 Simulator Menu Entry Description continued Bus Trace Opens the Bus Trace dialog box to enable instructions and memory accesses recording and display recording captures Select Core Selects the processor with which to communicate Debugger Status Bar with Full Chip Simulation The status bar Figure 10 2 and Figure 10 3 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
19. Ox801C OxFE 0x2102 LAB on 12 platform A B C on S12S P A B C D on S12X S12 X Debugger Manual 411 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries Figure 17 13 Triggers Set in Data and Memory Windows 412 Data 1 DER main c Auto Symb Global fiboCount 233 unsigned int counter 14 unsigned int TER Expert Triggers in Data and Memory Windows NOTE Expert Triggers are available for S12 devices only Expert Mode offers a different set of triggers and trigger options To completely separate Expert mode from Automatic mode the debugger provides a unique set of Expert triggers Expert triggers are independent of normal regular triggers In the Data and Memory windows context sensitive menu entries for Expert Triggers contain a Set DBGCA entry and a Set DBGCB entry Expert Mode requires a thorough knowledge of the DBG module register usage and debugging For more details on Expert mode and Expert triggers see Expert Triggers Tab tsio platform only S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries Figure 17 14 Source Window Context Menu Expert Trigger Options S12 Set Breakpoint Run To Cursor Show Breakpoints Show Location Set DBGCA Set DBGCB Set DBGCC Set up Expert triggers Open Trigger Settings Dialog Trigger Module Usage gt Delete Markpoint Show Markp
20. Properties Ctrl P Add New Instrument Analog Bar v Edit Mode Ctri4E Knob Load Layout Ctri4L 7 Segment Display Savelayoutas Ctrl4S LED Bitmap Value as s Relative Value as Text Command Command Callback DIL Switch Switch Chart Table 3 51 describes the visualization tool menu entries Table 3 51 VisualizationTool Menu Description Menu Entry Shortcut Description Properties lt Ctrl P gt Displays the properties of the currently selected instrument Add New None Enables you to choose an instrument from the list Instrument and add it to the view Edit Mode lt Ctril E gt Switches between Display mode and Edit mode Checked in Edit mode Load Layout lt Ctril L gt Loads a VisualizationTool Layout vt1 The actual instruments are not removed Save Layout lt Ctrl S gt Saves the current layout to a file vt1 as Associated Context Menu The context menu of the VisualizationTool varies depending on the current selection Table 3 52 describes possible menu entries S12 X Debugger Manual 145 Debugger Components Visualization Utilities Table 3 52 VisualizationTool Context Menu 146 Menu Appearsin Shortcut Description entry Menu Edit mode Always None Switches between Display mode and Edit mode In Edit mode this entry is checked Setup Always None Shows Setup dialog of the Visualiza
21. Set Breakpoint Run To Cursor Show Breakpoints Show Location Delete Trigger Address 4 Delete Trigger Address B Open Trigger Settings Dialog Trigger Module Usage Automatic triggers breakpoints watchpoints and trace possible gt Instruction execution inside Address 4 Address B range R Set Markpoint Show Markpoints Instruction execution outside Address 4 Address B range Instruction at Address A then at Address B were executed Instruction at Address A and value on data bus match Open Source File Instruction at Address A and value on data bus mismatch v Record continuously and halt on trigger hit Record continuously and DO NOT halt on trigger hit Start recording after trigger hit and halt when fifo is Full Start recording after trigger hit and DO NOT halt when fifo is Full Copy Ctrl C Go To Line Ctrl G Find Ctrl F Find Procedure Ctrl I Folding Marks ToolTips Trigger Module Usage Use this menu entry to set the DBG module functionality globally without opening the Trigger Module Settings window Figure 17 16 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Figure 17 16 Source Window Extended Menu S12 Set Breakpoint Run To Cursor Show Breakpoints Show Location Delete Trigger Address 4 Delete Trigger Address B Triggers Settings b Open Trigger Settings Dialog Trigger Module Usage ld Set
22. TimedEvent Time AssignmentList AssignmentList Assignment Exception PeriodicEvent PERIODICAL Start NbTimes PerTimedEvent END PerTimedEvent Time AssignmentList Exception RAISE Vector Priority ArbPrio Name Assignment ObjectId ObjectField Expression Name w character Expression astandard ANSI C expression The expression accepts object identifiers previously defined ObjectSpec and ObjectField Time anumber 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 S12 X Debugger Manual 333 HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins 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 Omitting bitRange affects all bits of the object register Specifying bitRange applies the mask defined by this bitRange to the value calculated with the Expression This value affects only the bits of the object register defined in the bitRange Bits are numbered from r
23. address ident ITPORT address ident Sets the line and column port addresses of the IT Keyboard component ITVECT address ident Sets the interrupt vector port address of the IT Keyboard component address ident KPORT address ident Sets the line and column port addresses of the Keyboard component address ident LCDPORT address ident Sets the data port and the control port address of the LCD component address ident LINKADDR address ident address ident address ident address ident Sets the components internal port addresses used with the IO Ports as memory buffers PBPORT address ident Sets the port address of the Push Buttons component PORT address Sets the LED components port address REGBASE Address R Sets or resets the base I O address address ident S12 X Debugger Manual SEGPOHT address ident Sets the display selection port and the segment selection port addresses of the 7 Segments display component 631 Connection Specific Commands Full Chip Simulator Commands Table 23 3 List of Component Specific Commands continued Command Syntax Short Description SETCONTROL lt Name gt Changes the number of ticks and Ticks Pixels pixels for the lt Name gt channel from the Monitor component WPORT address ident Sets the ports address
24. executing command2 txt 1 bckcolor red 1 1 done command2 txt bckcolor white done command1 txt S12 X Debugger Manual Debugger Engine Commands Debugger Commands Example with C Option If a command1 txt file contains bckcolor green cf command2 txt C bckcolor white and a command2 txt file contains bckcolor red Execution in cf command1 txt executing command1 txt bckcolor green Icf command2 txt C executing command2 txt 1 bckcolor red 1 1 done command2 txt done command1 txt CLOCK In the SoftTrace component the CLOCK command sets the clock speed Usage CLOCK frequency Where frequency is a decimal number which is the CPU frequency in Hertz Components SoftTrace component S12 X Debugger Manual 533 Debugger Engine Commands Debugger Commands Example in gt CLOCK 4000000 CLOSE Use the CLOSE command to close a component Component names are Assembly Command Coverage Data Inspect Memory Module Procedure Profiler Recorder Register Source Stimulation Usage CLOSE component where means all components Components Debugger engine Example in gt CLOSE Memory This closes unloads the Memory component window COLLAPSE 534 In the MCURegisters component the COLLAPSE command is used to fold node in the register tree view Usage COLLAPSE name where name is the name of a node in the register tree view If the n
25. for best code density None C float is IEEE32 double is IEEE32 C float is IEEE32 double is IEEEG4 lt Back 15 The C C options screen lets you select the level of Startup Code you wish to produce Selecting either of the options results in the following conditions Minimal startup code This option produces the best code density The 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 The application code must address variable initialization This means this option is not ANSI compliant since ANSI requires variable initialization S12 X Debugger Manual 227 How To Using the Stationery Wizard to Create a Project ANSI startup code This ANSI compliant startup code initializes global variables objects and calls the application main routine 16 Select the Memory Model by clicking the appropriate radio button Selecting any of the options results in the following conditions Small Use the Small memory model if both the code and the data fit into the 64 kilobyte address space By default all variables and functions are accessed with 16 bit addresses The compiler supports banked functions or paged variables in this memory model but all accesses must be explicitly handled Banked Banked memory model uses banked function calls by default but the default data ac
26. iv Hex Format Cancel Help NOTE The Show PC dialog box is the same as the Display Address dialog box In this dialog box the Assembly component dumps assembly code starting at the specified address CopyMem Dialog Box The CopyMem dialog box shown in Figure 3 51 allows you to copy a memory range to a specific address Figure 3 51 CopyMem Dialog Box Source from Address hex to Address 0 hex Destination from Address 0 hex lv Hex Format Cancel Help To copy a memory range to a specific address enter the source range and the destination address Click the OK button to copy the specified memory range Click the Cancel button to close the dialog without changes Click the Help button to open the help file associated with this dialog If you check Hex Format all given values are in Hexadecimal Format It is not necessary 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 S12 X Debugger Manual 97 Debugger Components General Debugger Components Search Pattern The Search Pattern dialog box shown in Figure 3 52 allows you to search memory or a memory range for a specific expression Figure 3 52 Search Pattern Dialog Box 98 Search Pattern Find Expression xc Search ASCII Ced MV Range Start Expression 0 38801B Help End Expression 0x38801B js Pattern OxcO Found at 38801B
27. 0 0 0 0 cee eee 373 MONITOR HCS12 Menu Options 0 0 0 0 eee eee eee 377 15 Abatron BDI Connection 381 Abatron BDI Technical Considerations 0 0 00 e cee eee 381 Abatron BDI Highlights 0 0 0 0 eee ee eee 381 Abatron BDI Requirements 0 0 0 0 eee eee 381 Abatron BDI Connection Introduction 0 0 c eee eee 382 Interfacing Abatron BDI and Your System 000 382 BDI Interface Software Setup 0 0 00 0 cee eee eee 383 Running the ABATRON Configuration Tool 0 383 Loading the Abatron BDI Connection 0 00 387 Abatron BDI Connection Menu Entries 0000 ce eee eee eee 389 Abatron BDI Connection Dialog Boxes 0 000 000 eee 391 Communication Device Specification Dialog Box 391 Setup Dialog BOX esegue eb ERR E ee etal 392 Terminal Emulation 0 0 cece n 393 16 TBDML Connection 395 TBDML Technical Considerations 0 000 cece eee eens 395 Connection Menu 2 is us eae Wen edie beatae As 395 TBDML HCS12 Menu Entries 395 S12 X Debugger Manual 9 Table of Contents Book Ill HC S 12 X Debugger Common Features Book TH Contents 21i ue EORR YIN AR e a MR Rag 399 17 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms401 DBG Features c cec cete nooner a Se SSA CRG REE TEMES Oe ERS 401 Specific Connection Me
28. 0c eee eee ee 241 Change Format of Register Display esee 241 Modify a Register Content 0 00 0 242 Start Memory Dump at Selected Register Address 243 Modify Content of Memory Address 0 0 00 002 cee eee eee 243 Consulting Assembler Instructions Generated by a Source Statement 244 Viewing Code o kk is et Aki as ede bp deba des 244 Communicating with the Application 00 0 0 0000000 245 6 S12 X Debugger Manual Table of Contents About startup cmd reset cmd preload cmd postload cmd 246 7 CodeWarrior Integration 247 Debugger Configuration lsleseeeee eee eee 247 8 Debugger COM Capabilities 249 COM Implementation lesse 249 Driving Debugger through COM 0 0 00 0 0 eee eee eee 249 9 Synchronized Debugging through DA C IDE 251 Configuring DA C IDE for Freescale Tool Kit 0 251 Create New Projectors nerca ninae cee WEI ae eS eS 252 Configure Working Directories 252 Configure File Types 123 ccc a daw a ae hae ee be LI Pe Risen Ss 253 Configure Library Path 0 0 0 cee eee 254 Configure the Tools iie he eR CHR ee ee ERE YE Se e 258 Debugger Interface dag set ek env seu ele a 261 DA C IDE and Debugger Communication 262 Synchronized Debugging 0 0 0 cece eee eee 265 Jrou bleshooting been eup nE e RAS echo ene e ede
29. Control Points Breakpoints Holding down the left mouse button pressing the T key 1 Point at a C statement in the Source window hold down the left mouse button and click the T key This defines a temporary breakpoint 2 Choose Run To Cursor from the context menu The application continues execution and stops before executing the statement Temporary breakpoints are automatically deleted once they have been activated If you continue program execution it no longer stops on the statement that contained the temporary breakpoint Permanent Breakpoints Permanent breakpoints activate each time the instruction executes The following icon identifies a permanent breakpoint Setting Permanent Breakpoints Using the Source Window Context Menu 1 Point at a C statement in the Source window and right click The Source context menu appears 2 Select Set BreakPoint from the context menu A permanent breakpoint mark appears in front of the selected statement Holding down the left mouse button pressing the P key 1 Point at a C statement in the Source window 2 Hold down the left mouse button and click the P key A permanent breakpoint mark appears in front of the selected statement Once you define a permanent breakpoint you can continue program execution The application stops before executing the statement Permanent breakpoints remain active until they are disabled or deleted S12 X Debugger Manual 171 Con
30. D AProfilesNS Klo My Documents Project 16 X5 0urces vnain c put your own cc Set Breakpoint 00 ANT 239 A EATA aon To coso YE3 Show Breakpornts 3C8004 LDX for BB Show Location 3C8007 LDY please make sut 3C800A BEQ 8bs OxSC801A a Set Trigger Address A 3C800C PSHY Set Trigger Address 6 Triggers Settings Open Trigger Settings Dialog O Procedure a Profiling and coverage no triggers trace not possible Disabled manual use of on chip trigger module with trace possible Ld E Auto 000080 07 07 00 20 OS 00 00 00 000088 80 00 00 00 00 00 00 FF 000090 00 00 00 00 00 00 00 00 LITT RUNNING Breakpoint ES i ai For Help press F1 Atomatic triggers breakpoints watchpoints and trace possible MC9S12NE64 Breakpoint S12 X Debugger Manual 403 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries Figure 17 3 Source Context Menu Added Options S12X Platform Set Breakpoint Run To Cursor Show Breakpoints Show Location Set Trigger Address A Set Trigger Address B Set Trigger Address C Set Trigger Address D Sequencer Setup gt Trace Setup gt Open Trigger Settings Dialog Trigger Module Usage Set Markpoint Show Markpoints Set Program Counter Show Core gt Open Source File Chri Go To Line Ctrl G Find Ctrl F Find Procedure Ctrl I Folding Freeze Marks
31. Figure 2 26 Example of a Component s Context Menu Set Breakpoint Run To Cursor Show Breakpoints Show Location Set Markpoint Show Markpoints Set Program Counter Open Source File Go To Line Ctri4G Find Ctri4F Find Procedure Ctri I Folding b Freeze Marks ToolTips gt Features of the User Interface This section describes some of 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 Figure 2 27 shows an example Figure 2 27 Drag and Drop Example OER D Sources main c i 2 while i lt n 0 fibo fibl fib2 fib2 fibo ic HB return fibo HB When an item cannot be dropped into a specific destination the following cursor symbol appears D S12 X Debugger Manual 47 Debugger Interface Features of the User Interface Example 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 28 Figure 2 28 Dragging Procedure Name from Coverage to Source Component Window 48 ISI DER D tces main c 8 while SCI SCDR ch B E Coverage El calc c Eval Echo El terminal c termport c Display the memory layout corresponding to the address held in a register by
32. HALT ON TRAP HCSI2 SUPPORT MESSAGE HIDE ID MESSAGE HIDE RESET MESSAGE SHOW ID PSMODE SELECTCORE STACK AREA CHECK STACK POINTER INFO WARNING SETUP Enter these commands in any command files that will be executed by the debugger or in the Command Line component of the debugger 644 S12 X Debugger Manual Connection Specific Commands Full Chip Simulation Connection Commands ADCx_SETPAD Description Sets PAD pin to a given voltage in floating point format on ADC module x Sets the value of an input channel of an Analog to Digital Converter to the specified voltage The module name is an integral part of the command name The voltage is given as a float constant value in volts The allowed range is from 0 0 to 5 12 Volts Syntax lt moduleName gt _SETPAD lt channel gt lt voltage gt Example ADC1_SETPAD 4 2 5 This sets the input of channel 4 of the ADC1 module to 2 5 volts ATD2_SETPAD 2 1 5 This sets the input of channel 2 of the ATD2 module to 1 5 volts BGND_CYCLES Description This command allows you to adapt the simulator s clock cycles for the BGND instruction by specifying the number of cycles it takes to execute a BGND instruction The default value is five CPU cycles Syntax BGND_CYCLES lt number gt Example BGND_CYCLES 10 A BGND instruction now takes 10 CPU cycles to execute S12 X Debugger Manual 645 Connection Specific Commands Full C
33. Integrated Queue Module IQUE Ethernet Media Access Controller EMAC Ethernet Physical Transceiver EPHY Debug Module DBG S12X INT Table 10 9 shows the simulated S12X INT registers Table 10 9 Simulated S12X INT Registers Register Full Register Name Simulated Acronym Fields IVBR Interrupt Vector Base Register Entire register INT XGPRIO XGATE Interrupt Priority Configuration Register Entire register INT CFADDR Interrupt Request Configuration Address Register Entire register INT CFDATAO 7 Interrupt Request Configuration Data Registers All registers 0 7 XGATE Table 10 10 shows the simulated XGATE registers Table 10 10 Simulated XGATE Registers 290 Register Acronym Full Register Name Simulated Fields XGMCTL XGATE Module Control Register Entire register XGCHID XGATE Channel ID Register Entire register S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 10 Simulated XGATE Registers continued Register Acronym Full Register Name Simulated Fields XGVBR XGATE Vector Base Address Entire register XGIF XGATE Interrupt Flag Vector Entire register XGSWT XGATE Software Trigger Register Entire register XGSEM XGATE Semaphore Register Entire register XGCCR XGATE Condition Code Register Entire register XGPC XGATE Program Counter Entire register XGR1 XGATE Regi
34. NVMC Commands LASH PAGE3 LASH PAGE4 LASH PAGES LASH PAGE6 LASH PAGE7 HALTED 38000 3BFFF Enabled Blank Protected Unselected 48000 4BFFF Enabled Blank Unselected 58000 5BFFF Enabled Blank Protected Unselected 68000 6BFFF Enabled Blank Unselected 78000 7BFFF Enabled Blank Protected Unselected As used in Listing 23 1 the FLASH command loads the applet that corresponds to the CPU derivative MCUID and displays the state of all modules To program an application into module number 7 FLASH PAGES you must unprotect the module as in Listing 23 2 Listing 23 2 Unprotect Module in 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 Unselected FLASH C000 C000 FFFF Enabled Blank Protected Unselected FLASH PAGET 18000 1BFFF Enabled Blank Protected Unselected FLASH PAGE2 28000 2BFFF Enabled Blank Unselected FLASH PAGE3 38000 3BFFF Enabled Blank Protected Unselected FLASH PAGEA 48000 A4BFFF 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 resulting from this code shows that FLASH PAGES is unprotected To select FLASH PAGES for programming enter in Flash select
35. Options Select to display the component menu in the main menu when you Component select a component For example if you select the Source window Menu the Source menu displays in the main menu Layout Load Option to Load Store your arrangements from a HWL file Store 44 S12 X Debugger Manual Debugger Interface Component Associated Menus NOTE Autosize and Component Menu are checked by default Help Menu This is the Debugger Main window Help menu Figure 2 23 Table 2 8 describes menu entries Figure 2 23 Help Menu Help Topics About Table 2 8 Help Menu Description Help Topics Choose to activate online help for specific information about a topic About Displays information about debugger version copyright and license About Box Select Help About to display the About box The about box lists directories for the current project system information program information version number copyright and registration information 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 OK to close this dialog box Component Associated Menus Various Debugger Component windows are shown in Figure 2 1 Each component window has two menus One menu is in the main menu and the other one is a context menu also called Associated Contex
36. Stopping an application does not reset DBG module nor does debugger set DBG module User Triggers Mode User must define trigger type Provides a 4 Stage Sequencer for trace buffer control List menu provides predefined sequences User can define their own sequences In this mode Debugger does not set triggers as watchpoints or breakpoints automatically Usercan define four triggers and their conditions Usercan use the Sequencer to decide how to stop the debugger Table 17 11 Memory Access Triggers Available Mode Memory Access at Description Use to set a trigger on a program instruction read or write at Address A memory location labeled Address A Memory Access at Use to set a trigger on a program instruction read or write at Address A or Address B memory location labeled Address A or Address B Memory Access Inside Use to set a trigger on a program instruction read or write Address A Address B that occurs within Address A to Address B memory range Range 436 Memory Access at Address A then Memory first reads or writes at Address A memory location then Access at Address B reads or writes at the Address B memory location Use to set a trigger on a program instruction sequence that S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Table 17 11 Memory Access Triggers Available continued Mode
37. The logical display gives a constant Memory view at a specific address For example if we define in a window address range the concatenation of PPAGE 16 added with the physical local address we obtain a 24 bit address that does not represent anything for the CPU but that is directly readable by the user in the Memory window By default for 8 16 bit devices the debugger displays memory addresses greater than address OxFFFF as logical These addresses no longer represent real addresses but are required by the debugger to synchronize the program flow display and data accesses within all windows The debugger defines page range accessibility in the DMM interface For 8 16 bit devices window ranges in the physical local memory 0000 FFFF can be defined as logical in the DMM interface to make them constant at display For example changing the 8000 BFFF program window from physical to paged or EEPROM paged for paged EEPROM in the DMM graphical user interface makes the debugger display the PPAGE 00 instead of what the CPU sees when looking at addresses in the 008000 00BFFF range The default debugger display is mixed You can change the display when you edit the module setup in the DMM interface Refer to the Debugging Memory Map section for further details S12 X Debugger Manual 91 Debugger Components General Debugger Components Memory Operations 92 Double click a memory position to edit it If the memory is n
38. The project will be setup for data optimization The data optimization is available for Custom memory only this selection is disabled for Banked memory model NOTE Itis not possible to use MemoryBanker for project with Processor Expert XGATE or OSEK 22 Click Next to continue The PC lint options screen appears 230 S12 X Debugger Manual How To Using the Stationery Wizard to Create a Project Figure 6 27 PC lint Options Screen HC S 12 X Microcontrollers New Project Wizard Map r Do you want to create a project set up for PC n TM Device and Connection XGATE Setup f Yes Project Parameters C No Add Additional Files Processor Expert C C Options ILint tools can find common pos eines o Memory model options suspicious lines in source code by zing it int TM is product from Gimpel Software You PC Lint the PC int TM software from Gimpel installed in der to use the Code armor plugin This wil add an additional Target to the project with the name PC Lint You need a professional icense in order to use the PC Lint plugin 23 Unless you wish to create a project set up for PC lint select No While Lint tools can find common programming mistakes or suspicious lines in source code by analyzing it you need to install the PC lint software from Gimpel to use the CodeWarrior plug in You can enable PC lint later by manually cloning a target and changing the linker to PC lint linker Selecting the Yes
39. There are two different ways to start an application Choose Run gt Start Continue e 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 continues execution until e You decide to stop the execution See Stopping an Application The application reaches a breakpoint or watchpoint The application detects an exception watchpoints or breakpoints Stopping an Application There are two different ways to stop program execution Choose Run gt Halt e Click on the Halt icon in the debugger tool bar HALTED in the status line indicates that execution has been stopped The blue highlighted line in the source component is the source statement at which the program was stopped next statement to be executed The blue highlighted line in the Assembly component is the assembler statement at which the program was stopped next assembler instruction to be executed Data window with attribute Global displays the name and values of the global variables defined in the module where the currently executed procedure is implemented The name of the module is specified in the Data info bar Data window with attribute Local displays the name and values of the local variables defined in the current procedure The name of the procedure is specified in the Data info bar Stepping in the Application The Debugger provides
40. main 0x410 P COM interface analog in Perl S g_hwiInst gt ExecuteCmd open data result g hwInst ExecuteCmdRes bs main SerCode Win32 OLE LastError COM EXIT Description Finishes debug session and destroys the previously created Hiwave Instance Syntax COM EXIT Examples in COM EXIT in ComMaster 2 COM EXIT COM interface analog in Perl g hwlInst ExecuteCmd exit COPYMEM 536 Use the COPYMEM command to copy a memory range to a destination range defined by the beginning address This command works on defined memory only The debugger compares the source range and destination range to ensure they do not overlap Usage COPYMEM Source address range dest address S12 X Debugger Manual Debugger Engine Commands Debugger Commands Components Memory Example in copymem 0x3FC2A0 0x3FC2B0 0x3FC300 This copies the memory located in the range 0x3FC2A0 to 0X3FC2B0 to the memory at 0x3FC300 to 0x3FC310 This Memory range appears in red in the Memory Component CMDFILE The CMDFILE command allows you to define all target specific commands in a command CMDFILE Command File Kind ON OFF Command File Full Name gt Components Simulator target engine Example in gt cmdfile postload on c temp myposloadfile cmd This executes the myposloadfile command file after loading the absolute file CR The CR command instructs the debug
41. sets if what TERM Wri TERM Wri if what direction of the terminal lt TERM_TO_WINDOW what gt TERM_APPEND_FILE return te ESC TERM Write h te char what 0 TERM TO WINDOW amp amp what TERM FROM KEYS TERM WriteString fileName TERM Write CR 128 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 11eName TERM APPEND BOTH append output to file and window TERM APPEND FILE append output to file fileName See also terminal h for further details Using 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 Sci object 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 Notall Full Chip Simulation components currently have an Sci0 object For all other Full Chip Simulation components the default virtual SCI port does not S12 X Debugger Manual Debugger Components General Debugger Components
42. Bean Inspector Cpu MC9512A512BCPV Bean Items Visibity Help lt Properties Methods Events Build options Used Comment v Bean name Cpu v CPU type MC351245128CPV E Clock settings Initializalion priority interrupts enabled Internal resource mappi Fe Register block mapping 0000 Intemal RAM mapping 0900 E Internal EEPROM Enabled Intemal EEPROM mape 0000 B Operating mode and ex He Boot operating mode Special Single Chip xi External bus settings E Enabled speed modes E High speed mode amp Intemal bus clock 80 8 0 MHz E PLL clock Enabled PLL clock frequency Mal 2 1 2 PLL bandwidth contre Automatic Bandwadth Contro PLL mode Acquisition mode zl BASIC ADVANCED EXPERT _ Bean Level High Level Bean Generation of Driver Code Next 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 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Verification of Files Created We can verify the folders created by Processor Expert User Modules A file called MyGuessTheNumber C is the placeholder for the
43. But if you program in a protected area boot block make sure that the matching module is unprotected 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 and 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 hardware however you first must do a connection reset by clicking the reset button of the Debugger Hardware Considerations This section consists of hardware specific information about current FPP files for HC12 CPU12 CPU devices and HCS12 and HCS12X CPU devices NOTE The Flash Programming release note in the on line documentation of your toolkit installation contains the latest information about FPP files HC12 CPU12 CPU Devices The HC12B32 the HC12D60 and the HC12DG128 CPU devices and Flash module information appears below HC12B32 fpp filename mcu03c1 fpp Number of Flash modules 1 applet code currently not relocatable loaded at 0x800 using 0x400 bytes S12 X Debugger Manual 477 Flash Programming Hardware Considerations Table 19 3 HC12B32 Flash Module Details Module Module Remarks Name Number FLASH_ 0 32 Kilobytes Flash located in 0x8000 OxFFFF or 0x0000 B32 Ox7FFF both handled according to M
44. Choose Stimulation gt Open File io_var txt Choose Stimulation gt Execute oy px dm Choose Run Start Continue The Stimulation component executing io var txt accesses TargetObject at address 0x210 associated with PORT DATA in the source You can observe this by watching the Template component The arrow is not continuously rising but jumping around The value of PORT DATA is now handled from the Stimulation component Using an editor open the file named io var txt in the FCS demo directory This file looks like Listing 10 4 Listing 10 4 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 PERIODICA 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 328 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection True Time I O Stimulation 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 then 100 000 cycles
45. If an asterisk precedes a directory name 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 5 O NOTE Some DOS environment variables like GENPATH and LIBPATH are used We strongly recommend working with WinEdit and setting the environment by means of a DEFAULT ENV file in your project directory You can set this project directory in WinEdit s Project Configure menu command This way you can have different projects in different directories each with its own environment NOTE When using WinEdit do not set the system environment variable Defaultdir lf you do and this variable does not contain the project S12 X Debugger Manual 673 Debugger Engine Environment Variables Local Configuration File usually project ini directory given in WinEdit s project configuration files might not be put where you expect them Line Continuation Specify an environment variable in an environment file default env hidefaults over multiple lines by using the line continuation character Example OPTIONS W2 Wpd This is the same as OPTIONS W2 Wpd Be careful when using the line continuation character with paths For example GENPATH N TEXTFILE txt Results in GENPATH TEXTFILE Ntxt To avoid such problems use a semicolon
46. 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 To use a file as an input stream make sure there is at least one connection from the input file to any output device Then open an input file by choosing Input File from the context menu As soon as you click the OK button in the File Open dialog input from the file starts The file closes as soon as the end of file is reached or as soon as you choose Close Input File from the context menu S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities When the input file reaches the end a CTRL Z character ASCII code 26 decimal is sent to all output devices receiving characters from the input file to notify them that the file transfer is complete Redirecting input devices to an output file requires a similar process Make sure that you have chosen your connections from input devices to the output file Then open or create your output file by choosing Output File from the context menu If the file does not exist it is created Otherwise you can choose to overwrite or append the existing file To stop writing to the output file choose Close Output File from the context menu 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 10 28 illustrates the p
47. Module base address edit box Base address is typically 0x20 for M68HC912B32 address hex M68HC912D60 and M68HC912DG128 and 0x28 for HCS12 derivatives 493 On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog Table 21 1 Description of Settings 494 Setting Description Continue on Allows you to debug in banked memory model when using 16 bits illegal break break module 16 bits break module does not allow you to set a breakpoint in bank To address this problem when the debugger stops on a hardware breakpoint it compares the address to an internal breakpoint list If the low 16 bit portion of the address compares to the low 16 bit portion of the address of a set breakpoint the breakpoint is located in an alternate bank Debugger automatically restarts target When you finish making these settings the debugger considers any breakpoint set in Non Volatile Memory as a Hardware Breakpoint If your application is loaded in RAM breakpoints are software breakpoints In this case the Hardware Breakpoint module allows you to debug using breakpoints and one watchpoint only one watchpoint is available NOTE In Automatic mode the HC12 or HCS12 hardware breakpoint modules allow only two breakpoints or one watchpoint at a time If you are debugging your code in Flash you cannot set more than two breakpoints or one watchpoint Some actions like stepping over or stepping out use one in
48. 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 output is The value of the counter is 2 580 S12 X Debugger Manual Debugger Engine Commands Debugger Commands PTRARRAY Use the PTRARRAY command to display a pointer as an array Usage PTRARRY on off nb Where e on displays pointers as arrays off displays pointers as usual pointer nbisthe number of elements to display in the array when unfolding a pointer displayed as array Components Data component Example in Ptrarray on 5 Display content of pointers as array of five items RD The RD command displays the content of specified registers The register display includes both the name and hexadecimal representation If the specified register is not a CPU register then the debugger looks for an I O register in a register file called MCUIxxxx REG where xxxx is a number related to the MCU NOTE This command is processor derivative specific Banked registers are not displayed unless the processor supports banking Usage RD list CPU where 1ist is a list of registers to be displayed Separate registers to be displayed by a space Specifying RD CPU displays all CPU registers This command displays an error message of No CPU loaded if no CPU is found S12 X Deb
49. Trace HCS12x only Record continuously vi FIFO Normal mode v Table 17 9 Data Recording Options Option Description FIFO normal Change of flow COF program counter PC addresses are stored mode debugger rebuilds program flow FIFO LOOP1 Loop1 Mode similarly to Normal Mode also stores only COF mode address information to the trace buffer it however allows the filtering out of redundant information Loop1 Mode only inhibits consecutive duplicate source address entries that would typically be stored in most tight looping constructs It does not inhibit repeated entries of destination addresses or vector addresses since repeated entries of these would most likely indicate a bug in the user s code that the DBG module is designed to help find The debugger rebuilds program flow S12 X Debugger Manual 431 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Table 17 9 Data Recording Options Option Description FIFO DETAIL In Detail Mode address and data for all memory and register mode accesses is stored Pure PC mode Default recording mode when available Debugger decodes pure PCs recorded by module Does not perform program flow rebuild In Compressed Pure PC Mode the PC addresses of all executed opcodes are stored A compressed storage format is used to increase the effective depth of the trace buffer T SIZG STZP platform Seq
50. at the end of a path if there is a V at the end GENPATH TEXTFILE txt 674 S12 X Debugger Manual 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 In the Debugger for C Source Files c cpp Je ee th EE 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 Abs File directory In the Debugger for Assembly Source Files dbg Rw Np Path coded in the absolute file abs Project file directory where pjt or ini file is located Paths defined in the GENPATH environment variable from left to right Abs File directory In the Debugger for Object Files rate wR YN 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 Debugger Files The Debugger comes with several program application configuration files and examples Table 24 1 lists these files and file extensions S12 X Debugger Manual 675 Debugger Engine Environment Variables Debugger Files Table 24 1 Debugger Files and File Extensions 676 File Extension Descripti
51. disabled Load Arms all selected modules executes a LOAD command then disarms modules Click Load without selecting any Flash modules to make the NVMC utility select and load all modules Click on a module to select or use Select All Unselect All buttons to adjust selection Selecting and unselecting are not automatic from the command line Before using command line to perform any operation use SELECT command to select module See FLASH 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 Anon relevant displayed speed is symptomatic of a Flash Programmer diagnostic problem In that case close the dialog check the hardware and reset the connection Configuration FPP File Loading When the dialog box is open the NVMC utility loads the FPP configuration file according to this algorithm S12 X Debugger Manual 473 Flash Programming NVMC Graphical User Interface 6 The utility reads the NV PARAMETER FILE entry from the connection specific section of the project ini file Freescale ESL is a connection specific section Example Freescale 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 me
52. full debugger when capture buffer is full Do not halt when the Continuously records data accesses but does not halt FIFO is full processor debugger when the capture buffer is full Display Information A large gray box provides dynamic information about the current triggers and selected options As context sensitive menus only display triggers matching the number and type of currently set triggers the debugger checks the current trigger settings against the trigger mode If one or more triggers do not match the trigger mode selection a warning icon and message appears on the bottom of the dialog The display field in Figure 17 24 shows that the Memory Write Access type does not match the Instruction trigger type selected in the list S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 24 Trigger Settings Tab Information Display S12 Trigger Module Settings Trigger settings Expert trigger s General settings Instruction at Address A then at Address B were executed X Triggers Address Settings Address A 0x308011 Instruction opcode fetch Address B 00500 Memory Write Access Record continuously and halt on trigger hit v FIFONomalmode v This mode is used to trigger on a program instruction execution program counter sequence A fest at Address A then at Address B The DBG module starts recording program flow information immediately aft
53. or provide trace information both before and after the final state is reached Table 17 12 describes the available recording options Table 17 12 Recording Options Option Description Record continuously Starts recording program flow information immediately after run Halts the processor debugger when capture buffer is full Start recording on condition Starts recording program flow information on trigger condition match Halts the processor debugger when capture buffer is full Record before and after condition Data Recording Control Starts recording program flow information on trigger condition match Does not halt the processor debugger on trigger condition match halts when capture buffer is full The data recording options are available for Capture triggers only Select these options from the list box in the Trigger Settings tab S12 X Debugger Manual 441 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 36 Data Recording Control Trigger Module Settings Trigger settings Sequencer General settings User Triggers trace possible no automatic breakpoints and watchpoints A RAWAccess B Notdefined C Notdefned D Not defined Ades DD Ee Address Compare to 00000 With Mack 00000 C Inside Range C Outside Range Compare mismatch Always stop on this trigger Triggeron HCS12 C XGATE Trace HCS12
54. sure that you use the correct module name in your command If the abs is in HIWARE format some debug information is in the object file 0 and module names have an o extension e g fibo o In ELF format module name extensions are c cpp or dbg dbg or program sources in assembler e g fibo c since the abs file contains all debugging information and object files are not used 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 Do not include the path name in the module name You must specify the module extension i e DBG for assembly sources or C for C sources etc The debugger searches for the module name in the directories associated with the GENPATH environment variable and displays an error message Ifthe module specified does not take part of the current application loaded e If no application is loaded Components Data Memory and source components S12 X Debugger Manual 591 Debugger Engine Commands Debugger Commands Example in gt Data 1 lt SMOD fibo c Displays global variables found in the ibo c module in the Data 1 component window SPC In the Source component the SPC command loads the corresponding module s source text scrolls to the corresponding text location the code address and highlights the statement that corresponds to this code address In the Assemble
55. this command displays the first word taken from the address following the last word displayed by the most recent DB DW or DL command or from address 0x0000 for the first DB DW or DL command of a session Components Debugger engine Example in gt DW 0x8000 4 8000 FE80 45FD 8043 2710 Displays the content of four words starting at 0x8000 as word 2 byte values Memory words appear in the Command Line component window 546 S12 X Debugger Manual Debugger Engine Commands Debugger Commands 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 appears in the default number base The result appears as a signed number in decimal format and as an unsigned number in all other formats Usage E expression 0 D xX C B where O displays the value of expression as an octal base 8 number D displays the value of expression as a decimal base 10 number X displays the value of expression as an hexadecimal base 16 number C displays the value of expression as an ASCII character Displays the remainder resulting from dividing the number by 256 Displays all values in the current font Displays control characters 32 as decimal B displays the value of expression as a binary number Components Debugger engine Example in define a 0x12 in define b 0x10 in
56. uL then Equum Nea 583 RESEP aini aE E esu PUER Rep eR a 583 RESTART Uv ERE EET OD UE ans haba oe ae acts EE ERE RENE 584 RETURN EneSeDRD EROS D PHI oh Serge eet eese 584 RS eee e PATITUR MR Go e CRI i PER C gs ae yt Sees 585 Seren ua o od sea hg See uM RTL E eee eed ot Ue ASA NU IC 586 SAVE dece necs ies bu PORA ERR UERMUCURLUMRVRRERVECRES 586 SAVEBP Lacs EAE LEER a eH Ep 587 SET ihe geben eb Rie te SE wa 588 SEICOLDORS uuee Ri une ERU ME RE REPE CERE 588 SLAY 46 5 cated seed segs d ys ote E hola Aiba whee eR 589 SEINE zie bem iet etre tert eg Out CENE ORAS 590 S12 X Debugger Manual Table of Contents SMEM are dnte RDUM atin e b ERR SOR ERES e 590 SMOD aee pt USERS CURUN REN URL RR RT RR named ERU SUR aes 591 SPC Skies nome Sia ed rp SS he bh isthe deleted 592 SPROG ves vada AA TC MAR E e RU RR d RR cs 592 SREGC diede x RM I nace ees e a ee aerea uiu 593 STEPINTOY uet RV ERR ae OFT RDG SET ERE NU CE ed 594 STEPOUT d ena pale ur REC ERE RE EN 594 STEPOVER 5 ARRA LAE AR ERA uM Ene 595 STOP sates stars ack ter e e RR NSER ER rd i OC ERE PRU ON gata kts eee ata od 596 T Sus tee tere t e a Ca separe nd eade rues 596 TESTBONX waive ts He EC UARIIS ALONE RR 597 TUPDATE RR es eae tes RE Neqoe ce Weis 598 UNDEF 45 34 ERE SEE CEU S 598 UNEOLDD d dee UR RR ER CER RA 601 UNTIE xeu ttr ee Rr ee ote ER e SI me ere eee ede 601 UPDATERATE vk ESAME RAOERER dH EE SPESE PER DS TR SUE 602 WER 2 3 ive a eet eee nt hae a RE E RE eque
57. 0 eee eee eee eee Watchpoints Tab 0 0 00 eee ee eee Multiple Selections 0 Checking Syntax 0000 0 Setting Watchpoints 0 Watchpoints in Multi Core Projects Markpoints reu Oo Ae ea ete ae Markpoints Tab 0 0 2 2 eee eee eee Setting Markpoints 0 0 Halting on a Control Point Counting Control Point Conditional Control Point Control Point with Command 5 Real Time Kernel Awareness Inspecting Task State 0 00 0004 RTK Interface ccce eet Task Description Language lesse Application Example 0 eee ee Inspecting Kernel Data Structures RTK Awareness Register Assignments OSEK Kernel Awareness lssesess OSEK RTI eoe emm ORTI File and Filename ORTI Aware Debugging System ORTI File Structure 0 0 00 OSEK RTK Inspector Component 6 How To Configuring the Debugger For Use from Desktop Windows 2000 S12 X Debugger Manual Table of Contents Table of Contents Staring the Debugger soups bei ie een bee E Urbe eie ei 208 Starting with WinEdit 0 ee eee 208 Starting from within the IDE 00 0 00 0 eee eee ee 209 Debugger Command Line Start 00 0 0 0
58. 12 X Debugger Manual 4 Ww z freescale Revised August 10 2010 s micon ductor Freescale the Freescale logo and CodeWarrior are trademarks of Freescale Semiconductor Inc Reg U S Pat amp Tm Off Flexis and Processor Expert are trademarks of Freescale Semiconductor Inc All other product or service names are the property of their respective owners 1989 2010 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 ic
59. 15 6 Communication Setup Dialog Box 386 Communication Setup Channel Baudrate COMI 9600 C come 19200 38400 C COM3 57600 115200 EEEE C COM4 IP Address C Network 192 168 1 100 Cancel Test O In this dialog box set the communication for using the BDI with the debugger Make sure these settings are identical to debugger communication settings made in the Communication Setup dialog box see Figure 15 6 Click the Test button to check the setup then click OK to quit this dialog Save the settings if necessary BDI Working Mode and Setup List Transmission Select Setup gt Mode to open the BCI Working Mode dialog box Figure 15 7 Set the required parameters and click Transmit to download the configuration to the target board S12 X Debugger Manual Abatron BDI Connection BDI Interface Software Setup Figure 15 7 BDI Working Mode Dialog Box BDI Working Mode Identification MC amp 8HC912DA128 Startup CPU Type HC812DA128 v BDM Communication Clock 8 0 MHz X Register Address 0000 Hex Reset C Stop C Run C Hot Plug BDI Workspace 2000 Hex Terminal Address 2000 Hex Loading the Abatron BDI Connection Use the Target Abatron BDI inthe Environment Variables section of the project file to set the target The Abatron BDI Connection automatically detects whether the target is connected to your system If no target is detected the target is not connected or is connected to a
60. 317 SCIOutput 317 SCIOutputH 317 Scope menu entry 73 Scope submenu 73 Search for text in source 122 Search order 675 Assembly source files 675 C source files 675 Object files source files 675 Search Pattern menu entry 93 Search procedure 120 SEGPORT 641 718 Select Core menu entry 273 Select Core Option 355 369 390 398 Select Derivative option 389 396 Selected menu entry 74 Selecting 471 473 Send to Back menu entry 146 Send to Front menu entry 146 Serial Communication Interface SCI 285 315 Serial Monitor 421 Serial Peripheral Interface SPI 287 SerialInput 315 317 SerialOutput 317 SET 588 Set Breakpoint menu entry 58 119 Set Connection menu entry 42 Set DBGCA 412 Set DBGCB 412 Set Derivative menu entry 272 Set Derivative option 354 Set Markpoint menu entry 59 120 Set Program Counter menu entry 120 Set Trigger A 419 428 435 Set Trigger Address 411 Set Trigger Address B 412 Set Trigger B 419 428 435 Set TriggerAddress 404 SETCOLORS 588 SETCONTROL 642 SETCPU 642 Setcpu command file 275 Setup dialog 392 Setup menu entry 146 390 Setup Option 368 396 Show Breakpoints menu entry 58 120 Show Location 408 448 Show Location menu entry 58 120 Show Markpoints 406 Menu entry 120 Show Markpoints menu entry 59 Show Protocol 392 SHOWCYCLES 643 SHOWPROT 688 Silicon ID reading 220 Simulation 25 S12 X Debugger Manual Hardware design 25 Simulator Menu 272 Single Step instruction 236 Single Step menu ent
61. Command line component the HELP command displays all available commands Subcommands from the ATTRIBUTES command are not listed Component specific commands for closed components are not listed Usage HELP Components Debugger engine Example in gt HELP HI WAVE Engine VER LF NOLF CR NOCR S12 X Debugger Manual 561 Debugger Engine Commands Debugger Commands ICD12EXEC HELP The ICD12EXEC HELP command outputs a list and descriptions of all P amp E available debugger commands to the Command Window Usage icdl2exec help Components Debugger engine Example in gt icd12exec help IF The conditional commands IF ELSEIF ELSE and ENDIF allow you to execute different sections depending on the result of the corresponding condition You may next the conditional commands 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 562 S12 X Debugger Manual Debugger Engine Commands Debugger Commands Example DEFINE jump 0 DEFINE ju
62. Create a Project 13 This screen appears only for selected derivatives that offer Processor Expert support as well as it also depends on other project settings For example Processor Expert is not available for projects with XGATE and Processor Expert is not available for projects with absolute assembly or C Selecting any of the rapid application development options results in the following conditions None No device initialization code is generated Only generates startup code See readme txt in project to know how Processor Expert can be enabled if not done here Device Initialization The tool can generate initialization code for on chip peripherals interrupt vector table and template for interrupt vector service routines Processor Expert Processor Expert can generate for you all the device initialization code It includes many low level drivers 14 Click Next to continue The C C Options screen appears Figure 6 25 C C Options Screen HC S 12 X Microcontrollers New Project Wizard Map Which level of startup code do you want to use Select minimal startup code for best code density C minimal startup code XGATE Setup ANSI startup code Project Parameters Device and Connection Which memory model shall be used Add Additional Files C Smal Banked c Processor Expert C C Options Custom Memory model options Select the floating point format supported PC Lint Select None
63. Cyclone Pro Connection Connection Menu Figure 11 5 P amp E HC S 12 Connection Manager dialog box PEMICRO Connection Manager ou have selected to display this dialog on startup Specify communications parameters and click OK Connection port and Interface Type Add LPT Port Interface USB Multilink Embedded Multilink or Embedded OSBDM p Refresh List Port USB1 USB ML 12 Rev C PE5015296 Target CPU Information CPU HC12 no paging y Advanced BDM Communications Speed Autodetect communications speed UselO DELAY CNT 18 Decimal MCU Intemal Bus Frequency For programming Of c a Reset Options Delay after Reset and before communicating to target for 0 milliseconds decimal Cyclone Pro Power Control Voltage gt Power Dut Jack Provide power to target r Pr s Hotsync Show this dialog before attempting to contact target Otherwise only display on Error NOTE The Connection Manager dialog box will only show after attempting to automatically contact to the target using the default connection settings Connection settings can be changed during Hi wave by going to MultilinkCyclonePro gt Communications however the debug session must be restarted to see the changes 358 S12 X Debugger Manual P amp E Multilink Cyclone Pro Connection Connection Menu Figure 11 6 P amp E HC S 12 Connection Manager Advanced Options dialog box Ell HC S 12 Advanced Opti
64. D D B BS 3555595322 SETAHEADREADSIZE front size when halted back size when halted front size when running back size when running 624 S12 X Debugger Manual Connection Specific Commands DMM Commands DMM Description Displays the current DMM Memory Types Overlap Priorities and memory ranges in the Command window Syntax DMM DMM ADD Description Inserts a new memory range in the DMM as if added via the DMM dialog user interface Syntax DMM ADD comment address size handle type cache locking priority mapping access while running access kind access size Arguments on comment a string for Comment field use for space address the start address of the memory range size the size of the memory range handle along value allowing the DMM to handle the memory range duplicated handled is not allowed WARNING User defined handles must have a value greater than or equal to 100 type a value corresponding to a memory type handle as given listed in the DMM command cache locking a0or 1 value 0 forces a memory range refresh after each debugger halt priority a value corresponding to an overlap priority handle value as given listed with the DMM command mapping a0 or 1 value 1 enables memory range mapping S12 X Debugger Manual 625 Connection Specific Commands DMM Co
65. DEVI dee dt 660 STEPBOTHCORES eee ue kp Behe PVR Sea E ES AS 660 S12 X Debugger Manual 17 Table of Contents DID BG escent ace nad dee AE sm bv 661 XGATECODERANGE eki RR ERU Rer eR Re 661 XGATECODERANGESRESET 0 000 000 ee 662 Other Hardware Connection Commands 00000000005 662 HWBREAKONLY reien oes og eee ea BRA be eas 662 ISRDISABLEDSTEP 0022 64 05 hina bee abe dese ee genres 663 24 Debugger Engine Environment Variables 667 Debugger Environment 667 The Current Directory e n E eee ee Le EY e 668 Global Initialization File MCUTOOLS INI PC Only 668 Local Configuration File usually project ini 000 669 Default Layout Configuration PROJECT IND 000 670 Environment Variable Paths 0 0 e eee eee eee eee 673 Search Order for Source Files eee ees 675 In the Debugger for C Source Files c cpp 000020005 675 In the Debugger for Assembly Source Files dbg lusus 675 In the Debugger for Object Files HILOADER 675 Debugger Piles 5 veles edits 28 RR RR Eh RE ma o e ong 675 Environment Variables 0 0 00 cece ce e 678 ABSPATH Absolute Path llle eee 678 DEFAULTDIR Default Current Directory 0 678 ENVIRONMENT Environment File Specification 679 GENPATH include File Path 0 2 0 0 eese 680 LIBRARYPATH i
66. DPAGE 8 R14 IP 24 concatenation of PPAGE PC if in banked area OSEK Kernel Awareness 200 The 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 S12 X Debugger Manual Real Time Kernel Awareness OSEK Kernel Awareness information semaphores messages queues resources allocations synchronization and communication between tasks ORTI describes the applications in any OSEK implementation A set of attributes for system objects A method for interpreting the data obtained OSEK RTI The OSEK Run Time Interface ORTI is a development tool interface to the OSEK operating system It is a part of the OSEK standard see www osek vdx org The ORTI enables the attached tool to evaluate and display information about the operating system its state its performance the different task states and different operating system objects 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 winLif
67. Debugger Components General Debugger Components Table 3 14 Dragging Data Possibilities continued Destination Action Component Window Source Dragging the name of a global variable in source Window displays the module at which the variable is defined and highlights first occurrence of the variable Register Dragging the name loads the destination register with the address of the selected variable Dragging the value loads the destination register with the value of the variable NOTE 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 describes the drop actions possible in the Data component Table 3 15 Data Drop Possibilities 80 Source Component Action Window Source A selection in the Source window is considered an expression in the Data window as if entered through the Data component Expression Editor Refer to Data Component Expression Editor Module Displays global variables from the selected module in Data component Demo Version Limitations Only two variables can be disp
68. Debugger Components Visualization Utilities Figure 3 106 DILSwitch Instrument Table 3 60 lists DILSwitch instrument attributes Table 3 60 DILSwitch Instrument Attributes Attius paeent Display 0 1 When enabled displays value of bit under each plot of DILSwitch instrument Switch Color Specifies the color of the switch Knob Instrument The Knob instrument is normally known as an adjustment instrument For example it can simulate the volume control of a radio Figure 3 107 Figure 3 107 Knob Instrument Table 3 61 shows the Knob instrument attributes Table 3 61 Knob Instrument Attributes Attribute Description Low Display Value Defines zero point of the indicator Values below this definition are not displayed High Display Value Defines highest position of the indicator the value at which the indicator reads 100 Indicator Color Defines color and width of pen used to draw the indicator Knob Color Defines color of the knob side 156 S12 X Debugger Manual Debugger Components Visualization Utilities LED Instrument Use the LED instrument for observing one definite bit of one byte Figure 3 108 There are only two states On and Off Figure 3 108 LED Instrument Table 3 62 shows LED instrument attributes Table 3 62 LED Instrument Attributes Attribute Description Bitnumber to Display Defines bit of the given byte to be displayed Colo
69. Debugger Manual 349 HC S 12 X Full Chip Simulation Connection FCS Tutorials 350 Run the Application The application is now finished and we can launch it Make sure you have chosen the FCS connection 1 Select the Debug icon in the Project Manager window or the menu bar Project gt Debug or F5 2 Select Component gt Open in the debugger and open the VisualizationTool component VisualizationTool Properties In the following paragraphs we create a visualization for our project Make all changes in the VisualizationTool window Make sure that you are in the Edit mode switch with Right mouse click gt Edit Mode or Ctrl E 1 Right mouse click gt Properties 2 For Refresh Mode select CPU Cycles 3 For Cycle Refresh Count select 10000 Chart Properties Now add a chart in which 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 Select Expression for Kind of Port Select pwmChannel 0 for Port to Display Select 2 for High Display Value Select Target Periodical for Type of Unit Select 1000 for Unit Size Select 1000 for Numbers of Units PF ON UU Eu UC WESS uo Leave all others on default Period Bar Properties With the bar we can change the period value of the PWM channel 0 1 Right mouse click gt Add New Instrument gt Bar 2 Double click on the Bar to see the Bar Properties 3 Sel
70. Debugger Manual 683 Debugger Engine Environment Variables Environment Variables USELIBPATH Using LIBPATH Environment Variable Tools Compiler Linker Debugger Synonym None Syntax USELIBPATH OFF ON NO YES Arguments ON YES Uses the LIBRARYPATH environment variable see LIBRARYPATH include lt File gt Path to look for system header files h gt NO OFF Does not use the LIBRARYPATH environment variable Default ON Description This environment variable allows flexible use of the LIBRARYPATH environment variable because LIBRARY PATH may be used by other software for example version management PVCS Example USELIBPATH ON See also Environment variable LIBRARYPATH include File Path 684 S12 X Debugger Manual 25 Connection Specific Environment Variables Some of the environment variables that can be used in the debugging process are imported with the connection software and are specific to that connection This chapter lists and describes those variables Abatron BDI Connection Environment Variables This section describes the environment variables used by the Abatron BDI Connection The Abatron BDI Connection specific environment variables are BDICONF COMDEV COMPRESS SHOWPROT SKIPILLEGALBREAK VERIFY These variables are stored in the BDIK section from the project file Listing 25 1 Example of the BDIK
71. Display Headline menu entry 147 Display menu 96 S12 X Debugger Manual Display menu entry 93 319 Display Scrollbars menu entry 147 Display Symbolic menu entry 57 Display Version 157 Displayfont 159 DL 544 DMM 455 Do not halt when the FIFO is full 422 424 442 Down Counter 314 Download Mode and Data Transfer Verification 393 Dragging 48 Driving debugger through DDE 701 DUMP 545 Dump 451 DW 545 Dynamic trigger types 413 E e character in Source and Assembly windows 409 E keyword 547 Edit Mode menu entry 145 146 147 Editing Expressions 71 Memory 243 Register 242 Variable 240 Editing Registers 83 Editor 71 EEPROM 289 EETS 289 ELSE 548 ELSEIF 548 Embedded application 25 Enable Breakpoint menu entry 58 119 Enabled module state 472 Enabling Flash 473 End 472 ENDFOCUS 549 ENDFOR 549 ENDIF 550 ENDWHILE 550 Enhanced Capture Timer ECT 294 314 Environment S12 X Debugger Manual File 667 Panel 31 Environment variable 678 ABSPATH 678 DEFAULTDIR 678 ENVIRONMENT 667 GENPATH 680 682 HIENVIRONMENT 679 HIPATH 680 682 LIBPATH 681 684 LIBRARYPATH 682 OBJPATH 682 TMP 683 USELIBPATH 684 ENVpath option 613 EQUAL Mask 154 Erasing Flash 473 Error messages DA C 266 Ethernet 381 382 EXECUTE 551 Execute menu entry 319 EXIT 551 Exit menu entry 31 EXPAND 552 Expert mode 409 412 425 Expert triggers 425 Explorer 668 Expression Command file 72 Generating 72 Expression Editor 71 Expressions Ad
72. HC S 12 X Microcontrollers New Project Wizard Map Please choose the set of languages to be Project name supported initially You can make multiple Device and Connection selections Project 1 mcp SEA Location sl Raves D Project_1 Project Parameters Relocatable assembly Vc Set Ce Add Additional Files Processor Expert C C Options This will set up your application with an R NSI C compliant startup code doing Memory model options initialization of global variables PC Lint lt Back Next gt Finish Cancel 8 Select the language format by checking its checkbox You can make multiple selections creating the code in multiple formats Selecting any of the options results in the following conditions Absolute Assembly Using only one single assembly source file with absolute assembly There is no support for relocatable assembly or linker Relocatable Assembly It supports to split up the application into multiple assembly source files The source files are linked together using the linker C This sets up your application with ANSI C compliant startup code and initializes global variables e C This sets up your application with ANSI C startup code and performs global class object initialization 9 Inthe Project name textbox type the name of your new project 10 Click Next to continue The Add Additional Files screen appears S12 X Debugger Manual 225 H
73. IDLE Idle Line Detection Set after a period without any input The system Flag considers the ILT flag OR Overrun Error Flag Set if the receipt of value ends but the processor has not yet read the value NF Noise Error Flag Not supported no physical transmission takes place FE Framing Error Flag Not supported no physical transmission takes place PF Parity Error Flag Not supported 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 R8 Receive Bit 8 Supported T8 Transmit Bit 8 Supported Rx Tx Receive Transmit Supported with autoclear feature Bit x FCS uses non memory mapped registers to simulate SCI connection to the outer world FCS 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 FCS simulates an empty input line All the sent values are available in the output registers listed in Table 10 19 Other modules can subscribe to these registers to receive the sent values S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 19 Input Output Serial Output Registers Name Meaning Comments Input Adds a value to be received The Read has no specified System takes the ninth bit from
74. IO Register Symbol Table Visualization Utilities The symbol table shown in Figure 3 94 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 Figure 3 94 Inspector Window Symbol Table i Inspect FulName SrcPos mc9s 12e 128 main c D Profiles 13 Start12 c D WProfies 13 GP Object Pool I8 10 Register Events Icon FileName D Profies b 13 D WProfieslb13 D Profiles p 13 The Inspect window Events icon shown in Figure 3 95 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 S12 X Debugger Manual 137 Debugger Components Visualization Utilities Figure 3 95 Inspector Window Events Icon Events are only used in the HC S 12 X Full Chip Simulator Use this information for simulation I O device development When simulating a watchdog COP the Event View displays an event with the remaining time Exceptions Icon The Inspect window Exceptions icon shown in Figure 3 96 shows all currently raised exceptions Exceptions are pending interrupts Figure 3 96 Inspector Window Exceptions Icon 138 fl Inspect Events are only used in the HC S 12 X Full Chip Simulator Use this in
75. LS on a single symbol e g in gt ls counter that is an application variable as well as a user symbol displays the application variable 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 S12 X Debugger Manual 573 Debugger Engine Commands Debugger Commands Components Debugger engine Example in gt mem Type IO the PRU NONE RAM NONE Ei Ei NONE ROM IO the PRU NONE ROM COP PROM Addresses 0 3F 40 4F 50 64F 650 7FF 800 ATF A80 3DFF 3E00 FDFF FEOO FELF FE20 FFDB FFDC FFFE FFFF FFFF O s 3FF PRU or TOP TOP board resource or NONI Ei PRU or TOP TOP board resource or NON Ed ROM Special ram for cop enabled MS 574 The MS command sets a specified block of memory to a specified list of byte values Specifying a range that is wider than the list of byte values repeats the list of byte values as many times as necessary to fill the memory block When the range is not an integer multiple of the length of 1ist the last copy of the list is truncated appropriately This command is identical to the write bytes WB command Usage MS range list S12 X Debugger Manual D
76. MSG ELSIF i 8 THEN MSG ELSE MSG inyalid END BlockedByAccept WaitForDReply WaitForMail DelayQueue BlockedByReceive WaitForSemaphore Dummy SysBlocked Inspecting Kernel Data Structures To allow the debugger to display the data structures of the operating system the corresponding symbol information in this case for SOOM System REM must be available To use another kernel its source code must be available and must be compiled However if only the object code is available generate the needed symbol information by describing the kernel data structures of interest using ANSI C language as shown in Listing 5 2 Listing 5 2 Kernel Data Structure Description typedef struct PD 198 int status struct PI D next S12 X Debugger Manual Real Time Kernel Awareness Inspecting Kernel Data Structures long regs 6 PD Define a simple task descriptor by collecting variables in a structure and assigning them to a segment for example OS_DATA shown in Listing 5 3 Define this structure to fit the same layout as the operating system If necessary use filler variables to get the correct alignment 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 tasks OS_DATA Th
77. Menu EDI Untitled BDI1000 Setup for CPU12 EGF Setup Tools View Help New Ctrl N Open Ctri o Save Ctri S Save As Figure 15 4 Setup Menu EDI Untitled BDI1000 Setup for CPU12 File ETH Tools View Help D Firmware Communication Init List Mode Select Setup gt Init List to see and edit if necessary the content of this configuration file This displays the Startup Init List configuration file in the Startup Init List dialog box You can edit add or remove memory write instructions in this dialog box to configure your MCU and MCU environment S12 X Debugger Manual 385 Abatron BDI Connection BDI Interface Software Setup Figure 15 5 Startup Init List Dialog Box Startup Init List Address 000000012 o EEPROM to Ummm i Ox000000F1 EEPROT Unprotect all EEPROM blocks Ox000000FF PPAGE Select Flash Array 0 0x000000F5 FEEMCR Enable program of boot block O0x000000FF PPAGE Select Flash Array 1 0x000000F5 FEEMCR Enable program of boot block Ox000000FF PPAGE Select Flash Array 2 0x000000F5 FEEMCR Enable program of boot block Ox000000FF PPAGE Select Flash Array 3 0x000000F5 FEEMCR Enable program of boot block 0x00000010 INITRM Map RAM to 0x2000 Cancel Quit this dialog box by clicking OK and save the settings if necessary Communication with the Debugger Setup Select Setup gt Communication to open the Communication Setup dialog box Figure
78. Module for S12 S12S 12G 12P S12X Platforms S12 X Debugger Manual HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface Figure 14 9 Monitor Setup Dialog Box Monitor Communication Tab Monitor Setup Monitor Communication Vector Table Mirroring Load Options HOST Serial Communication Port Please select in this dialog the serial communication port used HOST Serial Communication Port v Monitor Setup Monitor Communication Vector Table Mirroring Load Options r Application Loading Options v Enable Automatic Erase Flash on Load By default the Monitor DLL will automaticallly erase the flash when a load is i To disable this feature uncheck the checkbox S12 X Debugger Manual 379 HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface 380 S12 X Debugger Manual 15 Abatron BDI Connection This section guides you through the Abatron BDI connection Abatron BDI Technical Considerations The ABATRON AG company supplies many of the debug cables used to connect the 8 16 bit debugger and the CodeWarrior IDE to HCS12 hardware When the debugger runs the Abatron BDI connection it can communicate and debug CPU12 HC12 HCS12 HCS12X and XGATE core based hardware connected through Abatron BDI BDI S BDI HS and BDI1000 debug interfaces Abatron BDI Highlights The Abatron BDI Connection currently supports the Background Debug Interfaces BDI designed by ABAT
79. On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 28 Trigger Settings Tab Trace Drop List Trigger Module Settings Trigger settings Sequencer General settings Automatic breakpoints watchpomnts and trace possible A RAWAcces B Notdefined C Notdefined D Not defined Lumen se Ram 70 Roc oo00 with Mask ooo 7 Trace disabled Trace HCS12X only Trace XGATE only Trace both cores The list options allow you to enable or disable tracing Table 17 7 Trigger Settings Tab Trace Drop List Option Description Trace disabled Disable trace Trace HCS12X only Trace the HCS12X core only Trace XGATE only Trace the XGATE core only Trace both cores Trace both the cores S12 X Debugger Manual 429 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 29 Trigger Align Trigger Module Settings Trigger settings Sequencer General settings User Triggers trace possible no automatic breakpoints and watchpoints A RAWAccess B Notdefined C Notdefined D Not defined Mes BE E Address Compare to 0x0000 With Mask 00000 C Inside Range C Outside Range Compare mismatch Always stop on this trigger Triggeron HCS12X C XGATE Trace both cores Ed Record continuously nro Nemalmode v Record continuously ee Trace mechanism activate
80. Protect DBG FIFO Debugger retrieves FIFO data from DBGFH DBGFL registers content from performing several reads to retrieve entire buffer When debugger unexpected reads halts it may also read target processor memory at same location reading the first FIFO data buffer and shifting the buffer and corrupting user interface FIFO data Enabling this option protects FIFO content from debugger reads When starting After encountering trigger debugger must clear current trigger automatically step match condition and avoid being locked by trigger Instruction ifatriggeris setat triggers require a single step to escape Check this option to step PC address out of trigger automatically When clear a dialog box appears to otherwise warn validate stepping see Figure 17 41 Figure 17 41 Trigger Escape Dialog Box HI WAVE EN The current PC corresponds to DBG Comparator address Would you like to perform a single step before running w Trace Component Window Use the Trace component to display the internal database in the Trace window Set up the context sensitive menu from the connection or the GDI DLL using the component All debugger connections including the DBG user interface are synchronized with the Trace component It is not necessary to open the Trace component window to use the DBG user interface triggers However several triggers collect code program flow information or access data information Open the T
81. Protected Unselected FLASH PAGEZ 28000 ZBFFF Enabled Blank Unselected FLASH PAGE3 38000 SBFFF Enabled Blank Protected Unselected FLASH PAGE4 48000 4BFFF Enabled Blank Unselected FLASH PAGES 58000 SBFFF Enabled Blank Protected Unselected FLASH PAGE6 68000 6BFFF Enabled Blank Unselected FLASH PAGET7 78000 7BFFF Enabled Programmed Protected Unselected HALTED in S12 X Debugger Manual 617 Connection Specific Commands NVMC Commands FLASH Description Displays Flash modules loads the pp file or performs Flash operations The FLASH command displays names locations and states of all available modules provided that a parameter pp file is already loaded If no parameter file is loaded this command loads either the pp file for the current MCUID or the last used fpp file Syntax FLASH SELECT UNSELECT ERASE ENABLE DISABLE PROTECT UNPROTECT AEFSKIPERASING lt blockNo gt ARM DISARM SAVECONTEXT LOADCONTEXT MEMMAP MEMUNMAP RE LEASE OVLBACKUP OVLRESTORE PROTOCOLON PROTOCOLOFF SKIPS TATUSON SKIPSTATUSOFF NOUNSECURE UNSECURE NVMFREQUENCY lt frequency in Hz gt NVMIF2RELOCATE lt address gt NVMIF2WORKSPACE address lt address gt INIT fileName AUTOID Usage 618 FLASH INIT fileName AUTOID loads the parameter file according to fileName you can specify the path If this comma
82. S Components Debugger engine Example in STOP STOPPING HALTED Current application debugging is stopped 596 The T command executes one or more instructions at a specified address or at the current address the address in the program counter The T command traces into subroutine calls and software interrupts For example if the current instruction is a Branch to Subroutine instruction BSR the T command traces the BSR 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 Stop this command by typing the Esc key Usage T address count S12 X Debugger Manual Debugger Engine Commands Debugger Commands address is an address constant expression the address where execution begins If you omit address 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 you omit count only one instruction is traced Components Debugger engine Example in gt T 0xF030 TRACED A 0x0 HX 0x7F02 SR 0x62 PC 0xF032 SP 0x44D 00F032 B787 STA 0x87 Displays contents of registers and disassembles the
83. S12 X Debugger Manual Debugger Engine Commands Debugger Commands Command Line Options This section lists the DOS command line options NOTE Options are not case sensitive T lt time gt Test mode The debugger terminates after a specified time in seconds The default value is 300 seconds Example 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 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 waits even when an lt exeName gt is specified w W command line option for HIWAVE indicates that in case executable file is specified in command line string it would be loaded on target but not started Without w option HIWAVE loads executable on target and run it C Program Files Freescale CodeWarrior for Microcontrollers V6 x Prog hiwave exe c Program Files Freescale CodeWarrior for Microcontrollers V6 x demo hc12 sim fibo abs w Target sim The command in the above example starts the debugger and loads fibo abs file S12 X Debugger Manual 611 Debugger Engine Commands Debugger Commands Instance currentTargetName This option defines a build instance name The debugger uses the defined build instance Exampl
84. S12 X Debugger Manual SofTec HCS12 Connection Connection Menu Figure 13 3 Communication Settings Dialog Box Communication Settings BDM Clock Source CLKS W 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 You 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 Cancel S12 X Debugger Manual 371 SofTec HCS12 Connection Connection Menu 372 S12 X Debugger Manual 14 HCS12 Serial Monitor Connection This section provides information about debugging with the CodeWarrior IDE and the HCS12 Serial Monitor connection Serial Monitor Technical Considerations 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 AN2548 specifications and AN2548SW1 and AN2548SW2 software Refer to this Application Note for communication hardware requirements CodeWarrior IDE and Serial Monitor Connection You can access the HCS12 Serial Monitor connection in two different ways when using Codewarrior IDE You either Use the Stationary Wizard at the start of the project to set the connection or Set the connection from with
85. SCI Status Register 2 RAF bit 0 simulated SC1SR2 bits 7 1 unused SCODRH SCI Data Register High R8 SC1DRH T8 bits 7 6 simulated SCODRL SCI Data Register Low R7 0 SC1DRL T7 0 simulated Table 10 26 contains information about the SCI input and output registers S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 26 Input Output Serial Output Registers Name SCIInput Meaning Non memory mapped register that sends a character to the SCI Read access to the SCDR can read this value System takes the ninth bit from the SCIInputH register Read access to SCIInput has no specified meaning Comment bits 7 0 character sent to the SCI SCIInputH Non memory mapped register that sends a character the ninth bit to the SCI Write this register value before writing the SCIInput register value Read access to SCIInputH has no specified meaning bits 7 1 unused bit O ninth bit sent to the SCI SClOutput Non memory mapped register that receives a character sent from the SCI Write access to the SCDR triggers the value that the SClOutput receives SClOutputH register receives the ninth bit Write access to SClOutput has no specified meaning bits 7 0 character sent from the SCI SClOutputH Non memory mapped register that receives a character the ninth bit sent from the SCI Write access to SClOutput has n
86. Simulator Commands Use simulator environment commands to monitor the debugger environment specific component window layouts and framework applications and targets Table 23 2 contains all available Environment commands Table 23 2 Full Chip Simulator Commands Command Syntax Short Description SETCPU ProcessorName Sets a new CPU simulator RESETCYCLES Resets Simulator CPU cycles counter RESETMEM Resets all configured memory to undefined RESETRAM Resets RAM to undefined RESETSTAT Resets the statistical data SHOWCYCLES Returns executed Simulator CPU cycles Component specific commands are associated with specific components supported by the Full Chip Simulator Table 23 3 contains all available Component Specific commands 630 S12 X Debugger Manual Table 23 3 List of Component Specific Commands Connection Specific Commands Full Chip Simulator Commands Command Syntax ident ADCPORT address ident address ident address Short Description Sets the ports addresses used by the ADC_DAC component ADCPORT lt Name gt Creates a new channel lt Name gt for the Monitor component address ident CPORT address ident address ident address ident address ident Sets the five port addresses and the control port address of the IO Ports component DELCHANNEL Name Deletes a specific channel for the Monitor component
87. Temporary Breakpoints For information on how to set breakpoints refer to Control Points Point to an instruction in the Source component window and click the right mouse button to display the Source window context menu Select Run To Cursor from the context menu The application continues execution and stops at this location Holding down the left mouse button 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 71 Figure 3 71 Setting Breakpoints El Source DOR la Assembly EADEMOMibo c Line26 a fibl fib2 fibo at 2 aunile ti n i fibl fib2 ein2 fibo 7X 3 X 4 X 6 X 5 X 4 X 6 X 3 X 5 X return fibo Kam Setting Permanent Breakpoints Point to an instruction in the Source component Window and click the right mouse button to display the Source component context menu Select Set Breakpoint from S12 X Debugger Manual 117 Debugger Components General Debugger Components the context menu This displays the permanent breakpoint icon in front of the selected source statement 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 displays in front of the selected source statement Folding and Unfolding Use this feature to show or hi
88. This closes the Debugger application S12 X Debugger Manual 551 Debugger Engine Commands Debugger Commands EXPAND In the MCURegisters component the EXPAND command is used to unfold node in the register tree view Usage EXPAND name where name is the name of a node in the register tree view If the name belongs to the register item then item s parent node is unfolded If the name belongs to group of registers module or board item then item s own node is unfolded If the name is empty then all nodes are unfolded Components MCURegisters component Example MCURegisters lt expand mc9s08dv60 This command unfolds the root node in the register tree view This node contains the name of the board so all the module items are visible FILL 552 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 context menu and by selecting the Fill or Memory gt Fill menu entry S12 X Debugger Manual Debugger Engine Commands Debugger Commands Example in gt FILL 0x8000 0x8008 OxFF This fills the memory range 0x8000 0x8008 with the value OxFF FILTER In the Memory component with the FILTER command you
89. Watchpoint is set to XGATE data bus in two cases watchpoint memory area is identified as variable defined in XGATE source code watchpoint is set directly to memory area with XGATE space In all other cases watchpoint is set to CPU12X data bus S12 X Debugger Manual 185 Control Points Markpoints Setting Watchpoint to the variable shared between CPU12X and XGATE 1 Variable shall be defined in CPU12X source code otherwise watchpoint to CPU12X data bus can not be set 2 Set first watchpoint to the variable or directly to the memory area with Logical or Global space This watchpoint will be set to CPU12X data bus 3 Set second watchpoint directly to the memory area with XGATE space Use HCS12XAdrMap component to convert address to XGATE space This watchpoint will be set to XGATE data bus Figure 4 7 Watchpoint Configuration for Shared Variable Controlpoints Configuration Breakpoints Watchpoints Markpoints 2100 2101 L main c shared_counter Write E 1 1 E100 E101X Write E 1 1 Markpoints Markpoints are control points associated with a source line memory or data range They give the programmer accessible program markers Program execution does NOT stop when the Source line data or memory range defined by the markpoint has been accessed 186 S12 X Debugger Manual Control Points Markpoints Markpoints are controlled through the Markpoint tab of the Controlpoints Configu
90. a configuration dialog to set up the columns to view in each display mode You can open the Displaying mode list to make column display modifications in Textual Instructions or Graphical mode Use the right arrow to move items to the Displayed Items list and the left arrow to hide the item Moving the item Up in the list moves it to the left in the Trace component window Select More for more options Select OK to save your changes 450 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trace Component Window Figure 17 45 Items Configuration Dialog Box Items configuration Displaying mode Instructions m Defined items Displayed items Address Instruction Up Instruction FIFO analyse remark FIFO analyse remark Remark Down More Cancel Help Dumping Frames to File Selecting Dump in the Trace window contest sensitive menu opens a dialog that allows you to specify the number of Trace component frames to save and the name of the text file to which to save the frames Figure 17 46 Dump Trace Frames Dialog Box Dump Trace Frames Dump File M y_Dump_File txt Frames to Dump From 0 To 50 on Instructions Cancel Help Go to Frame Selecting Go to Frame in the Trace window context sensitive menu opens a Search Frame dialog to allow you to look for a specific frame in the Trace window S12 X Debugger Manual 451 On Chip DBG Module for S12 S12S S12G S12
91. activation stack in a symbolic way S12 X Debugger Manual 195 Real Time Kernel Awareness Task Description Language RTK Interface When the application halts the debugger displays the state of the current task To identify the task to be inspected follow these steps 1 Make the task descriptor or a pointer to it visible in any of the debugger s data windows 2 While holding down the left mouse button on a variable of type pointer to task descriptor click the P key The current state of the selected task and procedure chain of that task appears in the Procedure Chain window By clicking on the procedures in the call chain list the local data of that function appears in the Datal window All the usual debugging functions are available to inspect this task including displaying the register contents Task Description Language To perform debugging on any task create a file named OSPARAM PRM and store it in one of the directories specified in GENPATH include File Path OSPARAM PRM contains the algorithm for collecting the context information for a specific task the PC SP DL SR and registers Use the following syntax in EBNF to specify the algorithm StatSequence Statement Statement Statement Assignment ErrorMsg If Assignment Ident Expression ErrorMsg MSG String IfStatemen IF BoolExpr THEN StatSequence ELSIFPart ELSEPart E
92. after the reset button menu entry or Command Line command has been selected Specify the Reset command file full name and status enable disable either with the CMDFILE RESET Command Line command or using the Reset property tab of the Connection Command Files Window 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 executes before an application loads to the target system through the connection Specify the Preload command file full name and status enable disable either with the CMDFILE PRELOAD Command Line command or using the Preload property tab of the Connection Command Files Window By default the PRELOAD CMD file located in the current project directory is enabled as the current Preload command file S12 X Debugger Manual 41 Debugger Interface Debugger Main Window Postload Command File The Postload command file executes after an application loads to the target system through the connection Specify the Postload command file full name and status enable disable either with the CMDFILE POSTLOAD Command Line command or using the Postload property tab of the Connection Command Files Window By default the POSTLOAD CMD file located in the current project directory is enabled as the current Postload command file Component Menu Figure 2 18 shows the Component menu Figure 2 18 Compon
93. and current program state displays in all window components Delete Appears in context menu only if a breakpoint is set or disabled at Breakpoint nearest code position visible with marks When selected deletes this breakpoint Enable Appears in context menu only if a breakpoint is disabled at nearest Breakpoint code position visible with marks When selected enables this breakpoint Disable Appears in context menu only if a breakpoint is set at nearest code Breakpoint position visible with marks When selected disables this breakpoint Run To Cursor S12 X Debugger Manual When selected sets a temporary breakpoint at nearest code position and continues program execution immediately Disabling a breakpoint at this position disables the temporary breakpoint also and the program will not halt Temporary breakpoints are automatically removed when reached 119 Debugger Components General Debugger Components Table 3 42 Associated Context Menu Description continued 120 Menu Entry Show Breakpoints Description Opens Controlpoints Configuration window s Breakpoints Tab which allows you to view the list of breakpoints defined in application and modify their properties see Control Points Show Location Highlights a code range in Assembly component window matching the line or selected source code Highlights the line or the source code range as well Set Markpoint App
94. 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 18 Click Next to continue The Memory model options screen appears The Memory model options are available for derivatives from HCS12X family 228 S12 X Debugger Manual How To Using the Stationery Wizard to Create a Project Figure 6 26 Memory model options Screen HC S 12 X Microcontrollers New Project Wizard Map Select all non constant data fit in the non paged RAM or all constants and the code fit into the non paged flash don t know Device and Connection Al nonconstant data fit in the non paged RAM XGATE Setup C All constants and the code fit into the non paged flash Project Parameters Add Additional Files Processor Expert Use both ranges 0x4000 0x7FFF and 0xC000 OxF FFF for placing code and constants Cite dits 2 Yes Memory model options Use MemoryBanker for Code PCLnt Data Choose this if you are not sure will non constant data fit in the non paged RAM or constants land the code fit into the non paged flash CNN 19 The Memory model options screen lets you select if all non constant data fit in the non paged RAM or all constants and the code fit into the non paged flash don t know Choose this option if you are not sure whether non constant data fit in the non paged RAM or constants and the code fit into the non paged flash Al
95. as the Full Chip Simulation take the following steps 1 In the Debugger Main window select the Component menu 2 Choose Component gt Set Connection to select another connection Figure 6 16 Set Connection Dialog Box HCS12 Serial Monitor Selection Set Connection Processor Hc12 Connection HCS12 Serial Monitor Abatron BDI HCS12 Serial Monitor P amp E Multilink Cyclone Pro Full Chip Simulation SofTec HCS12 HCS12 V4 7 prog HCS12SERIALMON tgt 3 Select HC12 as Processor then HCS12 Serial Monitor as the connection in the Set Connection dialog box and click the OK button S12 X Debugger Manual 219 How To Switching Connections 4 In the Monitor Setup window Monitor Communication tab choose the correct Host serial communication port if necessary Figure 6 17 Monitor Setup Window Monitor Communication Tab Monitor Setup Monitor Communication Vector Table Miroring Load Options HOST Serial Communication Port Please select in this dialog the serial communication port used to connect to the hardware HOST Serial Communication Port X Communication protocol Show Monitor TX RX 5 Click the OK button The HCS12 Serial Monitor connection reads the device silicon ID This ID can match several derivatives 6 Setthe correct derivative matching your hardware in the Derivative Selection dialog box Figure 6 18 Derivative Selection Dialog Box Set Derivative MC3512E12
96. box see Load Executable File Window Reset Resets connection hardware and software Setup Displays Setup dialog box S12 X Debugger Manual 377 HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface Table 14 1 MONITOR HCS12 Menu Options continued 378 Menu Entry Connect Description Displays Monitor Setup dialog box containing Monitor Communication tab and Load Options tab n Monitor Communication tab Figure 14 9 set or modify current serial communication from HOST Serial Communication Port list box Check Show Monitor TX RX to report all low level communication frames between host computer and HCS12 Serial Monitor in Command Line window n Load Options tab Figure 14 10 use checkbox to enable or disable automatic erase of Flash memory on loading Command Files Opens Connection Command Files dialog box Each tab allows access to a different set of connection command files NemdNHCS12 Serial Monitor startup cmd NemdNHCS12 Serial Monitor reset cmd NemdNHCS12 Serial Monitor preload cmd NemdNHCS12 Serial Monitor postload cmd Debugging Opens Debugging Memory Map dialog box for target MCU see Memory Map Debugging Memory Map Trigger Module Opens Trigger Module Settings dialog see On Chip DBG Module for Settings 12 S128 12G S12P S12X Platforms Bus Trace Opens Trace component window within the main window see On Chip DBG
97. bytes is accessed using the type and rules of the overlapped range NOTE The Start and 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 priority The debugger always reads with rules of the range with the highest priority Access kind The Access Kind list menu provides a way to indicate that the memory range is read write R W read only write only or none of these When defined as read only the range is never written by the debugger When defined as write only the range is never read by the debugger When defined as none the range is never read or written by the debugger This is internally equivalent as not defining the range in the DMM dialog Access Size When available the Access Size list menu provides a way to define if the memory range is accessed as byte 1 short 2 or long 4 NOTE The memory range must be size aligned For example a module defined with access size 2 must start with an even address and finish on an odd address A module defined with access size 4 must start with an address with the least significant byte in 0 4 8 C and finish with an address with the least significant byte in 3 7 B F NOTE A memory range overlapping in priority another memory range can only have the same or a higher access size Types The Type list menu provides all kinds of memory type available for the processor di
98. chapter below S12 X Debugger Manual Debugger Components General Debugger Components Table 3 42 Associated Context Menu Description continued Menu Entry Description Marks Toggles display of source positions where breakpoints may be set If 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 to set up tool tip format NOTE If some statements do not show marks although the mark display is switched on the following may be the cause The statement did not produce any code due to optimizations done by the compiler The entire procedure was not linked in the application because it was never used Open Source File The Open Source File dialog box shown in Figure 3 74 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 An assembly file dbg is searched for in the directory given by the OBJPATH and GENPATH variables C and C files c cpp h etc are searched for in the directories given by the GENPATH variable Figure 3 74 Open Source File Dialog Box Source Files main c Start12 c OK x _ tee Go To Line This menu entry is only enabled if a source file is loaded It opens the dialog box shown in Figure 3 75 In this dialog box enter the line number you want to go to in
99. check box can be modified If the connection to the BDI box failed and the dialog box opens automatically or you use Abatron BDI gt Connect you can modify the Communication Device Specification edit box The Communication Device specification edit box contains the communication settings to connect to the BDI box The syntax of the initialization string is e COMn baudrate nisthe COM port number such as 1 2 or 3 baudrate is 9600 19200 38400 57600 or 115200 according to the ABATRON configuration application setup e g COM1 57600 S12 X Debugger Manual 391 Abatron BDI Connection Abatron BDI Connection Dialog Boxes For communication via an Ethernet and bdiNet use the following initialization string syntax e NETWORK ip address port ip address is the IP address of the BDI box or bdiNet in the form XXX XXX XXX XXX port is the bdiNet port usually 1 for BDI1000 and BDI2000 e g NETWORK 151 120 25 101 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 you check the Show Protocol box the Command Line window reports all commands and responses sent and received NOTE The Show Protocol checkbox is a useful debugging feature if a communication problem exists The settings in the Communication Device Specification edit box are stored for a later debugging session in the Abatron BDI section of the project file
100. code generation The second message shows the progress with the information S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials processed and the code generated Another window shows compiling and linking progress Verification of Files Created We can verify the folders created by Processor Expert User Modules A file MyPWMChanne10 C is the placeholder for the main procedure and any other procedure desired by the user These other procedures can be placed in additional files Generated Code The C files for the code is associated with the beans added to the project This includes initialization input output and the declarations necessary for the use of the functions Entering User Code e Open the user module MyPWMChannel0 C Replace the main routine with the following code 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 Aah Key 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 krk End of main routine DO NOT MODIFY THIS TEXT I S12 X
101. code is already loaded into the target system or programmed into a non volatile memory device If no target is installed the following error message appears Error no target is installed If no target is connected the following error message appears Error no target is connected Usage LOADSYMBOLS applicationName S12 X Debugger Manual 567 Debugger Engine Commands Debugger Commands Components Debugger engine Example LOADSYMBOLS FIBO ABS Loads debugging information of the FIBO ABS application If no path is specified the destination directory is the current project directory LOG 568 The LOG command enables or disables information logging in the Command Line component window and to logfile when opened with an LF command If LOG is not used all types are ON by default i e all information is logged in the Command Line component and log file NOTE 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 appear in red in Command Line component Protocol messages are not errors about NOTICES Notices appear 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 re
102. command and corresponding command line command CHIPSECURE UNSECURE allows the debugger to connect to the target through the Information Required to Unsecure the Device Dialog Box and to execute the Unsecure Command File to unsecure the connected derivative NOTE Some of the HCS12 derivatives cannot be unsecured while in Special mode this is not possible with all MC9S12DP256 derivatives masks Check the appropriate user manual for the connected derivative Information Required to Unsecure the Device To unsecure a device the debugger needs to know the value of the flash divider register to correctly mass erase the device and program the security byte The Information required to unsecure the device dialog box provides an register value to the Unsecure Command File script Select HC12MultilinkCyclonePro gt Unsecure to display the Information Required to Unsecure the Device dialog box S12 X Debugger Manual 485 Unsecure HCS12 Derivatives Information Required to Unsecure the Device Figure 20 1 Information Required to Unsecure the Device Dialog Box Information required to unsecure the device To unsecure the device the command script needs the correct value for the FCLKDIV onchip register Datasheet proposed values oscillator frequency FCLKDIV value decimal 16 MHz 17 12 MHz 13 8 MHz 3 4 MHz 5 FCLKDIV 17 The information required for unsecuring the device can differ depending on the device famil
103. command diverts execution of the command file to the command line that follows the Label You must define the Label in the current command file The GOTO command fails if the Label is not found A label can only be followed on the same line by a comment Usage GOTO Label Components Debugger engine S12 X Debugger Manual 559 Debugger Engine Commands Debugger Commands Example GOTO MyLabel MyLabel comments When the instruction GOTO MyLabel is reached the program pointer jumps to MyLabe1 and follows program execution from this position GOTOIF The GOTOIF command diverts execution of the command file to the command line that follows the label if the condition is true Otherwise the command is ignored The GOTOIF command fails if the condition is true and the label is not found Usage GOTOIF condition Label where condition is same as defined in C language Components Debugger engine Example DEFINE jump 0 DEFINE jump jump 1 GOTOIF jump 10 MyLabel T MyLabel comments The program pointer jumps to MyLabe1 only if jump equals 10 Otherwise the next instruction T Trace command executes 560 S12 X Debugger Manual Debugger Engine Commands Debugger Commands GRAPHICS In the Profiler component GRAPHICS switches the percentages display in the graph bar on off Usage GRAPHICS on off Components Profiler component Example in gt GRAPHICS off HELP In the
104. configuration file Save Saves the project file Configuration Save Opens debugger project window to save the project file under a different path and name and or format such as PJT INI Configuration Opens Preferences window to set environment variables for current project S12 X Debugger Manual Debugger Interface Debugger Main Window Table 2 2 File Menu Entry Description continued 1 Project ini Recent project file list 2 Test ini Exit Quits the Debugger Use the toolbar icons as shortcuts for some of these functions refer to the Debugger Main Window Toolbar section Configuration Window Open the Configuration window by selecting File gt Configuration Use this window shown in Figure 2 6 to set up environment variables for the current project Click the OK button to save new variables in the current project file NOTE _ The File gt Configuration menu entry is only enabled if a project file is loaded Figure 2 6 Configuration Window Environment Tab Configuration Environment Load Object Path Text Path Absolute Path Header File Path Various Environment Variables Project Sources Delete Down Compilertlib he 12c src Compiler lib hc 12c include Compiler lib hc 12c Vib Compiler lib xgatec erc Compilerjlib xgatec include Compilertlib xaatec lib Cancel Help The Environment tab contains the following controls A l
105. control register output All TCTL3 TCTL4 Timer control register input All TMSK1 Timer interrupt mask 1 All TMSK2 Timer interrupt mask 2 TOI TCRE PR2 0 TFLG1 TFLG2 Main timer interrupt flags All TCO to TC7 Timer input capture output compare registers All 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 S12 X Debugger Manual 315 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 25 Serial Communication Interface Related Registers 316 Register Full Register Name Simulated Fields Acronym SCOBDH SCI Baud Rate Register High SBR bits 4 0 simulated SC1BDH BTST BSPL and BRLD bits 7 5 reserved for test functions SCOBDL SCI Baud Rate Register Low SBR bits 7 0 simulated SC1BDL SCOCR1 SCI Control Register 1 M bit 4 simulated SC1CR1 ILT bit 2 simulated LOOPS WOMS RSRC WAKE PE and PT bits 7 5 3 1 0 not simulated SCOCR2 SCI Control Register 2 TIE SC1CR2 TCIE RIE ILIE TE RE SBK bits 7 2 0 simulated RWU bit 1 not simulated SCOSR1 SCI Status Register 1 TDRE SC1SR1 TC RDRF IDLE OR bits 7 3 simulated NF FE and PF bits 2 0 not simulated SCOSR2
106. defined SetDBCGB DBGC1 Debug Control Register DBGC2 Debug Control Register DBGEN BEGIN BKABEN BKCEN ARM DBGBRK FULL TAGC TRGSEL T BDM RWCEN TAGAB RWC CAPMOD FIFO Normal mode DBGC3 Debug Contiol Register BKAMBH RWAEN DBGSC Debugger Tagger Register BKAMBL RwA BKBMBH M RwBEN BKBMBL RWB Aon z DBG Contiol Registers DBGC1 0x00 DBGSC 0x00 DBGC2 0x00 DBGC3 0x00 OK Carel Use Set DBGCA or Set DBGCB to set the triggers comparator addresses from the Source Assembly Memory and Data component windows The debugger sets the DBG module DBG module enabling and arming depend on selected flags set within the DBG register control registers through the Expert triggers tab In this mode the debugger writes all settings to the hardware right before the application runs The debugger resets the DBG module when the application stops NOTE _ Refer to the core reference manual for detailed information on specific registers 12G S12P S12S DBG Module Tabs The user can modify or control all of the available options using the Trigger Module settings window with its three tabs Trigger Settings Sequencer and General Settings 426 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 27 Trigger Settings Tab Listbox Trigger Module Settings Trigger settings Sequence Gene
107. dialog box and allows you to choose the Derivative target MCU for the Abatron BDI connection Command Files Displays the Target Interface Command Files Window S12 X Debugger Manual 389 Abatron BDI Connection Abatron BDI Connection Menu Entries Table 15 1 Abatron BDI Menu Entries continued 390 Menu Entry Description Unsecure Runs the project s Unsecure command file script The Unsecure Option script mass erases the target device then programs the target device security byte to unsecure state to enable BDM communication Available only when debugger Flash Programmer is enabled See Setup Dialog Box Debugging Displays Debugging Memory Map dialog box for target MCU See Memory Map Debugging Memory Map Trigger Module Displays Trigger Module Settings dialog box See On Chip DBG Settings Module for S12 S128 12G S12P S12X Platforms Bus Trace Displays a Trace component window See On Chip DBG Module for Option S12 S128 S12G S12P S12X Platforms Flash Displays Non Volatile Memory Control Dialog Box See Flash Programming Available only when Flash Programmer is enabled See Setup Dialog Box Setup Opens the Setup Dialog Box Use to set the link to the ABATRON configuration tool set the download mode and set the Continue on illegal break banked hardware breakpoint option only available for HC12 CPU12 derivatives Configure BDI Box Opens the confi
108. different port the Communication Device Specification Dialog Box appears If no target or a different target is set load the Abatron BDI Connection as described below In the debugger select Component gt Set Target in the component menu Figure 15 8 Debugger Component Menu Component Source Winc Open Fonts Background Color The Set Connection dialog box appears Select Abatron BDI Connection in the list of connections and click OK Figure 15 9 Set Connection Dialog Box After successfully loading the target the Debugger main window target menu item is replaced by Abatron BDI S12 X Debugger Manual 387 Abatron BDI Connection BDI Interface Software Setup Figure 15 10 Abatron BDI Menu Figure 15 11 Communication Device Specification Dialog Box 388 AbatronBDI Component Command Load Reset Ctri L Ctr R Communication Select Derivative Command Files Unsecure Debugging Memory Map Trigger Module Settings Bus Trace Flash Setup Configure BDI Box You can change the communication parameters baud rate and port by selecting Abatron BDI Communication If you cannot establish communication with the BDI Interface an error message appears followed by the Communication Device Specification dialog box Communication Device Specification Communication Device Show Protocol Connection Mode Normal Hot plug i
109. disable at same time using ROMON bit in MISC register Table 19 5 HC12DG128 Flash Module Details S12 X Debugger Manual Module Module Remarks Name Number FLASH 0 16 Kilobytes unpaged Flash located in 0x4000 0x8000 also 4000 matches 11FEE even page 6 that is FLASH PAGE6 FLASH 1 16 Kilobytes paged Flash accessed in bank window 0x8000 PAGEO OxBFFF equivalent to OOFEE Flash even page 0 FLASH 2 16 Kilobytes unpaged Flash located in 0xC000 OxFFFF also C000 matches 11FEE odd page 7 that is FLASH PAGET Boot sector unprotectable protectable 8 Kilobytes in range OxE000 OxFFFF or paged range 0xA000 0xBFFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register FLASH 3 16 Kilobytes paged Flash accessed in bank window 0x8000 PAGE1 OxBFFF equivalent to OOFEE Flash odd page 1 Boot sector unprotectable protectable 8 Kilobytes in range 0xA000 0xBFFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register FLASH 4 16 Kilobytes paged Flash accessed in bank window 0x8000 PAGE2 OxBFFF equivalent to 01FEE Flash even page 2 FLASH 5 16 Kilobytes paged Flash accessed in bank window 0x8000 PAGES OxBFFF equivalent to 01FEE Flash odd page 3 Boot sector unprotectable protectable 8 Kilobytes in range 0xA000 0xBFFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register FLASH 6 16 Kilobytes paged Flash accessed in bank window 0x8000 PAGE4 OxBFFF e
110. drop it into the Source component window The Source component window scrolls to the source statement generating this assembly instruction and highlights it Left click the mouse and click the L key This highlights a code range in the Assembly component window corresponding to the first line of code selected in the Source component window in which the operation is performed This line or code range is also highlighted Drag Out Table 3 3 shows the drag actions possible from the Assembly component Table 3 3 Assembly Component Drag Actions Destination Action Component Window Command Line The Command Line component appends the address of the specified instruction to the current command Memory Dumps memory starting at the selected instruction PC Selects the PC location in the memory component S12 X Debugger Manual 59 Debugger Components General Debugger Components Table 3 3 Assembly Component Drag Actions continued Destination Component Window Action Register Loads the destination register with the PC of the selected instruction Source Source component scrolls to the source statements and highlights it Drop Into Table 3 4 shows the drop actions possible in the Assembly component Table 3 4 Drop Into Assembly Component 60 Source Component Action Window Source Displays disassembled instructions starting at first high level language instr
111. eee ee eee 211 Switching Connections siere e e eee eee eens 212 Loading the Full Chip Simulation Connection 212 Loading the P amp E Multilink Cyclone Pro Connection 214 Switching to SofTec HCS12 0 ee eee 218 Switching to HCS12 Serial Monitor Connection 219 Using the Stationery Wizard to Create a Project 000 221 CodeWarrior IDE Integration nurru eee eee 232 Debugger Configuration 0 0 0 0 eee eee eee eee 232 Automating Debugger Startup 0 0 eee eee 233 Loading an Application llle 234 Starting an Application 0 0 00 0 eee Ih 235 Stopping an Application 0 0 0 0 eee cee ene 235 Stepping in the Application sseeleleeee eee 235 On Source Level cent ets v rS Ue Un E HEICLWe nfi 236 Step on Assembly Level sici00 002 se la Rr m Rem 237 Working on Variables 2 0 0 0 ee e 238 Display Local Variable from a Function 2 000005 238 Display Global Variable from a Module 000 238 Change Format for Variable Value Display 239 Modify a Variable Value 0 0 0 0 cee eee eee 240 Retrieve the Variable Allocation Address 00000 240 Inspect Memory Starting at a Variable Location Address 241 Load an Address Register with the Variable Address 241 Working on the Register 2 0 0
112. entry 42 Open Source File menu entry 120 Operating system task context 195 Options C 613 Cmd 612 ENVpath 613 Nodefaults 612 Pointer as Array 73 Prod 612 Target 611 W 611 Options Autosize menu entry 44 Options Component Menu menu entry 44 Options group 208 Options menu entry 73 OR 316 ort file 201 ORTI 201 ORTI file name 201 715 ORTI File names 201 OSBDM 365 OSEK Kernel Awareness 200 OSEK RTK Inspector component 202 OSEK Run Time Interface ORTI 201 OSEK Run Time Interface ORTI 201 OSPARAM PRM 195 Outlinecolor 158 OUTPUT 578 Output Compare channels 314 Output file Coverage component 66 Output File menu entry 66 107 P P 579 P amp E Multilink Cyclone Pro Loading the connection 214 Panels Environment 31 Paste menu entry 146 PATH 673 Pause 110 PAUSETEST 580 PBPORT 637 PC Lint support selecting 231 PE 316 Percentage of executed source code 65 Percentage values 106 Periodic Interrupt Timer PIT 297 PERIODICAL 320 Periodical menu entry 75 95 Periodical mode 73 Permanent breakpoints 163 PF 316 Pins configuring 314 PIX bits 314 PJT 30 Play 109 Pointer as Array option 73 76 PORT 638 Port Integration Module PIM 292 Port memory width display 149 Port to Display 149 716 PORTT 314 PORTTBitx 314 Postload command file 42 postload cmd file 246 Executing 246 PPAGE 314 PRO 315 PRI 315 PR2 315 Preload command file 41 preload cmd file 246 Executing 246 PRINTF 580 Procedure a
113. execution of a non matching byte value at Address A memory location Uses trigger B address as a mismatch value rather than an address location If you select this trigger type using a context menu without setting the match value an error message prompts for the match value Replaces standard trigger editing dialog box with Triggers Address Settings dialog box see Figure 17 7 Match Value edit boxes replace Trigger Editing dialog Capture Read Write Values at Address B Use to capture data used in a read or write access to address location specified by trigger B Typically a data or memory address rather than program code address program counter Capture Read Write Values at Address B After Access at Address A Use to capture data used in a read or write access to address location specified by trigger A and trigger B Typically a data or memory address rather than program code address program counter Capture of values at Address B begins only after accessing Address A On Chip DBG Control Options The user can modify or control all of the available options using the Trigger Module settings window with its three tabs Trigger Settings Sequencer and General Settings 438 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 33 Trigger Module Settings Window Trigger Settings Tab Trigger Module Settings Trigger settings S
114. ident Arguments Address locates the port address value of the component The default format is hexadecimal many formats are allowed Ident a known identifier Its content defines the port address Components 7 Segments display Example in gt SEGPORT 0x100 0x200 The ports of the 7 Segments display are now defined at addresses 0x100 and 0x200 S12 X Debugger Manual 641 Connection Specific Commands Full Chip Simulator Commands SETCONTROL Use the SETCONTROL command to modify the number of ticks and pixels for a Monitor component specific channel This changes the horizontal scale of this channel Syntax SETCONTROL Name Ticks Pixels Arguments Name the name of the channel to modify lt Ticks gt the new number of ticks for this channel Pixels the new number of pixels for this channel Components Monitor component Example in gt SETCONTROL Leds Port Register bit 0 100 1 This defines the horizontal scale from the channel Leds Port Register bit 0 with the value 100 for the Ticks value and 1 for pixels value SETCPU 642 Loads CPU awareness for the debugger Syntax SETCPU ProcessorName Arguments ProcessorName a supported processor HC08 HC11 HC12 HC16 M68K XA and PPC Components Simulator component S12 X Debugger Manual Connection Specific Commands Full Chip Simulator Commands Example in gt SETCPU HC12 Loads the H
115. in window range 8000 BFFF does not execute properly For this reason it is best not to use entire capacity of Flash To ensure backward compatibility these modules can be programmed but not erased Erasing is available but has no effect ALL_EPAGES previously called EEP_PAGED HCS12X only S12 X Debugger Manual The entire on chip Flash memory Erasing this module erases all other EEPROM modules 481 Flash Programming Hardware Considerations Table 19 6 HCS12 and HCS12X Module Usage Module Name Range Comments PFLASH Range is specified by Universal module with adjustable MODULEREMAP memory range Operates with any P parameter of fpp file FLASH block DFLASH Range is specified by Universal module with adjustable MODULEREMAP memory range Operates with D parameter of fpp file FLASH memory HCS12 EEPROM Relocation HCS12 devices provide some hidden EEPROM memory that can only be accessed when changing the Memory Expansion Register called INITEE This EEPROM is hidden or visible under the following conditions Fully Hidden EEPROM The EEPROM is fully blank checked The FPP file uses INITEE to automatically remap the EEPROM to 2000 on the condition that the user did not relocate the EEPROM and changes INITEE In that case the FPP driver accesses the EEPROM at the user specified location Partially Visible EEPROM in 400 7FF or 400 FFF The EEPRO
116. in our example we want to debug the fibo abs file 4 Then click on the Setup button The dialog box shown in Figure 9 12 opens Figure 9 12 DDE Debugger Setup Dialog Box Generic DDE Debugger Setup HIWARE HI WAYE 6 0 x Program to start C HIWARE PROG Shiwave exe Browse Cancel Help 5 Specify the path to the hiwave exe file or use the Browse button 6 Click OK S12 X Debugger Manual 263 Synchronized Debugging through DA C IDE Debugger Interface Debugger Project File Configuration Now configure the debugger project file NOTE Before configuring the project file close DA C Open Debugger and select File gt Open Project from the main menu bar 2 Select the Project ini file from the currently defined working directory in our case C Freescale WORK lt processor gt c project ini Now add in the layout of the project the Debugger DAC component dac wnd 3 In the Debugger select Component gt Open from the main menu bar 4 Choose Dac as shown in Figure 9 13 Figure 9 13 DA C Component Opening HI WAVE C HIWARE WORK M68KC project ini of xj Ele View Bun Simulator Component Data Window Help oleja e 2 e 9l led P CPU Cycles 0 Hex I Auto Symb Global F Memory m x I 00000000 uu uu uu uu E 00000004 uu uu uu uu 00000008 uu uu uu uu 0000000C uu uu uu uu 00000010 uu uu uu uu 00000014 uu uu uu uu 00000018 uu uu uu
117. in the current directory It is suggested that you use this name for the Debugger configuration file The debugger can use the editor configuration written and maintained by the shell only when the shell and the compiler use the same file 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 you load a configuration file from a different directory then the current directory also changes Changing the current directory reloads the default env file Loading or storing a configuration file reloads the options in the environment variable COMPOPTIONS and adds these options to the project options Beware of this behavior when different default env files exist in different directories as they may contain incompatible options in COMPOPTIONS Loading a project using the first default env adds its COMPOPTIONS to the configuration file If you store this configuration in a different directory where a default env file exists with incompatible options the Debugger attempts to add the options to the default env file 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 you can either remove the option fr
118. is executed to set up the target system right after the connection has been established Browse IV Enable Command File Waming The file above does not exist Switching to SofTec HCS12 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 2 Choose Component Set Connection from this menu to select another connection in the Set Connection dialog box Figure 6 14 Set Connection Dialog Box SofTec HCS12 Selection Set Connection Processor HC12 Connection Soffec HCS12 c Cancel P amp E Multilink Cyclone Pro Full Chip Simulation SofTec HCS12 HCS12 V4 7 prog Soffec_HCS12 tat 3 Select HC12 as Processor 4 Select SofTec HCS12 as connection 218 S12 X Debugger Manual How To Switching Connections Figure 6 15 MCU Configuration Dialog Box MCU Configuration DEMOSS12PFAME Starter Kit for Freescale MC9S 12P128 5 In the MCU Configuration dialog box choose the correct target processor 6 Click the OK button to start debugging Switching to HCS12 Serial Monitor Connection To take the first steps toward debugging with CodeWarrior IDE choosing the HCS12 Serial Monitor connection from within an existing debugging project that uses another connection such
119. levels use the following command inspect lt ATTRIBUTES EXPAND Object Pool TargetObject 4 NOTE Because the name Object Pool contains a space it must be surrounded by quotes NOTE The symbol table stack or other items may have recursive information so the information tree may grow with the depth Specifying large expand values may use a large amount of memory COLLAPSE folds one item You must specify the item name The following command folds TargetObject inspect lt ATTRIBUTES COLLAPSE Object Pool TargetObject SELECT shows the information of the specified item on the right pane The following command shows all Objects attached to TargetObject inspect lt ATTRIBUTES SELECT Object Pool TargetObject SPLIT 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 shows only the right pane a value of 100 shows only the left pane Any value between 0 and 100 makes a relative split The following command makes both panes the same size inspect lt ATTRIBUTES SPLIT 50 MAXELEM sets the number of subitems to display After the following command the Inspector prompts for 1000 subitems inspect ATTRIBUTES MAXELEM ON 1000 S12 X Debugger Manual 521 Debugger Engine Commands Debugger Commands FORMAT specifies whether to display integral values such as addresses
120. line number Components Source component Example in gt sline 15 SMEM 590 In the Source component the SMEM command loads the corresponding module s source text scrolls to the corresponding text location the code address and highlights the statements that correspond to this code address range In the Assembly component the SMEM command scrolls the Assembly component shows the location the assembler address and select highlights the memory lines of the address range given as the parameter In the Memory component the SMEM command scrolls the memory dump component shows the locations the memory address of the address range given as the parameter Usage SMEM range Components Source Assembly and Memory components S12 X Debugger Manual Debugger Engine Commands Debugger Commands Example in gt Memory lt SMEM 0x8000 8 This scrolls the Memory component window and highlights the specified memory addresses 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 The Module component window displays the correct module names Make
121. main procedure and any other procedure desired by the user You can also place these other procedures in additional files Generated Code The C files for the code associated with the beans are added to the project This includes initialization input output and the declarations necessary for the use of the functions Entering User Code 1 Open the user module MyGuessTheNumber C 2 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 void PutString const char str while str 0 0 PutChar str 0 strt void GuessTheNumber void int ran rand RAND_MAX 9 AS1_Init PutString Guess a Number between 0 and 9 n PutString Number for unsigned char c if AS1 RecvChar amp c ERR OK PutChar c PutChar du er EMO noces 18959 of PutString not a number try again n else if c ran 0 PutString nCongratulation You have found the number S12 X Debugger Manual 345 HC S 12 X Full Chip Simulation Connection FCS Tutorials 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 3 Call the function GuessTheNumber in the main routine
122. mode the DBG module is used to set Breakpoints and W atchpoints In Normal mode the DBG module will record program change of flow or data value depending on the trigger condition DBG Module Mode Setup The on chip DBG module provides some exclusive debugging features Four modes are available Automatic Expert Profiling and Coverage Disabled Four types of triggers are available Memory Access Triggers Instruction Triggers Capture Triggers Expert Triggers All modes and triggers are available through the Trigger Settings tab Open the top list menu to display all available modes triggers and trigger conditions Figure 17 21 Table 17 2 describes the modes and trigger settings S12 X Debugger Manual 417 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window 418 NOTE Encountering any Memory Access or Instruction triggers causes the Trace Component window to switch to Instructions Display mode and display the program flow rebuild see Trigger Module Settings Window and Instructions Display for more information NOTE Encountering any Capture trigger causes the Trace Component window to switch to Recorded Data Display mode and display the captured byte data see Trigger Module Settings Window and Recorded Data Display for more information NOTE Expert Mode is described in Expert Triggers Tab Figure 17 21 Trigger Settings Tab Listbox S
123. mode of the Core normal extended special FCS simulates only single chip mode therefore ports A and B cannot be used as external bus lines Except for port E FCS simulates only the I O behavior of the ports 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 an I O pin it stays at 0 Other functionalities are not simulated Port Integration Module PIM This I O device simulates the Port Integration Module PIM The PIM controls all the ports that are not directly associated to the CORE All registers present in the PIM are port specific apart from the MODRR register that affects ports S P M J and H All port specific registers are implemented together with the associated interrupt logic Timer Modules This section describes the simulated timer modules and specifies which modules blocks and features are not simulated 292 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Clock and Reset Generator CRG This I O device simulates the PLL RTI and COP features of the Clock and Reset Generator CRG Additional features of the CRG such as oscillator system hardware failures are not simulated The PLL output clock frequency is PLLCLK 2 OSCCLK SYNR 1 REFDV 1 FCS considers the PLL block a frequency c
124. of modified memory blocks The parent class can access this list updating its own list S12 X Debugger Manual 279 HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu Cancel Closes the dialog box canceling your modifications Help Opens the dialog box help file Access Details Dialog Box Figure 10 7 shows the Access Details dialog box which lets you change read and write access values for seven types Figure 10 7 Memory Configuration Dialog Box Access Details Dialog Box Memory Configuration Mode Memory Check mfocnibed IV Stop if no memory Stop on read undefined Open Save IV Stop on write protected Memory lype Acce etails X Symbolic representation end wait state bus width AUTO ROM Name vuuuuuuff a Ea a TESI d kb bk bk bk kk Eb ke aaqaaaada FF OT at at a ad a at b Eb Eb El Eb kk kk Stat x End Wat state 0 Access Details y Set Up puah V Auto Configue C 8b 16bis C 32b s Iv Allow misaligned access Add Update Delete OK Cane Heb Follow this guidance to use the Access Details dialog box 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 The highest possible value is 127 To store changes into currently selected memory block cl
125. of the for loop If you use a variable you must define it with a DEFINE command before executing the FOR command 556 S12 X Debugger Manual Debugger Engine Commands Debugger Commands 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 have no impact on the number of iterations Stop this command by pressing the Esc key Usage FOR variable range step Where variable is the name of a defined variable range This is an address range constant that specifies addresses to be disassembled Step constant number matching the step increment of the loop Components Debugger engine Example DEFINE loop 0 FOR loop 1 6 1 T ENDFOR This performs the T Trace command six times FPRINTF FPRINTF is a standard ANSI C command that writes a formatted output string to a file Usage FPRINTF lt filename gt lt amp format gt lt expression gt lt expression gt Components Debugger engine Example fprintf test txt s 2d The value of the counter is counter S12 X Debugger Manual 557 Debugger Engine Commands Debugger Commands The content of the file test txt is The value of the counter is 25 FRAMES In the SoftTrace component the FRAMES command sets the maximum number of frame records Usage FRAMES number Where number is a decim
126. 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 Markpoints are marked points of observation that give the programmer easily accessible program markers They can be located in data source or memory Control Point Configuration 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 context menu of the Source Memory or Assembly window You can see and edit control point characteristics through the Controlpoints Configuration Window using the Breakpoint Watchpoints and Markpoints tabs These three tabs have common properties that allow you to interactively perform the following operations on control points Select a single control point from a list box and click Delete Select multiple control points from a list box and click Delete Enable disable a selected control point by checking or unchecking the related checkbox Enable disable multiple control points by checking or unchecking the related checkbox Enter or modify the condition of a selected control point Enable disable the condition of a selected control point by checking unchecking the related checkbox Enter or modify the command of a selected control point Enable disable the command of a selected control point by checking unchecking the related checkbox S12 X Debugg
127. port to display as TargetObject MyField Expand Object Pool to see the added PortIO icon Click on the PortIO icon On the right side the MyField is displayed with current value Double click on the values to change them Figure 3 99 displays PortIO icon and MyField value 140 S12 X Debugger Manual Debugger Components Visualization Utilities Figure 3 99 Changing MyField Value in the Inspector Window d Reserved Regsters Porti 88 10 Register VisualizationToot EditMode Moving X 222 Y 45 W 100 H 20 1D 3 PS amp eg x 2 is en Inspect Menu The Inspect menu contains entries described in Table 3 48 Table 3 48 Inspect Menu Entries Menu Entry Description Update Updates all displayed information Removes items that no longer exist and adds new items Periodical Switches to Periodical mode Update Updates displayed information at regular time intervals when connection is running The update rate is 1 second Associated Context Menu Commands in the Inspect context menu depend on the selected item Table 3 49 describes possible context menu entries S12 X Debugger Manual 141 Debugger Components Visualization Utilities Table 3 49 Inspector Context Menu Entries Description Menu Entry Context Description Update All items Updates all displayed information Removes items that no longer exist and adds new items Periodical All items Sw
128. provides more flexibility for EB386 Example 1 Layout device RAM memory relocation lt blockNo gt Description Syntax Examples FLASH ERASE 2 7 blockNo is a list of Flash block or module numbers blockNo number number This erases memory blocks 2 and 7 FLASH ERASE 2 4 6 8 FLASH ERASE This erases memory blocks 2 4 5 6 and 8 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 or step a message box prompts you to disarm the modules or cancel the command If you click the OK button the system disarms all Flash modules then executes your command If you click the CANCEL button the system cancels the command and leaves the Flash modules armed Listing 23 1 Flash Programming Example from Command Line in Component Window in gt Flash FLASH parameters loaded for M68HC912DG128 from J MCU cloc HC12_EA PROG FPP mcu03C4 fpp Module Name FI Fl Fl Fl Fl LASH 4000 LASH PAGEO LASH C000 LASH PAGE LASH PAGE2 k speed 802500 Address Range 4000 8000 C000 18000 28000 S12 X Debugger Manual 0 7FFF BFFF FFFF 1BFFF 2BFFF Status Enabled Blank Unselected Enabled Blank Unselected Enabled Blank Protected Unselected Enabled Blank Protected Unselected Enabled Blank Unselected 621 Connection Specific Commands
129. range that can overlap an on chip address range thus making a debugger display filter for a Memory window for example when creating a No read access while running memory address range A Flat memory architecture i e without memory blocks moving feature provides the following Priority list menu e g HCS12X core Figure 18 4 HCS12X Core overlap priorities Priority highest debugger v highest debugger default device S12 X Debugger Manual 459 Debugging Memory Map CPU Core Priorities and Types The default is that the CPU sees all memory blocks with the same priority Memory Read Caching The Refresh memory when halting option controls the debugger memory cache When this option is checked internal images caches of memory data are always deleted and the data is always retrieved from hardware when required by the debugger When unchecked the 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 Access While Running Use the No memory access while running option to discard debugger access to a memory range whi
130. read write registers and memory values debug code on the processor and program internal or external FLASH memory devices P amp E Cyclone PRO USB Connect to P amp E Cyclone PRO via USB port This flexible tool is designed for in circuit flash programming debugging and testing of Freescale HCS12 X microcontrollers in development and production environments The Cyclone PRO can be operated in interactive or batch mode Once loaded with data it can be disconnected and operated manually in stand alone mode via the LCD menu and control buttons The Cyclone PRO has over 3 MB of non volatile memory which allows the onboard storage of multiple programming images When connected to a computer for programming or loading it can communicate via Ethernet USB or serial interfaces S12 X Debugger Manual How To Using the Stationery Wizard to Create a Project P amp E Cyclone PRO Serial Connect to P amp E Cyclone PRO via serial port This flexible tool is designed for in circuit flash programming debugging and testing of Freescale HCS12 X microcontrollers in development and production environments The Cyclone PRO can be operated in interactive or batch mode Once loaded with data it can be disconnected and operated manually in stand alone mode via the LCD menu and control buttons The Cyclone PRO has over 3 MB of non volatile memory which allows the onboard storage of multiple programming images When connected to a computer for
131. same effect as the Break Modules Settings index tab in the Hardware Breakpoint Configuration dialog The HWBPM SET16BITS command has the same effect as the 6 bits Break Module User Mode index tab in the Hardware Breakpoint Configuration dialog Parameters set using are only relevant when the User controlled mode is active and the 16 bits break module is used The HWBPM SET22BITS command has the same effect as using the 22 bits Break Module User Mode index tab in the Hardware Breakpoint Configuration dialog Parameters set using this command are only relevant when the User controlled mode is active and the 22 bits break module is used NOTE The hardware breakpoints settings are stored in the targetName section of the PROJECT file using variable HWBPMn When using the 22 bits module use the HWBPM REMAP_22BITS commands to perform page remapping and to set breakpoints in non banked memory areas when using this on chip break module When selecting a derivative the debugger uses this command to set up the corresponding remapping needed for the specified derivative Use HWBPM REMAP 22BITS DISPLAY to display all the currently set remapping for the selected derivative e Use HWBPM REMAP 22BITS RANGE to specify that the prefix mask must be used to set a hardware breakpoint in range start address end address gt Use HWBPM REMAP 22BITS MCUID DEFAULT to retrieve the derivative default setting in case i
132. section from the project file BDIK CMDFILEO CMDFILE STARTUP ON startup cmd CMDFILE1 CMDFILE RESET ON reset cmd CMDFILE2 CMDFILE PRELOAD ON preload cmd CMDFILE3 CMDFILE POSTLOAD ON postload cmd COMDEV COM1 57600 SHOWPROT 0 BDICONF C tmp B10c12 exe SKIPILLEGALBREAK 0 VERIFY 1 COMPRESS 1 S12 X Debugger Manual 685 Connection Specific Environment Variables Abatron BDI Connection Environment Variables 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 several topics BDICONF 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 You can set up the BDI Box Configuration Tool Path edit box with the path and application name of the configuration tool from ABATRON The application tool is automatically browsed when selecting the Abatron BDI gt Configure BDI Box menu entry and browsing for the application Otherwise click the Browse button to look for the tool Syntax BDICONF ConfigurationToolFileNameandPath Arguments ConfigurationToolFileNameandPath the ABATRON configuration tool file name and path Default No default value exists The string Enter here the path to the ABATRON configuration tool appears in
133. 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 Figure 3 63 Output File Filter Dialog Box 108 Output File Filter Content Modules Modules Functions C Modules Functions Code Lines Range to dump From o X To 100 X Cancel Help Output File Save The Save As entry opens a Save As dialog box in which you can specify the output file name and location Associated Context Menu Identical to menu Drag Out AII displayed items can be dragged out Destination windows may display information about the time spent in some codes in a split view S12 X Debugger Manual Figure 3 64 Debugger Components General Debugger Components Drop Into Nothing can be dropped into the Profiler component window Demo Version Limitations Displays only modules and the Save function is disabled Associated Commands GRAPHICS TUPDATE DETAILS RESET BASE Recorder Component The Recorder window shown in Figure 3 64 provides record and replay facilities for debug sessions Recorder Window El Recorder The Recorder window enables the user to record and replay command files The recorded file may also contain the command execution time Click the buttons shown below to play record stop and pause gt Play e Record m Stop M pause An animation occurs during record
134. specified by trigger B Typically a data or memory address rather than program code address program counter Capture Read Write Values at Address B After Access at Address A Use to capture data used in a read or write access to address location specified by trigger A and trigger B Typically a data or memory address rather than program code address program counter Capture of values at Address B begins only after accessing Address A S12 X Debugger Manual 421 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window DBG Module Options The DBG module includes options to record and change the program flow when using instruction and memory access triggers The following options are available Record continuously and halt on trigger hit Record continuously and DO NOT halt on trigger hit Start recording after trigger hit and halt when the FIFO is full Start recording after trigger hit and DO NOT halt when the FIFO is full When using Capture triggers the following data recording options are available Halt when the FIFO is full Do not halt when the FIFO is full Recording Program Code Change of Flow and Data Recording Options describe these options Recording Program Code Change of Flow Use the recording options with Instruction and Memory Access triggers Use the Trigger Module Settings window s Trigger Settings tab list box Figure 17 22 to control the
135. 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 You can overwrite an application variable or I O register with a DEFINE command NOTE Use this command to assign meaningful names to expressions for used in other commands This increases the command file readability and avoids re evaluation of complex expressions Usage DEFINE symbol expression S12 X Debugger Manual Debugger Engine Commands Debugger Commands Components Debugger engine Example in gt DEFINE addr 1000 in gt DEFINE limit addr 15 These commands first define addr as a constant equivalent to 1000 and then define limit with the value 1000 15 You can redefine a symbol defined in the loaded application by using the DEFINI command on the command line The symbol defined in the application is not accessible until an UNDEF on that symbol name is detected in the command file Lj Example In this example we define a symbol named testCase in the test application Loads application test abs LOAD test abs Display value of testCase DB testCase Redefine symbol testCase DEFINE testCase 800 Display value stored at address 800 DB testCase Redefine symbol testCase
136. the NV PARAMETER FILE entry of the project ini file If you check this checkbox the utility does not save the FPP in the project file Click the Cancel button to close the dialog box without saving changes 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 Figure 19 8 Load Executable File Dialog Box Look in C3 Wsdil2c ai Hexb000 abs a Fibo abs a Hex1b000 abs a Hex6b000 abs a Hex7b000 abs jaa Hex9000 abs Filename Files of type Executables abs If a problem occurs during application loading into Flash the NVMC utility displays an error message Figure 19 9 FLASH Writing Error Message Box FLASH Writing Error A The FLASH PAGEO module is not armed Cannol write at address 0x00009000 S12 X Debugger Manual 475 Flash Programming Preparing and Loading an Application 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 Preparing and Loading an Application To prepare an application and load it int
137. the T Trace instruction is executed RS The RS command assigns new values to specified registers Follow the RS mnemonic by the register name and new value s Use an equal sign to separate the register name from the value to be assigned to the register otherwise they must be separated by a space Set the contents of any number of registers using a single RS command If the specified register is not a CPU register then the debugger searches for the register as an I O register in a register file 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 change 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 gt rs a Oxff hx 0x7fff S12 X Debugger Manual 585 Debugger Engine Commands Debugger Commands The S command stops execution of the emulation processor Use the Go G command to start the emulator NOTE The S command ends as soon as the PC is changed STOP Components Debugger engine Example in gt s STOPPING HALTED Current application debugging is stopped halted SAVE The SAVE command saves a specified block of memory to a specified file in Freescale S record format Reload the memory block later using the load S
138. the application started Figure 10 2 Debugger Status Bar with CPU Cycles For Help press F1 Hc12 8 000000 MHz 11 007 656 IMc9S12xDP512 HALTED Figure 10 3 Debugger Status Bar with Elapsed Time For Help press F1 IHci2 8 000000 MHz 1927 0604 341 202ms MC9S12XDP512 HALTED A 4 The selected simulated derivative or simulated CORE or core SAMPLE is shown and the current derivative CPU frequency in MHz NOTE Clicking on the CPU frequency opens the Clock Frequency Setup NOTE Double clicking on the CPU cycles or true time resets the value NOTE Clicking on the displayed derivative or CORE or on the core SAMPLE opens the Set Derivative dialog box NOTE The CPU information in the Status Bar such as HC12 might be displayed with XGATE when simulating an HCS12X core device The debugger indicates its current halt or step location on the core thread S12 X Debugger Manual 27 wo HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu Open I O Component Dialog Box From the Simulator menu choose Load I Os to open the Open I O Component dialog box This dialog box shown in Figure 10 4 allows you to open an I O device peripheral simulation The Browse button allows you to specify a location for the I O Figure 10 4 Open IO Component Dialog Box Open IO Component Alu Basic Basic io Flash Inter Pinconn Random Signal Swap NOTE TO si
139. the application currently loaded O address Starts execution of the application currently loaded F fileName A Opens a log file LOG type state type state Enables or disables logging of a specified information type MEM Displays the memory map MS range list Sets memory bytes NOCR Closes the record file NOLF Closes the log file P address Single assembly steps into program RESTART Restarts the loaded application S12 X Debugger Manual Debugger Engine Commands Commands Overview Table 22 2 List of Base Commands continued Command Syntax RD list Short Description Displays the content of registers RS Sets a register register value register value E Stops execution of the loaded application STEPINTO Steps to the next source instruction of loaded application STEPOUT Executes program out of a function call STEPOVER Steps over the next source instruction of the loaded application STOP Stops execution of the loaded application SAVEBP on off Saves breakpoints T address count Traces program instructions at the specified address WB range list Writes bytes WL range list Writes longwords WW range list Writes words Environment Commands Use Simulator Debugger environment commands to monitor the debugger environment specific component
140. the changes displayed in a chart Environment Setup The tutorial uses Processor Expert You can get a free Processor Expert license Special Edition from www codewarrior com Creating the Project 1 Launch the CodeWarrior IDE 2 In the CodeWarrior menu Select File gt New Project 3 Select HCS12 gt HCS12D Family gt MC9S12DP256B derivative in HC S 12X Microcontrollers New Project window 4 Select Full Chip Simulation connection and click Next to proceed 5 Select C for the language and enter a project name like MyPWMChannel0 6 Change the directory if you want Location gt Set and click Next 7 Add existing files to the project if required and click Next 8 Select Processor Expert radio button from the rapid application developement option and click Next 9 Select ANSI startup code Banked memory model and None for floating point support and click Next 10 Select No for PCLint support and click Finish The IDE creates a new project with the Processor Expert available Several windows will be visible S12 X Debugger Manual 347 HC S 12 X Full Chip Simulation Connection FCS Tutorials 348 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 and ADC Modules with an icon attached to them are modules used by the application The pins that are used to connect exte
141. the component window title if only one component of this type is open For example if you have one Memory component window open and you open a second Memory component window the first window becomes Memory 1 and the second is Memory 2 The debugger automatically associates a number with a component when there are several components of the same type open Command Example in Memory 2 SMEM 0x8000 8 The symbol directs a command to a specific component in this example Memory 2 Some commands are valid for several or all components and if you do not direct the command to a specific component the command affects all components Directing the command to specific components prevents mismatches caused by differing parameter requirements of different components S12 X Debugger Manual 499 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 five groups according to their specific actions or targets However these groups have no relevance in the use of these commandis It is possible to build powerful programs by combining Kernel commands with Base commands common commands and component specific commands The following sections detail all commands in their respecti
142. the edit box Example BDICONF C tmp B10c12 exe COMDEV 686 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 S12 X Debugger Manual Connection Specific Environment Variables Abatron BDI Connection Environment Variables 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 value is COM1 57600 Example COMDEV COM1 57600 COMPRESS 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 Syntax COMPRESS 1 0 Default The default value is 1 Example COMPRESS 1 S12 X Debugger Manual 687 Connection Specific Environment Variables Abatron BDI Connection Environme
143. the left mouse button W key to set a Write watchpoint on the selected variable A red vertical bar appears on the left side of the variables on which a write watchpoint is defined If write access is detected on the variable during execution the program halts and the current program state displays in all window components Select a variable in the Data component and click the left mouse button B key to set a Read Write watchpoint on the selected variable A yellow vertical bar appears for the variables on which a read write watchpoint is defined If the variable is accessed during execution the program halts and the current program state displays in all window components Select a variable on which a watchpoint was previously defined in the Data component and click the 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 click the left mouse button S key to set a watchpoint on the selected variable The Watchpoints Setting dialog box opens A grey vertical bar appears for the variables on which a watchpoint is defined Expression Editor To add your own expression in EBNF notation double click a blank line in the Data component window to open the Edit Expression dialog box shown in Figure 3 19 or point to a blank line and right click to select Add Expression in the context menu You may ente
144. the line 3 Point in the Source window and right click The Source context menu appears 4 Choose Show WatchPoints from the context menu The Controlpoints Configuration Window Markpoints Tab appears 5 Make any modifications to any markpoints listed 6 Click OK to close the window Setting a Data Markpoint A blue letter L appears in front of a variable associated with a markpoint To define a data range markpoint Use the Data Context Menu 1 Point at a variable in the Data window and right click The Data context menu appears see Figure 4 10 2 Choose Set Markpoint from the context menu to define a markpoint at the beginning of the data range selected 3 Point in the Data window and right click The Data context menu appears 4 Choose Show WatchPoints from the context menu The Controlpoints Configuration window Markpoints tab appears 5 Make any modifications to any markpoints listed 6 Click OK to close the window Setting a Memory Markpoint A blue letter L appears in front of a memory range associated with a markpoint To define a Memory markpoint S12 X Debugger Manual Control Points Markpoints Use the Memory Context Menu 1 Point at a line in the Memory window and right click The Memory context menu appears see Figure 4 9 2 Choose Set Watchpoint from the context menu to define a Markpoint 3 Point in the Memory window and right click The Memory context menu appears 4 Ch
145. the meaning last value written to InputH InputH Ninth Input bit must be written before Read has no specified Input meaning Output Contains the last value sent Write has no specified Notification is sent every time a new meaning value is written OutputH Ninth Output bit Must be read Write has no specified immediately after Output meaning Seriallnput Alias for Input for SCI 0 connects Only available in SCI 0 Only SCI 0 to terminal window supports eight bits SerialOutput Alias for Output for SCI 0 connects Only available in SCI 0 Only SCI 0 to terminal window supports eight bits Serial Peripheral Interface SPI Table 10 20 describes the SPI interface Table 10 20 SPI Interface Acronym Full Name Comments Control Register 1 SPIE Interrupt Enable Implemented SPE System Enable If set FCS supports SPI functions SWOM Port S Wired OR Not simulated no physical transmission takes Mode place MSTR Master Slave Mode Select Master or Slave mode Select CPOL Clock Polarity Not simulated no physical transmission takes place CPHA Clock Phase Not simulated no physical transmission takes place S12 X Debugger Manual 307 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 20 SPI Interface continued 308 Acronym Full Name Comments SSOE Slave Select Output Not simulat
146. the selected memory area The underline disappears 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 opens Memory ranges at which a watchpoint is defined are underlined in black S12 X Debugger Manual Debugger Components General Debugger Components Memory Menu The Memory menu shown in Figure 3 44 provides access to memory commands Table 3 25 describes the menu entries Figure 3 44 Memory Menu Fl Address Copymem Search Pattern Refresh Table 3 25 Memory Menu Description Menu Entry Description Word size Opens a submenu to specify the display unit size Format Opens a submenu to select item display format Mode Opens a submenu to choose update mode Display Opens a submenu to toggle display of addresses and ASCII dump Fill Opens Fill Memory Dialog Box to fill a memory range with a bit pattern Address Opens memory dialog and prompts for an address CopyMem Opens CopyMem dialog box that allows you to copy memory range values to a specific location Search Pattern Opens Search Pattern dialog box S12 X Debugger Manual 93 Debugger Components General Debugger Components Word Size Submenu With the Word Size submenu shown in Figure 3 45 you can set the memory display unit Table 3 26 describes the menu entries Figure 3 45 Word Size Submenu v By
147. this bit has no effect RSBCK FCS does not simulate background mode this bit has no effect RTIFLG 0x0015 0x00 COPCTL 0x0016 OxOF CME FCME FCM FCS does not support these COPCTL bits writing to these bits has no effect COPRST 0x0017 0x00 INTCR Ox001E 0x60 FCS does not distinguish normal from special mode IRQE The implementation allows any write access In normal mode write to this register once only In special mode system ignores the first write access HPRIO 0x001F OxF2 System may write to HPRIO register if mask in CPU condition code register CCR is set FCS does not simulate this register S12 X Debugger Manual 301 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 17 TIM Simulated Registers 302 Standard Timer Module TIM FCS simulates all functions of TIM General restrictions The HPRIO register 001F may be written if the I mask in the CPU CCR is set This is not simulated The external timer output occurs at the PORTT register for testing purposes only Restrictions considering special registers and single bits of registers are covered in Table 10 17 TIM Simulated Registers Table 10 17 shows all simulated TIM registers Register Register Initial Remarks Name Address Value TIOS 0x0080 0x00 CFORC 0x
148. up or down arrow or the F3 function 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 scroll up a page keys Clearing the Line or a Character of the Command Line Selected text can be deleted by clicking the left arrow To clear the current line click the ESC key Command Interpretation The component executes the command entered and displays results or error messages if any Ten previous commands can be recalled using the up arrow key to scroll up or the down arrow key to scroll down Commands are displayed in blue Prompts and command responses appear in black Error messages appear in red When a command executes and runs from the Command Line component the component cannot be closed In this case closing the Command Line component with the window S12 X Debugger Manual 61 Debugger Components General Debugger Components close button X or with the Close entry of the system menu displays the following message Command Component is busy Closing will be delayed The Command Line component closes as soon as command execution completes Applying the CLOSE command to this Command Line component for example from another Command Line component clos
149. 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 or the PPage tab in the Banked Memory Window Syntax BANKWINDOWn lt one BANKWINDOW Command Line command gt 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 S12 X Debugger Manual Connection Specific Environment Variables Unsecure Environment Variable 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 Example BANKWINDOWO BANKWINDOW PPAGE OFF 0x8000 0xBFFF 0x30 64 T BANKWINDOW1 BANKWINDOW DPAGE OFF 0x7000 0x7FFF 0x34 256 BANKWINDOW2 BANKWINDOW EPAGE OFF 0x400 0x7FF 0x36 256 BANKWINDOW3 BANKWINDOW VARIOUS DLGATCONNECT Unsecure Environment Variable The following section describes the HC12 Unsecure environment variable used by the Target Interface This variable is CHIPSECURE This variable is stored in the targetName GDI SETTINGS section Listing 25 3 Example of ICD12 ta
150. uu Auto Symb Local 0000001C uu uu uu uu 00000020 uu uu uu uu 00000024 uu uu uu uu 00000028 uu uu uu uu 0000002C uu uu uu uu 00000030 uu uu uu uu 00000034 uu uu uu uu 00000038 uu uu uu uu For Help press F1 SIM READY The Debugger DA C window needed for communication with DA C IDE opens Figure 9 14 264 S12 X Debugger Manual Synchronized Debugging through DA C IDE Synchronized Debugging Figure 9 14 DA C Window S3 DA C Link m D Save this configuration by selecting File gt Save Project from the main menu of the Debugger This component loads automatically the next time this project is called Close the Debugger Synchronized Debugging We can now test the synchronization between DA C IDE and Debugger 1 PF Ye m pa a Run DA C exe and open the previously created project Open Fibo c if it s not already open Right click the mouse button on Fibo c source window Select Main in the context menu The cursor points to the void main void statement In the main DA C menu select Debug gt Set Breakpoint or click on the corresponding button on the debug toolbar The selected line is highlighted in red indicating that a breakpoint has been set Select Debug gt Run The Debugger starts and after a while stops on the specified breakpoint You can debug from DA C IDE with the toolbar as shown in Figure 9 15 or from the Debugger Figure 9 15 DA C Toolbar BHtLLRR
151. want to define as a counting watchpoint From the list box select the type of access you want to track In the interval field specify the interval count for the watchpoint CON ssepe y ON Click OK to close the window and define a counting watchpoint for the selected variable Use the Left Mouse Button and click the S Key 1 Point at a variable in the Data window 2 Hold down the left mouse button and click the S key The Watchpoints tab of the Controlpoints Configuration window appears 3 Select the watchpoint you want to define as a counting watchpoint from the list 4 From the list box select the type of access you want to track S12 X Debugger Manual Control Points Watchpoints 5 In the interval field specify the interval count for the watchpoint Click OK to close the window and define a counting watchpoint for the selected variable If you continue program execution the Current field decrements each time an appropriate access on the variable is detected When Current equals zero the application stops Current reloads with the value stored in the interval field to enable the counting watchpoint again Defining a Conditional Watchpoint You can associate a condition with any type of watchpoint read write read write The Debugger provides two ways to define a conditional watchpoint Use the Data Context Menu Point at a variable in the Data window and right click The Data context menu appears Ch
152. which provides information about inDART HCS12 dll release and version Select Core Use to synchronize debugger windows with a specific core Appears only when several cores are available for debugging MCU Configuration Dialog Box Figure 13 2 shows the MCU Configuration dialog box S12 X Debugger Manual 369 SofTec HCS12 Connection Connection Menu Figure 13 2 MCU Configuration Dialog Box MCU Configuration DER Hardware Model OK Code SK S12 DP512 4 X Cancel Starter Kit for Freescale MC9S12XDP512 Freescale code EVB9S12 lt DP51 2 Device Device code Communication Settings Use the Hardware Model list menu to select another type of debug interface Use the Device Code list menu to select another HCS12 derivative If your hardware supports stopping the application while running the IRQ vector requires an additional interrupt service routine See the inDART HCS12 In Circuit Debugger Programmer for Freescale HC12 Family Flash Devices User s Manual from SofTec for more details Communication Settings Dialog Box Clicking the Communication Settings button in the MCU Configuration dialog box displays the Communication Settings dialog box Figure 13 3 Using this dialog box you can fine tune critical parameters for proper operation with the target microcontroller by choosing the BDM clock source either the system bus frequency or an alternate frequency dependent on the target 370
153. 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 394 S12 X Debugger Manual 16 TBDML Connection This section contains information to assist you with the TBDML connection TBDML Technical Considerations The 8 16 bit debugger and the CodeWarrior IDE may connect to HCS12 hardware using the TBDML cable When the debugger runs the TBDML connection it communicates and debugs CPU12 HC12 HCS12 HCS12X and XGATE core based hardware through the Turbo BDM Light debug cable You can retrieve the cable design schematics and cable driver from the Freescale forum as the cable interface is open source technology Search for Turbo BDM light or TBDML in a web browser The CodeWarrior IDE is compliant with the TBDML firmware and does not require any cable driver installation NOTE The TBDML connects to the PC via a USB port Connection Menu Once you set the TBDML connection the Connection menu entry in the debugger main toolbar changes to TBDML HCS12 TBDML HCS12 Menu Entries The following figure shows the TBDML HCS12 menu Table 16 1 describes the menu entries S12 X Debugger Manual 395 TBDML Connection Connection Menu Figure 16 1 TBDML HCS12 Menu Options TBDML HCS12 Component Commanc Load Reset Ctri L Ctr R Setup Select Derivative Command Files Un
154. while the application is paused in break mode program is waiting for user input after completing a debugging command Usage STEPOUT 594 S12 X Debugger Manual Components Debugger engine Example in gt STEPOUT STEP O STARTE RUNNING STOPPED UT D Debugger Engine Commands Debugger Commands STOPPED in the status line indicates that the application is stopped by a step out function STEPOVER The STEPOVER command executes the procedure as a unit and then steps to the next statement in the current procedure Therefore the next statement displayed is the next statement in the current procedure regardless of whether the current statement is a call to another procedure NOTE This command works while the application is paused in break mode program is waiting for user input after completing a debugging command Usage STEPOV ER Components Debugger engine Example in gt STEPOVER STEP OVER STARTE RUNNING STOPPE STEPPE D D D OVI ER or STOPPI ED in the status line indicates that the application is stopped by a step over function S12 X Debugger Manual 595 Debugger Engine Commands Debugger Commands STOP The STOP command stops execution of the emulation processor Use the Go G command to start the emulator NOTE The STOP command ends as soon as the PC changes Usage STOP Alias
155. window layouts and framework applications and targets Table 22 3 contains all available Environment commands Table 22 3 List of Environment Commands Command Syntax ACTIVATE component Short Description Activates a component window AUTOSIZE on off Autosizes windows in the main window layout BCKCOLOR color S12 X Debugger Manual Sets the background color 503 Debugger Engine Commands Commands Overview Table 22 3 List of Environment Commands continued 504 Command Syntax CLOSE component Short Description Closes a component DDEPROTOCOL ON OFF SHOW HIDE STATUS Configures the Debugger Simulator DDE protocol FONT fontName size color Sets text font LOAD applicationName Loads a framework application code and debug information LOADCODE applicationName Loads the code of a framework application LOADSYMBOLS applicationName Loads debugging information of a framework application OPEN component x y width height i max Opens a Windows component SET targetName Sets a new target SLAY fileName Saves the general window layout S12 X Debugger Manual Debugger Engine Commands Commands Overview Component Commands Use Component commands to monitor component behaviors Since these commands are common to more than one component direct the commands to specific components usi
156. within the IDE From a Project window icon 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 6 2 at the top of the Project window S12 X Debugger Manual 209 How To Starting the Debugger Figure 6 2 Project Window Make and Debug Icons Make Icon my 128 project mcp Facw smi i Ww d Y Files Link Order Targets File Code Daa B readme txt BB tips txt C3 Sources C Startup Code QQ Pm C3 Linker Map C3 Libraries Debugger Project Fie C3 Debugger Cmd Files n a n a De 6 KEE ka ka ka ka ka ka 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 Project gt Debug 210 S12 X Debugger Manual Figure 6 3 Main Window Project Menu Debugger Command Line Start AOSA Processor Expert Window Help Add Files Check Syntax R Ctrl Preprocess Compile Ctri4F7 Disassemble Ctri4Shift4F7 Bring Up To Date Ctrl U Make F7 Remove Object Code Ctrl Re search for Files Reset Project Entry Paths Synchronize Modification Dates Debug F5 Set Default Project Set Default Target How To Starting the Debugger You can start the debugger from a DOS command line The command syntax is as follows HIWAVE EXE lt AbsFileNam
157. 0 Setup for CPU12 Dialog Box Untitled BDI1000 Setup for CPU12 Ele Setup Tools View Help olsa amp al 2I Firmware Loading In the dialog box shown in Figure 15 1 select Setup gt Firmware to open the firmware dialog Figure 15 2 BDI Update Setup Dialog Box BDI1000 Update Setup Connect BDI1000 Loader Channel Baudrate COM1 9600 C COM2 C 19200 C COM3 C 38400 C COM4 57600 BDI1000 Firmware Logic Current Newest Loader 1 00 Current SN 92098001 MAC Firmware 1 00 1 12 Logic 1 00 1 02 TCP IP Configuration IP Address 192 168 1 100 Subnet Mask 255 255 255 255 Default Gateway 255 255 255 255 Cancel Transmit Connecting to BDI1000 loader passed 384 S12 X Debugger Manual Abatron BDI Connection BDI Interface Software Setup In the Update Setup dialog box set the communication port and the baud rate according to your installation and click the Connect button If the connection passes the current BDI firmware logic appears If the dialog box shows that the Current firmware or logic is unknown load new firmware by clicking the Update button To use Ethernet communication between your computer and the BDI interface set the IP address reserved for the BDI then click the Transmit button Quit the dialog by clicking the Ok button Initialization List Startup Init List Loading Select File gt Open to load a configuration file e g HC912DA128 BDI Figure 15 3 File
158. 00 Instructions display 448 Instrument attributes 148 Instruments Virtual 143 Inter IC Bus IIC 285 Introduction 21 Invalid license using 26 IPATH 682 is 422 424 Items 450 ITPORT 634 ITVECT 635 J J1850 Bus BLCD 285 K Kernel data structures Describing 198 Inspecting 198 Kernel implementation 195 Kind of Port 148 Knob Color 156 Knob instrument attributes 156 KPORT 635 S12 X Debugger Manual L Language support selecting 224 Large memory model 228 Layout 671 Component windows 27 Layout Load Store menu entry 44 LCDPORT 636 Left menu entry 147 LF 564 LIBPATH 684 Library path Configuring DA C 254 LIBRARYPATH 681 682 Limitations of Demo version 26 Line Continuation 674 LINKADDR 636 Linker configuration DA C 259 Linker settings DA C 260 List Transmission 386 LOAD 565 Load 389 Load Application menu entry 30 Load I Os menu entry 272 Load Layout menu entry 145 146 Load menu entry 38 272 Load Option 354 368 396 LOADCODE 567 Loading an application 234 389 Loading error 475 Loading problems 475 Loading the BDI Connection 387 LOADSYMBOLS 567 Local Data component 234 Local menu entry 73 Local Variable Displaying 238 Local variable display 73 Locked menu entry 76 Locked mode 73 LOG 568 LOOPS 316 Low display value 153 156 160 LS 572 713 Lword menu entry 94 M M 316 MainFrame 671 Maker configuration DA C 260 Maker settings DA C 261 Manual Configuration 277 Markpoint Defin
159. 005 103516e 005 155273e 005 220703e 004 525879e 004 831055e 004 LOOP 16 TIMEUNIT SECONDS TIMEFACTOR 3 6 GAIN 4 2 DCOFFSET 2 5 OPTION NORMAL 2 136230e 004 441406e 004 746582e 004 051758e 004 356934e 004 662109e 004 EOF 051758e 005 051758e 005 051758e 005 051758e 005 051758e 005 051758e 005 051758e 005 PrRRWO DW WWWW C C Ww 051758e 005 051758e 005 051758e 005 051758e 005 051758e 005 051758e 005 WWWN ND WWWW WW Ww File Example 2 FILELOOP INF LOOP INF TIMEUNIT NONE TIMEFACTOR 0 5 GAIN 1 DCOFFSET 0 OPTION NORMAL a5 5 2 8 0 4e 3 300 123 EOF 336 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins File Parameters Table 10 29 shows the available file parameters Table 10 29 Signal Description File Parameters Parameter LOOP FILELOOP Description 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 scanning loops through the block that number of times TIMEUNIT CYCLES means that the second data field is specified in cycles SECONDS means that the second data field is specified in seconds NONE means that the second data field does not exist and the data time unit is forced to 1s Adjust the data time unit by t
160. 0081 0x00 OC7M 0x0082 0x00 OC7D 0x0083 0x00 TCNT H 0x0084 0x00 TCNT_L 0x0085 0x00 TSCR 0x0086 0x00 TSWAI FCS does not support the CPU Clock stop setting this bit has no effect TSBCK FCS does not simulate background mode this bit has no effect TQCR 0x0087 0x00 TCTL1 0x0088 0x00 TCTL2 0x0089 0x00 TCTL3 0x008A 0x00 TCTL4 0x008B 0x00 TMSK1 0x008C 0x00 S12 X Debugger Manual Table 10 17 TIM Simulated Registers continued HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives S12 X Debugger Manual Register Register Initial Remarks Name Address Value TMSK2 0x008D 0x30 TPU This bit controls a pull up resistor or a pin Since the FCS has no real pins setting this bit has no effect TDRB This bit controls the output drive of a pin Since the FCS has no real pins setting this bit has no effect TFLG1 0x008E 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 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 PAFLG 0x00A1 0x00 303 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 17 TIM Simulated Registers
161. 1 ls UNTIL i S12 X Debugger Manual 571 Debugger Engine Commands Debugger Commands Generates the following log file repeat until condition Idefine i 1 REPEAT define i i 1 1s i 0x2 2 IUNTIL i define i i 1 1s i 0x3 3 IUNTIL i define i i 1 1s i 0x4 4 IUNTIL i 4 LS 572 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 Memory size determines the symbol table size Use the DEFINE command to define symbols and the UNDEF command to delete symbols The LS command lists symbols split into two parts Applications Symbols and User Symbols Usage LS symbol C S Where symbol is a restricted regular expression that specifies the symbol whose values are to be listed specifies to list all symbols C specifies to list symbols in canonical format which consists of a DEFINE command for each symbol S12 X Debugger Manual Debugger Engine Commands Debugger Commands S 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 fib1 0x85 133 fib2 0x87 135 fibo 0x89 137 Fibonacci OxF000 61440 Entry 0xF041 61505 Performing
162. 10 8 Simulated ADC Registers continued Register Full Register Name Simulated Fields Acronym ATDCTL5 ATD Control Register 5 DJM CC DSGN CB SCAN CA MULT ATDSTATO ATD Status Register O SCF FIFOR ETORF CC2 0 ATDSTAT1 ATD Status Register 1 CCF7 0 ATDDIEN ATD Input Enable Register 8 Channel IEN7 0 ATDDIENO ATD Input Enable Register 16 Channel IEN15 8 ATDDIEN1 ATD Input Enable Register 16 Channel IEN7 0 PORTAD Port Data Register 8 Channel PTAD7 0 PORTADO Port Data Register 16 Channel PTAD15 8 PORTAD1 Port Data Register 16 Channel PTAD7 0 ATDDRx ATD Conversion Result Registers Entire register Registers not Mapped to Memory The following ADC registers are not mapped to memory PADx The PADx registers are eight registers not mapped to memory that serve as the measured values for the ATD The format of the PADx registers is IEEE32 To set up a PAD use the following command ATDx SETPAD CHANNEL VOLTAGE AS FLOAT gt Memory Modules These memory modules are not simulated EEPROM EETS Flash FTS S12 X Debugger Manual 289 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Miscellaneous Modules The following miscellaneous modules are not simulated Voltage Regulator VREG Compact Flash Host Controller CFHC Memory Stick Host Controller MSHC Secure Digital Host Controller SDHC ATASHC Module ATASHC
163. 12 Trigger Module Settings Trigger settings Expert triggers General settings Automatic triggers breakpoints watchpoints and trace possible M Automatic triagers breakpoints watchpoints and trace possible Expert triggers through Expert triggers property page trace possible Profiling and coverage no triggers trace not possible Disabled manual use of on chip trigger module with trace possible Memory access at Address Memory access at Address or at Address B Memory access inside Address A Address B range Memory access at Address A then memory access at Address B Memory access at Address and value on data bus match Memory access at Address and value on data bus mismatch Instruction at Address 4 is executed Instruction at Address or Address B is executed Instruction execution inside Address A Address B range Instruction execution outside Address Address B range Instruction at Address A then at Address B were executed Instruction at Address amp and value on data bus match Instruction at Address 4 and value on data bus mismatch Capture the read write values at Address B Capture r write values at Address B after access at Address amp Cancel Help S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Table 17 2 Trigger Modes Trigger Module Settings Window Coverage Mode Mode Description Automatic Mode Setup three regular hardware
164. 12 Symbol references in asm statement are ignored Fiboc 15 Warning 302 fiboCount Global identifier used in only one module Fiboc 186 Warming 302 counter Global identifier used in only one module Fiboc 18 Warming 302 Fibonacci Global identifier used in only one module 4 warnings errors detected 256 S12 X Debugger Manual Synchronized Debugging through DA C IDE Configuring DA C IDE for Freescale Too 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 using symbol information In the Project Manager window of DA C select the Logical View Tab shown in Figure 9 6 and unfold all fields You now have the overview of your project Figure 9 6 Logical View Tab A DA C myproject Project OP x Fie Edit Search Browse Graph Metrics Start Project Options Window Help 8 x EH myproject Symbols Messages Version Info Dependencies DA C Properties a Default folders a Project Root DETE default env B fibo mak O Fibo prm myproject dep project ini Readme t t E gg Dac Egg Pinclude HIWARE M68xxx CPU32 V5 0 h E gg Drive C Eg HIWARE Eg LIB Gg MEBKC EH gl include O Hidef h 3 Stddet h L Stdtypes h fiboCount B Default types Egg C Source Files O Fibo c Assembler Source Files Header Files zy Document Files Eig Misce
165. 12 X Debugger Manual LAS specified unprotects all available blocks This command ignores modules that cannot be unprotected LAS protec protec LAS LAS desele LAS comm Files user interface This command is required before loading Flash LAS LAS LAS LAS LAS LAS LAS H UNPROTECT unprotects the specified modules If no modules are H PROTECT protects the specified modules If no modules are specified ts all available blocks This command ignores modules that cannot be ted H SELECT selects the specified modules for Flash programming If no odules are specified selects all available blocks for Flash programming H UNSELECT deselects the specified modules If no modules are specified cts all available blocks The deselected state protects against accidental Flash programming H ARM prepares the NMVC utility for loading as does a normal LOAD and The system executes the VPPON CMD file specified in the Command H DISARM ends a load process The system executes the VPPOFF CMD file specified in the Command Files user interface H SAVECONTEX backs up current SRAM content into a buffer H LOADCONTEX restores current buffer content into the MCU SRAM H OVLBACKUP backups application code overlap with programming runtime algorithm RAM preset for debugging Execute this command before the application file loading H OVLRESTORE restores installs writes in RAM the applica
166. 12 X Debugger Manual Synchronized Debugging through DA C IDE Troubleshooting 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 Figure 9 19 DA C Debugger Options Dialog Box Debugger Options 2 x Debugger e HIWARE HIA AVE 6 0 About Startup Switches Load binary ESHWAR EXWORKAMB8KC fibo abs Browse Ask before sending to debugger Timeouts zo s Iv Check debugging through non project files Both must be the same If not change the Debugger name in the Debugger Connection Specification and click OK This establishes a new connection and saves the Connection Specification in the current Project ini file in the section shown in Listing 9 4 Listing 9 4 DA C Section in Project File DA C DEBUGGER NAME HI WAVE 6 0 SHOWPROT 1 S12 X Debugger Manual 267 Synchronized Debugging through DA C IDE Troubleshooting 268 S12 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 use the environment Book II HC S 12 X Debug Connections defines the connections available for debugging code written for HC12 CPUs Chapter 10 HC S 12 X Full Chip Simulation Connection Chapter 11 P amp E Mul
167. 20 HC S 12 X Microcontrollers New Project Screen 222 HC S 12 X Microcontrollers New Project Wizard Map Select the derivative you would like to use Device and Connection HC12 XGATE Setup amp HCS12 HCS12X Project Parameters HC512 4 Fami Add Additional Files pisces MC9512XA Processor Expert MC9512XA HCS125B Famil HCS12XxD Famil HCS12XE Famil HCS12XF Famil HCS12XHY Family HCS12XHZ Family HC512X5 Family Choose your default connection Connections P amp E USB BDM Multilink P amp E Cyclone PRO USB P amp E Cyclone PRO Serial P amp E Cyclone PRO TCPIP SofTec HC512 Abatron BDI TRDMI Freescale Full Chip Simulation with simulation of on chip peripherals Later on in the debugger you can switch to hardware debugging 3 In the tree navigate to the family and select derivative for example HCS12X HCS12XA Family gt MC9S12XA512 4 Select the connection by clicking on the appropriate connection 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 e P amp E USB BDM Multilink Connect to P amp E USB BDM Multilink This development tool allows access to the Background Debug Mode BDM on Freescale HCS12 X microcontrollers to directly control the target s execution
168. 28 User interface 47 Using on Windows 2000 208 Version number 45 Debugger Start option C 613 ENVpath 613 Instance currentTargetName 612 Nodefaults 612 Target 611 W 611 Debugger Trigger Register 425 Debugging Embedded applications 25 Memory Map 355 369 390 397 Memory Map DMM 455 Dec menu entry 75 94 112 239 Decimal 239 Decimal format signed 239 Decimalmode attribute 157 Default Directory defining 208 DEFAULT ENV 667 668 679 680 683 default mem file 275 DEFAULTDIR 678 708 DefaultDir environment variable 208 DEFINE 542 DELCHANNEL 633 Delete Breakpoint menu entry 58 119 Delete Markpoint menu entry 59 120 Delete Trigger 408 Delete Trigger Address 405 Demo 161 Demo mode 26 Demo version limitations 26 Command component 64 Coverage component 68 DA C link component 70 Debugger 26 VisualizationTool 161 Derivative Selection 220 Setting 216 DETAILS 543 Details menu entry 66 107 Development Assistant for C using 256 Dialog 471 Dialog box Display Address 96 Fill Memory 96 Disable Breakpoint menu entry 58 119 Disabled mode 419 428 436 Disabled module state 472 Disabling 473 Disarm automatically the module when the debugger stops 445 446 Display Component information 135 Lines of code 121 Port 149 Port memory width 149 Values VisualizationTool 153 Display 0 1 156 158 Display Absolute Address menu entry 57 Display Address dialog box 96 Display Address menu entry 57 Display Code menu entry 57
169. 2X only Trace XGATE only wf Trace both cores 4 The list options allow you to Disable trace Trace the HCS12X core only Trace the XGATE core only Trace both cores Program Code Change of Flow Recording The program code change of flow options are available for Instruction and Memory Access triggers and controlled through the Trigger Module Settings window Trigger Settings list menu 440 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Figure 17 35 Change of Flow Recording Control Trigger Module Settings Trigger settings Sequencer General settings Trigger Module Settings Window User Triggers trace possible no automatic beeakpoints and watchpoints Not defined ONE Address Compare to 00000 C Inside Range C Outside Range Compare mismatch Triggeron HCS12 C XGATE A RAV Access B C Notdefined D po With Mask 00000 Always stop on this trigger Not defined Trace both cores x Record continuously Record continuously ee Trace mechanism activated ecord before and after condition Jb eia Mode is not available when tracing both cores The DBG module records change of flows unti the condition is met or the debugger is gt FIFO Namal mode Sequencer Any trigger Recording can start either when the sequencer final state is reached and then stop stop when the sequencer final state is reached
170. 390 Command Files 389 Communication 389 391 Configure BDI Box 390 Connect 389 391 Debugging Memory Map 390 Flash 390 Help 390 Load 389 Reset 389 Select Core 390 Select Derivative 389 Set Derivative 389 Setup 390 392 Trigger Module Settings 390 Unsecure 390 ABATRON Configuration tool 383 About box 45 About menu entry 45 About Option 369 abs file 53 389 ABSPATH 678 ACTIVATE 511 ADCPORT 632 Add New Instrument menu entry 145 146 ADDCHANNEL 632 Adding expressions 71 S12 X Debugger Manual Adding files to project DA C 255 Address 408 Address menu entry 57 59 93 96 ADDXPR 511 Align menu entry 146 All menu entry 74 AII Text Folded At Loading menu entry 124 Analog 148 Analog instrument attributes 153 Analog to Digital Converter ATD 288 Analyzing FIFO 448 AND Mask 154 ANSI startup code selecting 231 Application Assembly level stepping 237 Embedded 25 Loading 234 Flash 475 RTK example 197 Source level stepping 236 Starting 235 Stepping 236 237 Stopping 235 Target 25 Application Programming Interface DAPI 261 Arrange Icons menu entry 44 ASCII menu entry 96 Assembly component 55 234 235 Assembly context menu 58 Assembly menu 57 Assembly Step menu entry 37 Assembly Step Out menu entry 37 Assembly Step Over menu entry 37 AT 523 ATTRIBUTES 512 Attributes CMD Callback 161 Command 161 Auto configure 275 Auto menu entry 113 Auto on Access 277 703 Auto on Load 277 Auto select according to MCU Id 47
171. 4 Automatic menu entry 75 95 Automatic mode 73 Automatically analyze the FIFO content 432 444 445 446 AUTOSIZE 524 B B 405 Background Color menu entry 42 Background Debug Mode BDM 381 Backgroundcolor Instrument property 148 Menu entry 147 Banked Hardware breakpoint 393 Memory model 228 314 BANKWINDOWn 690 Bar instrument 148 Attributes 153 Barcolor 153 Bardirection 153 BASE 524 Base menu entry 107 BC 525 BCKCOLOR 526 BD 527 BDI 616 Abatron setup 383 Communication device specification 391 Configuration 383 Connection menu 389 Connection Windows 391 Device Specification Edit Box 391 Firmware 384 Initialization List 385 Interface 382 Interface setup 383 Menu Entries 389 Setup dialog box 392 Startup Init List 385 Terminal Emulation with BDI 393 Working Mode 386 704 BDI1000 381 BDICONF 686 BDI HS 381 BDM connector port 382 BDM port 381 Bin menu entry 75 94 112 239 Binary Displaying register content in 241 Format 239 Bit Reverse menu entry 75 95 113 Bitmap directory 258 Bitnumber to Display 157 158 Blank module state 472 473 BLCD 285 Blocks 470 Bottom menu entry 147 Bounding Box 148 Box configuration 383 Breakpoint 115 393 492 494 688 Banked hardware 393 Checking condition 167 Command association 175 Conditional 173 193 Counting 172 192 Definition 163 Deleting 174 Disabling 119 Enabling Disabling 58 Hardware 393 419 428 435 688 Marks 56 Multiple selection 166 P
172. 4 describes its entries Figure 3 57 Procedure Menu v Show Values Show Types 104 S12 X Debugger Manual Debugger Components General Debugger Components Table 3 34 Procedure Menu Description Show Values Displays function parameter values in procedure component Show Types Displays function parameter types in procedure component Drag Out Table 3 35 shows the drag actions possible from the Procedure component Table 3 35 Procedure Component Drag Possibilities Destination Action Component Window Data gt Local Displays local variables from selected procedure in data component Source Displays source code of selected procedure Highlights current instruction inside procedure in Source component Assembly Highlights current assembly statement inside procedure in Assembly component Drop Into Nothing can be dropped into the Procedure component Demo Version Limitations Displays only the last two procedures Associated Commands ATTRIBUTES FINDPROC Profiler Component The Profiler window shown in Figure 3 58 provides information on application profile NOTE Advanced code optimizations like linker overlapping ROM code areas affects the profiler output data In such cases switching off such linker optimizations is recommended S12 X Debugger Manual 105 Debugger Components General Debugger Components Figure 3 58 Profiler Window E Profiler DER El fibo c Fibo
173. 40 The DB command displays the hexadecimal and ASCII values of the bytes in a specified range of memory The command displays one or more lines depending on the address or range specified Each line shows the address of the first byte displayed in the line followed by the number of specified hexadecimal byte values The corresponding ASCII characters separated by spaces follow the hexadecimal byte values Between the eighth and ninth values a hyphen replaces the space as the separator Each non displayable character is represented by a period Cancel this command by clicking the Esc key S12 X Debugger Manual Debugger Engine Commands Debugger Commands Usage DB address range When you omit address and range the first longword displayed is taken from the address following the last longword displayed by the previous DB DW or DL command or from address 0x0000 for the first DB DW or DL command of a session Components Debugger engine Examples in DB 0x8000 0x800F 8000 FE 80 45 FD 80 43 27 10 35 ED 31 EC 31 69 70 83 p Ey C 5 lilipf This displays memory bytes in the Command Line component window with matching ASCII characters Open the Command Line component before executing this command to see the dumped code in DB amp TCR 0012 5A Z This displays the byte that is at the address of the TCR I O register The DEFAULT REG file contains the I O register definitions DDEPROTOCOL Us
174. 49 Debugger COM Capabilities Driving Debugger through COM 250 S12 X Debugger Manual 9 Synchronized Debugging through DA C IDE This chapter provides information on using and configuring 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 This chapter contains the following sections Configuring DA C IDE for Freescale Tool Kit Debugger Interface Synchronized Debugging Troubleshooting Configuring DA C IDE for Freescale Tool Kit Install the DA C software The Freescale CD contains a demonstration version located in Addons DA C Run Setup to install the Typical installation Complete the following steps 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 Add files to project Build the Database Configure the tools In the following sections we assume that the Freescale tool kit is installed in C Freescale directory You may need to adapt the paths to your current installation An example configuration for the M68000 CPU is provided which can be adapted to each CPU supported by Freescale S12 X Debugger Manual 251 Synchronized Debugging through DA C ID
175. 55 Assembly Component 0 0 00 cece eee eee 55 Command Line Component 0 0 rreren orere 61 ComMaster Component 64 Coverage Component ss ceris aia 0 cece eee cee eee 65 DA C Link Component esses e 68 Data Component i ra eer eG e nesta tbe OERE EE VR E quee d 70 HCS12XAdrMap Component 00 0 0c eee 81 MCURegisters Component 0 0 02 eee eee 83 Memory Component 0 0 00 cece eee eee 89 Module Component 0 0 0 0 eee eee eee 102 Procedure Component iss saia acei aaa eee 103 Profiler Component s r n E T EE eee ene 105 Recorder Component 0 0 0 0 ra Tea E ie a E eee 109 Register Component 0 0 00 rererere eee eee 111 Source Component oesi mesa EE cee eee eee 114 Terminal Component cries dee Re eye ge y RE ea 125 Trace Component 0 20 22 oe ne eI HR eT ee pP RE 129 Visualization Utilities 0 eee ee 135 Inspect Component sranie ere tann E cee eee eee 135 Visualization Tool Component 00 0 0 eee eee eee 143 4 Control Points 163 Control Point Configuration 0 00 c eee ee eee eee 163 Breakpoints 2 2 4 ee or Soe e o EP RU Sade gon 164 Breakpoints Taba uu ty tts gar edges eda ER ee Le 166 4 S12 X Debugger Manual Multiple Selections in List Box Checking Expressions Saving Breakpoints 0 4 Setting Breakpoints 0 Watchpoints 0
176. 65 Debugging Memory Map Manager Command Set 465 19 Flash Programming 467 Automated Application Programming 00002 eee ee ee 467 Sep ei eda Shee eee sae atk EI EE Gea ae ai 468 Advanced Options Erase Prevention 00 0000 0005 468 NVMC Graphical User Interface 00 0 eee eee eee 470 NVMC Dialog Box 1 0 0 ec eens 471 Flash Module Handling 0 0 cece ee eens 472 MCU Speed Information 0 0 00 ees 473 Configuration FPP File Loading 0 0 0 0 0008 473 Loading an Application in Flash 0 0 enneren 475 Preparing and Loading an Application 0 0 0000 476 Hardware Considerations 0 0 eee cee nee 477 HC12 CPU12 CPU Devices 0 2 esee 477 HCS12 and HCS12X CPU Devices 0 0 0 0 0 2 ee eee 480 HCS12 EEPROM Relocation 0 0 c cece eee eee eee 482 EB386 Compliance and RAM Moving 0 000 00005 482 HCS12X Emulated EEPROM 0 0 cee eee eens 483 Legacy Flash Programming Commands in Preload and Postload Command Piles Locke eod sts nathan Meee eee eee e Mal bee baat ees ae 483 S12G 12P 12X SI2XE 12XS D Flash memory 484 20 Unsecure HCS12 Derivatives 485 Information Required to Unsecure the Device 000 485 Unsecure Command File 0 0 487 21 On Chip Hardware Breakpoint Module 491 Hardwar
177. 68 Fen elif defined OPTIMIZE_FOR_SIZE_ 1 X 1 Y Drag Out All displayed items can be dragged into a Source or Assembly component The 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 Displays only modules and disables the Save function Associated Commands DETAILS FILTER GRAPHICS OUTPUT RESET TUPDATE DA C Link Component The DA C Link window shown in Figure 3 15 is an interface module between the DA C Development Assistant for C from RistanCASE GmbH and the IDE allowing synchronized debugging features DA C Link Window S4 DA C Link DA C Link Operation When you load the DA C Link component you establish communication 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 S12 X Debugger Manual Debugger Components General Debugger Components NOTE For related information refer to Synchronized Debugging through DA C IDE 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 Table 3 7 DA C Link Menu Description Opens the Connection Specification dialog box Connection Specification Dialog Box Set the DA C debugger name in the Connection Specificatio
178. 7 To arm for programming in Flash arm Now load your application in gt load a my_page5 sx RUNNING To stop loading and disarm in gt Flash disarm FLASH disarmed Halted 622 S12 X Debugger Manual Connection Specific Commands NVMC Commands Use the FLASH command to display the final state of the modules Listing 23 3 Listing 23 3 Display Module Final State in gt Flash MCU clock speed 8025000 Module Name Address Range Status LASH 4000 4000 7FFF Enabled Blank Unselected LASH PAGEO 8000 BFFF Enabled Blank Unselected LASH C000 C000 FFFF Enabled Blank Protected Unselected LASH PAGE 18000 1BFFF Enabled Blank Protected Unselected LASH PAGE2 28000 2BFFF Enabled Blank Unselected LASH PAGE3 38000 3BFFF Enabled Blank Protected Unselected LASH_PAGE4 48000 4BFFF Enabled Blank Unselected LASH_PAGE5 58000 5BFFF Enabled Programmed Unprotected Selected LASH PAGE6 68000 6BFFF Enabled Blank Unselected LASH PAGE7 78000 7BFFF Enabled Blank Protected Unselected HALTED n j Hj Hj Hj hj ni rj nj rj The FLASH PAGE5 module is programmed Now protect and unselect the module Listing 23 4 Listing 23 4 Protect and Unselect Module in 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 Blan
179. 8 7 Click the OK button The Monitor Setup window opens again showing the Vector Table Mirroring Tab We recommend that you use the Vector Table Mirroring feature Otherwise vectors cannot be programmed as captured or protected from erasing or overwriting by the HCS12 Serial Monitor 8 To enable this specific feature check the Enable Vector Table Mirroring checkbox 220 S12 X Debugger Manual How To Using the Stationery Wizard to Create a Project Figure 6 19 Monitor Setup Window Vector Table Mirroring Tab Monitor Setup Monitor Communication Vector Table Mirong Load Options ESL 9 Click 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 auto detection completes click the OK button to start debugging Using the Stationery Wizard to Create a Project 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 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 File New Project to create a new project from a stationery the HC S 12 X Microcontrollers New Project wizard screen appears S12 X Debugger Manual 221 How To Using the Stationery Wizard to Create a Project Figure 6
180. A Control PAEN PAOVI Register PEDGE PAFLG Pulse Accumulator A Flag Register PAOVF PACNS3 PACN2 Pulse Accumulators Count Registers 3 All registers and 2 PACN1 PACNO Pulse Accumulators Count Registers 1 All registers and 0 MCCTL 16 Bit Modulus Down Counter Control MCZI FLMC Register MODMC MCEN RDMCL MCPR1 0 ICLAT MCFLG 16 Bit Modulus Down Counter FLAG MCZF POLF3 0 Register ICPAR Input Control Pulse Accumulators PA3EN PA1EN Register PA2EN PAOEN ICOVW Input Control Overwrite Register NOVWT 0 ICSYS Input Control System Control Register SH37 TFMOD SH26 PACMX SH15 BUFEN SH04 LATQ PTPSR Precision Timer Prescaler Select Entire register if Register derivative supports it PTMCPSR Precision Timer Module Counter Entire register if Prescaler Select Register derivative supports it PBCTL 16 Bit Pulse Accumulator B Control PBEN PBOVI Register PBFLG Pulse Accumulator B Flag Register PBOVF PASH PAOH 8 Bit Pulse Accumulators Holding Entire register Registers 3 0 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 13 Simulated ECT Registers continued Register Full Register Name Simulated Fields Acronym MCCNT Modulus Down Counter Count Register Entire register TCOH TC3H Timer Input Capture Holding Registers Entire register 0 3 Registers not Mapped to Memory The following registers are not mapped to memory Port T PORTT The functionality linking the PWM mo
181. AD2 TIP You can place commands to create signal generators in a command file such as a Postload command file CLOSESIGNALFILE Command CLOSESIGNALFILE closes the current signal file and generator Syntax CLOSESIGNALFILE value 0 15 Example CLOSESIGNALFILE 1 Remarks A message box displays the 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 automatically reprograms level duration when duration in seconds is provided or no duration information is provided Currently all header parameters are mandatory also EOF in the same order as described in EBNF above without spacing between words S12 X Debugger Manual 609 Debugger Engine Commands Debugger Commands Pinconn Commands CONNECT Connects output pin to input Syntax CONNECT lt OutputPin gt lt InputPin gt Example CONNECT Pim PORTHPinO Pim PORTPPin3 DISCONNECT Removes connection between pins Syntax DISCONNECT lt OutputPin gt lt InputPin gt Example DISCONNECT Pim PORTHPinO Pim PORTPPin3 CONNECT_STATE Displays the list of active connections Syntax CONNECT STATI Ej NOTE There is no limitation of connections NOTE TheInspect component provides this list of simulated pins for a derivative FCS under the Object Pool key 610
182. ANSE NOTE If you make changes to your source code remember to rebuild the Database when generating new binary files to avoid misalignment between the Debugger and DA C source positions S12 X Debugger Manual 265 Synchronized Debugging through DA C IDE Troubleshooting Troubleshooting This section describes possible trouble when trying to connect the Debugger with the DA C IDE Load the DA C component into the Debugger If the message box shown in Figure 9 16 appears find out if the Ndapi d11 is located in the prog directory of your current Freescale installation If not copy the specified DLL into this directory Figure 9 16 DA C Component Loading Error Message Could not load component dac wnd or one of its libraries Error code 126 If the message box shown in Figure 9 17 appears in DA C IDE then the current name specified in the Options Debugger main menu of DA C doesn t match the debugger name specified in the Debugger Figure 9 17 DA C Debugger Support Message External debugger tried to connect with DA C is not the same like configured Open the setup dialog in the Debugger by clicking on the DA C Link component and choose DA C Link Setup from the main menu The Connection Specification dialog box opens Figure 9 18 Figure 9 18 DA C Connection Specification Dialog Box Connection Specification Debugger Name HIWARE HI WAVE 6 0 Show Protocol Cancel Help 266 S
183. APROM bit in MISC register Boot sector unprotectable protectable 2 Kilobytes in range OxF800 OxFFFF or 0x7800 0x7FFF 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 Table 19 4 HC12D60 Flash Module Details Module Module Remarks Name Number FEE28 0 28 Kilobytes Flash located in 0x1000 0x7FFF or 0x9000 OxFFFF both handled according to MAPROM bit in MISC register Boot sector protection off on 8 Kilobytes in range 0x6000 Ox7FFF or OxE000 OxFFFF Use BOOTP bit in FEE28MCR register and LOCK bit in FEE28LCK register Flash enable disable using ROMON2Z8 bit in MISC register FEE32 1 32 Kilobytes Flash located in 0x8000 0xFFFF or 0x0000 Ox7FFF both handled according to MAPROM bit in MISC register Boot sector protection off on 8 Kilobytes in range OxE000 OxFFFF or 0x6000 0x7FFF Use BOOTP bit in FEES2MCR register and LOCK bit in FEES2LCK register Flash enable disable using ROMON32 bit in MISC register 478 S12 X Debugger Manual HC12DG128 fpp file name mcu03c4 fpp Flash Programming Hardware Considerations number of Flash modules 10 Applet code currently not relocatable loaded at 0x2000 using 0x400 bytes All Flash modules enable
184. ASH 4000 479 FLASH B32 478 FLASH C000 479 FLASH PAGEO 479 FLASH PAGEI 479 FLASH PAGE2 479 FLASH PAGE3 479 FLASH PAGEA 479 FLASH PAGES 480 FLASH PAGE6 480 FLASH PAGE 480 Flat step 236 FLEXIm component protection in demo mode 26 S12 X Debugger Manual Float menu entry 113 Floating point format 228 230 Selecting 228 230 FOCUS 555 FOLD 555 Fold All Text menu entry 124 Fold menu entry 123 Folding mark 118 Folding menu 123 Folding source code 118 Foldings menu entry 120 FONT 556 Fonts menu entry 42 FOR 556 569 Format Changing register display 241 Changing variable display 239 Format menu 239 Format menu entry 73 93 Format mode 160 Format Selected and All Submenu 85 Format Submenu 84 Format submenu 74 94 FPP Browse 474 FPP directory 474 FPP file loading 473 FPRINTF 557 FRAMES 558 Frames Definition 448 Frozen menu entry 76 95 Frozen mode 73 Full Chip Simulation Technical Considerations 271 Full Chip Simulation Connection 271 Full Chip Simulation connection loading 212 G G 558 GDI 421 447 GENPATH 680 682 Global Data component 234 Global menu entry Menus S12 X Debugger Manual Scope submenu 73 Global variable Displaying 238 Global variable display 73 GO 559 Go to Frame 451 Go to Line dialog box 122 Go to Line menu entry 120 121 Graphic bar 106 Coverage window 65 Graphical 449 Graphical display 449 GRAPHICS 561 Graphics menu entry 66 107 Grid Color menu entry 148 Grid Mode me
185. C12 sim simulator SHOWCYCLES The SHOWCYCLES command returns the number of CPU cycles already done since the beginning of the simulation in the Command Line component performs RESETCYCLES internally or since the last RESETCYCLES command Also displays the number of cycles executed in the status bar CPU cycles counter Syntax SHOWCYCLI Ed n Components Debugger engine 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 WPORT Use the WPORT command to set the port addresses of the Wagon component Syntax WPORT address ident address ident S12 X Debugger Manual 643 Connection Specific Commands Full Chip Simulation Connection Commands Arguments Address locates the port address value of the component various formats are allowed the default format is hexadecimal Ident a known identifier Its content defines the port address Components Wagon Example in gt WPORT 0x100 0x200 Ports of the Wagon are now defined at addresses 0x100 and 0x200 Full Chip Simulation Connection Commands This section describes the Full Chip Simulation connection specific commands that are used when the Full Chip Simulation FCS connection is set The Full Chip Simulation connection specific commands are ADCx SETPAD BGND CYCLES
186. CS Warning ID 0x400a L Value implemented FCS Warning ID 0x400a L Value implemented FCS Warning ID 0x400a L Value implemented STOPPING 12 0x0 12 0x0 L2 0x0 12 0x0 S12 X Debugger Manual reading Memory reading Memory reading Memory reading Memory from unimplemented regis 0x106 Address from unimplemented regis 0x106 Address from unimplemented regis 0x106 Address from unimplemented regis 0x106 Address ter at pc Flash CONTROL module ter at pc Flash CONTROL module ter at pc Flash CONTROL module ter at pc Flash CONTROL module not not not not 283 HC S 12 X Full Chip Simulation Connection FCS and Silicon On Chip Peripherals Simulation HALTED Warning message IDs usually belong to a group of registers from the same simulated block such as the Flash CONTROL registers block in the listing above Therefore any access to unimplemented Flash CONTROL registers generate the same kind of message The debugger provides a set of commands to hide specific ID messages to stop the FCS automatically or to display a warning message box Execute these commands from a POSTLOAD command file These commands are volatile and not saved in current project For a list of commands and their uses see Full Chip Simulation Connection Commands FCS and Silicon On Chip Peripherals Simulation FCS not only simulates the cor
187. Capture Timer ECT Legacy HC12 CPU12 Derivatives Simulation MC68HC812A4 This section explains the simulated features of the MC68HC812A4 derivative The FCS implements the on chip peripherals listed here Register Block Table 10 15 shows the register block functionality You can move all I O registers according to the INITRG Register Block Mapping at offset 11 inside the register block Table 10 15 MC68HC12A4 Register Block Register Register Initial Name Address Value 300 Lite Integration Module FCS simulates many functions of the Lite Integration Module LIM including Interrupt handling Watchdog Periodic Interrupt S12 X Debugger Manual General restrictions HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives FCS does not distinguish normal from special mode Accordingly it allows all write accesses as if the chip were in special mode Table 10 16 shows restrictions relative to special registers and single bits of registers LIM Simulated Registers Table 10 16 shows the LIM Simulated Registers Table 10 16 LIM Simulated Registers Register Name CLKCTL Register Address 0x0047 Initial Value 0x00 Remarks LCKF PLLON PLLS BCSC BCSB BCSA These CLKCTL bits control PLL settings FCS does not simulate the PLL values of these bits have no effect RTICTL 0x0014 0x00 RSWAI FCS does not support the CPU Clock stop
188. Commands Debugger Commands 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 address range l OBJ address A constant expression representing the address at which disassembly begins range An address range constant that specifies addresses to be disassembled When you omit range a maximum of sixteen instructions are disassembled When you omit address and range disassembly begins at the address of the instruction that follows the last instruction that was 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 S12 X Debugger Manual 539 Debugger Engine Commands Debugger Commands Example in dasm Oxf04b 00F04B LDHX 0x0450 OOFO4E TXS OOFO4F CLRH 00F050 CLRX 00F051 STX 0x80 00F053 INC 0x80 00F055 LDX 0x80 00F057 JSR OxF000 00F05A STX 0x82 OOFO5C STA 0x81 OOFO5E LDA 017 00F060 CMP 0x80 00F062 BEQ 20 abs F050 00F064 BRA 19 abs F053 00F066 DECX 00F067 DECX NOTE Depending on the target the above code may vary Disassembled instructions appear in the Command Line component window Therefore you must open the Command Line component before executing this command to see the dumped code DB 5
189. Configuration Dialog Box Memory Configuration Memory Check W Stop if no memory Stop on read undefined v Stop on write protected wait state bus width name 0 16 AUTO RAM Name AUTO ROM Type ROM Start End Wait state Access Details Set Up V Auto Configure C 8bis 16bits C 32bits 7 Allow misaligned access Bus width Add Update Delete Cancel Help Memory Configuration Modes Use the Memory Configuration dialog box to select the memory configuration mode auto configuration on access auto configuration on load or user defined Depending on your settings the FCS component initializes the FCS memory as Table 10 2 explains Table 10 2 Memory Configuration Modes Mode Description Auto Configuration Defines memory as RAM of unlimited size Mode combo box on Access Standard displays auto on access Configuration 276 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu Table 10 2 Memory Configuration Modes continued Mode Description Auto Configuration Defines memory as RAM and ROM according to code and on Load default data area defined in a loaded absolute file Defines code segments as ROM Defines data segments as RAM Memory outside these segments is not implemented access to unimplemented locations result in error messages Mode combo box displays auto on load Manual Configuration Defines memory as RAM ROM or non
190. Debugger through DDE 00 00 0000 0 0005 701 Index 703 S12 X Debugger Manual 19 Table of Contents 20 S12 X Debugger Manual Introduction Manual Contents The S12 X Debugger Manual consists of the following books Book I Debugger Engine describes the HC12 HCS12 and HC S 12 X common and base features their functionality and a description of the components that are available in the debugger Chapter 1 Introduction Chapter 2 Debugger Interface Chapter 3 Debugger Components Chapter 4 Control Points Chapter 5 Real Time Kernel Awareness Chapter 6 How To Chapter 7 CodeWarrior Integration Chapter 8 Debugger COM Capabilities Chapter 9 Synchronized Debugging through DA C IDE Book II HC S 12 X Debug Connections describes the connections available for debugging code written for HC12 CPUs Chapter 10 HC S 12 X Full Chip Simulation Connection Chapter 11 P amp E Multilink Cyclone Pro Connection Chapter 12 OSBDM Connection Chapter 13 SofTec HCS12 Connection Chapter 14 HCS12 Serial Monitor Connection Chapter 15 Abatron BDI Connection Chapter 16 TBDML Connection Book III HC S 12 X Debug Connections Common Features describes the common connections available for debugging code Chapter 17 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Chapter 18 Debugging Memory Map Chap
191. E Configuring DA C IDE for Freescale Too Kit 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 contains options which establish project directories Figure 9 1 DA C Project Options Window Directories Tab 252 Project Options 2 x Directories File Types Names Manager Miscellaneous Project root director Browse Reeferential project root directory Browse Database directory User Help file CAHIWARE PROG H itools hip Browse Project Root Directory This text box determines the project root directory In our case enter a single dot to specify that the same directory in which the project file resides is the root directory All project files are considered relative to the Project root directory if the full file path is not given You can also enter the full file path if desired Referential Project Root Directory For the purposes of this project leave this field empty If used this text box specifies an alternate Project Root Path for locating files not found in the origina
192. E command To do this 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 Run the Debugger and in the Service field in the DDEClient type HI WAVE 2 In the Topic field type Command 3 Push the Connect button of the DDEClient The following message appears in DDECLient Connected to HI WAVEICommand S12 X Debugger Manual 701 Debugger DDE Capabilities DDE Implementation 4 In the Exec field of DDECLient type a Debugger command for example open recorder and click the Exec button The command executes by way of DDE and you ll see a new recorder component in the Debugger NOTE You can disconnect the DDE in the Debugger You can start the Debugger 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 702 S12 X Debugger Manual Index Numerics 16 Bit Modulus Down Counter 314 315 16 bits Break Module User Mode 494 22 bits Break Module User Mode 495 A A 405 510 Abatron BDI Connection windows 391 Highlights 381 Requirements 381 Setup Dialog 392 Terminal Emulation with BDI 393 Abatron BDI menu Bus Trace
193. E 602 WATT ite lent inn od int pRi UU QU pU A Nn 603 oA S E eee IPIS SUL e REIR E REQRUS PLURI UR eo Segara D DR ER ae Ug 605 WHILE 55 wide edness eed wee ASA dee hee tied 605 MN Eae tur ea erga data RA PUR a lider ota sta Rice tuba b e tlg e 606 WW ios E e dee V Kr eee en aes ir 607 ZOOM isset ie ee PE see bone E HER LEER DR RES are 607 SETSIGNALFILE Command eeeeeeeeeeeeeeeh 608 CLOSESIGNALFILE Command seeeeeeeeeeeeeeee 609 CONNECT 7 ex aw aod ori acre d pe RE ou nate teeta cce 610 DISCONNECT rni c t neret eR EE Re 610 CONNECT STATE i vt RERO E SOR S COENA SE 610 T lt time gt Test mode ecce vic luu ld ee ES 611 Target targetname sse 611 SW Wait mode 62 000 tes euge pP Een 611 Instance currentTargetName 0 0 ccc 612 Prod lt fileName gt 1 0 cette nes 612 Nodefaults 2 cee esha IR IR EE ed A See dots 612 Cmd lt Commiand gt ts e beset iene bole bes taste Dae a 612 S12 X Debugger Manual 15 Table of Contents C lt emd Files iis aes a ils Sees eee a DURER 613 ENVpath Env Environment Variable Variable Setting 613 23 Connection Specific Commands 615 Abatron BDI Connection Commands eee ese 615 BDU iore reete sess rboepUiopbUxriseePidebUiSsek ete 616 PROTOC Ob xis uu Ee eie eA t Ex eS ee oh bu 616 RESET 5e nee REUS IRE EINE Re 617 NVMC Commands lud ger RR Re RR RR ee alas 617 FLASH 5 eR ee ie pn tee e egets 618
194. EK Kernel Awareness 202 ORTI File Structure The ORTI file structure builds on the structure of the OSEK OIL file It consists of the following parts Version Section describes the version of the ORTI standard used for the current ORTI file mplementation Definition Section describes the proper method for interpreting the data obtained for the value This section may also detail the suggested display name for a given attribute Application Definition Section contains information on all objects currently available for a given system This section also describes the proper method for referencing or calculating each required attribute Supply this information either as a static value or as a formula to calculate the required value OSEK RTK Inspector Component This section describes the OSEK RTK Inspector component Open the Inspect window by selecting Component Open and clicking on the Inspect icon in the Open Window Component window CodeWarrior RTK Inspect Window When you select the RTK components icon in the hierarchical content of the items the right side displays a variety of information about OSEK Awareness The OSEK RTK Inspect Window provides access to all this information The ORTI file definition groups objects of the same type so they can be viewed together The following object types are accessible through the Inspect window Task Stack SystemTimer Alarm Message The following sections desc
195. ET 558 Gao ete tbeiwd Bebb tesa Tee des Sede Pan peat AFER ERES 558 GO e vk ee EE LP REC CER Ue oe boas be eds 559 GOTO essei pee Ge rue EFC MER ER eS 559 GOTOIE 21 sued ee aa d db ee e EO ERA UAE 560 GRAPHICS lesuey Rv LIS UR RO ERE D e E er NUS 561 HEBEEBZ eec Per PR TREE E Sip 561 S12 X Debugger Manual 13 Table of Contents 14 ICDIQZEXE HELP i rSv pane bebe aged ee aes Fehon 562 IE Laid lal alts aoe arrest IDEE Uto ER ace RU p acy RR EROR REG 562 INSPECTORQUTPUT co cc hd A RI erm er REPERI 563 INSPECTORUPDATE 4 RERO ER ERR REESE ER ERR 564 E UE 564 LOAD zer6enzce evel RAM NER e EEFERT ELE ES 565 LOADCODE uem a sets ee es Sia es REN RR 567 LOADS YMBOLS eges eas Leah Ee xe 567 LOG Bice hs Be e qe Et o mea aha ates ta eens Boa eS 568 jc E are taste a eae 572 MEM iiss i iota vis carte sete RT BURNER aed wea gute be 573 MS 5 doe ut DEP sea a AREE EORR Ue ao ae etree a WU eet toate states Wes 574 NB 22 Spend HEUS t premi ra ah bee DRE eter petet 575 NOGCR ean en vnde ao oe ary Raid wei ac 577 lop bebe awit die E es ye ee gee eck die ete 577 OPEN cscs tives Gets bb cee tie ed een dg REPE Id ig e e eg 577 OUTPUT 3 stein sos ite Ata Se eet tite he dite ed 578 Pe ies Ske ead Ae ie bh tts cass A d et i e x OU ART CLP E URS 579 PAUSETEST s khkeetzbeE RR e RUP RU eR eR 580 PRINTE reb ena id ane S MEET ERE HE IRR 580 PTRARRAY luin ranea Co ae RE AA eder PEE 581 jb 581 RECORD usse nort Deere ttes gent ddp 582 REBEAT
196. Engine Commands Debugger Commands 518 NAMEWIDTH width Equivalent Operations ATTRIBUTES FORMAT Select menu Data gt Format ATTRIBUTES MODE Select menu Data gt 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 Select menu Data gt Mode gt Periodical ATTRIBUTES COMPLEMENT Select menu Data gt Format ATTRIBUTES NAMEWIDTH Select menu Data gt Options gt Name Width Example Data 1 lt ATTRIBUTES MODE FROZEN In Data 1 global variables variables update is frozen mode Variables do 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 WORD 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 ADR ON or OFF displays or hides the address in front of the memory dump lines ASC ON or OFF displays or hides the ASCII dump at the end of the memory dump lines ADDRESS 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 scroll t
197. F FPROT all protection disabled wb 0x105 0x30 clear PVIOL and ACCERR in FSTAT register ww 0x108 OxD000 write to FADDR address register ww O0x10A Ox0000 write to FDATA data register wb 0x106 0x41 write MASS ERASE command in FCMD register wb 0x105 0x80 clear CBEIF in FSTAT register to execute the command wait 20 wait for command to complete mass erase eeprom wb 0x110 CLKDIV set ECLKDV clock divider wb 0x114 OxFF EPROT all protection disabled wb 0x115 0x30 clear PVIOL and ACCERR in ESTAT register ww 0x118 0x0400 write to EADDR eeprom address register ww Ox11A 0x0000 write to EDATA eeprom data register wb 0x116 0x41 write MASS ERASE command in ECMD register wb 0x115 0x80 clear CBEIF in ESTAT register to execute the command wait 20 wait for command to complete reset reprogram Security byte to Unsecure state wb 0x100 CLKDIV set FCLKDIV clock divider wb 0x103 0 FCFNG select block 0 wb 0x104 OxFF FPROT all protection disabled wb 0x105 0x30 clear PVIOL and ACCERR in FSTAT register ww OxFFOE OxFFFE write security byte to Unsecured state 488 S12 X Debugger Manual wb 0x106 0x20 wb 0x105 0x80 wait 20 reset FLASH MEMMAP undef CLKDIV Unsecure HCS12 Derivatives Unsecure Command File write MEMORY PROGRAM command in FCMD register clear CBEIF in FSTAT register to execute the command wait for com
198. Figure 17 40 Trigger Module Settings Window General Settings Tab Trigger Module Settings Trigger settings Expert tiggers General settings DBG On Chip Debug Module Setup v Automatically analyze the FIFO content Disarm automatically the module when the debugger stops Protect DBG FIFO content from unexpected reads IV When starting automatically step if a trigger is set at PC address otherwise warn DBG Module address hex 20 Derivative First Vector adi hex FF80 Table 17 14 On Chip Debug Module Setup Options Option Description Automatically When debugger halts with Trace component window open analyze the FIFO debugger analyzes DBG module results and displays them in content Trace window If Trace window is closed DBG user interface performs no result analysis except trigger flags reported in status bar Clear to limit analysis to reporting trigger flags in status bar even when Trace window is open Disarm Target processor halt due to user break not trigger leaves on automatically the chip DGB module armed Check to disarm on chip DGB module module when the on halt to retrieve data from DBG FIFO If clear DBG FIFO buffer debugger stops information cannot be retrieved until module is disarmed 446 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trace Component Window Table 17 14 On Chip Debug Module Setup Options Option Description
199. GE 0xC000 OxFFFF Ox3F REMAP 22BITS RANGE 0x4000 Ox7FFF Ox3E REMAP 22BITS RANGE 0xC000 OxFFFF Ox3F The following sections describe each variable available for the Target Interface The variables are listed in alphabetical order HWBPD MCUIDnnn BKPT REMAPn Description The HWBPD MCUIDnnn BKPT REMAPn variable specifies a command file definition using HWBPM RI EMAP22BITS Command Line command The variable name depends on the derivative MCU ID and on the remapping range number Those variables are used to store the current Hardware Breakpoints Module remapping settings specified with the HWBPM REMAP22BITS Command Line command Syntax HWBPD MCUIDnnn BKPT REMAPn one HWBPM REMAP22BITS Command Line co 692 mmand gt S12 X Debugger Manual Connection Specific Environment Variables On Chip Hardware Breakpoint Module Environment Variables Default Defaults settings are retrieved according to the derivative from a common ini file Example HWBPD_MCUID3C6_BKPT_REMAPO HWBPM REMAP 22BITS RANGE 0x4000 Ox7FFF 0x3 Ei HWBPMn Description The HWBPMn variable specifies the configuration of the Hardware Breakpoints module using HWBPM Command Line command Three entries appear in the project file Those variables are used to store the current Hardware Breakpoints Module settings specified either with the HWBPM Command Line command or through the Hardware Breakpoint Configuration dia
200. GRE RR Sak tee eA e AA ESI MENS 537 GR pu 537 12 S12 X Debugger Manual Table of Contents CYCLE DIEA see elias Lee ile ee ah bs fos ad th 538 DASM zu eceREDDePRAeReenERER ae UR ub era N CRIR eee ad BO 538 Em 540 DDEPROTOCOL k as m key eR eae essa ER 541 DEFINE x vue Robb PS e od tau axe ED E Vetus 542 DETAILS 4 2 odetoe b cDerpdteetex verset oeUts in pM 543 DEG xu ax ub Cu AURA EE e Ree a eA RR LE 544 DUMP x AE Cae RR UD uS ui S CI 545 DW iue eb gode ao e OD REPRE POUR OO PNE ae aave RR E inal RESO 545 jl E 547 EESES ctr EEERIECUQNONME SORORE SR S 548 ELSEIF boeno a E sued US ake ope oes Dee waite ERES 548 ENDEOCUS tbERRRERRERAMEEHER Et mei edes 549 ENDEOR ERR mee oe sie le reae de 549 ENDIE eee rese en NU E 550 ENDWHIBE 7 cit esate CREW EEERUEEY WtiquenbbT e MEN eh 550 EXECUTE LL r ar MEINE entree 551 EXEE ix etie puse VERE eee aa ie DP BUE 551 EXPAND eek EIER ed ate ERI U A Hey ela Saeed eae ATE 552 Peet nee eRURRDPHeLURMRREP TRI wigan ed die PEE 552 FILTER utu da ei ERE Re Re be b Mace tamem a ate 553 EIN DD 4x telecast de ame ae SU LUCR IEEE 553 EINDPROG be ttr sche tne PEReeeEQq eee I ERSNEBREFG Qr Lee ed 554 EOCU Sr esL EIU E reda ceu Rue e 555 FOLD 2 RATES PR eU IR aes 555 FOND cad RE rene aedes ed al ede PRU Foe qn ea 556 FOR ootate Paco eee ape Medea DES he ee nepote beste 556 BPRIN TE usce eere e endo E RE NUES RETE EE 557 FRAMES ene Beata ed oa EN Ned UC
201. ICD 12 connection from within an existing project take the following steps 1 From the Debugger main menu select Component gt Set Connection as shown below Figure 6 7 Component Menu E Source Winc Open een Fonts Background Color The Set Connection dialog box now appears Figure 6 8 Set Connection Dialog Box Connection Menu Set Connection Processor JHC12 Connection Full Chip Simulation Abatron BDI HCS12 Serial Monitor C Program Files Freescale CodeW armor for 2 Within the Set Connection dialog box click 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 The Connection menu selection P amp E Multilink Cyclone Pro loads the proper drivers and other things for the connection 4 Inthe Debugger Main window the Connection heading has been renamed HC12MultilinkCyclonePro Click on this heading to display its menu with the list of possible selections 214 S12 X Debugger Manual How To Switching Connections Figure 6 9 HC12MultilinkCyclone Pro Menu ues an Ml eee COmMpoM Load Ctri L Reset Ctri R Setup Select Derivative Command Files Help The menu selection HC12MultilinkCyclonePro 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 sele
202. KOMBH Mask high byte 1st adr BKP1 hex max x3FFFFF o BKOMBL Mask low byte 1st adr BK1MBH Mask high byte 2nd adr BK1MBL Mask low byte 2nd adr BKORWE RAW Cmp Enable 1st adr BKORW RAW Cmp Value 1st adr I BKIRWE RAW Cmp Enable 2nd adr BKIRW RAW Cmp Value 2nd adr Cancel Help BKPCTO I BKEN Breakpoint Enable BKFULL Full Breakpoint Mode Enable BKBDM Breakpoint BDM Enablz BKTAG Breakpoint on Tag You can modify the following registers BKPCTO Breakpoint Control Register 0 BKPCT1 Breakpoint Control Register 1 BKPO Breakpoint Address Register BKP1 Breakpoint Data Register For more information about these registers refer to your MCU reference manual CAUTION When a hardware breakpoint or watchpoint is set in User controlled mode the ILLEGAL BP message appears in the status bar when the breakpoint or watchpoint is reached If the control point set is a breakpoint you must perform a single step before running again otherwise the target endlessly breaks on the same address bus access 496 S12 X Debugger Manual Book IV Commands and Environment Variables 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 defines the HC12 HCS12 and HC S 12 X commands used by t
203. M is fully blank checked Ifthe 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 Compliance and RAM Moving NVMIF2 format new FPP drivers can be relocated in RAM This format for HCS12 devices is based on PIC code runtimes Therefore the NVM handling runtime can be moved in RAM if necessary First you must type the FLASH command in a Command window to verify that the FPP file is NVMIF2 Execute the FLASH NVMIF2WORKSPACE to relocate the driver workspace in RAM according to an eventual user specified RAM relocation using INITRM set up with a debugger WB command See NVMC Commands 482 S12 X Debugger Manual Flash Programming Hardware Considerations This provides more flexibility for EB386 Example 1 Layout device RAM memory relocation However if the application itself performs the relocation using FPP relocation has no effect as programming is performed with the default location of the RAM CAUTION The FPP files drivers do not support HCS12 on chip Registers block moving from default reset position HCS12X Emulated EEPROM Currently the debugger does not support handling of these memory types Legacy Flash Programming Commands in Preload and Postload Command Files The legacy Flash commands created by the project wizard to program an applicati
204. M offsets internal range addresses NOTE The debugger does not poll the MER registers while running Also the debugger performs remapping only on factory defined memory range not on user defined memory ranges Execute the DMM HCS12MERHANDLINGOFF command to disable the MER Registers tracking Execute the DMM HCS12MERHANDLINGON command to re engage this feature S12 X Debugger Manual Debugging Memory Map CPU Core Priorities and Types NOTE Factory default setup protects the HCS12 DBG12 FIFO Registers to reserve DBG12 FIFO Reading for the debugger DBG interface Removing this protection causes 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 refer to device specifications RAM memory block refer to device specifications EEPROM memory block refer to device specifications On chip Flash EEPROM refer to device specifications Remaining external space 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 legacy replaced by physical memory type with Write Only access kind Writ
205. Markpoint Show Markpoints v Automatic trig Open Source File Copy Ctrl C Figure 17 17 Source Window Extended Menu S12X breakpoints watchpoints and trac Expert triggers through Expert triggers property page trace possible Profiling and coverage no triggers trace not possible Disabled manual use of on chip trigger module with trace possible Context Menu Entries possible True Time Simulator amp Real Time Debugger D Wrofiles SKrylovWMy Documents Project_20 PGE_Multitink_CyclonePro ini Fie View Run inDART HCS12 Component Source Window Help Jajal me Birt o sz 9 BELICE miiy HCI2 man FE8021 ANDCC 239 FE8027 CLRX FE8029 INCU FESO2D LDO FE8030 PSHX FE8031 CALL FE8035 STD Disabled marsal use of on chip trigger module with trace possible User Triggers trace possible no automatic breakpoints and watchpoints Data 1 fiboCount counter S12 X Debugger Manual 0x2102 0x2102 0x8000 0xFE 0x2100 CCR SXHINZVC RPAGE FD 415 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms DBG Support Status Bar ltem DBG Support Status Bar Item A specific DBG support debugger status bar item appears as soon as the debugger target processor features the DBG module Clicking on this item opens the Trigger Module Settings window Figure 17 18 Status Bar Item For Help press F1 Automatic triggers breakpoints watchpoints and trace
206. ND ELSIFPart ELSIF BoolExpr THEN StatSequence ELSEPart ELSE StatSequence String char BoolExpr Expression RelOp Expression Expression Term Op Term Term Ident Function Number Ident a z R00 R31 DL SP SR PC STATUS Bi Function MB Mw MD MA Expression RelOp ret ten tat tsa Op y roo 196 S12 X Debugger Manual Real Time Kernel Awareness Application Example Table 5 1 shows the terminal symbol meanings Table 5 1 Terminal Symbol Meanings Terminal Meaning Symbol B Given reference to the task descriptor initialized upon start a z Variables for intermediate storage MB Retrieves value of memory BYTE at given address MW Retrieves value of memory WORD at given address MD Retrieves value of DOUBLE WORD at given address MA Retrieves value at given address interpreted as DOUBLE WORD PC Program counter to be set SP Stack pointer to be set SR Status register value to be set DL Dynamic link data base to be set if not available same as SP STATUS Error number to be set refer to manual Rnn Processor registers to be set mapping to CPU registers see manual MSG Error message must be specified if N gt 1000 On activation of the task debugging command the file OSPARAM PRM opens and stores the selected address in variable B Then the comm
207. NVMC Dialog Box The NVMC dialog box lists all the Flash or EEPROM modules of a CPU derivative Depending on the derivative there may be one or multiple on chip Flash modules EE FY NOTE The dialog box does not have a Select or Deselect button as you merely click on a module in the list to select it Selecting and deselecting are not automatic from the command line Before you use the command line to perform any operation on a module you must use the SELECT command to select the module Figure 19 6 Non Volatile Memory Control Dialog Box Non Volatile Memory Control r Configuration File D tested slave Prog FPP mcu03CF fpp Browse IV Auto select according to MCUID O0x03CF MCU speed 8 03 MHz Save and restore work space content End Select All FLASH 4000 00004000 00007FFF Enabled Blank 00008000 000 Enabled Programmed Enable FLASH C000 0 d T Enabled Pro TENE Enabled Programmed Unprotected Disable ASH PAGE2 0 00 00028 i ned r Madules 8 Enabled Programmed 00058000 O005BFFF Enabled Programmed Unprotected Une 00068000 O006BFFF Enabled Programmed DOO7BFFF Enabled Programmed Unprotected EEPROM 00000800 Disabled Ime Enabled Programmed Unprotected Protect p t Cancel S12 X Debugger Manual 471 Flash Programming NVMC Graphical User Interface For each block the dialog box has a line composed of the following fi
208. O is full Begins recording program flow information when trigger condition match occurs and halts processor debugger when capture buffer is full Start recording after trigger hit and DO NOT halt when the FIFO is full Begins recording program flow information when trigger condition match occurs Does not halt processor debugger Data Recording Options Use the data recording options with Capture triggers Select these options from the list box in the Trigger Settings tab of the Trigger Module Settings window Figure 17 23 Table 17 5 shows the available data recording options S12 X Debugger Manual 423 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 23 Data Recording Control 424 Trigger Module Settings Trigger settings Expert triggers General settings Capture the read write values at Address B Address B 0x0500 Memory R W Access Modify Trigger B Halt when fifo is full FIFO Normal mode Halt when fifo is full F E Do not halt when fifo is full ede The trigger address is typically not a program code address program counter but rather data address The DBG module halts the processor debugger on trigger condition match Cancel Help Table 17 5 Data Recording Options for Capture Triggers Option Description Halt when the FIFO is Continuously records data accesses and halts processor
209. ON or OFF displays or hides the marks NOTE Also refer to SMEM SPC SPROC and SMOD command descriptions for more detail about these commands Equivalent Operations ATTRIBUTES SPC Drag and drop from Register component to Source component ATTRIBUTES SMEM Drag and drop from Memory component to Source component 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 Marks Usage ATTRIBUTES list where 1ist command command command SPC address SMEM range SMOD module without extension SPROC numberAssociatedToProcedure MARKS ON OFF Example in gt Source lt ATTRIBUTES MARKS ON Marks are visible in the Source component window In the Data Component The ATTRIBUTES command allows you to set the display and state options of the Data component window FORMAT selects the format for the list of variables The format is one of the following binary 516 S12 X Debugger Manual Debugger Engine Commands Debugger Commands octal hexadecimal signed decimal unsigned decimal symbolic DE selects the display mode of variables Automatic mode default updates variables when the target stops Variables from the currently executed module or procedure appear in the data component In Locked and Frozen mode the same vari
210. OR Frame Address Data Instruction 02 Trace Operations Pointing at a frame and dragging the mouse forces all open windows to show the corresponding code or location All other frames evaluate time and cycles relative to this base Holding down the left mouse button and pressing the Z key sets the zero base frame to the selected frame Holding down the left mouse button and pressing the D key forces all open component windows to show the code matching the selected frame Trace Menu The Trace menu shown in Figure 3 84 contains the functions described in Table 3 47 The exact content of the Trace menu can vary depending on the connection and derivative 130 S12 X Debugger Manual Debugger Components General Debugger Components Figure 3 84 Trace Menu v Textual Graphical Instructions Items Dump Go to Frame Enabled Records memory accesses Clear Table 3 47 Trace Menu Description Menu Entry Description Textual Displays window contents in text Graphical Displays window content in graphical format Instructions Displays instructions in window Items Specifies the window display items Dump Selects a file to dump or a range of frames to dump Go to Frame Searches for specific frame Enabled Disable or enable tracing function Records memory accesses Enables recording of memory accesses Clear Clears the trace comp Associated Context Menu The Trace
211. OSx 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 Stimulate 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 the OP SetValue RegisterBlock PORTTBit5 amp parameter NO UPDATE function with parameter n 0 1 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives 16 Bit Modulus Down Counter Table 10 24 shows the simulated registers and fields of the 16 bit modulus down counter Table 10 24 16 Bit Modulus Down Counter Related Registers Register Full Register Name Simulated Acronym Fields MCCTL 16 bit modulus down counter control register All bits except ICLAT MCCNT Modulus down counter count register All Capture Compare Timer TIOS Timer input capture output compare select All CFORC Timer compare force register All TCNT Timer count register All TCTL1 TCTL2 Timer
212. P S12X Platforms Trace Component Window Clearing Frames Selecting Clear in the Trace window context sensitive menu flushes the frames in the Trace window It also flushes the database in the background DBG Module FIFO Buffer Display This menu entry toggles between Display DBG FIFO data and Display program flow Selecting Display DBG FIFO data in the Trace window contest sensitive menu displays data information retrieved from the on chip DGB module FIFO buffer Selecting Display program flow in the Trace window context sensitive menu reverts the display back to the code program flow The following columns appear in the Display DBG FIFO data window FIFO Depth This is a number representing the depth in the DBG FIFO of the word data value The first frame Depth 1 is the oldest value DBG FIFO Data This is the word value retrieved from the DBG FIFO buffer from DBGFH and DBGFL DBG on chip module registers Figure 17 47 Trace Window FIFO Display Show Location v Textual Graphical Instructions Items Dump Go to Frame Clear Display program Flow Open Trigger Settings Dialog Recorded Data Display Using Capture triggers automatically activates this display mode The following columns appear in the Recorded Data Display window FIFO Depth A number representing the depth in the DBG FIFO of the byte data value The first frame Depth 1 is the oldest value Data value The byte value retr
213. Preferences Window Load Tab Preferences Environment Load V Automatically erase and program into FLASH and EEPROM To specify affected memory block click here Advanced Advanced Options Erase Prevention Clicking the Advanced button in the Load tab of the debugger Preferences window opens the NVM Programming Selection list box 468 S12 X Debugger Manual Flash Programming Automated Application Programming Figure 19 4 NVM Programming Selection List Box NVM Programming Selection Please select in the list below the modules you do NOT want to be automatically erased before programming FLASH_4000 FLASH_COO0 PAGED EEPROM C00 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 the line again deselects it Erasing is skipped for all selected modules If all modules are selected the debugger simply programs the application without erasing non volatile memory on the device CAUTION The debugger ignores pre programmed modules and the user is responsible for reprogramming limitations risks and impossibility However the debugger displays a warning message when a programmed i e not blank not automatically erased module is going to be written You can disable the displayed warning message TIP When available on chip EEPROM type mo
214. Program Page 64 PPAGEs on MC9S12XEP100 slows down the programming As aresult only relevant on chip Flash blocks have their own listed module The list below gives an overall availability for all HCS12 and HCS12X devices 480 S12 X Debugger Manual Table 19 6 HCS12 and HCS12X Module Usage Flash Programming Hardware Considerations Module Name Range Comments FLASH_4000 On chip Flash in 4000 Provided to allow you to design non 7FFF banked code such as ISR code or Mirror of PPAGE 3E on startup code HCS12 devices and FD on HCS12X devices FLASH C000 On chip Flash in C000 Provided to allow you to design non FFFF banked code such as ISR code or Mirror of PPAGE 3F on startup code and vectors HCS12 devices and FF on HCS12X devices ALL PPAGES The entire on chip Flash Erasing this module also erases previously memory FLASH 4000 and FLASH C000 PAGED modules FLAT8000 Pxx or FLASH 8000 HCS12X and EEPROM 800 HCS12X 4000 to FFFF Reset default page Pxx visible in 8000 BFFF may vary from one HCS12 device to another and be the same as the 3E PPAGE on HCS12X devices Allows you to design linear source code to be programmed from address 4000 to FFFF Use to evaluate a 48 Kilobyte application across several devices although you may not have full control of current PPAGE If PPAGE changes by program CALL or by accidentally writing the PPAGE register program code stored
215. Protocol functionality on or off and report all the messages sent to and received from the debugger in the Command Line window of the debugger You can switch the Show Protocol facility on or 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 Syntax PROTOCOL ON OFF Example PROTOCOL ON NOTE Use Show Protocol to assist when debugging communication problems S12 X Debugger Manual Connection Specific Commands NVMC Commands RESET Description Use this command to reset the target board from the Command Line component of the debugger This command executes the Reset Command File and the BDI interface automatically processes the initialization list startup init list stored in the interface Syntax RESET Example RESET NVMC Commands Issue the following Flash Commands through the debugger Command component window as shown in the figure below Figure 23 1 NVMC Commands In Command Window Command in gt FLASH FLASH parameters loaded for M68HC912DG128 from G HC12_D PROG FPP mcu03C4 fpp MCU clock speed 8019000 Module Name Address Range Status FLASH_4000 4000 7FFF Enabled Programmed Unselected FLASH PAGEO 8000 BFFF Enabled Blank Unselected FLASH_COO0 cooo FFFF Enabled Programmed Protected Unselected FLASH PAGEl 18000 1BFFF Enabled Programmed
216. R A fa Assembly lt 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 Current 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 10 shows a typical component window display Figure 2 10 Typical Component Window Display SIE TTE OER D Profiles b1 381 S My Documents project2 ources main c include hidef h common defines and include mc9s12dp256 h deriv pragma LINK INFO DERIVATIVE mc9s12dp256b void main void 0 put your own code here EnableInterrupts for BH wait forever please make sure that you never B Figure 2 11 shows a component window without a title and headline 34 S12 X Debugger Manual Debugger Interface Debugger Main Window Figure 2 11 Component Window without Title and Headline return fibo a void main void Figure 2 12 shows a component window without a title and headline and with a small border Figure 2 12 Component Window without Title and Headline and with Small Border i 2 while i a fibo fibl fib2 a fibl fib2 fib2 fibo iw a return fibo a void main void v juil gt Figure 2 13 shows a component window without headline and small border Figure 2 13 Co
217. RAW Compare Enable BDM Dual Ad BK ALE B BKORW RAW Compare Value Cancel Help You can modify the following registers BRKCTO Breakpoint Control Register 0 BRKCT1 Breakpoint Control Register 1 BRKA Breakpoint Address Register BRKD Breakpoint Data Register For more information about those registers refer to your MCU reference manual section Breakpoints of the Background Debug Mode Development Support part of the manual CAUTION When you set a hardware breakpoint or watchpoint in User controlled mode the ILLEGAL BP message appears in the status bar when the breakpoint or watchpoint is reached If the control point set is a breakpoint you need to perform a single step before running again otherwise the target endlessly breaks on the same address bus access 22 bits Break Module User Mode The 22 bits Break Module User Mode index tab allows you to set up the hardware breakpoint module of the connected HCS12 derivative when the Breakpoint Module mode is set to User controlled and the Breakpoint Module Kind is set to use 22 Bits Break Module S12 X Debugger Manual 495 On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog Figure 21 5 22 bits Break Module User Mode index tab Hardware Breakpoint Configuration Break Module Settings 16 bits Break Module User Mode 22 bits Break Module User Mode BKP fhex max Ox3FFFFF E BKPCT1 B
218. READSIZE lt front size when halted gt lt back size when halted gt lt front size when running gt lt back size when running gt For detailed descriptions of the available DMM commands see DMM Commands 466 S12 X Debugger Manual 19 Flash Programming Writing to Flash modules EEPROMs or other non volatile memory modules requires special algorithms 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 chapter explains The Non Volatile Memory Control NVMC utility an extension component that lets you control the on chip Flash devices for all Debugger connections 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 can program an application without making use of the NVMC dialog GUI which remains useful for specific operations only Currently CodeWarrior projects created with the wizard may be programmed or flashe
219. RM AD 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 see MC65HC912DA128 MC68HC912DG128 16 Bit Microcontroller Technical Summary MC68HC912DA128TS D 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 S12 X Debugger Manual 313 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives 314 Memory Expansion Register The system fully simulates this mechanism within CALL and RTC instructions for banked memory model Related Register Program Page Register PPAGE PIX2 PIX1 PIX0 bits memory defined but NOT updated Enhanced Capture Timer The 16 Bit Modulus Down Counter is fully simulated and contains the following Eight Input Capture Output Compare channels AII channels are non buffered and identical except channel 7 with TCRE Timer Counter Reset Enable also implemented PORTT pins Configure individually as standard parallel port I O pins or as timer pins For standard parallel I O pins reading and writing are transparent behaving like reading writing in typical RAM For this configuration assign the value 1 to the channel x bit I
220. RON AG including the BDI HS on CPU12 and HCS12 and the BDI1000 on the CPU12 HCS12 and HCS12X cores 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 Check the technical specifications provided by the ABATRON User Manuals and Freescale Communicating with the BDI interface requires one free serial communication port of your computer You may need to set it up even if you use Ethernet communication instead of an RS 232 serial communication S12 X Debugger Manual 381 Abatron BDI Connection Abatron BDI Connection Introduction Abatron BDI Connection Introduction Use the Abatron BDI Connection to load different connections which implement the interface with target systems This section 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 for execution You also have the feedback of the real target system behavior to the debugger The debugger supervises and monitors the target system MCU i e controls program execution You can read and write in internal external memory even while the application is running single step run stop the application and set breakpoints and watchpoints in the code Interfacing Abatron BDI and Your System NOTE BDI Str
221. Register SClOutputH Description Receives a character sent from the SCI Contains the ninth bit associated with SCIOutput Write access to SCIOutputH has no specified meaning Bit 0 ninth bit sent from SCI Seriallnput Alias for SCIInput register SerialInput connects SCI to terminal window Ninth bit is not supported Read access to SerialInput has no specified meaning Bit 7 0 data sent from terminal window to SCI SerialOutput Alias for SCIOutput register SerialOutput connects SCI to terminal window Ninth bit is not supported Write access to SerialOutput has no specified meaning Bit 7 0 data sent from SCI to terminal window Serial Peripheral Interface Table 10 6 details the simulated Serial Peripheral Interface SPI registers Table 10 6 Simulated SPI Registers Register Full Register Name Simulated Fields Acronym SPICR1 SPI Control Register 1 SPIE CPOL SPE CPHA MSTR LSBFE SPICR2 SPI Control Register 2 SPISWAI SPCO SPIBR SPI Baud Rate Register SPPR2 0 SPR2 0 SPISR SPI Status Register SPIF MODF SPTEF SPIDR SPI Data Register SPIDR7 0 Registers not Mapped to Memory Table 10 7 shows the registers that are not mapped to memory S12 X Debugger Manual 287 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 7 SPI Registers not Mapped to Memory SPIValue Sends and receives swaps a character from an
222. S 12 X Derivatives Table 10 21 defines the Key Wakeups Table 10 21 Key Wakeups S12 X Debugger Manual Acronym Full Name Implemented Meaning PORTD Port D Register Implemented DDRD Port D Data Implemented Direction Register KWIED Port D Interrupt Implemented Enable Register KWIFD Port D Flag A falling edge on the associated pin sets each flag Register provided that corresponding DDRD Register bit is reset Clear flag by writing 1 to corresponding bit of 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 corresponding DDRH Register bit is reset Clear flag by writing 1 to corresponding bit of 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 corresponding DDRJ Register bit is reset Clear flag by writing 1 to corresponding bit of KWIFJ register KPOLJ Port J Polarity Implemented Register 309 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 21 Key Wakeups continued Table 10 22 Memory Mapped Page Registers 310 Acronym PUPSJ Full Name Po
223. SELIBPATH Using LIBPATH Environment Variable OBJPATH Object File Path 682 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 it first checks for an object file specified by this environment variable then in GENPATH see GENPATH include File Path and finally in HIPATH S12 X Debugger Manual Debugger Engine Environment Variables Environment Variables Example OBJPATH sources obj TMP Temporary directory Tools Compiler Assembler Linker Librarian Debugger Synonym None Syntax TMP directory Arguments directory Directory to use for temporary files Default None Description If a temporary file must be created normally you use the ANSI function tmpnam 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 that says Cannot create temporary file NOTE This is a system level global environment variable It CANNOT be specified in a default environment file DEFAULT ENV hidefaults Example TMP C TEMP See also The Current Directory S12 X
224. Sort submenus in Figure 3 29 Table 3 8 describes Data menu entries Figure 3 20 Data Menu 72 Data Window Zoom Scope gt v Automatic Periodical Format gt 5 Locked Options gt Frozen Sort gt Refresh S12 X Debugger Manual Debugger Components General Debugger Components Table 3 8 Data Menu Entry Description Menu Entry Description Zoom Zooms in or out of selected structure The member field of 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 data sort criteria Scope Submenu Activate the Scope submenu by highlighting the Scope entry on the Data menu v Global Local User External Figure 3 21 Scope Submenu Table 3 9 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 Data component Displays user defined expression variables are erased External Switches to Ext
225. TES ADR Select 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 S12 X Debugger Manual 513 Debugger Engine Commands Debugger Commands 514 Example Assembly lt ATTRIBUTES ADR ON SYMB ON CODE ON SMEM 0x800 16 This displays addresses hexadecimal codes and symbolic names in the Assembly component window and highlights assembly instructions at addresses 0x800 16 In the Register Component The ATTRIBUTES command allows you to set the display and state options of the Register component window FORMAT sets the display format of register values VSCROLLPOS 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 HSCROLLPOS 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
226. The debugger does not poll the MER registers while running The debugger performs remapping only on factory defined memory range modules not user defined memory range modules Syntax DMM HCS12MERHANDLINGON DMM HCS12MERHANDLINGOFF Description Completely disables DMM HCS12MERHANDLINGON Syntax DMM HCS12MERHANDLINGOFF DMM OPENGUI Description Opens the DMM Graphical User Interface Syntax DMM OPENGUI mcuid Arguments lt mcuid gt optional a part device MCUID value in range 0 S FFFF DMM SETAHEADREADSIZE Description Provides special debugger memory cache tuning in case of slow connection with hardware S12 X Debugger Manual 629 Connection Specific Commands Full Chip Simulator Commands Syntax DMM SEATAHEADREADSIZE front size when halted gt lt back size when halted gt lt front size when running gt lt back size when running gt Arguments lt front size when halted gt amount of bytes to read ahead of exact start of read block address when the hardware is halted lt back size when halted gt amount of bytes to read after the exact block of read addresses when the hardware is halted lt front size when running gt amount of bytes to read ahead of exact start of read block address when the hardware is running lt back size when running gt amount of bytes to read after the exact block of read addresses when the hardware is running Full Chip
227. Vppoff aS The Unsecure command file is executed to unsecure the connected derivative NcmdNP amp E Multilink USB erase unsecure hcs12 cmc Browse MV Enable Command File Cancel Listing 20 1 is an example of command file to unsecure an HCS12 derivative Listing 20 1 Example command file HCS12 Core erasing unsecuring command file These commands mass erase the chip then program the security byte to OxFE unsecured state Evaluate the clock divider to set in ECLKDIV FCLKDIV registers An average programming clock of 175 kHz is chosen If the oscillator frequency is less than 10 MHz the value to store in ECLKDIV FCLKDIV is equal to oscillator frequency kHz 175 If the oscillator frequency is higher than 10 MHz the value to store in ECLKDIV FCLKDIV is equal to oscillator frequency kHz 1400 0x40 to set PRDIV8 flag Datasheet proposed values S12 X Debugger Manual 487 Unsecure HCS12 Derivatives Unsecure Command File oscillator frequency ECLKDIV FCLKDIV value hexadecimal 16 MHz 49 8 MHz 27 4 MHz 13 2 MHz 9 1 MHz 4 define CLKDIV 0x49 FLASH MEMUNMAP do not interact with regular flash programming monitor mass erase flash wb 0x100 CLKDIV set FCLKDIV clock divider wb 0x103 0 FCFNG select block 0 wb 0x102 0x10 set the WRALL bit in FTSTMOD to affect all blocks wb 0x104 OxF
228. Warrior menu Select File gt New Project Select HCS12 HCS12D Family MC9S12DP256B derivative in HC S 12X Microcontrollers New Project window Select Full Chip Simulation connection and click Next to proceed Select C for the language and enter a project name like MyGuessTheNumber Change the directory if you want Location Set and click Next Add existing files to the project if required and click Next Select Processor Expert radio button from the rapid application developement options and click Next Select ANSI startup code Banked memory model and float is IEEE 32 and double is IEEE 32 and click Next 10 Select No for PCLint support and click Finish 340 This creates a new project with Processor Expert available Several windows are visible S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Figure 10 24 Created Project Freescale CodeWarrior Fie Edt Wew Search Project Processor Expert Window Help BEsEoe xX RGORAMA SRL BBR 2s Target CPU Cpu MC9S12A5128CPV PA Test mp oomen inv OS Flee Urk Orde Targets Processor xps MCSS1242256 112 MCSS12 A512 112 MCSGY24A2AE VA S HCI AE 0909124512 10 co2002 02 S uosiai Sucesos v seo 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
229. Window From the Connection menu choose Load to open the Load Executable File window shown in Figure 2 16 then set the load options and choose a Simulation Execution Framework an ABS application file S12 X Debugger Manual Debugger Interface Debugger Main Window Figure 2 16 Load Executable File Window Load Executable File CjProject Data Sources File name Files of type Executables abs elf v Cancel Advanced Commands Load Code Load Symbols Add Symbols Verify Code Open and Load Code Options jn Verify memory image after loading code E Cc Run after successful load r m Open Button Clicking this button loads the application code and symbols Advanced Commands Buttons These three buttons allow you to select which part of the executable file to load Load Code Button Loads only the application code into the target system Use this button if no debugging is needed Load Symbols Button Loads symbols only Only debugging information is loaded Use this button if the code is already loaded into the target system or is programmed into a non volatile memory device ROM Flash Add Symbols Button Loads additional symbolic information Appends the loaded debugging information to the existing symbol table instead of replacing it You can use this button if the executable file consists of several applications and code is already loaded into the target system or programmed into a no
230. Working on the Register 1 Point to a variable name in a Data Component 2 Click the variable name The start address and size of the selected variable appears in the Data information 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 drag a variable name from the Data Component to Memory component Holding down the left mouse button and clicking the A key Point to a variable name in a Data Component Hold the left mouse button down and click 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 Variable Address The Debugger allows you to load a register with the address where a variable is allocated Drag a variable name from the Data Component to Register component This updates the destination register with the start address of the selected variable Working on the Register This section describes working 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 context menu appears 2 Choose Options from the context menu The list menu containing the possi
231. X only v Record continuously FIFO Nomalmode 7 FIFO Normal mode Y FIFO LOOP mode Any tigger means Address or B or C of D Trace mechanism activated for the HCS12X core d A em The DBG module records change of flows until the condition is met o mode stopped This mode is used to trigger on any trigger address FIFO Normal and LOOPI modes record the change of flow allowing program rebuild while DETAIL mode only records data accesses In Pure PC mode the debugger decodes pure PCs only Table 17 13 describes the available data recording options Table 17 13 Data Recording Options 442 Option Description FIFO normal Continuously records data accesses Halts the processor mode debugger when capture buffer is full FIFO LOOP1 Continuously records data accesses Does not halt the processor mode debugger when capture buffer is full FIFO DETAIL Continuously records data access details Halts the processor mode debugger when capture buffer is full Pure PC mode Default recording mode when available Debugger decodes pure PCs recorded by module Does not perform program flow rebuild S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Trigger Sequence Control Select the Trigger Sequence control options from the list box in the Trigger Settings tab of the Trigger Module Settings window shown below You can also choose
232. able 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 Deleting a Watchpoint The Debugger provides three ways to delete a watchpoint Use Delete Breakpoint from Context Menu 1 In the Data window point to a variable where a watchpoint has been defined and right click The Data context menu appears 2 Select Delete Watchpoint from the context menu to delete the watchpoint and remove the vertical bar in front of the variable Use the Left Mouse Button and click the D Key 1 Point at a variable in the Data window 2 Hold down the left mouse button and click the D key This deletes the watchpoint and removes the vertical bar in front of the variable Choosing Show Watchpoints from Data Context Menu Point in the Data window and right click The Data context menu appears 2 Choose Show Watchpoints from the context menu The Watchpoints tab of the Controlpoints Configuration window appears 3 Select the watchpoint you want to delete 4 Click Delete This removes the selected watchpoint from the list of defined watchpoints 5 Click OK to close the window This deletes the watchpoint and removes the vertical bar in front of the variable 184 S12 X Debugger Manual Control Points Watchpoints Associate a Command with a Watchpoint You can associate each watchpoint type read write r
233. ables from a specific module always appear in the data component In Locked mode values from variables displayed in the data component update when the target stops In Frozen mode values from variables displayed in the data component do not update when the target stops In Periodical mode variables update at regular time intervals while the target runs The default update rate is 1 second but you can modify this rate up to 100 ms using the associated dialog box or UPDATERATE UPDATERATE sets the variables update rate see also UPDATERATE command SPRCC show procedure and SMOD show module display local or global variables of the corresponding procedure or module SCOPE selects and displays global local or user defined variables COMPLEMENT sets the display complement format of Data values one sets the first complement each bit is reversed none deselects the first complement NAMEWIDTH sets the length of the variable name displayed in the window NOTE Referto SPROC UPDATERATE and SMOD command descriptions for more de tail about these commands Usage ATTRIBUTES list where command FORMAT bin oct hex signed unsigned symb SCOP list command command B3 global local user external MODE automatic periodical locked frozen SPROC level SMOD module UPDATERATE rate COMPLEMENT none one S12 X Debugger Manual 517 Debugger
234. ached Code execution is NOT halted when the program reaches a markpoint Counting Control Point If the interval property is greater than one a counting control point has been defined When the Debugger is running every time code reaches the control point its current value decrements The Debugger halts when the value reaches zero When the Debugger stops on the control point a command executes if defined and enabled 192 S12 X Debugger Manual Control Points Halting on a Control Point Conditional Control Point If a condition is defined and enabled for a control point that halts the Debugger a command executes if defined and enabled Control Point with Command When the Debugger halts on the control point the specified command executes S12 X Debugger Manual 193 Control Points Halting on a Control Point 194 S12 X Debugger Manual Real Time Kernel Awareness The Debugger allows you to load and control applications on the target system or 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 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 any t
235. again 8 Choose Run gt Halt to stop execution after a few seconds The Analog instrument 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 this value and displays it in a speedometer like graphic The IO Show procedure in io demo c shown in Listing 10 3 this value is incremented or decremented depending on the raise direction The raise direction depends on a global variable dir that is returned when the top or bottom value is reached Listing 10 3 IO Show Procedure in io demo c static void IO Show void for 4 endless loop dig 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 j S12 X Debugger Manual 327 HC S 12 X Full Chip Simulation Connection True Time I O Stimulation Example Program with Periodical Stimulation of a Variable 1 Choose Simulator gt Reset 2 Choose Simulator gt Load Io_demo abs 3 Choose Component gt Open gt Stimulation Figure 10 22 shows the Stimulation component Figure 10 22 Stimulation Component Window cs Stimulation def a TargetObject 210 B 10000000 Activate Stimulation Window by clicking on it
236. akpoint or watchpoint Triggers Disabled Mode User makes trigger settings manually Debugger analyzes DBG module before and after the run to build up Status and Trace information but does not set up DBG module before running Requires advanced knowledge of on chip DBG module Use to set hardware breakpoints watchpoints and triggers User must handle trigger comparator addresses and DBG control registers through Memory component or by using command line commands without a dedicated GUI to access DBG module register Use selected flags within DBG control registers to enable or arm DBG module By default when debugger halts it automatically protects FIFO content from unexpected reads analyzes FIFO content and disarms DBG module user can disable this function Stopping an application does not reset DBG module nor does debugger set DBG module User Triggers Mode User must define trigger type Provides a 4 Stage Sequencer for trace buffer control List menu provides predefined sequences User can define their own sequences In this mode Debugger does not set triggers as watchpoints or breakpoints automatically Usercan define three triggers and their conditions Usercan use the Sequencer to decide how to stop the debugger Trace Setup Control Use the options made available in the Trace list menu of the Trigger Settings tab to set up DBG trace in the Trace component window S12 X Debugger Manual
237. al number equal to the maximum number of recorded frames This number must not exceed 1000000 Components SoftTrace component Example FRAMES 10000 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 specify the entry point of your program skipping execution of the previous code Usage G address When no address is entered the address in the program counter is not altered and execution begins at the address in the program counter Alias GO Components Debugger engine Example G 0x8000 558 S12 X Debugger Manual Debugger Engine Commands Debugger Commands Program execution starts at 0x8000 RUNNING appears in the status bar The application runs until a breakpoint is reached or you stop the execution GO The GO command starts code execution in the emulated system at the current address in the program counter or at the specified address You can therefore specify the entry point of your program skipping execution of previous code Usage GO address When no address is entered the address in the program counter is not altered and execution begins at the address in the program counter Alias G Components Debugger engine Example in gt GO 0x8000 Program execution starts at address 0x8000 RUNNING appears in the status bar The application runs until a breakpoint is reached or you stop execution GOTO The GOTO
238. all memory range modules is retrieved from the target hardware Syntax DMM CACHINGOFF S12 X Debugger Manual 627 Connection Specific Commands DMM Commands DMM WRITEREADBACKON Description Upgrades only the cached data in the matching memory location when the debugger writes data to a memory location For example if the debugger performs aWB 0x80 0x01 command the debugger reads back only the byte at address 0x80 and upgrades its internal cache This is the default behavior of the debugger Syntax DMM WRITEREADBACKON DMM WRITEREADBACKOFF Description Clears the cached data of the entire DMM range including this location when the debugger writes data to a memory location For example if the debugger performs a WB 0x80 0x01 command the debugger reads back the entire block of memory around the location You can use this legacy implementation to perform a live update on IO registers belonging to the same IO module although a Memory window Refresh operation is more relevant and keeps the default debugger setup Syntax DMM WRITEREADBACKOFF DMM HCS12MERHANDLINGON 628 Description Enables the handling of Memory Expansion Registers MER for HCS12 devices i e INITRM INITRG and INITEE The DMM automatically remaps memory range module addresses according to the real value of these registers when halting S12 X Debugger Manual Connection Specific Commands DMM Commands NOTE
239. als 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 6501 William Cannon Drive West Austin Texas 78735 U S A World Wide Web http www freescale com codewarrior Technical Support http www freescale com support Table of Contents Introduction Manual Contents 0 00 00 ccc
240. also perform this operation 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 gt Project gt File types as described in Configure File Types will be added to the project Build the Database Development Assistant for C provides the static code analysis of C source files and generates various data based on the results Results of the analysis of the project source files and individual program modules are saved in database files on the disk You can choose between the unconditional analysis of all project files using Start gt Build or analysis of changed source files only using Start gt Build database and Start Update database When analyzing changed files only you can optionally check modified include files used in program modules Data about global symbols usage resulting from analysis is saved in database files on the disk enabling their use later in DA C To build the database in our example use the 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 appear in the Messages window as shown in Figure 9 5 for Fibo c sample file Figure 9 5 DA C Message Window amp Messages OF x Analysis for Symbols BL CENT AEN INI Fibo c 38 Warning 3
241. always displayed in the data component Update Rate Dialog Box The Update Rate dialog box shown in Figure 3 25 allows you to modify the default update rate using steps of 100 ms Figure 3 25 Update Rate Dialog Box Update Rate Rate ii Cancel Options Submenu Activates the Options submenu by highlighting the Options entry on the Data menu Figure 3 26 Options Submenu Pointer s 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 76 S12 X Debugger Manual Debugger Components General Debugger Components Figure 3 27 Pointer as Array Dialog Box Pointer As Array v Display Pointer As Array Number of Items in Array 1 1000 Cancel Help 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 Figure 3 28 Edit Name Width Dialog Box Edit Name Width Name Width Cancel Help This dialog box allows you to adjust the width of the variable name displayed in the Data window Max
242. ame belongs to the register item then item s parent node is folded If the name belongs to group of registers then module or board item item s own node is folded If the name is empty then all nodes are folded Components MCURegisters component S12 X Debugger Manual Debugger Engine Commands Debugger Commands Example MCURegisters lt collapse mc9s08dv60 This command folds the root node in the register tree view This node contains the name of the board so all the module items are folded COM_START Description Creates a new Hiwave Instance Only one new Hiwave Instance can be created in each ComMaster component Syntax in COM START lt path to Hiwave gt HIWAVE EXE If parameter is omitted the Hiwave instance registered as a COM server is created To register Hiwave as a COM server start it with the key RegServer Examples in gt COM_START C Freescale prog hiwave exe in gt ComMaster 2 lt COM_START COM interface analog in Perl In Perl system C Freescale prog hiwave exe RegServer g hwliInst Win32 OLE gt new Metrowerks Hiwave COM_EXE Description Executes a debugger command within the created Hiwave instance Syntax COM_EXE lt debugger command gt S12 X Debugger Manual 535 Debugger Engine Commands Debugger Commands Examples in gt COM_EXE open data in gt ComMaster 2 lt COM_EXE bs main
243. and ADC Modules with an icon attached to them are modules used by the application The pins used to connect external functions are indicated by a line and an icon symbol of the function attached CPU and Port A S12 X Debugger Manual 341 HC S 12 X Full Chip Simulation Connection FCS Tutorials Figure 10 25 Target CPU Window Target CPU Cpu MC9S12A512BCPV DER Q Q ied E i a 68 PADOS ANOS PADOS ANOB Optional Place the cursor on the pins to see a description of their functions Enlarge the Target CPU window to see different on chip modules 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 some versions of the CodeWarrior IDE The Standard and Professional Editions offer a wider range of hardware and software beans than the Special Edition Select Bean Categories gt CPU internal peripherals gt Communication gt AsynchroSerial 342 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Figure 10 26 Bean Selector Window Selection of AsynchroSerial Bean Bean Selector DOR Categories On Chip Prph Alphabet Assistant m C CPU amp G CPU Extemal Devices S CPU Internal Peripherals 8 9 amp synchroSerial 8 9o SynchroMaster S SyrchioSlave amp Converter E Interrupts B Measurement Memory amp Peripheral Initialization Beans amp
244. and File EESTI EET The command file in the edit box executes when the corresponding event occurs Click the Browse button to set the path and name of the command file The Enable Command File check box allows you to enable disable a command file on an event By default all command files are enabled The default Startup command file is STARTUP CMD The default Reset command file is RESET CMD The default Preload command file is PRELOAD CMD 40 S12 X Debugger Manual Debugger Interface Debugger Main Window 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 Setting a CPU stores the settings in this dialog 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 executes after the connection loads Specify the Startup command file full name and status enable disable either with the CMDFILE STARTUP Command Line command or using the Startup property tab of the Connection Command Files Window By default the STARTUP CMD file located in the current project directory is enabled as the current Startup command file Reset Command File The Reset command file executes
245. and hposition can be constant expressions or symbols defined with the DEFINE command The COMPLEMENT command sets the display complement format of register values one sets the first complement each bit is reversed none deselects the first complement An error message is displayed if the parameter is a negative value the scroll box is not visible If the given scroll position is bigger than the maximum scroll position the current absolute position of the scroll box is set to the maximum scroll position Equivalent Operations ATTRIBUTES FORMAT Select menu Register gt Options ATTRIBUTES VSCROLLPOS Scroll vertically in the Register component window ATTRIBUTES HSCROLLPOS Scroll horizontally in the Register component window ATTRIBUTES COMPLEMENT Select menu Register gt Options S12 X Debugger Manual Debugger Engine Commands Debugger Commands Usage ATTRIBUTES list where 1ist command command command FORMAT hex bin dec udec oct VSCROLLPOS vposition HSCROLLPOS hposition COMPLEMENT none one where vposition expression and hposition expression Example in gt Register ATTRIBUTES FORMAT BIN Contents of registers appear in binary format in the Register component window in gt Register ATTRIBUTES VSCROLLPOS 3 Scrolls three positions down The third line of registers appears on the top of the register component in gt Regis
246. ands in the file are interpreted The CPU context of the task is then expected in the variables PC SP SR DL Rnn and EN EN describes the status of the task If EN is greater than 1000 the string MSG expects the status Application Example Listing 5 1 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 fj S S12 X Debugger Manual 197 Real Time Kernel Awareness Inspecting Kernel Data Structures in in in in message displayed in Procedure Chain window PD dynamic link PD stack pointer PD program counter PD status register Initialized with 1000 saved in task Control Block THEN MD B 26 R2 MD B 30 MD B 38 R5 MD B 42 MD B 50 R8 MD B 54 MD B 62 R11 MD B 66 i contains the current state of the selected task ReadyInCQSc MSG DL MD B 8 A6 SP MD B 4 A7 PC D B 14 PC SR MW B 12 SR STATUS 1000 IF MW B 18 1 THEN IF registers are RO MD B422 R1 R3 MD B 34 R4 R6 B 46 R7 RI B 58 R10 R12 D B 70 END R13 R14 R15 i MB B 112 IF i 0 THEN MSG ELSIF i 1 THEN MSG ELSIF i 2 THEN MSG ELSIF i 3 THEN MSG ELSIF i 4 THEN MSG ELSIF i 5 THEN MSG ELSIF i 6 THEN MSG ELSIF i 7 THEN
247. ape sequences in the data stream from serial port or virtual SCI Table 3 46 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 and ESC is the ESC Character ASCII code 27 decimal Table 3 46 Terminal File Control Commands Escape Sequence Function ESC h 1 Close output file ESC h 2 filename Open output file ESC h 3 filename Open output file and suppress output to terminal display ESC h 4 Close input file 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 S12 X Debugger Manual 127 Debugger Components General Debugger Components You can give these commands 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 terminal h is used to send such commands from a target via SCI to the terminal Listing 3 3 shows the source code in terminal c Listing 3 3 TERM_Direct Source Code void TERM Direct TERM_DirectKind what const char fileName
248. apping in gt HWBPM REMAP 22BITS DELETE 1 in gt HWBPM REMAP 22BITS DISPLAY HWBPM Remappings for 0x3CA RangeO0 0x4000 0x7FFF mask 0x3e Rangel 0x8000 0xBFFF mask 0x47 Retrieve the default remapping for the currently set derivative in gt HWBPM REMAP 22BITS MCUID DEFAULT in gt HWBPM REMAP 22BITS DISPLAY HWBPM Remappings for O0x3CA RangeO0 0x4000 0x7FFF mask 0x3e Rangel 0xC000 0xFFFF mask Ox3f Unsecure Commands The following sections describe the HCS12 Unsecure Command Line command used by the Target Interface This command is CHIPSECURE Enter this command in the Target Interface associated command files or in the Command Line component of the debugger S12 X Debugger Manual 657 Connection Specific Commands XGATE Specific Hardware Connection Commands CHIPSECURE Description The CHIPSECURE SETUP command allows you to set up the debugger unsecure mechanism The CHIPSECURE UNSECURE command allows you to unsecure the connected derivative This is the same as selecting HC12MultilinkCyclonePro gt Unsecure and using the same settings Using CHIPSECURE UNSECURE executes the Unsecure command file and performs the secured derivative check process To find out if the derivative is unsecured the debugger reads lt addr reg to check gt masks it with lt mask gt and compares it to lt compare value gt Arguments lt addr reg to check gt address of the security regist
249. as hexadecimal or decimal The following command specifies hexadecimal display inspect ATTRIBUTES FORMAT Hex Equivalent Operations ATTRIBUTES COLUMNWIDTH Modify column width with the mouse ATTRIBUTES EXPAND Expand any item with the mouse ATTRIBUTES COLLAPSE Collapse the specified item with the mouse ATTRIBUTES SELECT Click on the specified item to select it ATTRIBUTES SPLIT Move the split line between the panes with the mouse ATTRIBUTES MAXELEM Select max Elements from the context menu In the MCURegisters Component The ATTRIBUTES command allows you to set the display and state options of the MCURegisters component window Usage ATTRIBUTES list where list command command command FORMAT bin hex oct dec udec EXPAND name COLLAPSE name MODE automatic periodical UPDATERATE rate The FORMAT command selects the format for all the registers The format can be binary hexadecimal octal signed decimal unsigned decimal The EXPAND command unfolds the node with given name in tree view The COLLAPSE command folds the node with given name in tree view NOTE Refer to EXPAND and COLLAPSE command descriptions for more detail about these commands The MODE command selects the display mode of variables In Automatic mode default registers are updated when the target is stopped 522 S12 X Debug
250. as accessed by Global core instruction set The XGATE address space covers the memory as seen by the XGATE on chip core Figure 3 43 Example HCS12X Device Address Space Selection 90 FE FE CO OD FD A N JO poaren an na ae 4 1N d Set Watchpoint i i N w D H 4 Show Watchpoints bp F Set Markpoint Show Markpoints pa I Show Location iz Word Size E Format Mode Display Fill Address Copymem Search Pattern Refresh S12 X Debugger Manual Debugger Components General Debugger Components Banked Window Paged Memory Physical Local vs Logical display This section applies only to devices having on chip program pages or data pages For Legacy reasons the debugger provides two ways to display the banked window paged memory such as the PPAGE window 8000 BFFF range with HCS12 devices with on chip banked memory or EEPROM windows EPAGE selectable The Debugging Memory Map DMM interface calls the default display the physical memory Device specifications sometimes call the default display local memory and it matches exactly what the CPU sees for silicon memory This means that what displays in the Memory window at a specific suspended time debugger halted matches the current setup of page registers like PPAGE or EPAGE for EEPROM Changing the page registers then refreshing the Memory window immediately shows changes in the window range
251. ask 3 EQUAL mask 2 brake and flasher light on AND mask 3 EQUAL mask 3 Chart Instrument The Chart instrument helps you to graphically represent any change in data 154 S12 X Debugger Manual Figure 3 105 Chart Instrument Debugger Components Visualization Utilities Table 3 59 Chart Instrument Attributes Attribute High Display Value Description Defines the maximum value for the Y axis Low Display Value Defines the minimum value for the Y axis the crossing with X axis Display Mode Specify what type of chart will be used Point Line or Surface can be used to display the chart Type of Unit The capturing of the value for the chart can be driven either the host or target time Select Target Periodical to capture values relative to target time Unit Size Defines the period of update Number of Units Defines the number of items displayed on time axis X Line Fill Color Defines color of points line or surface Draw Frame Specifies whether the axis are displayed or not Horiz Index Step Defines the interval between markers on horizontal axis in frames Vert Index Step Defines the interval between markers on vertical axis DILSwitch Instrument Use the Dual in Line Switch DILSwitch instrument Figure 3 106 for configuration purposes Use it for viewing or setting bits of one to four bytes S12 X Debugger Manual 155
252. ask in the system e g viewing the state of any task in the system It is possible to switch the debugging context from the current task to any other task and between any tasks in the system Real time kernels use data structures to describe the state of the system such as scheduling information queues timers Some of these data structures are of interest to operating system users and are described in this chapter Inspecting Task State Each multitasking operating system stores the context of each task at a specific location usually called the task descriptor This descriptor consists of the CPU context CPU registers and the content of the associated stack The task descriptor contains further information depending on the specific kernel implementation The Debugger allows you to inspect the CPU registers and stack containing all procedure activation frames return addresses parameters local variables Therefore it must retrieve this information for each task to be debugged The debugger reads this information from a file called OSPARAM PRM which contains the algorithm for retrieving all the needed data from the target memory task descriptors To describe this algorithm a simple procedural language is used The only parameter to the algorithm is a user specified address which identifies the task to be inspected The result is the CPU context CPU registers and status of the task which allows the debugger to display the procedure
253. ation dialog box Stop if no memory Check this box to have the FCS stop when an access to non existent memory occurs Clear this box to ignore this condition Stop on read undefined Check this box to have the FCS stop when a read of undefined memory occurs Clear this box to ignore this condition Stop on write protected Check this box to have the FCS stop when a write to read only write protected memory occurs Clear this box to ignore this condition Memory Configuration Module Startup Memory configuration is a dynamically loaded facility That is the new entry Configure appears in the Simulator menu upon loading the FCS the FCS dll Selecting Configure opens the Memory Configuration dialog box so that you can configure memory Memory Block Setting You must set memory blocks within the available memory and each block must cover a certain range The start address and end address define each memory block Memory Block Properties Table 10 3 lists the properties you may specify for a memory block S12 X Debugger Manual Table 10 3 Memory Block Properties HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu 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 t
254. ations Simulation and or cross debugging of embedded applications Multi Language Debugging Assembly C and C True Time Simulation Creation of user components 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 which perform specific tasks The Debugger Engine monitors and coordinates the component tasks 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 at will 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 S12 X Debugger Manual 25 Introduction Debugger Features Debugger Features True 32 bit application Powerful features for embedded debugging Special features for real time embedded debugging Powerful true time simulation features Powerful simulation and debugging capabilities Variety of target interfaces User Interface Graphical user interface GUI version including command line Configurabl
255. ator component Example in gt RESETMEM This initializes all configured memory to undefined in gt RESETMEM 0x100 0x110 This resets the memory located between 0x100 and 0x110 if configured to undefined in gt RESETMEM 0x003F This resets the memory location 0x003F if configured to undefined NOTE Inthe Auto on Access memory configuration the full memory is defined as RAM so RESETMEM has the same effect as RESETRAM RESETRAM This command marks all RAM as uninitialized undefined NOTE Inthe memory configuration Auto on Access the full memory is defined as RAM so RESETMEM has the same effect as RESETRAM Syntax RESETRAM Components Simulator component Example in gt RESETRAM After the RESETRAM command the content of RAM is undefined 640 S12 X Debugger Manual Connection Specific Commands Full Chip Simulator Commands RESETSTAT This command resets the statistics read and write counters to zero Syntax RESETSTAT Components Simulator component Example in gt RESETSTAT The RESETSTAT command initializes all counters to zero SEGPORT Use the SEGPORT command to set the display selection port and segment selection port addresses of the 7 Segments display component Syntax SEGPORT display selection port address ident segment selection address
256. b the SAVEBP command is used SAVEBP on when checked SAVEBP off when unchecked NOTE For more information about this see the SAVEBP command List of defined breakpoints the BS command is used as shown in Listing 4 1 Listing 4 1 Breakpoint BPT File Syntax BS address P T state cond condition state l cmd command state cur current inter interval cdSz codeSize srSz sourceSize 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 S12 X Debugger Manual 167 Control Points Breakpoints 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 Breakpoints tab for conditional breakpoint command is any debugger command It matches the Command field in the Breakpoints tab for associated commands current is an expression It matches the Current field Counter in the Breakpoints tab for counting breakpoints interval is an expression It matches the Interval field Counter in the Breakpoints tab for countin
257. bit sampling definition Scaled on a 1 Hz frequency 0 to 5 Volts voltage range saw_8bit_0_5v_1kHz txt Sawtooth signal 8 bit sampling definition Scaled on a 1000 Hz frequency 0 to 5 Volts voltage range sinus_11bit_0_5v_1Hz txt Sinus signal 11 bit sampling definition Scaled on a 1 Hz frequency 0 to 5 Volts voltage range sinus_8bit_0_5v_1kHz txt Sinus signal 8 bit sampling definition Scaled on a 1000 Hz frequency 0 to 5 Volts voltage range square_1_5v_1Hz txt Pure square signal Scaled on a 1 Hz frequency 1 volt at low level 5 volts at high level square_1_5v_1kHz txt Pure square signal Scaled on a 1000 Hz frequency 1 volt at low level 5 volts at high level S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials Virtual Wire Connections with the Pinconn IO Component This section explains making virtual wire connections using the Pinconn IO Component Pinconn IO Use the Pinconn IO component to create virtual links shortcuts between processor device pins like a simple wire Open the Pinconn component within the Open I O Component Dialog Box or with the openio pinconn command Release the Pinconn component within the same dialog or with the close pinconn command See Pinconn Commands for the Pinconn IO commands WARNING Itis up to the user to properly connect input pins to output pins without bus or level conflicts Command Set t
258. ble formats appears 3 Select either binary or hexadecimal format S12 X Debugger Manual 241 How To Working on the Register The format selected is valid for the entire Register component The contents from all registers appear according to the selected format Modify a Register Content The Debugger allows you to 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 32 Modifying Index or Accumulator Register Content 242 Register DER HC12 CPU Cycles 45 D Em X 0 B 0 IX C017 IY 0 IP 388002 PC 8002 PPAGE 38 SP 4FD CCR SXHINZVC The format of the input value depends on the format selected for the data component Ifthe format of the component is Hex the input value is treated as a Hex value Ifthe input value is 10 the variable will be set to 0x10 16 To validate the input value click either the Enter or Tab key or select another register If you validate an input value using the Tab key the content of the next register in the component is automatically highlighted This register can also be edited To restore the previous register content click 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 tha
259. bloekiNos iu etr ter ceci NER OE bee 621 DMM Commands esasan e a E EE e 624 Debugging Memory Map Manager Commands 624 DMM E EE EAEE EAE 625 BMM ADD e sare dee id tie er Rm nda 625 BMM DEL rarose t reee eaaa CREE ee EEES 626 DMM SAVE opini oe dade 4er e nere A ka E gus 626 DMM DELETEALLMODULES 0 0 00 c eee eee eee 626 DMM RELEASECACHES 0 00 c cece eee eee eee eae 627 DMM CACHINGON kergetek p 00 a ect orai iaa 627 DMM CACHINGOF F s ae a a a a a a m 627 DMM WRITEREADBACKON 000 0c eee eee eens 628 DMM WRITEREADBACKOFF 000 0 n 628 DMM HCS12MERHANDLINGON 2 00 02 e eee eee eee 628 DMM HCS12MERHANDLINGOFF 0 0 0000 e 629 DMM OPENGYUILI nii cath a RR Hab eal nece od Rf 629 DMM SETAHEADREADSIZE seseeee eee eee 629 Full Chip Simulator Commands 0 0 00 0c cee eee eee ee 630 AD PORT 34 eta So Bde ee eects Saale eae 632 ADDCHANNEL ese boson 4 640 bo RAGS GES SRE ERS ees 632 CPORT c dehet etu p b Eee 633 DBLECHANNEL LERRA RE EH aee 633 IIPORT eR ERR Roni Rp oh Su te e PR ERR 634 IIVECT SC cases ee UU p eb ts 635 KPORT rccte vi visui uo REPE 635 16 S12 X Debugger Manual Table of Contents ECDPORT eacouie wri se i See eee be ee Pia I RARE 636 LEINKADDR ebnkk n Saladin Re vial Sone bat eta EUR 636 PBPORT scc5 sci eiada did tahhee ol ag gtd the ead nibbled weed 637 PORD ue Seats ola Race ae a eR e
260. box shown in Figure 10 14 allows you to define the number of lines displayed in the Stimulation component Clear the Limited Size of Cache checkbox to have an unlimited number of lines Check the Limited Size of Cache check box to limit the number of lines to the value displayed in the edit box Specify a value between 10 and 1 000 000 By default the number of lines is 1000 Figure 10 14 Size of the Cache Dialog Box Size of the Cache V Limited Size of Cache Number of lines to be cached 1000 OK Cancel Help NOTE Increasing the cache size may slow performance S12 X Debugger Manual 319 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Example of a Stimulation File Using an editor open the file named IO VAR TXT located in the project directory Listing 10 1 shows an example file Listing 10 1 Stimulation File Example def a is TargetObject 210 B ERIODICAL 200000 50 50000 a 128 150000 a 4 END 10000000 a 0 The first line defines the stimulated object 1 byte wide and located at address 0x210 This code accesses the memory location 0x210 periodically 50 times once 200000 cycles have been executed line 3 First the memory location is set to 128 and then 100000 cycles later it is set to 4 NOTE The True Time I O Stimulation section describes in detail and with examples how to take advantage of this component Drag Out Nothing can be dragged
261. breakpoints or one watchpoint or set Default up triggers selected from list or menu Set trigger conditions and addresses from Source Assembly Memory or Data components using Set Trigger A or Set Trigger B menu entry or within this dialog DBG module records executed change of flows Since no triggers are set in automatic mode the debugger stops on the typical breakpoints watchpoints or by user request Expert Mode Enables the Expert Triggers tab see Expert Triggers Tab Profiling and Sets DBG module to code execution profiling and code execution coverage Open Profiler and or Coverage components to display results Uses a periodic real time fetch from debugger program counter to DBG module Not all program counters are represented with each fetch Improve accuracy and precision by using a longer run time and test period Use software breakpoints triggers and DBG based control points have no effect User must request the debugger to stop Disabled Mode Requires advanced knowledge of on chip DBG module Use to set hardware breakpoints watchpoints and triggers Requires user to handle trigger comparator addresses and DBG control registers through Memory component or using command line commands without a dedicated GUI to access DBG module register Use selected flags within DBG control registers to enable or arm DBG module On halt debugger automatically protects FIFO content from unexpected reads analyzes FIFO co
262. bugger within the CodeWarrior IDE using the following software e CodeWarrior IDE HC12 version 4 5 or later Debugger Configuration Debugger Configuration To configure the Simulator Debugger 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 1 Select Build Extras as shown in Figure 7 1 2 In the Build Extras pane check the Use External Debugger checkbox 3 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 4 In the Arguments field type the arguments in the Argument field for example ZotargetFilePath Target sim 5 Click on Apply to validate these changes S12 X Debugger Manual 247 CodeWarrior Integration Debugger Configuration Figure 7 1 IDE Target Window Build Extras Panel B Full Chip Simulation Settings my E128 project mcp Target Settings a A E Access Palhs Iv Use modification date caching IV Cache Subprojects Generate Browser Data From Compier Source Trees OSEK Sysgen V Dump beat eee Ecce aliar cong Assembler for HC12 This setting is used by compiler developers to debug generated browser data Bumer for HC12 Compder for HC12 Importes for HC12 Linker for HC12 v Use Extemal Debugger gt Editor 5 Compiegne ee Custom Keywords oe Compi
263. c UDec Float Auto BitReverse Table 3 39 Register Menu Description 112 Menu Entry Description Hex Selects hexadecimal register display format Bin Selects binary register display format Oct Selects octal register display format Dec Selects signed decimal register display format S12 X Debugger Manual Debugger Components General Debugger Components Table 3 39 Register Menu Description continued Menu Entry Description UDec Selects unsigned decimal register display format Float Selects float register display format displays all 32 64 bit registers as floats all others as hex Auto Selects auto register display format displays all floating point 32 64 bit registers as floats all others as hex Bit Reverse Selects bit reverse data display format reverses each bit Drag Out Table 3 40 contains the drag actions possible from the Register window Table 3 40 Register Component Drag Possibilities Destination Action Component Window Assembly Assembly component receives an address range scrolls up to corresponding instruction and highlights it Memory Dumps memory starting at address stored in selected register Selects corresponding address in memory component Command Line Appends address stored in selected register to current command Drop Into Table 3 41 shows the drop actions possible into the Register component S12 X Debugg
264. c Commands On Chip Hardware Breakpoint Module Commands Modify the current Module mode to User controlled and the on chip hardware breakpoint module to 16 bits relevant only if present on the hardware in gt HWBPM MODE USER BPM16BITS 0x20 SKIP OFF in gt HWBPM Hardware Breakpoints Module Settings Module kind 16BITS Module mode User Defined Module address 0x20 Skip illegal BP 16bits only off HWBPM 16 bits BRKCTO 0x0 BRKCT1 0x0 BRKA 0x0 BRKD 0x0 HWBPM 22 bits BKPCTO 0x0 BKPCT1 0x0 BKPO 0x0 BKP1 0x0 Enter values in the on chip breakpoint module registers in gt HWBPM SET16BITS 0xa4 0x0 0xc004 0x0 in gt HWBPM Hardware Breakpoints Module Settings Module kind 16BITS Module mode User Defined Module address 0x20 Skip illegal BP 16bits only off HWBPM 16 bits BRKCTO 0xa4 BRKCT1 0x0 BRKA 0xc004 BRKD 0x0 WBPM 22 bits BKPCTO 0x0 BKPCT1 0x0 BKPO 0x0 BKP1 0x0 Display the currently set remapping in gt HWBPM REMAP 22BITS DISPLAY HWBPM Remappings for 0x3CA RangeO0 0x4000 0x7FFF mask 0x3e Rangel 0xC000 0xFFFF mask Ox3f 656 S12 X Debugger Manual Connection Specific Commands Unsecure Commands Add a new remapping in gt HWBPM REMAP_22BITS RANGE 0x8000 Oxbfff 0x47 in gt HWBPM REMAP 22BITS DISPLAY HWBPM Remappings for 0x3CA RangeO0 0x4000 0x7FFF mask 0x3e Rangel 0xC000 0xFFFF mask Ox3f Range2 0x8000 0xBFFF mask 0x47 Delete a rem
265. cally selects the Instruction markpoint type Selecting Show Markpoints from the Source window context menu opens the Controlpoints Configuration window with its Markpoints tab displayed Figure 17 6 Figure 17 6 Controlpoints Configuration Window Markpoints Tab Controlpoints Configuration Breakpoints Watchpoints Markpoints er A 3C8000 INSTRUCTION size 1 main c main line 10 col 3 Trigger B 3C8006 INSTRUCTION size 1 main c main 6 line 13 cok 3 Markpoint Address 3C8000 Size 1 I Hex format Name Trigger A Type Instruction m General SavetRestore on load Add Delete Show Location Cancel Help Use the Save and Restore on load option to save the application with the DBG module setup and trigger positions This option is also available with breakpoints and watchpoints LAB on 12 platform A B C on S12S P A B C D on S12X 406 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries Trigger Editing Use the Triggers Address Settings area Figure 17 7 of the Trigger Settings tab when specifying trigger addresses or match or mismatch values You can also use the context sensitive menus to set trigger addresses or types Figure 17 7 Triggers Address Settings Dialog Box Triggers Address Settings Address A 0 3C08024 Memory Read Access Modify Trigger Match value 00 hex Pressing a Modify Trigger button opens a trigger e
266. cel v Expert Triggers in Source and Assembly Windows NOTE Expert Triggers are available for S12 devices only Expert Mode offers a different set of triggers and trigger options To completely separate Expert mode from Automatic mode the debugger provides a unique set of Expert triggers Expert triggers are independent of normal regular triggers As shown in Figure 17 10 Expert triggers appear in Source and Assembly windows with a small additional e character and different colors in the Memory component When you set the trigger from the Source or Assembly window the debugger automatically selects the markpoint type INSTRUCTION NOTE Setting Expert mode grays out preset Instruction Memory Access or Capture trigger designs Setting automatic mode or a predefined preset trigger grays out the Expert mode trigger designs s12 platform only 2 512 platform only S12 X Debugger Manual 409 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries Figure 17 10 Expert Triggers in Source Assembly Memory and Data Windows amp Source MEIN D AProflesNSKrylovAMy Documents NProgect 18 Sources nain c Fibonacci fib 1 3C800F ADDD 2 5P fibo n 1 Ll LD KT i2 A3C8013 STD 2 P while i lt n 8 3C8015 INY fibo fibl fib2 3CB01L6 EXG Afibl fib2 3c8018 CPY Afib2 fibo SCOLA BLS ie 3C801C TFR B 3C801E LEAS return fibo 3C8020 RTC Data and Memory Windows From
267. cess is still 16 bit Because the overhead of the far function call is not very large this memory model suits all applications with more than 64 kilobytes of code Data paging can be used however all ar objects and pointers to them must be specially declared Large The Large memory model supports both code banking and data paging by default However data paging requires a lot of overhead and should 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 use the banked memory model instead Custom The Custom memory model allows you to configure the project to support both code banking and data paging It allows the build tools to optimize accesses and generate more efficient code than the Large memory model without the need for the programmer to manually place data Note that any application can be written using the Banked memory model instead and the generated code will be more efficient than using the custom memory model The cost is that the user must manually place data that does not fit in the first 64k by means of pragmas 17 Select the floating point format by clicking the appropriate radio button 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
268. ch the debugger can typically access while running Use this feature to protect on chip I O Register flags from being triggered by debugger memory reads due to display refreshes Remarks Itis possible to create as many memory ranges of any size as desired down to a single byte Deleting Default Factory ranges generates warning dialogs Some settings are required for the debugger to debug and removing ranges leads to erroneous debugging information All GUI settings can be done by debugger commands Settings and DMM changes are saved in the current user project You can always restart from default by clicking the Revert to Default button You can disable automatic DMM range remapping with 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 Priorities and Types This section describes the various memory priorities and types for the different CPU cores 460 S12 X Debugger Manual Debugging Memory Map CPU Core Priorities and Types HC12 CPU12 Core The following priorities and types are specific to the HC12 CPU12 core Priorities All derivatives except MC68HC12A4 Highest debugger a high debugger priority that you can use or define for the debugger typically to protect a memory area from being read Internal register space refer to device specifications RAM me
269. ck May be required for first BDM module revisions when using BDM constant clock source CLKSW 0 with PLL engaged PLLSEL 1 and PLL multiplier greater than or equal to 2 Under these conditions set CLKSW 1 before engaging PLL or BDM may lose communication with host system Default Cleared BDM clock runs at EXTAL 2 S12 X Debugger Manual P amp E Multilink Cyclone Pro Connection Connection Menu Element Resynchronize from hardware reset COP etc checkbox in P amp E HC S 12 Connection Manager Advanced Options dialog box Description Checked Forces debugger to review and resynchronize BDM communication and control if BDM communication is still active If BDM mode is disabled debugger inquires whether an internal core reset has occurred and if so reactivates BDM mode for debugging purposes Rebuilds the S12X series program flow Default Clear option disabled BDM Communications Speed The BDM Communication Speed defines the frequency at which the P amp E hardware interface communicates with the target microprocessor Autodetect communications speed This is the recommended setting for the first time that a connection is made to the target microprocessor The appropriate BDM communication speed is automatically calculated UselO DELAY CNT Once a successful connection is made using the Autodetect communications speed setting the lO DELAY ONT which stores the ap
270. clone Pro Connection Connection Menu 364 S12 X Debugger Manual 12 OSBDM Connection This section contains information to assist with use of the Open Source BDM OSBDM hardware with Codewarrior OSBDM Technical Considerations Freescale supplies certain development boards with an integrated debug circuit based on Open Source BDM This allows the development board to be debugged from the PC via the USB bus without requiring external debug hardware such as the Cyclone Pro or USB Multilink The development board also derives its power from the USB Bus The Open Source BDM circuit design OSBDM JM60 is an open source community driven design It has been published on Freescale s website and full documentation can be found in the Community Forums CodeWarrior Integration Integration with CodeWarrior is handled via the P amp E Multilink Cyclone Pro connection P amp E has integrated the Open Source BDM support into the same connection that supports both the USB Multilink and the Cyclone Pro Refer to the P amp E Multilink Cyclone Pro Connection chapter of this manual for more details on this connection All of the dialogs which affect operation of these hardware interfaces function in the same manner when using OSBDM albeit at a lower data rate Minimum Firmware Version The integration with Codewarrior via the P amp E Multilink Cyclone Pro will require a minimum OSBDM firmware version of at least Build 27 If the OSBDM har
271. command with no parameter displays the Open File dialog The CALL command is equivalent to the CF command NOTE If path is unspecified 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 you use the C option in the calling file the command interpreter quits the calling file and executes the called file The commands following the CF C command never execute When you omit the C option calling file execution resumes after the execution of the commands in the called file NL This option prevents the commands in the called file from being logged in the Command Line window even if the CMDFILE type is set to ON see LOG This option does not log the commands to a log file opened with an LF command S12 X Debugger Manual 531 Debugger Engine Commands Debugger Commands 532 Components Debugger engine Examples in gt CF commands txt Executes the COMMANDS TXT file containing debugger commands like those described in this chapter Example without C Option If a command1 txt file contains bckcolor green cf command2 txt bckcolor white and a command2 txt file contains bckcolor red Execution in cf command1 txt executing command1 txt bckcolor green cf command2 txt
272. 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 you redirect the RESET command to the correct component Since targets have their own RESET command using RESET without redirecting it to the correct component resets the target Usage RESET S12 X Debugger Manual 583 Debugger Engine Commands Debugger Commands Components Profiler and Coverage Example in gt Profiler lt 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 The RESTART command initializes the cycle counter to zero RETURN 584 The RETURN command terminates the current command processing level returns from a CALL command If executed within a command file control returns to the caller of the command file i e the first instance that did not chain execution Usage RETURN Components Debugger engine S12 X Debugger Manual Debugger Engine Commands Debugger Commands Example In file d demo cmd1 txt CALL d demo cmd2 txt T In file d demo cmd2 txt RETURN returns to the caller The command file cmd1 txt calls a second command file cmd2 txt You must use the RETURN instruction to return to the caller file Then
273. cond 0 1 to 60 seconds Components Data Memory and MCURegisters component Example in gt Memory lt updaterate 30 This commands sets the Memory component updaterate to 3 seconds VER 602 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 S12 X Debugger Manual Example in gt ver HI WAVI Ei HI WAVE Engine Source Assembly Procedure Register Memory Data Data Simulator Target Command Line NA HAHA HN HD DW DW AW CO e O X cC OD O H Cpnoes6o e SP ND Ae OF O So N 27 27 17 16 Debugger Engine Commands Debugger Commands Displays Debugger engine and components versions in the Command Line component window WAIT The WAIT command pauses command file execution for a time in tenths of second or pauses until the target halts when the option s is set Specifying no parameter pauses command file execution for 50 tenths of a second 5 seconds Specifying time only halts execution of the command file for the specified time Specifying s only halts execution of the command file until the target halts If the target is already halted command file execution is not halted When you specify both t ime and s Ifthe target is running command file execution halts for the specified time only if the target is not halted If t
274. context menu shown in Figure 3 85 contains functions described in Table 3 47 associated with the selected frame S12 X Debugger Manual 131 Debugger Components General Debugger Components Figure 3 85 Trace Assocaited Context Menu Set Time Base Show Location v Textual Graphical Instructions Items Go to Frame Enabled Records memory accesses Clear Selecting Show Location in the Trace window context sensitive menu displays the frame matching source and assembly code in the Source and Assembly windows Display Modes The information collected by the Trace component can be presented in different modes Instructions Textual and Graphical display Instructions Display The Instruction display is the default display mode or you can switch to this mode by selecting Instructions in the Trace window menu This mode provides the display of disassemble information Figure 3 86 Trace Window Instruction Display A Trace frame address instruction Data wl 132 S12 X Debugger Manual Debugger Components General Debugger Components Textual Display Activate this display mode by selecting Textual in the Trace window menu Textual display mode simply expands instruction assembly code in the Trace window Figure 3 87 Trace Window Textual Display A Trace Frame Address Instruction daca sv Graphical Display Graphical Display mode provides a graphical representation of the same informa
275. context sensitive menus only display triggers matching the number and type of currently set triggers the debugger checks the current trigger settings against the trigger mode If one or more triggers do not match the trigger mode selection a warning icon and message appears on the bottom of the dialog The display field in Figure 17 38 shows that the Memory Write Access type does not match the Instruction trigger type selected in the list S12 X Debugger Manual 443 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 38 Trigger Settings Tab Information Trigger Module Settings Trigget settings Sequencer General settings User Triggers trace possible no automatic breakpoints and watchpoints z A RA Acces B Notdefined C Notdefned D Not defined Modify Trigger Address 02102 E Address Compare to foxoooo With Mask foxoo00 C Inside Range C Outside Range Compare mismatch Always stop on this trigger T ggeron HCS12 C XGATE Trace mechanism activated for both the HCS12X and XGATE core Detail Mode is not available when tracing both cores The DBG module records change of flows until the condition is met or the debugger is 444 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Sequencer Tab You can choose or change the DBG sequence in the Sequencer tab of the Trigger Module Settin
276. continued Register Register Initial Remarks Name Address Value PACNT H 0x00A2 0x00 PACNT L 0x00A3 0x00 TIMTST 0x00AD 0x00 TCBYP PCBYP These bits are not simulated writing to them has no effect These bits have meaning only for chip testing in special mode PORTT OxO00AE 0x00 DDRT OxO0AF 0x00 Serial Communication Interface SCI Implement the SCI module as a separate class because there are several nearly identical instances of this class Supported Features Table 10 18 shows the supported SCI features Table 10 18 SCI Supported Features 304 Feature Full Feature Comments Acronym Name 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 LOOP LOOP Mode LOOP mode determines SCI connection to 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 Source Special feature of LOOP mode not simulated S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 18 SCI Supported Features continued S12 X Debugger Manual Feature Full Feature Comments Acronym Name M Mode 8 or 9 data bits Supported diff
277. cription Prints minimum and maximum value of the SP register Syntax STACK POINTER INFO RESET INFO Arguments displays the help RESET resets the collection stack pointer values Future INFO calls only report the SP area from now on INFO prints the area the SP was pointing to since the last RESET Example STACK POINTER INFO RESET WARNING SETUP Description The WARNING SETUP command sets the level of debugger warning to inform you about the usage of an unsimulated register Components Debugger Engine S12 X Debugger Manual 651 Connection Specific Commands Full Chip Simulation Connection Commands Syntax WARNING SETUP lt HALT CLMSG MSGBOX NONE STATUS gt Arguments TIP For HALT CLMSG and MSGBOX options executing the command more than once toggles the setup STATUS Displays the current warning setup status HALT FCS stops halts the debugger when a warning message occurs CLMSG Displays warning messages in the Command window MSGBOX A message box pops up on warning Clicking Cancel stops the FCS Clicking OK resumes the FCS NONE Clears all warning messages Example in warning setup status WARNING SETUP STATUS CLMSG Example in warning setup none in warning setup halt in warning setup status WARNING SETUP STATUS HALT Example in warning setup none in warning setup clmsg in warning setup status WARNING SETUP STATUS CLMSG Exampl
278. cted format Modify a Variable Value The Debugger allows you to change the value of a variable as shown in Figure 6 31 Figure 6 31 Modifying a Variable Value Data 2 DER Fibonacci Auto Symb Local unsigned int 987 signed int 1597 unsigned int 1597 unsigned int 18 int Double click on a variable The current variable value is highlighted and can be edited Formats for the input value follow the rule from ANSI C constant values Prefixed hexadecimal value with Ox Prefixed octal values with 0 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 To validate the input value you can either click the Enter or Tab key f you validate an input value using the Tab key the value of the next variable in the component is automatically highlighted this value can also be edited To restore the previous variable value click 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 while the function where they are defined is inactive Retrieve the Variable Allocation Address The Debugger provides you with the start address and size of a variable if you do the following 240 S12 X Debugger Manual How To
279. ction HC12MultilinkCyclonePro gt Reset triggers a reset of the connection and executes the command file reset cmd The menu selection HC12MultilinkCyclonePro gt 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 connection S12 X Debugger Manual 215 How To Switching Connections Figure 6 10 P amp E Multilink Cyclone Pro Connection Dialog Box PRE HC S 12 Connection Manager v2 70 00 00 Please select connection interface port and settings in order to connect to Connection port and Interface Type Interface USB HCS08 HCST2 CFV1 Mulnk USB Port Port USB1 USB ML 12 Rev C PESQ17170 Taeget CPU Information CPU HC12 HCS12 Autodetect Device Type BOM Communications Speed Auodetect communicatons speed UselO DELAY CNT 58 Deces MCU Inteenal Bus Frequency For programming c c 9 Reset Options Delay aier Reset and before communicating to targat for 0 milseconds decimal Cyclone Pro Power Control Voltage gt Power Out Jack fV Provide power to target Regulater Output Voltage Power Down Delay 250 mS 7 Power off target upon software exi fw x Power Up Delay 250 m Connect Reset Hotsync Abort Show this dialog belore attempting to contact target Otheewite only delay on Emoe The menu selection HC12MultilinkCyclonePro Select Derivative takes
280. ctions starting at the specified address Figure 3 5 Show PC Dialog Box Show PC Emmm Iv Hex Format Cancel Help Associated Context Menu To open the context menu right click in the text area of the Assembly component window The context menu contains default menu entries for the Assembly component It also contains some context dependent menu entries described in Table 3 2 depending on the current state of the debugger S12 X Debugger Manual 57 Debugger Components General Debugger Components Figure 3 6 Assembly Context Menu Set Breakpoint Run To Cursor Show Breakpoints Show Location Set Markpoint Show Markpoints Address Format Freeze Table 3 2 Assembly Context Menu Description 58 Menu Entry Set Breakpoint Description Appears in context menu if no breakpoint is set or disabled on specified instruction Select to set a permanent breakpoint on instruction When program execution reaches instruction program halts and current program state displays in all window components Delete Appears in context menu if a breakpoint is set or disabled on the Breakpoint specified instruction Select to delete breakpoint Enable Appears in context menu only if a breakpoint is disabled on an Breakpoint instruction Select to enable breakpoint Disable Appears in context menu if a breakpoint is set on an instruction Breakpoint Select to disable breakpoint Run To Cur
281. ctivation frames 195 Procedure chain 103 Procedure Chain window 196 Procedure component 103 Processor expert selecting 226 Prod option 612 Profiler component 105 Profiler menu 107 Profiling 419 453 Program counter setting 120 Program flow rebuild gap 448 Program loading 475 Program markers 163 Programmed module state 472 Project File analysis DA C 256 Overview DA C 257 Root directory DA C 252 Root directory referential 252 Project files default 671 project ini 474 475 669 670 project ini file 37 Properties menu entry 145 146 Protect DBG FIFO content from unexpected reads 445 447 Protected module state 472 Protecting Flash 473 PROTOCOL 616 Pseudo terminal facility using 245 PSMODE 649 S12 X Debugger Manual PT 316 PTRARRAY 581 Pulse Width Modulator PWM 297 Pure PC mode 432 442 PVCS 684 R R W Access 408 R8 316 RAF 316 RAMs 383 RD 581 RDRF 316 RE 316 Read 408 411 Read Access 413 Read Write 411 Read Write Access 413 READACCESS 411 READWRITEACCESS 411 Real time embedded application 25 Real Time Kernel Awareness 195 Real Time Kernels Definition 195 rec file 110 RECORD 582 Record 109 Record before and after condition 441 Record continuously 441 and DO NOT halt on trigger hit 422 423 and halt on trigger hit 422 423 Record menu entry 110 Record Time menu entry 110 Recorder component 109 Recorder menu 110 Refresh Mode menu entry 148 REGBASE 638 Register Changing display format 241 Working
282. current instruction TESTBOX Displays a modal message box shown in Figure 22 2 with a given string Figure 22 2 Test Box Message Box Test Box AN Step 1 init all vars Usage TESTBOX lt String gt Components Debugger engine S12 X Debugger Manual 597 Debugger Engine Commands Debugger Commands Example in gt TESTBOX Step 1 init all vars TUPDATE Switches the time update feature on or of f Usage TUPDATE on off Components Profiler and Coverage components Example in gt TUPDATE on UNDEF 598 Removes a symbol definition from the symbol table This command does not undefine the symbols defined in the loaded application Program variables whose names were redefined using the UNDEF command are visible again Undefining an undefined symbol is not considered an error Usage UNDEF symbol Specifying the argument undefines all symbols previously defined using the DEFINE command Components Debugger engine Example DEFINE test 1 UNDEF test S12 X Debugger Manual Debugger Engine Commands Debugger Commands When the test variable is no longer needed in a command program you can undefine it and remove it from the list of symbols After UNDEF test the test variable must be redefined before you can use it NOTE See also examples of the DEFINE command Examples You can change the value of an existing symbol by reapplying the DEFINE comman
283. cution Inside Address A Address B Range Use to set a trigger on program instruction execution program counter occurring within Address A to Address B range Instruction Execution Outside Address A Address B Range Use to set a trigger on a program instruction execution program counter occurring outside Address A to Address B range Instructions at Address A then at Address B Were Executed S12 X Debugger Manual Use to set a trigger on program instruction execution program counter occurring first at Address A then Address B 437 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Table 17 11 Memory Access Triggers Available continued Mode Instruction at Address A and Value on Data Bus Match Description Use to set a trigger on a program instruction execution at Address A with an instruction opcode that matches a specific byte value at the Address A memory location Uses trigger B address as a match value rather than an address location If you select this trigger type using a context menu without setting the match value an error message prompts for match value Replaces the standard trigger editing dialog box with the Triggers Address Settings dialog box see Figure 17 7 Match Value edit boxes replace Trigger Editing dialog Instruction at Address A and Value on Data Bus Mismatch Use to set a trigger on a program instruction
284. d Breakpoint instruction When selected disables this watchpoint S12 X Debugger Manual Debugger Components General Debugger Components Table 3 13 Data Context Menu continued Menu Entry Description Show Opens the Watchpoints Setting dialog box and allows you to view the Watchpoints list of watchpoints defined in the application refer to Control Points Show location Forces all open components to display information about the specified variable e g the Memory component selects memory range where variable is located Open Module Submenu The dialog shown in Figure 3 31 lists all source files bound to the application Displays global variables from the selected module in the data component This is only supported when the component is in Global scope mode Figure 3 31 Open Modules Dialog Box 4 Module Startl2 c Drag Out Table 3 14 describes the drag actions possible from the Data component Table 3 14 Dragging Data Possibilities Destination Action Component Window Command Line Dragging the name appends the address of the variable to the current command in the Command Line Window Dragging the value appends the variable value to the current command in the Command Line Window Memory Dumps memory starting at the address at which selected variable is located Selects memory area at which the variable is located in memory component S12 X Debugger Manual 79
285. d which replaces and loses the previous value It is not put on a stack Then when you apply UNDEF to the symbol it no longer exists even if the value of the symbol has been replaced several times in gt DEFINE apple 0 in gt LS apple 0x0 0 apple is equal to 0 in DEFINE apple apple 1 in gt LS apple Ox1 1 apple is equal to 1 in DEFINE apple apple 1 in gt LS apple 0x2 2 apple is equal to 2 in gt UNDEF apple in gt LS apple no longer exists In the next example we assume that the FIBO ABS sample is loaded At the beginning no user symbol is defined in UNDEF in LS User Symbols there is no user symbol Application Symbols symbols of the loaded S12 X Debugger Manual 599 Debugger Engine Commands Debugger Commands 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 gt 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 in gt LS User Symbols there is no user symbol Application Symbols symbols of the
286. d 2eco d before and after condition In etal Mode is not available when tracing both cores The DBG module records change of flows unti the condition is met or the debugger is Sequencer Any trigger Using the this list it is possible to align the trigger with the end or the beginning of a tracing session Table 17 8 Trigger Align Options Description Record continuously Starts recording program flow information immediately after run Halts the processor debugger when capture buffer is full Start recording on condition Starts recording program flow information on trigger condition match Halts the processor debugger when capture buffer is full Record before and after Starts recording program flow information on condition trigger condition match Does not halt the processor debugger on trigger condition match halts when capture buffer is full 430 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 30 Data Recording Control Trigger Module Settings Trigger settings Sequencer General settings User Triggers trace possible no automatic breakpoints and watchpoints A RAV Access B Notdefined C Notdefined D Not defined Address 02102 Address Compare to 0x0000 With Mask 00000 C Inside Range C Outside Range Compare mismatch Aliways stop on this trigger T ggeron HCS12X C XGATE
287. d for instrument s visualization 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 width of memory to display up to 4 bytes Kind of Port Table 3 55 lists the kind of port S12 X Debugger Manual 149 Debugger Components Visualization Utilities Table 3 55 Kind of Port 150 Attribute Substitute Description Used to substitute a field of an object from the Object Pool Objects can substitute other objects fields that is they can replace a certain field range of the substituted object and hence become the actor for these fields In this case the substituted object forwards all requests concerning such fields to the appropriate substituting object Requests for subscription to substituted fields are forwarded to the appropriate substituting object i e subscribers always deal with the corresponding object which manages the fields that is the actor Objects fields are identified by their names Names have the following syntax objSpec objname fieldname objname ident index fieldname identnum identnum size identnum ident f hexnumber size B w r Example Use it to create IO Port with needed name or address Substitute TargetObjec
288. d immediately The debugger displays a warning dialog to get user acceptance before mass erasing then programming the application Use the Flash specific command FLASH NOUNSECURE to incorporate device security byte programming in user code Figure 19 1 Flash Programming Loader Warning Dialog Box LOADER WARNING The debugger is going to mass erase the non volatile memory eeprom and flash of the current device then program the application Do not display this message anymore for this project S12 X Debugger Manual 467 Flash Programming Automated Application Programming Select the OK button to launch background Flash commands to arm programming load program an application file then disarm programming Check the Do not display checkbox to remove the Warning message for the current project saved in project under the project variable AEFWarningDialog FALSE Setup The Open and Load Code Executable File dialog box opens when you choose the Load menu entry in the debugger main window s connection menu Figure 19 2 Open and Load Code Options Dialog Box Open and Load Code Options M Automatically erase and program into FLASH and EEPROM Checking this checkbox engages the automated device mass erasing and application programming into non volatile memory i e Flash and or EEPROM To set this option permanently use the Load tab in the debugger Preferences window File gt Configuration Figure 19 3
289. d is designed for the HCS12XE family for the MMCCTLI register and the ROMHM and RAMHM flags CAUTION Match the setup of the debugger with the HCS12X_MAP4000 option with the HC12 Compiler Code Generation Define mapping for memory space 0x4000 0x7FFF option in the compiler options settings dialog i e MapRAM MapF lash or MapExternal command line options S12 X Debugger Manual 65 Connection Specific Commands XGATE Specific Hardware Connection Commands SELECTCORE Description Select CPU12 or XGATE as a current core This is the same as selecting Select Core menu item in target specific menu Syntax SELECTCORE CPU12 XGATI Ej Example in gt SELECTCORE XGATE Selects XGATE as a current core STEPBOTHCORES Description Single steps XGATE and HCS12X core at the same time Disabled by default A Mr Qa WARNING This is a simulation and does not match with any real time instruction cycling Syntax STEPBOTHCORES ON OFF Example STEPBOTHCORES ON 660 S12 X Debugger Manual Connection Specific Commands XGATE Specific Hardware Connection Commands XDBG Description XGDBG bit debugger setup when starting and stopping the debugger XDBG commands define how the debugger sets the XGATE core when halting and starting the main e g HCS12X cor
290. d to the SPI Bit 7 0 data sent from to SPI Analog to Digital Converter Module This I O device simulates the Analog to Digital Converter ADC FCS supports eight and 16 channel versions of the ADC module Access the analog inputs PADO to PAD7 PADI5 separately through the object pool For ADC module 1 PADO input corresponds to PAD8 PAD 16 pin of the microcontroller Conversion Results The analog inputs of ADC module are simulated as 8 bit logic values Therefore the simulation of the conversion itself only has a limited interest The conversion results are an image of the simulated input For the unsigned right justified 8 bit conversion the result displayed in the corresponding data register is the exact image of the input Simulation is accurate on the conversion delays and the modifications that affect the input 8 10 bits left right justified signed unsigned The data registers in which to transfer the conversion results give a precise image on how to configure the ADC modules for the proper conversion process Table 10 8 Simulated ADC Registers 288 Register Full Register Name Simulated Fields Acronym ATDCTL2 ATD Control Register 2 ADPU ETRIGP AFFC ETRIGE AWAI ASCIE ETRIGLE ASCIF ATDCTL3 ATD Control Register 3 S8C S2C S4C S1C ATDCTL4 ATD Control Register 4 SRES8 PRS4 0 SMP1 0 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table
291. d with a read write access watchpoint The Debugger provides two ways to define a read write access watchpoint Use the Data Context Menu 1 Point at a variable in the Data window and right click The Data context menu appears 2 Choose Set Watchpoint from the context menu to define a Read Write Watchpoint S12 X Debugger Manual 181 Control Points Watchpoints 182 Use the Left Mouse Button and click the B Key 1 Point at a variable in the Data window 2 Hold down the left mouse button and click the B key This defines a read write access watchpoint for the selected variable Once a read write access watchpoint is 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 Use the Data Context Menu 1 Point at a variable in the Data window and right click The Data context menu appears 2 Choose Set Watchpoint from the context menu to define a read write watchpoint 3 Point in the Data component window and right click to display the Source context menu 4 Choose Show WatchPoints from the context menu The Controlpoints Configuration window Watchpoints tab appears Select the watchpoint you
292. data display format Oct Selects octal data display format Dec Selects signed decimal data display format UDec Selects unsigned decimal data display format Bit Reverse Selects bit reverse data display format reverse each bit Mode Submenu Activate the Mode submenu by highlighting the Mode entry on the Data menu Figure 3 24 Mode Submenu v Automatic Periodical Locked Frozen Table 3 12 describes the Mode submenu entries Table 3 12 Mode Submenu Menu Entry Description Automatic Switches to Automatic mode default updates variables when connection stops Displays variables from currently executed module or procedure in data component Periodical Switches to Periodical mode updates variables at regular time intervals when 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 S12 X Debugger Manual 75 Debugger Components General Debugger Components Table 3 12 Mode Submenu continued Menu Entry Description Locked Switches to Locked mode updates values from variables displayed in data component when connection stops Frozen Switches to Frozen mode Does not update values from variables displayed in data component when the connection stops NOTE In Locked and Frozen mode variables from a specific module appear in the data component The same variables are
293. de 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 unfolds at loading Sections of code that can be folded are enclosed between IF and Sections of code that can be unfolded are hidden under E Double click a folding mark rl or to fold the text located between the marks Double click an unfolding mark i to unfold the text that is hidden behind the mark Source Menus Figure 3 72 shows the Source menu and Figure 3 73 shows the functions associated with the Source context menu Table 3 42 describes these functions Figure 3 72 Source Menu 118 Source Window Help Open Source File Copy Ctrl C Go To Line Ctrl G Find Ctrl F Find Procedure Ctrl I Folding v Marks ToolTips gt S12 X Debugger Manual Menu Entry Set Breakpoint Debugger Components General Debugger Components Figure 3 73 Source Associated Context Menu Set Breakpoint Run To Cursor Show Breakpoints Show Location Set Markpoint Show Markpoints Set Program Counter Open Source File Find Ctrl F Find Procedure Ctrl H Table 3 42 Associated Context Menu Description Description Appears in context menu only if no breakpoint is set or disabled at nearest code position visible with marks When selected sets a permanent breakpoint at this position If program execution reaches this statement program halts
294. de toolbar shortcuts for some of these functions Refer to Debugger Main Window Toolbar and Customizing the Toolbar 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 Control Points Connection Menu This menu entry Figure 2 15 appears between the Run and Component menus when no connection is specified in the PROJECT INI file and no connection has been set The Connection name is replaced by an actual connection name when the connection is set If a connection has been set the number of menu entries is expanded depending on the connection To set the connection select Component Set Connection Refer to Component Menu for details S12 X Debugger Manual 3 A Debugger Interface Debugger Main Window Figure 2 15 Connection Menu Load Ctrl t Reset hs Ctri4R Set Derivative Configure Reset RAM Reset MEM Reset Statistic Load IOs Close IOs Clock Frequency Command Files Bus Trace Help Table 2 5 describes the Connection menu entries Table 2 5 Connection Menu Common Options Description 38 Load Loads a connection Reset Resets the current connection Loading a Connection Choose Connection gt Load in the Connection menu to load a debugger connection This displays the Load Executable File window shown in Figure 2 16 Load Executable File
295. descriptions of Flash operations You also may use the Command Line component to handle Flash operations The NVMC Commands 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 Table 19 2 describes these buttons 472 S12 X Debugger Manual Flash Programming NVMC Graphical User Interface Table 19 2 NVMC Dialog Box Buttons Button Name Associated Action Select All Selects all modules in list box When clicked button changes to Unselect All Unselect All Click to deselect all current selections Enable Disable Enables all selected modules currently disabled Disable disables all selected modules currently enabled Ability to enable or disable Flash module depends on MCU features and context Protect Unprotect Protects all selected modules currently unprotected Unprotect unprotects all selected modules currently protected Ability to protect or unprotect a Flash module depends on MCU features and context For some MCUs protection is possible only for Boot section and boot routines not entire module See Hardware Considerations Erase Removes programming from all selected Flash modules by assigning the value OxFF or 0x00 to each byte Changes module status to Blank If all selected modules are already blank Erase is
296. ding 71 Editing 71 External Bus Interface EBI 291 Multiplexed 292 F FE 316 Features User interface 47 FEE28 478 FEE32 478 fibo prm file 255 709 Field Description 160 161 Field Description attribute 161 FIFO 445 446 447 448 Analyze remark 448 Analyzing content 432 444 445 446 Data 452 Depth 452 Detail mode 432 442 Display data 452 LOOPI mode 431 442 Normal mode 431 442 Protecting content 445 447 File Manager 668 File menu 30 File types Configuring DA C 253 Filename 154 Files abs 53 389 cmd 63 Component 46 default mem 275 Environment 667 Expression command file 72 fibo prm 255 HWC 30 INI 30 init cmd 234 mcutools ini 208 668 OSPARAM PRM 195 PJT 30 postload cmd 42 246 preload cmd 41 246 project ini 37 474 475 669 rec 110 reset cmd 246 Executing 41 Setcpu command 275 startup cmd 246 Executing 41 termbgnd c 393 wnd 46 53 xpr 72 FILL 552 710 Fill Memory dialog box 96 Fill menu entry 93 FILTER 553 FIND 553 Find 122 Find dialog box 122 Find menu entry 120 Find Procedure 123 Find Procedure dialog box 123 Find Procedure menu entry 120 FINDPROC 554 Firmware 384 Flash Commands 617 Disabling 473 Enabling 473 Loading 475 Module 471 Module selecting 473 Operations 472 Programming 393 Protecting 473 Select 471 SELECT command 473 Unprotecting 473 Unselect 471 UNSELECT command 473 Flash FTS 289 FLASH command 618 Flash option 355 369 390 397 FL
297. displayed source code S12 X Debugger Manual 123 Debugger Components General Debugger Components Table 3 43 Folding Menu Description continued Fold All Text Folds all displayed source code All Text Folded At Loading Folds all source code at load time Drag Out Table 3 44 shows the drag actions possible from the Source component Table 3 44 Source Drag Possibilities Destination Action Component Window Assembly Displays disassembled instructions starting at first high level language instruction selected Highlights assembler instructions corresponding to selected high level language instructions in Assembly component Register Loads destination register with PC of first instruction selected Data A selection in the Source window is considered an expression in the Data window as if entered through the Expression Editor of the Data component see Data Component or Expression Editor Drop Into Table 3 45 shows the drop actions possible into the Source component Table 3 45 Source Drop Possibilities Source Component Action Window Assembly Source component scrolls to source statement corresponding with selected assembly instruction and highlights it Memory Displays high level language source code starting at first address selected Instructions corresponding to selected memory area are gray in source component Module Displays source code from selected mo
298. ditor dialog box called Browse for Trigger see Figure 17 8 Figure 17 8 Browse for Trigger A Dialog Box Trigger Module Settings Trigger settings Expert triggers General settings Browse for Trigger A Q User Defined Address 3C802A hex u Markpoints Modify Trigger A B Instruction i Type Instruction v Size Trigger A ut e ger B Instruction FIFO Normalmode Bram counter at Address O Read ccess Info Read Access O Wirite Access Instr Vasas noman Q RAW Access line R W Access 535 Symbol Table Modify Trigger Delete Trigger A Cancel Help or data value OK Cancel Help Table 17 1 describes the options available in the Browse for Trigger dialog box S12 X Debugger Manual 407 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries Table 17 1 Browse for Trigger A Options 408 Option Description Address Contains initial and final trigger address value Set by typing directly in edit box Type Use to select or change trigger type Use Instruction for Instruction triggers Use Read Write and R W Access for Memory Access and Capture triggers Modify Trigger Modifies and records trigger in trigger database see Storing Triggers as Markpoints Delete Trigger Removes trigger from trigger database see Storing Triggers as Markpoints Trigger address is undefined Show Shows trigger locati
299. dow Enables paging of program space Enable EWEN Extra Window Enable Enables paging of extra space A21E Memory Expansion Not simulated no physical outputs A16E Assignment General Purpose I O Register Block Address Map Table 10 23 shows the Register Block Address mapping Table 10 23 Register Block Address Map Register Block Description Remarks 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 EEPROM Registers not simulated Use the memory mapping configuration dialog box to specify simulated memory configuration 0014 0017 Clock Function Control Completely simulated 001E 001F S12 X Debugger Manual Interrupt Control amp Highest Priority Interrupt Completely simulated 311 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 23 Register Block Address Map continued 312 Register Block Description Remarks Address 0020 002E Key Wakeup Completely simulated Control 002F Reserved 0030 0033 Port Registers Currently not simulated 0034 0038 PAGE amp memory configuration Registers Page Registers are simu
300. dows Object Information Bar contains the address and size of the selected variable It also contains the module name or procedure name in which the displayed variables are defined the display mode automatic locked etc the display format symbolic hex bin etc and current scope global local or user variables Various display formats such as symbolic representation depending on variable types and hexadecimal octal binary signed and unsigned formats may be selected Structures can be expanded to display their member fields Pointers can be traversed to display data to which they point Watchpoints can be set in this component Refer to Control Points chapter Data Operations Double click a variable line to edit the value e Click the fold unfold icons HIE to unfold fold the structured variable S12 X Debugger Manual Debugger Components General Debugger Components Double click a blank line Opens the Expression editor so you can insert an expression in the Data Component window Select a variable in the Data component and click the left mouse button R key to set a Read watchpoint on the selected variable A green vertical bar appears on the left side of the variables on which a read watchpoint is defined If a read access on the variable is detected during execution the program halts and the current program state displays in all window components Select a variable in the Data component and click
301. dragging the address from the Register Component to the Memory Component 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 to which you want to drag the object is visible 3 Select the object you want 4 Click and hold the left mouse button and drag the object into the destination component window 5 Release the mouse button Drag and Drop Combinations This section describes the possible combinations of drag and drop between components and associated actions Dragging and dropping objects between different component windows is explained in each component description section S12 X Debugger Manual Debugger Interface Features of the User Interface Dragging from Assembly Component Window Table 2 9 summarizes dragging from the Assembly Component Table 2 9 Dragging from the Assembly Component Window Destination Action Component Window Command Line Appends address of selected instruction to current command Memory Dumps memory starting at selected instruction program counter PC Select PC location in Memory component Register Loads destination register with PC of selected instruction Source Source component scrolls to source statement and highlights it Dragging from Data Component Window Table 2 10 summarizes dragging from the Data Compone
302. dress hex Name Condition Disable for condition Command Current and Interval controls are disabled S12 X Debugger Manual Control Points Breakpoints When multiple breakpoints are selected the Disable and Temporary controls in the Selected breakpoints group box are enabled and Disable in the Command group box is enabled Checking Expressions You can enter an expression in the Condition group edit box The debugger checks the expression syntax 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 the debugger detects a syntax error a message box appears Incorrect Condition Do you want to correct it If you click OK correct the error in the Condition edit box If you click Cancel the Condition edit box is cleared Saving Breakpoints The Debugger provides a way to store all defined breakpoints of the currently loaded application ABS file into the matching breakpoints file The matching file has the same name as the loaded ABS file but its extension is BPT for example the FIBO ABS file has a breakpoint file called FIBO BPT This file is generated in the same directory as the ABS file This is a text file in which a sequence of commands is stored This file contains the following information The Save amp Restore on load flag Save amp Restore on load checkbox in the Breakpoints ta
303. dress value of the component The default format is hexadecimal various formats are allowed Ident a known identifier Its content defines the port address Components IT_Keyboard component Example in gt ITVECT 0x400 Defines the interrupt vector port address of the IT_Keyboard at address 0x400 KPORT Use the KPORT command to set the line and column ports addresses of the Keyboard component Syntax KPORT address ident address ident address ident Arguments Address locates the port address value of the component The default format is hexadecimal many formats are allowed Ident a known identifier Its content defines the port address Components Keyboard component S12 X Debugger Manual 635 Connection Specific Commands Full Chip Simulator Commands Example in gt KPORT 0x100 0x200 0x300 Defines the ports of the Keyboard at addresses 0x 100 0x200 and 0x300 LCDPORT Description Use the LCDPORT command to set the data port and the control port address of the LCD component Syntax LCDPORT address ident address ident address ident Arguments Address locates the port address value of the component The default format is hexadecimal many formats are allowed Ident a known identifier Its contents define the port address Components LCD component Example in gt LCDPORT 0x100 0x200 Defines the ports of the LCD at addresses 0x100 0x200 and 0x300 LINKADDR Use the LINKADDR co
304. ds Full Chip Simulation Connection Commands mode SELECTCORE Description Select CPU12 or XGATE as a current core This is the same as selecting HCS12X FCS gt Select Core menu item NOTE Only for HCS12X and HCS12XE derivatives Syntax SELECTCORE CPU12 XGATE Example in gt SELECTCORE XGATE Selects XGATE as a current core STACK_AREA_CHECK Description Controls special checks if SP remains in the stack area Syntax STACK AREA CHECK AUTO OFF ON 1ow high STATUS Arguments displays the help AUTO enables stack checking Reads the range information from the ELF file This option works only if an ELF file is actually loaded It does not work with a HIWARE format object file or with an SRECORD An area specified with ON overrules the area set by the AUTO setting OFF disables the stack checking default This command only has an effect after enabling it with the ON or AUTO command 650 S12 X Debugger Manual Connection Specific Commands Full Chip Simulation Connection Commands ON low high range gt enables stack checking and sets the low and high range If the SP goes out of the low high range area the simulation stops with a stack overflow status STATUS prints a message which tells whether stack checking is currently enabled and if so which area is used Example STACK AREA CHECK ON 0x1234 0x1245 STACK POINTER INFO Des
305. dule 124 S12 X Debugger Manual Debugger Components General Debugger Components Demo Version Limitations Displays only one source file of the currently loaded application Associated Commands ATTRIBUTES FIND FOLD FINDPROC SPROC SMOD SPC SMEM UNFOLD Terminal Component The Terminal Component window shown in Figure 3 79 can be used to simulate input and output It can receive characters from several input devices and send them to other devices Figure 3 79 Terminal Window OC Terminal ZH 06 test file ZH_06 C Date Oct 04 1996 15 28 10 You can use a virtual Serial Communication Interface SCI 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 window shown in Figure 3 80 Figure 3 80 Terminal Context Menu Clear Input File Close Input File Output File Close Output File Configure Connections Cache Size S12 X Debugger Manual 125 Debugger Components General Debugger Components To open the context menu right click in the terminal window 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 choo
306. dule and port T are simulated using the Port T I O Register PTT PORTTBitx The pins are simulated as not memory mapped and can be accessed one by one through the object pool PORTTBitO to PORTTBit Periodic Interrupt Timer PIT The Periodic Interrupt Timer PIT I O device is not simulated Pulse Width Modulator PWM This I O device simulates the Pulse Width Modulator PWM Simulation of both 6 and 8 channel PWMs is supported The 6 channel PWM is a subset of the 8 channel PWM with fewer registers and in some registers using fewer bits The simulation is accurate up to one instruction due to instruction pipelining differences between the hardware and 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 as well as in the simulation although not the same irregularities as in the hardware For proper use of the module disable channels PWME register and reset the counter PWMCNTx registers before modifying the corresponding control register clock selection period settings etc as described in the manual S12 X Debugger Manual 297 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Clock Select Scalers and prescalers are simulated for the clock selection Changing clock control bits while channels are ope
307. dules are by default not selected for automatic erasing The NVM Programming Selection list box does not give many details about the listed blocks Type the Flash command in the Command window to display more information or open the Non Volatile Memory Control dialog box The NVM Programming Selection list box is closely associated with the Flash AEFSKIPERASING command of the debugger scs o a L TIP When using this feature make sure to also select modules that cover include all other modules listed modules usually called PAGED EEP_PAGED ALL PPAGES ALL EPAGES ALL xxx etc S12 X Debugger Manual 46 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 19 5 SDI Connection Menu Options Component Command Load Reset Communication Set MCU Type Set MCU Speed Memory Map Flash Modules and Module States If an on chip module consists of several independent blocks the NVMC dialog box might list all of these blocks Typically the NVMC groups all non volatile on chip blocks under one single listed module separates relevant and important non volatile memory blocks like mirrored non banked memory range and provides individua
308. dware doesn t have a sufficient firmware version the software will pop up an error dialog notifying the user that the firmware needs to be upgraded Future revisions of Codewarrior will update the firmware automatically For this release if you receive this error go to http www pemicro com osbdm and download the OSBDM Firmware Update Utility S12 X Debugger Manual 365 OSBDM Connection Support and Licensing Support and Licensing Open Source BDM is not supported by Freescale it is open source Any bugs enhancements or support questions should be addressed through the Open Source BDM forum Open Source BDM has been thoroughly tested but there is no guarantee of error free operation All the source files are available to anyone under the GNU LESSER GENERAL PUBLIC LICENSE For more information on this license refer to the COPYING_LGPL txt file located in the root directory of the OSBDM JM60 package which may be downloaded from the Freescale website Open Source BDM is a derivative project of the TBDML project 366 S12 X Debugger Manual 13 SofTec HCS12 Connection This section contains information to assist you with the SofTec HCS12 connection SofTec HCS12 Technical Considerations SMH Technologies earlier known as SofTec Microsystems supplies the SofTec HCS12 in circuit debugger programmer units which can be used with the 8 16 bit debugger and the CodeWarrior IDE to work with the HCS12 hardware When the debugger use
309. e Syntax XGDBGDONTSETONSTOP XGDBGAUTOONSTOP XGDBGCLEARONRUN XGDBGDONTCLEARONRUN XGDBGAUTOONRUN Arguments XGDBGDONTSETONSTOP Does not set XGDBG bit on stop XGDBGAUTOONSTOP Sets XGDBG bit automatically on stop if XGFRZ bit is set default mode XGDBGCLEARONRUN Clears XGDBG bit on run XGDBGDONTCLEARONRUN Does not clear XGDBG bit on run XGDBGAUTOONRUN Clears XGDBG bit automatically on run if XGFRZ bit is set default mode Example XGDBGDONTSETONSTOP XGATECODERANGE Description Defines the XGATE code memory area in RAM If using this command you must properly insert breakpoints in XGATE code S12 X Debugger Manual 661 Connection Specific Commands Other Hardware Connection Commands TIP You can extend address values with quotes to specify address spaces L for logical X for XGATE and G for global Syntax XGATECODERANGE lt first address gt lt last address gt Example XGATECODERANGE 0x800 X OxFFFF X XGATECODERANGESRESET Description Removes all XGATE code memory ranges inserted with the XGATECODERANGE command Syntax XGATECODERANGESRESET Example XGATECODERANGESRESET Other Hardware Connection Commands This section describes the other hardware connection commands i e not for Simulation that might be provided for a connection HWBREAKONLY Description Forces the debugger to use only hardware b
310. e c Freescale prog hiwave exe Instance currentTargetName Starting the debugger again brings the existing instance of the debugger to the foreground Prod lt fileName gt This option specifies the startup project directory and or project file Example c Freescale prog hiwave exe Prod c demoproject test pjt Nodefaults Instructs the debugger not to load the default layout see section 4 of the Project file Activation Example c Freescale prog hiwave exe nodefaults Cmd lt Command gt This option specifies a command to be executed at startup cmd characters Example c Freescale prog hiwave exe cmd open recorder 612 S12 X Debugger Manual Debugger Engine Commands Debugger Commands C lt cmdFile gt This option specifies a command file to be executed at startup Example c Freescale prog hiwave exe c c temp mycommandfile txt ENVpath Env lt Environment Variable gt lt Variable Setting gt This option sets an environment variable You may use this environment variable to overwrite system environment variables Example c Freescale prog hiwave exe EnvOBJPATH c sources obj S12 X Debugger Manual 613 Debugger Engine Commands Debugger Commands 614 S12 X Debugger Manual 23 Connection Specific Commands This chapter describes the unique connection specific commands available for the HC S 12 X debugger Abatron BDI Connect
311. e in warning setup none in warning setup msgbox in warning setup status WARNING SETUP STATUS MSGBOX 652 S12 X Debugger Manual Connection Specific Commands On Chip Hardware Breakpoint Module Commands Figure 23 2 FCS Warning Message Box FCS Warning C 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 warning setup none in warning setup status WARNING SETUP STATUS No warning messages NOTE With HALT CLMSG and MSGBOX options executing the command several times toggles the setup on and off On Chip Hardware Breakpoint Module Commands The following sections describe the Hardware Breakpoint Settings Command Line command used by the Target Interface This command is HWBPM You can enter this command in the Target Interface associated command files or in the Command Line component of the debugger HWBPM Description The command HWBPM allows you to set up the debugger to work with the on chip hardware breakpoints dialog Use HWBPM with no parameters to get the current breakpoints settings Use HWBPM MODE to specify which module to use and debugger response when using the on chip hardware breakpoint module and the on chip module S12 X Debugger Manual 653 Connection Specific Commands On Chip Hardware Breakpoint Module Commands 654 address This command has the
312. e lt 0 the position is relative to the end of the function P specifies the breakpoint as a permanent breakpoint T specifies the breakpoint as a temporary breakpoint A temporary breakpoint is deleted once it is reached State is E or D where E indicates enabled and D indicates disabled If state is unspecified default state is E condition is an expression matching 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 matching the Current field Counter in the Controlpoints Configuration window for counting breakpoints interval is an expression matching the Interval field Counter in the Controlpoints Configuration window for counting breakpoints codeSize is an expression 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 S12 X Debugger Manual Debugger Engine Commands Debugger Commands match the size of the function currently loaded in the ABS file the breakpoint is set but disabled sourceSi ze is an expression usually a constant number to specify for security the source text size of a functio
313. e Breakpoint Configuration dialog 000 491 Breakpoint Module Mode 0 0 0 0 ce eee eee eee 492 S12 X Debugger Manual 11 Table of Contents Book IV Commands and Environment Variables Book IV Contents s sson uisu DRE Ruhe press 497 22 Debugger Engine Commands 499 Commands Overview 0 0 cee eee eens 499 Available Command Lists 0 0 000 cece eee nee 500 Command Syntax Terms 20 0 ee eee 507 Debugger Commands rss es tunae iie a E T e a ia 510 A e T A A p E atts Ld 510 ACTIVATE S585 5 5 5 5 8 o e a a PEE e b ENA 511 ADDXPR ore ta aun EAA ans RUNS MESES DORIA ORS BS 511 ATTRIBUTES eoccvvwpe uH Ee REX esce 512 INT uoc eile Wendy RERUMS Hor E PENA RR ESSERE 523 AUTOS LDZE rod senes uda Ue ak ok dr 524 BASE utere ade E E comitis oi e Ness de d 524 Bei suh T E a AE UE 525 BCKCOLOR ew e SSG ee ER pe NEN 526 BDaor Iu IRA Ee EUM a A en DS 527 BS Soi wes eR eae el Soe Sd eee ey ie ake Ble eS 527 CADE et eto moe eee ohn an eer e eU 530 Gub PEREAT tne a PHP DP ME seh Goan DE 530 SE rM eedem is dre Sil cut bicis bM c 531 CLOCK 5 vemos nre be Do pene a peau ee x een ete ahah ES 533 CLOSE rune mu DE a age Ea A aa X HET OY 534 COLDPAPSE eerie EE LACE NICE MERI SO MSS SES ERE 534 COM START ERR Yee etat e ae e epa 535 COM EXE 5 IhCUheDuP EM ROM rp nu Reda nERE 535 COMCEXEDI a e a ut ida stie elc tei LES 536 COPYMEM eee atc ele a IESU ad A hae ace eS LE 536 CMDBHI E sy uz E
314. e Breakpoint Positions 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 S12 X Debugger Manual 169 Control Points Breakpoints Figure 4 3 Source and Assembly Windows 170 Cor CERE ENDEMOMiboc dne26 f f f i Afi cina r ibl ib2 ibo 2 hile i n i 0 1 fibl n 0 ds n Oh pw 9 9 0 0 0 KKK eturn fibo l The Debugger helps you detect all positions where you can set a breakpoint 1 Right click in the Source component to display the Source context menu on the screen 2 Choose Marks from the context menu All statements where a breakpoint can be set are identified by a red inverted check mark zl To remove the breakpoint marks right click in the Source component and choose Marks again Temporary Breakpoints Temporary breakpoints activate the next time the instruction executed The following icon identifies a temporary breakpoint 41 Setting Temporary Breakpoints Using the Source Window Context Menu 1 Point at a C statement in the Source window and right click to display the Source context menu 2 Choose Run To Cursor from the context menu The application continues execution and stops before executing the statement You have executed a temporary breakpoint S12 X Debugger Manual
315. e Component Table 2 13 Dragging from the Procedure Component Window Destination Component Window Action Data gt Local Displays local variables from selected procedure in data component Source Displays source code of selected procedure Highlights current instruction in Source component Assembly Highlights current assembly statement inside the procedure in Assembly component Dragging from Register Component Window Table 2 14 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 corresponding instruction and highlights it Memory Dumps memory starting at address stored in selected register Selects corresponding address in memory component S12 X Debugger Manual 51 Debugger Interface Features of the User Interface Dragging from Module Component Window Table 2 15 summarizes dragging from the Module Component Table 2 15 Dragging from the Module Component Window Destination Action Component Window Data gt Global Displays global variables from selected module in data component Memory Dumps memory starting at address of first global variable in module Selects memory area where variable is located in the memory component Source Displays source code from selected module
316. e GUI with tool bar Visualization functions Versatile and intuitive drag and drop functions between components Folding and unfolding of objects like functions structures classes Graphical editing of user defined objects Smart interactions with objects Extensibility function Show Me How Tool Context sensitive help Smooth integration into third party tools Supports both Freescale and ELF DWARF Object File Format and S Records Demonstration Version Limitations When you start the Debugger in demonstration mode or with an invalid engine license then all components protected with FLEXIm are in demonstration mode The limitations of all components are described in their respective chapters 26 S12 X Debugger Manual Debugger Interface This chapter describes the Debugger Graphic User Interface GUD The CodeWarrior IDE main window acts as a container for all debugger component windows 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 component windows automatically resize when you resize main window Component windows overlap Minimized component windows appear as Debugger Main window icons Application Programs The CodeWarrior installer
317. e Only access kind Write protected legacy replaced by physical memory type with Read Only access kind R W protected legacy replaced by physical memory type with None access kind 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 on chip memory Banked this type handles the PPAGE register when accessing the Program page banked data typically program code in on chip 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 cast by the DMM to global memory which should therefore be defined for the matching range EEP banked or D flash banked these types cover accessing 800 BFF EEPROM or D flash data window the user application accesses via EPAGE in global address space Important All accesses are cast 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 set to Global displays the global space memory of the device S12 X Debugger Manual Debugging Memory Map DMM Commands xgate this type covers accessing of the XGATE memory space as the XGATE core would see it The Memory window with Addr
318. e Selected and All Submenu Figure 3 39 shows Mode Selected and All submenu The Mode Selected and All submenu is activated by highlighting this entry on the MCURegisters component menu Figure 3 39 Mode Selected and All Submenus 86 v Automatic Periodical S12 X Debugger Manual Debugger Components General Debugger Components Table 3 22 describes the Mode Selected and All submenu entries Table 3 22 Mode Selected and All Submenu Menu Entry Description Automatic Switches to Automatic mode default registers are updated when the connection is stopped Periodical Switches to Periodical mode registers are 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 as shown in Figure 3 40 Update Rate Dialog Box Figure 3 40 shows Updat Rate dialog box The Update Rate dialog box allows you to modify the default update rate using steps of 100 ms Figure 3 40 Update Rate Dialog Box Update Rate Rate Cancel Tree Submenu Figure 3 41 shows the Tree submenu The Tree submenu is activated by highlighting the Tree entry on the MCURegisters menu Expand Collapse Table 3 23 describes Tree submenu entries Figure 3 41 Tree Submenu S12 X Debugger Manual 87 Debugger Components General Debugger Components Table 3 23 Tree Submenu LI re CC XENEEM Expand Un
319. e gt lt options gt AbsFileName is the name of the application to load in the debugger Precede each option with a dash Refer to Command Line Options for available command line commands Order of Commands Commands specified by options are executed in the following order 1 Load activate the project file see below The debugger uses project ini by default unless you specify another project file 2 Load lt exeFile gt if available and start running unless option W was specified 3 Execute command file lt cmdFile gt if specified 4 Execute command if specified NOTE In version 6 0 of the debugger the loaded program starts after all command and command files are executed S12 X Debugger Manual 211 How To Switching Connections NOTE The function Open in the File menu interprets any file without an ini extension as a command file and not a project file Example C Program Files Freescale CWS12v5 1 Prog DEMO TEST ABS w d Switching Connections It is possible to switch connections from within an existing HC12 debugging project The following paragraphs explain how to change the connection in debugger although it is recommended to switch connection in project in IDE to keep consistency If you are not using CodeWarrior IDE project then this information might be important for you Loading the Full Chip Simulation Connection Because there is no actual hardware inv
320. e information refer to Change MCU Connection Wizard section in S12 X Build Tools Reference Manual C Program Files Freescale CWS12v5 1 Help pdf 5 Click Next to display next page of the wizard The XGATE Setup screen appears S12 X Debugger Manual 223 How To Using the Stationery Wizard to Create a Project Figure 6 21 XGATE Setup Screen HC S 12 X Microcontrollers New Project Wizard Map Would you like to have the support of XGATE The created project will only contain source code for the HCS1 Device and Connection iow itis pear to manually add G Si support later XGATE Setup Single Core HCS12 Project Parameters Multi Core HCS12X and XGATE Add Additional Files Processor Expert lt Back Cancel 6 This screen appears only for selected derivatives that support XGATE Unless you need XGATE support select the Single Core HCS12X format by clicking its radio button Selecting any of the options results in the following conditions Single Core HCS12X The created project only contains source code for the HCS12X However it is possible to add XGATE support at a later date manually Multi Core HCS12X and XGATE The created project contains source code for the HCS12X and the XGATE 7 Click Next to continue The Project Parameters screen appears 224 S12 X Debugger Manual How To Using the Stationery Wizard to Create a Project Figure 6 22 Project Parameters Screen
321. e instruction set but also the on chip I O devices such as CRG PWM or ECT Supported HC S 12 X Derivatives lists the supported I O devices for each supported derivative Generating a new project with the New HC 12 Project Wizard and the Full Chip Simulation connection sets everything up to run the project with FCS support Use the menu option Simulator gt Set Derivative to change the derivative to simulate In addition to the derivatives there are special entries HC S 12 X CORE and HC S 12 X SAMPLE The CORE entries allow you to simulate the chip without FCS support plain instructions only and the SAMPLE entries allow you to simulate a chip with a minimal set of commonly available on chip peripherals like Register Block Memory Expansion Registers Clock and Reset Generator Serial Communication Interface 0 SCIO and PortB Figure 10 11 Set Derivative Dialog Box 284 Set Derivative 12DP255B The MCUID 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 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives The status bar shows the current mode of Simulation SAMPLE CORE or MCU derivative You can access the Set Derivative dialog by double clicking on the FCS support entry in the status bar See D
322. e linker uses a PRM file like the one shown in Listing 5 4 to place the segment at the correct address Listing 5 4 Linker PRM File NAMES rtk o END SECTIONS RTK SEC NO INIT 0x1040 TO Ox1F80 END PLACEMI Ej NT OS DATA INTO RTK SEC END Compile the source file for example rtk c and list it in the NAMES section of the linker parameter file To force linking follow the name of the object file immediately by In this example the variable is linked to the address 0x1040 If you prepare an application in this way you may inspect all declared variables 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 S12 X Debugger Manual 199 Real Time Kernel Awareness RTK Awareness Register Assignments NOTE Do 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 2 shows the register assignments for the RTK awareness for the HC12 processor Table 5 2 HC12 RTK Awareness Register Assignments Register Register Name Size in bits 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 R12 EPAGE 8 R13
323. e protected legacy replaced by physical memory type with Read Only access kind R W protected legacy replaced by physical memory type with None access kind 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 on chip memory Banked this type handles the PPAGE register when accessing the Program page banked data typically program code in on chip Flash in 8000 BFFF address range window Registers This type cares if the I O Registers block and Memory Expansion Registers change including I O Registers block moving S12 X Debugger Manual 463 Debugging Memory Map CPU Core Priorities and Types HCS12X Core These priorities and types are specific to the HCS12X core 464 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 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 legacy replaced by physical memory type with Writ
324. e the DDEPROTOCOL command to configure the Debugger Simulator dynamic data exchange DDE protocol By default the DDE protocol is activated and not displayed in the command line component Usage DDEPROTOCOL ON OFF SHOW HIDE Where ON enables the DDE communication protocol STATUS 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 S12 X Debugger Manual 541 Debugger Engine Commands Debugger Commands STATUS tells you whether the DDE protocol is active on or off and if display is active Show or Hide Components Debugger engine Example in gt DDEPROTOCOL ON in gt DDEPROTOCOL SHOW in gt DDEPROTOCOL STATUS DDEPROTOCOL ON DISPLAYING ON This example activates and displays the DDE protocol and gives the status in the command line component NOTE For more information on Debugger Simulator DDE implementation refer to Debugger DDE Capabilities DEFINE 542 The DEFINE command creates a symbol and associates the value of an expression with it Arithmetic expressions are evaluated when the command is interpreted Use the symbol to represent the expression until the symbol is redefined or until the UNDEF command undefine the symbol A symbol is a maximum of 31 characters long In a command line all symbol occurrences after the command name are
325. e 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 Assembly Component The Assembly window shown in Figure 3 3 displays program code in disassembled form Its function is similar to that of the Source component window but on a much lower abstraction level Thus it is possible to view change monitor and control the current location of execution in a program S12 X Debugger Manual 55 Debugger Components General Debugger Components Figure 3 3 Assembly Window E Assembly main 4322000 ANDCC 239 388002 BRA 0 abs 0x388002 388004 LDX OxC00D 0xC00B 16 abs 0x38801A 38800D LDY 2 X 38800F LDD 2 X 388011 CIR 1 Y This window contains all on line disassembled instructions generated by the loaded application Each disassembled line in the window can show the following information the address machine code instruction and absolute address in case of a branch instruction Default settings show the instruction and absolute address Any breakpoints set in the application are marked in the Assembly component with a special symbol depending on the kind of breakpoint If execution stops the current position is marked in the Assembly component by highlighting the corresponding instruction The Object Information Bar of the component window contains the procedure name which co
326. e you can specify hexadecimal octal or binary constants using the Assembler prefixes shown in Table 22 7 Table 22 7 Assembler Notation for Constant Notation Meaning Hexadecimal constant Q Octal constant l Binary constant Table Example 2F00 Hexadecimal Constant 43 p 10011 Binary Constant Octal Constant When the default number base is 16 constants starting with a letter A B C D E or F must be prefixed either by 0x or by as shown in Table 22 8 Otherwise the command line interpreter cannot detect if you are specifying a number or a symbol Table 22 8 Base is 16 Constants Starting with Letter A B C D E or F Hexadecimal constant 5AFD Table Example in NB 16 Hexadecimal constant AFD The number base is hexadecimal 576 S12 X Debugger Manual Debugger Engine Commands Debugger Commands NOCR The NOCR command closes the current record file Open the record file with the CR command Usage NOCR Components Debugger engine Example in gt NOCR Closes the current record file NOLF The NOLF command closes the current Log File Open the log file with the LF command Usage NOLF Components Debugger engine Example in gt NOLF Closes the current Log File OPEN Use the OPEN command to open a window component Usage OPEN component x y width height I MAX S12 X Debugger Manual 577 D
327. eName Cl NL Components Debugger engine Example in cf util config cmd Loads the config command file CD 530 The CD command changes the current working directory to the directory specified in the path Entering the command with no parameter displays the current directory The directory specified in the CD command must be a valid directory and 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 path is unspecified the default directory is the project directory Using the CD command can affect all commands that refer to files with unspecified paths Usage CD path path The pathname of a directory that becomes the current working directory case insensitive Components Debugger engine S12 X Debugger Manual Debugger Engine Commands Debugger Commands Example in gt 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 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 Entering the
328. ead write counting or conditional with a debugger command Specify this command in the Watchpoints tab of the Controlpoints Configuration window To open this window Choosing Show Watchpoints from Data Context Menu 1 Point in the Data component window and right click The Data Context Menu appears 2 Select Show Watchpoints from the context menu The Watchpoints tab of the Controlpoints Configuration window appears 3 Click on the corresponding entry in the list of defined breakpoints to select the watchpoint you want to modify 4 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 Associate a command file with a watchpoint using the commands CALL or CF Example CF breakCmd cmd 5 Click OK to close the window When the watchpoint is detected the command executes and the application stops at this point The Continue check button allows the application to continue after command execution Demo Version Limitations Only two watchpoints can be set Watchpoints in Multi Core Projects HCS12X multicore derivative debug module allows setting of watchpoint to either CPU12X or XGATE data bus Correspondingly for multicore HCS12X derivatives debugger sets watchpoint to either CPU12X or XGATE data bus so when watchpoint for the variable shared between CPU12X and XGATE is set it will work only for access from the corresponding core
329. ears in context menu only if a markpoint is disabled at nearest code position visible with marks When selected enables this markpoint Delete Appears in context menu only if a markpoint is set at nearest code Markpoint position visible with marks When selected disables this markpoint Show Opens Controlpoints Configuration Window s Markpoints Tab which Markpoints allows you to view the list of markpoints defined in application and modify their properties see Control Points Set Program Counter Sets Program Counter to the address of selected source code Open Source File Opens Source File dialog if a CPU is loaded see next section Copy Copies selected area of source component into the clipboard Select CTRL C a word by double clicking it You can select a text area with the mouse by moving the pointer to the left of the lines until it changes to a right pointing arrow and then drag up or down automatic scrolling is activated when the text is not visible in the windows Go to Line Opens dialog box to scroll window to a number line CTRL G Find Opens a dialog box prompting for a string and then searches file CTRL F displayed in source component To start searching click Find Next Search begins at current selection or at first line visible in source component Find Procedure CTRL l Opens a dialog box for searching a procedure Foldings Opens folding window see
330. ebugger Engine Commands Debugger Commands range an address range constant that defines the block of memory to be set to the values of the bytes in the list list a list of byte values to be stored in the block of memory Components Debugger engine Example in gt MS 0x1000 0x100F OxFF Fills the memory range between addresses 0x1000 and 0x100F with the OxFF value NB The NB command changes or displays the default number base for the constant values in expressions The initial default number base is 10 decimal Use NB to change to base 16 hexadecimal base 8 octal base 2 binary or reset to base 10 Always specify the base 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 22 6 Usage NB base Where base is the new number base 2 8 10 or 16 Components Debugger engine Table 22 6 ANSI C Constant Notation 0x Hexadecimal constant Q Octal constant S12 X Debugger Manual 575 Debugger Engine Commands Debugger Commands Table Example Ox2F00 Hexadecimal Constant 043 Octal Constant 255 Decimal Constant In the same way the debugger supports the Assembler notation for constant That means that independent of the current number bas
331. ebugger Engine Commands Debugger Commands where component is the component name with an optional path xis the X axis of the upper left corner of the window component e y is the Y axis of the upper left corner of the window component widthis the width of the window component height the height of the window component Specify I to activate the icons in the component window specify MAX to maximize the component window Component names are Assembly Command Coverage Data Inspect Memory Module Procedure Profiler Recorder Register Source Stimulation Components Debugger engine Example in gt OPEN Terminal 0 78 60 22 Opens the Terminal component and window at the specified positions and with specified width and height OUTPUT With OUTPUT you can redirect the Coverage component results to an output file indicated by the file name and his path Usage OUTPUT FileName Where FileName is file name path name Components Coverage component Example in gt coverage lt OUTPUT c Freescale myfile txt Redirects the Coverage output results to the file myfile txt from the directory C Freescale 578 S12 X Debugger Manual Debugger Engine Commands Debugger Commands The P command executes a CPU instruction either at a specified address or at the current instruction indicated by the program counter This command traces through subroutine calls software interrupts and operations involving the f
332. ebugger Manual 81 Debugger Components General Debugger Components HCS12XAdrMap Menu Figure 3 33 shows the HCS12XAdrMap menu Figure 3 33 HCS12XAdrMap Menu Show Location Table 3 16 describes HCS12XAdrMap menu entries Table 3 16 HCS12XAdrMap Menu Description Show Location Forces the Memory component to select data at the address displayed in the HCS12XAdrMap component window Drag Out NONE Drop Into Table 3 17 describes the drop actions possible in the HCS12XAdrMap component Table 3 17 HCS12XAdrMap Drop Possibilities Source Component Window Action Assembly Maps memory address at selected PC instruction Data Maps memory address where selected variable is located Register Maps memory address stored in selected register Demo Version Limitations NONE Associated Commands NONE 82 S12 X Debugger Manual Debugger Components General Debugger Components MCURegisters Component The MCURegisters window shown in Figure 3 34 displays the names values and details access size address id in case of CPU registers of CPU and device registers The registers are arranged on the basis of groups and modules in tree view structure The root item of the tree view contains the board name The content of child node can be hidden or displayed by folding or unfolding corresponding parent node Figure 3 34 MCURegisters Window MCU Register Details SRS 0x80 Read Wri
333. ebugger Status Bar with Full Chip Simulation Supported HC S 12 X Derivatives Please refer to release notes section for Full Chip Simulation to get detailed information on supported derivatives and modules simulated CodeWarrior install directory MRelease Notes MHC12NFCS Notes NOTE To simulate unlisted derivatives either use a derivative with similar on chip peripherals or use the FCS SAMPLE or CORE mode Communication Modules The communication modules available on the HC S 12 X debugger are described in the corresponding derivative simulation release notes The following I O devices are not simulated unless it is defined otherwise Byteflight BF J1850 Bus BLCD Scalable CAN MSCAN Universal Serial Bus Module USB20D6E2F nter IC Bus IIC Serial Communication Interface This I O device simulates the Serial Communication Interface SCI The unmapped registers SCIInput SCIInputH and SerialInput serve to send characters to the SCI Module The unmapped registers SCIOutput SCIOutputH and SerialOutput contain the characters sent from the SCI Module Table 10 4 Simulated SCI Registers Register Full Register Name Simulated Fields Acronym SCOBDH SCI Baud Rate Register High SBR12 8 SCOBDL SCI Baud Rate Register Low SBR7 0 S12 X Debugger Manual 285 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 4 Simulated SCI Registers continued
334. ect Variable for Kind of Port S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Tutorials 4 Select PWMPEROI Overlap STR PWMPEROSTR Byte for Port to Display Leave all others on default You might add labels with Right mouse click gt Add New Instrument gt Static Text Duty Time Bar Properties Now add a bar to change the duty time Right mouse click Add New Instrument Bar Double click on the Bar to see the Bar Properties Select Variable for Kind of Port Select pwmRatio for Port to Display Select 65535 for High Display Value QU e nose TBD SESS Leave all others on default Run the Application Now let s leave the Edit mode and run the final application First we save the window layout 1 Right mouse click gt Edit Mode or Ctrl E 2 Select the Save icon in debugger or the menu bar File Save Configuration to save the window layout 3 Select the Debug icon in debugger or the menu bar Run Start Continue or F5 S12 X Debugger Manual 351 HC S 12 X Full Chip Simulation Connection FCS Tutorials Figure 10 30 Debugger Main Window Final Application T a De Fie Vew Run HCSIZFCS Component Vausluaton Toot Window Heb legi e tie 5 i 9l D MPhof ecib 3819804 Documents groct my E128 peaarst PE Te COOL VE Tete Processor Expert internal initialization DON T REMOVE TRIS COQUE ee PL iow Level tasti Esd of Processor Expert tntersel init
335. ed no physical transmission takes Enable place LSBF LSB First Enable Not simulated no physical transmission takes place Control Register 2 PUPS Pull Up Port S Enable Not simulated no physical transmission takes place RDS Reduce Drive of Port Not simulated no physical transmission takes S place SPCO Serial Pin Control 0 Selects Normal or Bidirectional transmission mode SPRx Baud Rate Register Baud rate of the SPI transmission SPIF Interrupt Request System sets SPIF after the eighth SCK cycle in a data transfer Status Register read followed by a read or write access to the SPI data register clears SPIF WCOL Write Collision Status Set upon the writing of new data to the Data Register Register during a serial data transfer MODF Mode Error Interrupt Not simulated no physical transmission takes Status Flag place SPODR Data Register 8 bit Data Register for SPI data PORTS Port S Data Register Not simulated no physical transmission takes place DDRSx Port S Data Direction Direction of Data Only bits 4 and 5 have any for Bit x effect Virtual register Value simulates the data register of a second SPI device This permits simulated communication with a second SPI device The transmission can be in Normal or Bidirectional Mode the device can be set as Master or Slave See also the MC68HC812A4 Technical Summary MC68HC812A4TS D S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Key Wakeups Supported HC
336. ed 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 changes the Counter value automatically resets 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 Ctrl keys When multiple watchpoints in the list box are selected the name of the group box Watchpoint is changed to Selected Watchpoints When multiple watchpoints are selected the Address hex Size Name Condition Disable for condition Command Current and Interval controls are disabled When multiple watchpoints are selected in the list box the Disable Read and Write controls in the Selected watchpoints group box are enabled When multiple watchpoints are selected Disable in the Command group box is enabled Click Delete when multiple watchpoints are selected to remove watchpoints from the list box Checking Syntax You can enter an expression in the Condition group edit box The debugger checks the syntax of the expression when you select another watchpoint in the list box or when you click OK If a syntax error is detected a message box appears Incorrect Condition Do you want to correct it Click OK to correct the error in the co
337. eescale gt WORK gt lt processor gt c directory of your Freescale installation and select ibo c file Then right click the mouse and choose Add to Project from the context menu This adds the file to the current project and a green mark appears in front of it Figure 9 4 Figure 9 4 Adding Files to Project Using Explorer Tab ie Project _ Of x P Explorer View C Folder View Logical View zy flexim C Hiware w ork MB8kc 2 Hiware Name Size T Modified H Demo fibo abs 817 10 14 99 H E Docu v Fibo c 1017 CSource File 5 20 98 8 H Lib v myproject dcp 1 07KB Developme 11 5 99 2 v default env 211 11 5 99 9 a Monitors v project ini 1017 Configuratio 1145 99 9 HQ Prog v fibo mak 140 n 7 31 88 1 H Tutorials fibo MAP 6 29KB 7 22 99 9 Egg Work Default mem 160 747 97 8 3 fibo o 599 OFile 10 14 99 v Fibo prm 400 8 18 97 1 NA v Readme txt 567 TextDocum 8 26 98 1 E Recycled H E Temp 4 In the same way select the fibo prm file and add it to this project S12 X Debugger Manual 255 Synchronized Debugging through DA C IDE Configuring DA C IDE for Freescale Too Kit You can also add a directory to the project in the following way 1 Select Explorer View Tab in Project Window 2 In the left section select the directory containing the files to be added to the project you may also add files from subdirectories to the project 3 From context menu choose Add to project You may
338. egisters Selecting HCS12 X Autodetect returns debugger to automatic identification of device ID PARTID mode default debugger setup Select Core Synchronizes debugger windows with a specific core when several cores are available Available only when several cores are available for debugging Figure 16 2 Turbo BDM Light Status Box E Turbo BDM Light Status TBDML HW ver TBDML SW ver TBDML DLL ver TBDML GDI DLL BDM Status Reg OxC0 Crystal in MHz 2 0 1 398 S12 X Debugger Manual Book Ill HC S 12 X Debugger 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 III HC S 12 X Debug Connections Common Features e Chapter 17 On Chip DBG Module for S12 S128 S12G S12P 12X Platforms Chapter 18 Debugging Memory Map Chapter 19 Flash Programming e Chapter 20 Unsecure HCS12 Derivatives Chapter 21 On Chip Hardware Breakpoint Module S12 X Debugger Manual 399 Book IIl Contents 400 S12 X Debugger Manual 17 On Chip DBG Module for 12 12S 12G S12P 12X Platforms The HCS12 derivatives featuring an on chip DBG module require a graphical user interface to set up this module and take full advantage of this feature This chapter describes the DBG module features and us
339. eh Book Debugger Engine Book I Contents eee RR 1 Introduction Freescale Debugger 1 0 0 c eese Debugger Application 0 0 esee Debugger Features 0 cc cece eee eee Demonstration Version Limitations 2 Debugger Interface Application Programs llle eee eee Debugger Main Window 00 2 cece eee eee eee Debugger Main Window Toolbar Debugger Main Window Status Bar Main Window Menu Bar esee Component Menu 0 0 0 eee eee eee Window Menu 0 0c eh Help Mentee vba eee eee ed meV ag Sue bees Component Associated Menus 0 0 ess Component Main Menu 0 00 0008 Component Windows Object Information Bar Component Context Menu 2 0006 Features of the User Interface eese Activating Services with Drag and Drop S12 X Debugger Manual Table of Contents Drag and Drop an Object 2 0 0 eee eee 48 Drag and Drop Combinations 0 00 e eee eee ee 48 3 Debugger Components 53 Debugger Kernel Components 0 0 00 eee eee eee 53 CPU Components cocer whe see Gel qe RUE ee hee SS 53 Window Components 53 Connection Components 0 00 cece es 53 Loading Component Windows eeseeeeeeee eene 54 General Debugger Components 0 0 0 0 0c cece eee eee
340. elds 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 File Loading section explains this option The second checkbox of the Configuration group is Save and restore workspace content If this checkbox is clear Flash programming applications overwrite any data in RAM 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 See Configuration FPP File Loading for additional information about FPP files The FPP files also include code applet
341. em to behave like STOP mode 294 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 13 Simulated ECT Registers Register Full Register Name Simulated Fields Acronym TIOS Timer Input Capture Output Compare IOS7 0 Select Register CFORC Timer Compare Force Register FOC7 0 OC7M Output Compare 7 Mask Register OC7M7 0 OC7D Output Compare 7 Data Register OC7D7 0 TCNT Timer Count Register Partly simulated Not writable in test mode TSCR1 Timer System Control Register 1 TEN TFFCA TTOV Timer Toggle On Overflow Register 1 TOV7 0 TCTL1 TCTL2 Timer Control Register 1 and 2 OM7 0 OL7 0 TCTL3 TCTL4 Timer Control Register 3 and 4 EDG7B EDG3B EDG7A EDG3A EDG6B EDG2B EDG6A EDG2A EDG5B EDG1B EDG5A EDG1A EDG4B EDGOB EDG4A EDGOA TIE Timer Interrupt Enable Register C71 C3l Cel Cal C5I C1I CAI Col TSCR2 Timer System Control Register 2 TOI PR2 0 TCRE TFLG1 Main Timer Interrupt Flag 1 C7F C3F C6F C2F C5F C1F C4F COF TFLG2 Main Timer Interrupt Flag 2 TOF TCx Timer Input Capture Output Compare All registers Registers 0 7 S12 X Debugger Manual 295 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 13 Simulated ECT Registers continued 296 Register Full Register Name Simulated Fields Acronym PACTL 16 Bit Pulse Accumulator
342. ent S12 X Debugger Manual 511 Debugger Engine Commands Debugger Commands ATTRIBUTES 512 This command can affect several components as described in the next sections Ensure that you direct this command properly to prevent unexpected changes In the Command Component This 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 1 000 000 NOTE Usually this command is not specified interactively by the user However this command can be written in a command file or a layout HWL file to save and reload component window layouts An interactive equivalent operation is typically possible using Simulator Debugger menus and operations drag and drops etc as described in the Equivalent Operations sections of the following component descriptions Usage ATTRIBUTES list where 1ist command command command CACHESIZE value Example command lt ATTRIBUTES 2000 In the Procedure Component This 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 1ist command command command VALUES ON OFF TYPES ON OFF Example Procedure lt ATTRIBUTES VALUES ON TYPES ON S12 X Debugg
343. ent Menu Component Source Winc Set Connection x Fonts Background Color Table 2 6 describes the Component Menu entries Table 2 6 Component Menu Description 42 Menu entry Description Open Loads an extra component window not loaded by Debugger at startup Presents a set of components introduced in Typical Component Window Display Set Connection Sets the Debugger connection Fonts Opens standard Font Selection dialog to set font used by Debugger components Background Opens standard Color Selection dialog to set background color used Color by Debugger component windows NOTE To enhance display readability use a proportional font such as Courier or Terminal S12 X Debugger Manual Debugger Interface Debugger Main Window Select Component gt Open to load a component window not loaded by the Debugger at startup The context dialog presents a set of different components that are introduced in Debugger Components Open the Set Connection dialog box shown in Figure 2 19 by selecting Component gt Set Connection Figure 2 19 Set Connection Dialog Box Set Connection Processor es Connection Full Chip Simulation Y Cancel This Connection supports Help Freescale HC S 12 X Full Chip Simulation H Freescale HC S 12 X Instruction Set Simulator C Program FilessFreescalesCode Warrior for 1 Use the Processor context menu to select the desi
344. ently defined breakpoints SAVEBP on when the user quits the Simulator Debugger or loads another ABS file NOTE For more information about this syntax refer to BS command and to the Control Points chapter Usage SAVEBP on off Components Debugger engine S12 X Debugger Manual 587 Debugger Engine Commands Debugger Commands Example content of the FIBO BPT file savebp on BS amp fibo c Fibonacci 19 P 47 srSz 2 0 ti cond fibo gt 10 E cdSz BS amp fibo c Fibonaccit 31 P E cdSz 47 srSz 0 BS amp fibo c main 12 P E cdSz 42 srSz 0 BS amp fibo c main 21 P E cond fiboCount 5 E cmd Assembly lt spc 0x800 E cdSz 42 srSz 0 SET Sets a new current target for the debugger by loading the targetName component Usage SET targetName where targetName is name without extension of the target to set Components Debugger engine Example in gt SET Sim The debugger s current target is Simulator SETCOLORS Use the SETCOLORS command 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 588 S12 X Debugger Manual Debugger Engine Commands Debugger Commands Background is the new color for the channel background the format is 0x00bbggrr Cursor is the new color for the channel cursor the for
345. enu see VisualizationTool Menu 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 clicking the tab key To make multiple selections hold down the control key and left click on the desired instruments You can also left click hold and move to create a selection rectangle Move Instruments There are two ways to move instruments First make your desired selection 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 Resize an object by dragging its sizing handles or by using the directional arrow keys while holding down the shift key The resize process performed with the mouse can be broken off by pressing the escape key Only one instrument can be resized at a time Furthermore each instrument has its own size minimum VisualizationTool Menu Once you launch the Visualization Tool component its menu appears in the debugger menu bar Figure 3 101 displays the Visualization Tool menu S12 X Debugger Manual Debugger Components Visualization Utilities Figure 3 101 Visualization Tool Menu UTE eua Window Help
346. equencer General settings Automatic breakpoints MET and trace possible Automatic breakpoints watch The DBG module is setup to record the executed change of flows of the S12X No trigger is set the debugger must be stopped on the user request The DBG module is used to set Breakpoints and Watchpoints Trace mechanism activated for the HCS12X core The DBG module records change of flows until the condition is met or the debugger is Switch DBG modes by displaying the list menu as shown above and selecting any one of the three modes With some modes some of the Trigger Settings tab options are not available Use the four sub tabs of the Trigger Settings tab of this window with their text fields radio buttons and check boxes to set up the individual triggers Trace Setup Control Use the options made available in the Trace list menu of the Trigger Settings tab to set up DBG trace in the Trace component window Configure DBG Trace to record HCS12X only XGATE only or both cores S12 X Debugger Manual 439 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 34 Trigger Settings Tab Trace Drop List Trigger Module Settings Trigger settings Sequencer General settings Automatic breakpoints watchpowts and trace possible A RAWAcces B Notdefined C Notdefned D Not defined EE e Bam 70 Ro o000 wah Mask f0x0000 7 Trace HCS1
347. er OxFFOF default mask comparison mask for the security register 0x03 default lt compare value gt comparison value for the security register 0x02 default Syntax CHIPSECURE UNSECURE CHIPSECURE SETUP lt addr reg to check gt lt mask gt lt compare value gt Example The following command sets up the CHIPSECURE for most HCS12 derivatives in gt CHIPSECURE SETUP OxFFOF 0x3 0x2 in gt XGATE Specific Hardware Connection Commands This section describes a set of commands that are used when debugging with a hardware connection i e not for Simulation on a device with an XGATE core The specific commands are e HCS12X MAP4000 658 S12 X Debugger Manual Connection Specific Commands XGATE Specific Hardware Connection Commands SELECTCORE STEPBOTHCORES XDBG XGATECODERANGE XGATECODERANGESRESET Enter these commands in any command files to be executed by the debugger or in the debugger Command Line component HCS12X MAP4000 Description Use this command to indicate to the debugger for the S12X series where the 4000 7FFF memory range is mapped By default it is mapped to FLASH NOTE Place this command in a Startup command file Maps the S12X 4000 7FFF range to RAM FLASH or EXTERNAL memory Syntax HCS12X_MAP4000 FLASH RAM EXTERNAL Example in gt HCS12X_MAP4000 RAM 4000 7FFF memory range mapped to RAM NOTE The HCS12X_MAP4000 comman
348. er Manual Debugger Engine Commands Debugger Commands In the Assembly Component This command allows you to set the display and state options for the Assembly component window Usage ADR displays or hides the address of a disassembled instruction ON OFF switches 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 CODE displays or hides the machine code of the disassembled instruction ON OFF switches the machine code on or off ABSADR shows or hides the absolute address of a disassembled instruction such asbranch to ON OFF switches the absolute address on or off TOPPC scrolls the Assembly component to display the code location given as an argument on the first line of Assembly component window SYMB displays or hides the symbolic names of objects ON OFF switches the symbolic display on or off ATTRIBUTES list where 1ist command command command ADR ON OFF SMEM range SPC address CODE ON OFF ABSADR ON OFF TOPPC address SYMB ON OFF NOTE Also refer to SMEM and SPC descriptions for more details about these commands The SPC command is similar to the TOPPC command but also highlights the code and does not scroll to the top of the component window Equivalent Operations ATTRIBU
349. er Manual 113 Debugger Components General Debugger Components Table 3 41 Register Component Drop Possibilities 114 Source Component Action Window Assembler Loads destination register with PC of selected instruction Data Dragging the name loads destination register with start address of selected variable Dragging the value loads destination register with value of the variable Source Loads destination register with PC of first instruction selected Memory Loads destination register with start address of selected memory block Demo Version Limitations No limitations Associated Commands ATTRIBUTES Source Component The Source window shown in Figure 3 68 displays the source code of your program i e your application file S12 X Debugger Manual Debugger Components General Debugger Components Figure 3 68 Source Window Ei Source E DEMO fibo c Line 18 unsigned int Fibonacci unsigned int n E unsigned fibl fib2 fibo int i fibl fib2 fibo i 2 while i lt n BH fibo fibl fib2 fibl fib2 fib2 fibo return fibo EB void main void a The Source window allows you to view change monitor and control the current execution location in the program The Source component window emphasizes language keywords comments and strings with blue green and red respectively Select a word by double clicking it Select a section of code by holdin
350. er Manual 163 Control Points Breakpoints Enable disable multiple control point commands by selecting control points and checking unchecking the related checkbox Modify the counter and or limit of a single control point With breakpoints you can also perform the following operations Enable disable halting on a single temporary breakpoint by checking unchecking the matching checkbox Enable disable halting on multiple temporary breakpoints by checking unchecking the matching checkbox With watchpoints you can also perform the following operations Enable disable halting on a single read and or write access by checking unchecking the corresponding checkboxes Enable disable halting on multiple read and or write accesses by checking unchecking the corresponding checkboxes Define the memory range controlled by the watchpoint Breakpoints Breakpoints are control points associated with a program counter PC value That is program execution stops as soon as the PC reaches the value defined in a breakpoint The Debugger supports four different types of breakpoints Temporary breakpoints which activate the next time the instruction executes Permanent breakpoints which activate each time the instruction executes Counting breakpoints which activate after the instruction executes a certain number of times Conditional breakpoints which activate when a given condition is TRUE Breakpoints are contro
351. er and each is divided into several sections ABSPATH Absolute Path Tools SmartLinker Debugger Synonym None Syntax ABSPATH lt path gt Arguments path Paths separated by semicolons without spaces Description When you define this environment variable the SmartLinker stores the absolute files it produces in the first directory specified If you do not set ABSPATH the SmartLinker stores the generated absolute files in the directory in which the parameter file is located Example ABSPATH sources bin headers usr local bin DEFAULTDIR Default Current Directory Tools Compiler Assembler Linker Decoder Librarian Maker Burner Debugger Synonym None 678 S12 X Debugger Manual Debugger Engine Environment Variables Environment Variables Syntax DEFAULTDIR directory Arguments directory Directory specified as default current directory Default None Description Use this environment variable to specify the default directory for all tools All tools indicated above take the directory specified as their current directory instead of the one defined by the operating system or launching tool 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 INSTALL PROJECT See also The Current Directory Global Initializati
352. er interface The description is provided in generic way with highlighted specifics for particular families Several HCS12 debugger connections such as the P amp E Multilink Cyclone Pro Abatron BDI HCS12 Serial Monitor and SofTec inDART HCS12 provide a complete graphical user interface through a trigger setup dialog box combined with context sensitive menus These interfaces are available in Source Assembly Data and Memory component windows to enable you to set the on chip DBG module and triggers This DBG module support is available according to the user selected derivative features DBG Features The on chip DBG module provides the user with the following features Regular hardware breakpoints and watchpoints Predefined preset Instruction triggers Memory Access triggers or Capture triggers a wide set of complex hardware breakpoints and watchpoints and data bus recording Expert Triggers as powerful as predefined preset triggers Code program flow rebuild from DBG data capture within the Trace window component Real time program code profiling and coverage within the Profiler and Coverage window components L512 platform only S12 X Debugger Manual 401 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Specific Connection Menu Options Specific Connection Menu Options The menu displays two additional entries as soon as the DBG module acknowledges the debugger target processor Trigger Module Setti
353. er run The DBG module halts the processor debugger on trigger condition match In Normal mode the DBG module will record program change of flow ox data value Y A The selected Trigger condition does NOT match the current Triggers Address Settings Expert Triggers Tab The Expert triggers tab gives you access to most of the on chip DBG module registers You can set trigger types directly from the DBGT Debugger Trigger Register list menu Using Expert Mode and Expert triggers requires thorough knowledge and understanding of the on chip DBG module registers and flags Use this mode to synchronize code program flow rebuild and data recording and display the results in Trigger Module Settings Window To set Expert triggers use the Trigger Module Settings window ExpertTriggers tab Select Expert mode in the list menu Figure 17 25 to enable the Expert Triggers tab Figure 17 26 Figure 17 25 Trigger Settings Tab Expert Mode Information Trigger Module Settings Trigger settings Expert triggers General settings Expert triggers through Expert triggers property page trace S12 X Debugger Manual 425 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 26 Trigger Module Settings Window Expert Triggers Tab Trigger Module Settings Trigger settings Expert triggers General settings DBGCA hex not defined DBGCC thea not defined Set DBCGC DBGCE hen not
354. erent timing ninth bit WAKE Wakeup by Not supported Address Mark ldle ILT Idle Line Type Considered in the Idle Line Detection PE Parity Enabled Not simulated PT Parity Type Not simulated TIE Transmit Interrupt Supported Enable TCIE Transmit Complete Supported Interrupt Enable RIE Receive Interrupt Supported Enable ILIE Idle Line Interrupt Supported Enable TE Transmitter Enable Transmission process stops if this bit is clear 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 Up Not supported Control SBK Send Break When first set transmitter sends ten 11 if M bit is set 0 values Counter is set only if flag was previously cleared After the counter sends the required number of 0 bits it continues sending 0 bits as long as the SBK flag remains set TDRE Transmit Data Set when value to be transmitted moves from Register Empty transmit data register to serial shift register Flag TC Transmit Complete Set when the transmission of one value ends but Flag no other value is yet in the transmit data register 305 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 18 SCI Supported Features continued Feature Full Feature Comments Acronym Name RDRF Receive Data Set upon the complete read of a value and the Register Full Flag clearing of RDRF
355. eriprog hwave exe Browse XBATE Target Arguments jectFileDir Full_ Chip Simulation ini instancessim Assembler for XGA Compiler tor XGATE Initial drectory Project Browse Importes for XGATE File Mappings 248 S12 X Debugger Manual 8 Debugger COM Capabilities The debugger provides the Component Object Model COM Interface which allows the user to control debugger using scripts or other application This chpater has following two sections COM Implementation Driving Debugger through COM COM Implementation The debugger has COM server and client implementation The COM application name of the server is Metrowerks Hiwave The Debugger COM support allows you to execute almost any command available from within the debugger from Command line Driving Debugger through COM The COM implementation in the Debugger allows you to drive it easily by using the commands from a script or application or another Hiwave instance You can find simple script example in the CodeWarrior_Examples Scripting PERL directory There are the following commands implemented in Hiwave to support COM COM START COM EXE COM EXIT To use the COM interface one should create the instance of Hiwave and register it as COM server this could be done with starting it with option RegServer Once the COM server registered it is possible to execute any command available in command window S12 X Debugger Manual 2
356. ermanent 163 Position 169 Setting Deleting 58 within DA C 261 Temporary 119 163 170 with Register Condition 173 174 BRLD 316 BS 527 BSPL 316 BTST 316 Build Extras pane 232 247 Bus Trace 378 402 Bus Trace menu entry 273 S12 X Debugger Manual Bus Trace Option 355 369 390 397 Byte menu entry 94 Byteflight BF 285 C C option 613 Cache size menu entry 319 CALL 314 530 Call chain 104 Capture 314 R W values at Address B after access at Address A 421 438 Read write values at Address B 421 438 Stimulation 314 Capture Compare Timer 315 Cascade menu entry 44 CD 530 CF 531 CFORC 315 Clear 452 CLOCK 533 Clock and Reset Generator CRG 293 Clock Frequency menu entry 272 Clone Attributes menu entry 146 CLOSE 534 Close I Os menu entry 272 CMD Callback attributes 161 cmd file 63 Cmd option 612 CMDFILE 537 Code Coverage 419 Profiling 419 Viewing 244 CodeWarrior Integration 247 COLLAPSE 534 Color if 157 Color if Bit LED attribute 157 COM_EXE 535 COM_EXIT 536 COM_START 535 COMDEV 686 Command 161 Attributes 161 S12 X Debugger Manual Copy CTRL C 63 Syntax 499 Command file Executing 63 Command Files Abatron BDI 389 inDART HCS12 369 Monitor HCS12 378 MultilinkCyclonePro 355 Command Files menu entry 40 272 274 Command Files option 355 369 397 Command Files window 40 274 Command line Starting debugger from 211 Command line component 61 Command order 211 Commands 653 657 Abat
357. ernal variable display in the Data component S12 X Debugger Manual 73 Debugger Components General Debugger Components NOTE Ifthe data component mode is not automatic entries are gray 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 Activate the Format submenu by highlighting the format entry on the Data menu Figure 3 22 Format Submenu Selected gt All gt Table 3 10 describes the Format submenu entries Table 3 10 Format Submenu Entries Selected Applies the changes to the selection only All Applies the changes to all items Format Selected and Format All Submenu Activate the Format Selected and Format All submenu by highlighting this entry on the Data Component menu Figure 3 23 Format Selected and All Submenus v Symbolic Hex Oct Bin Dec UDec BitReverse Table 3 11 describes the Format Selected Mode and Format All Mode submenu entries 74 S12 X Debugger Manual Debugger Components General Debugger Components Table 3 11 Format Selected and All Submenu Menu entry Description Symbolic Selects Symbolic display format display format depends on variable type Default display Hex Selects hexadecimal data display format Bin Selects binary
358. es Read protected legacy replaced by physical memory type with Write Only access kind Write protected legacy replaced by physical memory type with Read Only access kind R W protected legacy replaced by physical memory type with None access kind 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 on chip memory Additional Types for MC68HC812A4 Derivatives Extra banked this type handles the EPAGE register when accessing the Extra page banked data typically data in 400 7FF window Banked this type handles the PPAGE register when accessing the Program page banked data typically program code in 8000 BFFF address range window Data banked this type handles the DPAGE register when accessing the Data page banked data typically variables in 7000 7FFF address range window Additional Types for MC68HC912xx128 Derivatives Banked this type handles the PPAGE register when accessing the Program page banked data typically program code in on chip Flash in 8000 BFFF address range window HCS12 Core The HCS12 core provides memory block moving with overlap priorities These overlap rules are handled 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 DM
359. es 38 Context information collecting 196 Context sensitive menus 46 Continue on illegal break 390 393 688 Control Point Definition 163 Dialogs 163 Control Points menu entry 37 Controlpoints Configuration 406 Copy command 63 Copy menu entry 120 146 COPYMEM 536 CopyMem menu entry 93 Copyright displaying 45 Counting breakpoints 172 Coverage Code 453 Mode 419 Coverage component 65 Coverage menu 66 CPORT 633 CPU Components 53 Cycles 64 bits 273 Cycles number of 29 111 Registers inspecting 195 CPU12 381 CR 537 Cross debugging 25 CTRL C copy command 63 Ctrl E 145 Ctrl L 145 Ctrl P 145 147 Ctrl S menu entry 145 Current Directory 668 678 Customize menu entry 33 Cut menu entry 146 CYCLE 538 S12 X Debugger Manual D DA C and debugger message exchange 261 Compiler configuration 258 Compiler settings 258 Compiler bmp 258 Component 264 Configuring 251 Configuring file types 253 Configuring project file 264 Configuring the tools 258 Configuring working directories 252 Database directory 253 Database building 256 Debugger interface 261 Debugger name 266 Debugger options 267 Default bitmap 258 Error messages 266 IDE 251 Configuring 251 Synchronized debugging 251 IDE and Debugger Testing synchronization 265 Library path configuring 254 Link component 68 Link operation 68 Linker configuration 259 Linker settings 260 Maker configuration 260 Maker settings 261 Ndapi dll 266 New project creation 252 Prepr
360. es 691 Vector table address Search for 221 Vector table mirroring using 220 VER 602 VERIFY 689 Version number displaying 45 Vert Text Alignment 159 Vertical Size menu entry 147 View menu 33 View splitting 65 Virtual instruments 143 Visualization tools Defining indicators 153 VisualizationTool 7 Segment Display instrument 157 Analog 152 Bar 153 Bitmap 153 Component 143 Demo version limitations 161 DILSwitch 155 Instrument 148 Knob instrument 156 LED instrument 157 Setup 147 Switch instrument 158 Text instrument 159 VisualizationTool context menu 146 VisualizationTool menu 144 Voltage Regulator VREG 290 721 W xpr file 72 W option 611 WAIT 603 Y WAKE 316 Y Position 148 Watchpoint Checking condition 179 Z Command association 185 ZOOM 607 Conditional 183 193 Zoom menu entry 73 Counting 182 192 Definition 163 Deleting 184 Read 180 Read Write 164 Read Write 181 Write 180 Watchpoints in Multi Core projects 185 WB 605 WHILE 569 605 Width 148 Window component 53 Window menu 43 Window menu description 44 Windows 668 WinEdit 668 Using to start debugger 208 WL 606 wnd file 46 53 WOMS 316 Word menu entry 94 Word size menu entry 93 Word Size submenu 94 WorkDir 208 Working directory defining 208 Working Mode 386 WorkingDirectory 208 WPORT 643 Write 408 411 Write Access 414 WRITEACCESS 411 WW 607 X X Position 148 722 S12 X Debugger Manual
361. es c as long L mapped at address 0x220 in TargetObject def pbits Leds Port Register B 7 3 This code 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 S12 X Debugger Manual 331 HC S 12 X Full Chip Simulation Connection True Time I O Stimulation 10000 pbits 3 This code sets the three bits of LEDs Port_Register accessed with pbits to binary 011 Other bits are unaffected The new value of Port_Register 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 This code sets a to 0 Without or in front of the time marker the time refers to the absolute time after starting execution of the Stimulation file NOTE Ina periodical loop the time marker without operator is interpreted as 20000 b pbits 1 This code reads pbits three bits in Leds Port_Register increments this value and writes it to b The in front of the time marker refers to the time relative to the last encountered time value in the Stimulation file as ERIODICAL 100000 10 T
362. es duration of one bounce Fill in if you chose Host Periodical 100ms in the Type of Unit attribute CPU Count Represents number of CPU cycles to reach before switch changes state Fill in if you chose CPU Cycles in Type of Unit attribute Text Instrument The Text instrument has several functions Static Text Value Relative Value and Command Figure 3 111 Text Instrument Value Use Text Mode to switch between the five available modes Table 3 65 shows Text instrument common attributes Table 3 65 Text Instrument Attributes S12 X Debugger Manual Attribute Description Text Mode Specifies mode Choose among four modes Static Text Value Relative Value and Command Displayfont Defines desired font All installed Windows fonts are available Horiz Text Specifies desired horizontal alignment of text in given bounding box Alignment Vert Text Specifies desired vertical alignment of text in given bounding box Alignment Textcolor Defines color of given text Use Static Text for adding descriptions on the workspace Table 3 66 shows Static Text attributes 159 Debugger Components Visualization Utilities Table 3 66 Static Text Attributes CO Field Description Contains the text to display Use Value for displaying a value in different ways decimal hexadecimal octal or binary Table 3 67 shows Value attributes Table 3 67 Value Attributes Attribute Descri
363. es of the Wagon address ident component ADCPORT Use the ADCPORT command to set the port addresses used by the ADC_DAC component Syntax ADCPORT address ident address ident address ident Arguments Address locates the port address value of the component The default format is hexadecimal many formats are allowed Ident a known identifier Its content defines the port address Components ADC_DAC component Example in gt ADCPORT 0x100 0x200 0x300 Defines the ports of the ADC_DAC component at the addresses 0x100 0x200 and 0x300 ADDCHANNEL Use the ADDCHANNEL command to create a new channel for the Monitor component Syntax ADDCHANNEL lt Name gt 632 S12 X Debugger Manual Connection Specific Commands Full Chip Simulator Commands Arguments Name the name for the new channel Components Monitor component Example in gt ADDCHANNEL Leds Port Register bit 0 Creates a new channel Leds Port Register bit 0 in the Monitor component CPORT Use the CPORT command to set the five coupler port addresses and the control port address of the coupler component Syntax CPORT address ident address ident address ident Arguments Address locates the port address value of the component The default format is hexadecimal many formats are allowed Ident a known identifier Its content defines the port address Component
364. es replace Trigger Editing dialog Memory Access at Address A and Value on Data Bus Mismatch Set trigger on a program instruction read or write of a non matching byte value at Address A memory location Uses trigger B address as mismatch value rather than address location Select this trigger type without setting the mismatch value and an error message prompts for value Replaces standard trigger editing dialog box with Triggers Address Settings dialog box see Figure 17 7 Match Value edit boxes replace Trigger Editing dialog Instruction at Address A Is Executed Set a trigger on a program instruction execution program counter occurring at Address A Instruction at Address A or Address B Is Executed Set a trigger on a program instruction execution program counter occurring at either Address A or Address B Instruction Execution Inside Address A Address B Range Set a trigger on a program instruction execution program counter occurring within Address A to Address B range S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Table 17 3 Trigger Types continued Type Instruction Execution Outside Address A Address B Range Description Set a trigger on a program instruction execution program counter occurring outside Address A to Address B range With the HCS12 Serial Monitor via GDI connection monitor c
365. es the component as soon as command execution finishes Variable Checking in the Command Line When you specify a single name as an expression in a command line the system checks for the expression in the following manner First checked as a local variable in the current procedure Next as a global variable in the current module Next as a global variable in the application Next as a function in the current module Then as a function in the application Finally if the expression is 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 you close the Command Line component with the close button or with the Close entry of the system menu the following message displays Command Component is busy Closing will be delayed The Command component closes as soon as command execution completes If you apply the Close command to this Command component the Command component closes as soon as command execution completes Command Menu Figure 3 8 shows the Command menu which is identical to the Command context menu Figure 3 8 Command Menu Execute File Paste Cache Size 62 S12 X Debugger Manual Debugger Components General Debugger Components Clicking Execute File opens a dialog in which you can select a file containing Debugger commands to be executed These files generally have the cmd default ex
366. esktop or Start menu set the working directory in the configuration file MCUTOOLS INI Define the working directory including the path in the environment variable DefaultDir in the Options group or WorkDir WorkingDirectory Starting the Debugger 208 This section explains starting the debugger using WinEdit from within the Codewarrior IDE or from a DOS command line Starting with WinEdit Start the Debugger by selecting Project Debug or by clicking the Debugger icon bug in the WinEdit tool bar when configured The Debugger window looks like Figure 6 1 S12 X Debugger Manual How To Starting the Debugger Figure 6 1 Debugger after Startup True T m ulator amp Real Time Debugger 0 Profile Fle View Run HCSI2FCS Component Source Window Hep lea fe Pine lalale iS e DAProtie b1 381I My Documenti Veroreci wy E128 proieci Soucerman c include lt hidef b gt common defines and macros include mc9s12e128 h derivative information pregea LINK INTO DERIVATIVE mcssl2el20 abs 0x322002 sabe Ox35001A void mais void 9 put your ova code here Enableinterrupts forts B wast forever please make sure that you sever leave this fonctica fiblefib2 undefined expression unknown identifier LITT READY displayed in the status bar indicates that the simulator is ready Starting from within the IDE There are two ways to start the debugger from
367. ess Sci0d 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 324 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection True Time I O Stimulation For implementations of this register with help of the IOBase class use the IOB NotifyAnyChanges flag Otherwise only the first of two identical characters are received Itis also possible to configure the terminal to use another object in the Object Pool instead of Sci0 with which to communicate Refer to Configure Terminal Connections for information about where you can do this Cache Size The item Cache Size in the context menu allows you to set the number of lines in the terminal window with the dialog shown in Figure 10 18 Figure 10 18 Size of the Cache Dialog Box Size of the Cache MV Limited Size of Cache Number of lines to be cached 1000 OK Cancel Help True Time I O Stimulation Use the FCS I O Stimulation component to trigger I O events With the Stimulation component loaded interrupts and register modifications invoked by the hardware can be simulated This tutorial introduces and explains examples of stimulation files Click any of the following links to jump to the corresponding section of this chapter Stimulation Program Examples Stimulation Input File Syntax Stimulat
368. ess Space set to XGATE displays the XGATE space memory of the device When existing the Flash RAM XGATE memory split is internally evaluated by the DMM NOTE FrFactory default setup protects the HCS12X DBG12X FIFO Registers to reserve the DBG12X FIFO reading for the debugger DBG interface Removing this protection leads 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 Debugging Memory Map Manager Command Set The commands provide the possibility to fully script the debugging device 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 List of Commands ADD parameters DEL module handle SAVE lt mcuid gt DELETEALLMODULES RELEASECACHES CACHINGON CACHINGOFF WRITEREADBACKON WRITEREADBACKOFF HCS12MERHANDLINGON HCS12MERHANDLINGOFF D D D D D D D D D D BBEBEBEBEEBEBE ES OPENGUI mcuid S12 X Debugger Manual 465 Debugging Memory Map DMM Commands DMM SETAHEAD
369. esses and choose Textual mode in the Trace menu context sensitive menu to record memory accesses Many types of information can be retrieved from the Trace window including instructions and instruction addresses data addresses data values and read write access type true time cycles and total simulation cycles for each instruction function name and module name for each instruction variable name and module name for each global variable data access 282 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu Figure 10 10 Bus Trace Data Access Symbolic Information 4350657 4350657 4350659 4350659 4350659 Symbol information SCIOHandler 8 xgate cxgate Fibonacci 8 main c SCIOHandler 8 xgate cxgate SCIOHandler 8 xgate cxgate Fibonacci B main c 4350662 4350662 4350662 4350662 4350662 4350663 SCIOHandler 8 xgate cxgate SCIOHandler 8 xgate cxgate SCIOHandler 8 xgate cxgate SCIOHandler 8 xgate cxgate Fibonacci 8 main c SCIOHandler 8 xgate cxgate Full Chip Simulation Warnings By default the FCS generates warning messages when the application accesses on chip registers that are not implemented for the selected derivative These warnings appear in the Command window For example the following messages can be repeated indefinitely in the Command window FCS Warning ID Ox400a L Value implemented F
370. estination register with PC of first instruction selected Memory Displays memory area corresponding with selected high level language source code Memory area corresponding to selected instructions appears gray in memory component Data A selection in the Source window is considered an expression in the Data window as if entered through Data component Expression Editor see Data Component and Expression Editor Dragging from the Memory Component Window Table 2 12 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 first address selected Highlights instructions corresponding to selected memory area in Assembly component Command Line 50 Appends selected memory range to Command Line window S12 X Debugger Manual Debugger Interface Features of the User Interface Table 2 12 Dragging from the Memory Component Window continued Destination Component Window Action Register Loads destination register with start address of selected memory block Source Displays high level language source code starting at first address selected Instructions corresponding to selected memory area appear gray in the source component Dragging from Procedure Component Window Table 2 13 summarizes dragging from the Procedur
371. et CunFile 258 S12 X Debugger Manual Synchronized Debugging through DA C IDE Configuring DA C IDE for Freescale Too Kit Now fill in the Action Script field to associate related compiler actions 1 Copy the code shown in Listing 9 1 into the Action Script field 2 Change the directory in the code to your compiler directory 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 Exist edout Message No Messages found Cancel SErrClr Compiler SErrGet edout Compiler Reset CurrFile 3 Click on OK to validate these settings 4 Select Fibo c file 5 Click on the Compiler button or from the main menu of DA C select Start gt Compile This file now compiles and generates the corresponding object file Fibo o Linker Configuration In the same way you can now configure the linker as shown in Figure 9 8 1 In the Menu Start Actions click on New The New Action box appears 2 Type amp Link in the New Action box 3 Validate by clicking ENTER Set the corresponding Linker bitmap 1 Copy the lines shown in Listing 9 2 into the Action Script field 2 Change the directory in the code to your linker directory Listing 9 2 Script for Linker Action Association c Freescale prog linker exe fibo prm if Exist edout Message No Messages found Cancel
372. et device and programs target device security byte to an unsecure state to enable BDM communication Debugging Displays Debugging Memory Map dialog box for target MCU See Memory Map Debugging Memory Map Trigger Module Displays Trigger Module Settings dialog box See On Chip DBG Settings Module for S12 S12S S12G S12P S12X Platforms Bus Trace Displays a Trace component window See On Chip DBG Module for 12 S128 12G S12P S12X Platforms Flash Displays Non Volatile Memory Control dialog box See Flash Programming Reset To Resets target device to normal mode Debugger continues running as target device resets and runs from reset vector in normal mode Application stopping and debugging remain available Show Status Displays Turbo BDM Light Status dialog box displays revision versions of drivers and firmware BDM status register value and chosen target crystal Figure 16 2 Set Speed S12 X Debugger Manual Displays Set Target Speed dialog box use to specify target crystal to synchronize TBDML cable BDM communication with silicon Crystal BDM frequency ratio can be tuned when not matching with default value 2 397 TBDML Connection Connection Menu Table 16 1 TBDML HCS12 Menu Entries continued Menu Entry Description Select HC12 Displays HC12 Derivative Selection box enables you to debug MCU legacy HC12 CPU12 devices that cannot be identified with any on chip device ID PARTID r
373. etrieves data entered in the TestTerm or Terminal component window through the keyboard using the Read function The target application sends data to the Terminal component window of the host with the Write function About startup cmd reset cmd preload cmd postload cmd 246 The 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 recognizes these command files and executes them e startup cmd executes when a connection is loaded the target defined in the project ini file or loaded when you select Component Set Connection reset cmd executes when you select Connection Name Reset in the menu Connection Name is the real name of the connection such as MMDS0508 etc preload cmd executes before loading an ABS application file or S Records file when you select Connection Name gt Load in the menu postload cmd executes after loading an ABS application file or S Records file when you select Connection Name gt Load in the menu Depending on the connection used the Debugger recognizes other command files Refer to the appropriate connection manual for information and properties of these command files S12 X Debugger Manual CodeWarrior Integration This chapter provides information on how to use and configure the Simulator De
374. ever after activating Selected Format is applied for all the child register items Format Selected and All Submenu Figure 3 37 shows Format Selected and All submenu The Format Selected and All submenu is activated by highlighting this entry on the MCURegisters component menu Figure 3 37 Format Selected and All Submenus Table 3 20 describes the Format Selected and All Submenu entries Table 3 20 Format Selected and All Submenus Menu Entry Description Bin Select the binary MCURegisters display format Hex Select the hexadecimal MCURegisters display format Oct Select the octal MCURegisters display format S12 X Debugger Manual 85 Debugger Components General Debugger Components Table 3 20 Format Selected and All Submenus Menu Entry Description Dec Select the signed decimal MCURegisters display format Udec Select the unsigned decimal MCURegisters display format Mode Submenu Figure 3 38 shows the Mode submenu The Mode submenu is activated by highlighting the Mode entry on the MCURegisters menu Figure 3 38 Mode Submenu Selected gt All gt Table 3 21 describes the Mode submenu entries Table 3 21 Mode Submenu Entries Selected Apply changes to the selection only All Apply changes to all items NOTE The Selected Mode can be applied to a board modules and register group items only For register items selected mode is not ticked Mod
375. ew the code associated with each assembler instruction 244 S12 X Debugger Manual How To Communicating with the Application Figure 6 34 Viewing Code Associated with Assembler instruction Set Breakpoint Run To Cursor Show Breakpoints Show Location Set Markpoint Show Markpoints Address Display gt Code t Synbol amp y Form v Address Freeze v Absolute Address Perform online disassembly in one of the following ways Using Context Menu 1 Point in the Assembly component and right click The Assembly Context Menu appears 2 Choose Display Code Figure 6 34 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 Communicating 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 TERMINAL H file and used in the calculator demonstration file 1 Start the Debugger and choose Open from the Component menu 2 Open the TestTerm or Terminal Component 3 Choose Load from the Simulator menu 4 Load the program CALC ABS S12 X Debugger Manual 245 How To About startup cmd reset cmd preload cmd postload cmd The target application r
376. f what lt TERM_TO_WINDOW what gt TERM_APPEND_FILE return TERM Write ESC TERM Write h TERM Write char what 0 if what TERM TO WINDOW amp amp what TERM FROM KEYS TERM WriteString fileName TERM Write CR j j 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 ileName See also terminal h for further details 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 Sci object 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 FCS components currently have an Sci0 object For all other FCS 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 addr
377. fault value S12 X Debugger Manual 667 Debugger Engine Environment Variables Debugger Environment NOTE Ensure that no spaces exist at the end of environment variables The 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 DEFAULT ENV hidefaults file Normally the operating system or the launching program determines the current directory of a tool For MS Windows based operating systems the current directory definition is more complex f you launch the tool using a File Manager Explorer the current directory is the location of the executable launched f you launch the tool using an Icon on the Desktop the current directory is the one specified and associated with the Icon Ifyou launch the tool by dragging a file on the icon of the executable under Windows NT 4 0 operating system or Windows 20006 operating system the desktop is the current directory If you launch the tool from another tool with its own current directory specified for example WinEdit the current directory is the one specified by the launching tool 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
378. ff target upon software exit If checked the Cyclone Pro will stop providing power to the target microprocessor when the software is closed Regulator Output Voltage Specifies the voltage generated by the Cyclone Pro internal regulator The available options are 2V 3V and 5V Power Down Delay Specifies the power down delay in milliseconds Power Up Delay Specifies the power up delay in milliseconds Connect Reset button Connects to the target microprocessor by resetting the device and entering background mode 362 S12 X Debugger Manual P amp E Multilink Cyclone Pro Connection Connection Menu Element Description Hotsync button Connects to the target microprocessor without resetting the device If the device is running it will still be running after this connection is made Hotsync command will not work when a Cyclone Pro is used to power up the target A Cyclone Pro will always attempt to power cycle the device upon connection Abort button Cancels the connection TIP When debugging with several cables and debuggers The debugger registers the serial numbers of USB cables automatically registered in each project when you press Connect in the Connection Manager dialog The next debug session opens the cable matching the registered serial number This feature is not available with Serial LPT parallel and TCP IP connections S12 X Debugger Manual 363 P amp E Multilink Cy
379. folds the whole register tree Collapse Folds the whole register tree Drag Out Table 3 24 describes the drag actions possible from the MCURegisters component Table 3 24 Dragging MCURegisters Possibilities Destination Component Window Action Command Line Dragging the register appends the register value to the current command in the Command Line Window Memory Dumps memory starting at the address of the Selected register value Register Dragging the register loads the destination register with the value of the register Drop Into NONE Demo Version Limitations NONE Associated Commands DUMP ATTRIBUTES UPDATERATE EXPAND COLLAPSE 88 S12 X Debugger Manual Debugger Components General Debugger Components Memory Component The Memory window shown in Figure 3 42 displays unstructured memory content or memory dump that is continuous memory words without distinction between variables Figure 3 42 Memory Window You can define watchpoints and specify various data formats byte word double and data displays hexadecimal binary octal decimal unsigned decimal for the display and editing of memory content NOTE Refer to Control Points for more information about watchpoints Use the Fill Memory Dialog Box box to initialize memory areas with a fill pattern Checking unchecking ASCII in the Display menu entry adds or removes an ASCII dump on the right side of the numerical d
380. formation 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 is something visible in this item S12 X Debugger Manual Debugger Components Visualization Utilities 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 97 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 97 Inspector Window Object Pool Fi Inspect The most common use of Objects is to simulate special hardware with the I O development package however other connections also use the Object Pool For example the Terminal Component exchanges its input and output by the Object Pool The Terminal Component also operates with some hardware connections For the HC S 12 X Full Chip Simulator the Object Pool usually contains the TargetObject which represents the address space All loaded Objects display in the Object Pool The TargetObject also shows the objects that are mapped to the address space Inspector Operations e Click the folded unfolded icons HE 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
381. ft Align None Aligns instruments to left line of last selected instrument Right Align None Aligns instruments to right line of last selected instrument Size Align None Makes size of all selected instruments the same as last selected Vertical Align None Makes vertical size of all selected Size instruments same as last selected Horizontal Align None Makes horizontal size of all selected Size instruments same as last selected VisualizationTool Properties Like other instruments the VisualizationTool itself has Properties There are several configuration possibilities for the VisualizationTool shown in Table 3 53 To view the property dialog box of the VisualizationTool use the shortcut lt CTRL P gt or double click on the background Table 3 53 VisualizationTool Properties Menu Entry Description Edit Mode Switches from Edit mode to Display mode Display Scrollbars Switches scrollbars on off or sets to automatic mode Display Headline Switches headline on or off Backgroundcolor Specifies background color of VisualizationTool Grid Mode Specifies 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 distance between two grid points vertical horizontal S12 X Debugger Manual 147 Debugger Components Visualization Utilities Table 3 53 Visualiza
382. g 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 f Save amp Restore on load is checked and the user quits the Debugger or loads another ABS file all breakpoints will be saved If 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 Listing 4 2 Breakpoint File with Save amp Restore on load Checked savebp on BS amp fibo c Fibonacci 19 P E cond fibo gt 10 E cdSz 47 srSz 0 BS amp fibo c Fibonacci 31 P E cdSz 47 srSz 0 BS amp fibo c main 12 P E cdSz 42 srSz 0 BS amp fibo c main 21 P E cond fiboCount 5 E cmd Assembly lt spc 0x800 E cdSz 42 srSz 0 168 S12 X Debugger Manual Control Points Breakp
383. g down the left mouse button and dragging the mouse The object information bar displays the line number in the source file of the first visible line 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 RIERA the matching assembler instruction in the Assembler component window is also selected The CPU executes this instruction next If breakpoints have been set in the program a special symbol marks the breakpoint in the program source The type of symbols depends on the types of breakpoint For information on breakpoints refer to Control Points If execution stops the current position is marked in the source component by highlighting the corresponding statement The complete path of the displayed source file is written in the Object Information bar of this window S12 X Debugger Manual 115 Debugger Components General Debugger Components NOTE You cannot edit the visible text in the Source window This is a file viewer only ToolTips 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 69 or the parameter value and address of the selected procedure Select a parameter or procedure by double click
384. ger Manual Debugger Engine Commands Debugger Commands In Periodical mode registers 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 registers update rate see also UPDATERATE command Equivalent Operations ATTRIBUTES FORMAT Select menu MCURegisters gt Format ATTRIBUTES MODE Select menu MCURegisters Mode ATTRIBUTES EXPAND Select menu MCURegisters gt Tree gt Expand ATTRIBUTES COLLAPSE Select menu MCURegisters Tree Collapse ATTRIBUTES UPDATERATE Select menu MCURegisters gt Mode gt Periodical Example MCURegisters ATTRIBUTES MODE PERIODICAL In MCURegisters the registers update is set in periodical mode Registers are updated at regular time 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 starts In the event that command files are chained one calling another the delay is measured from the time the first command file starts 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 in
385. ger to write records of commands to an external file Writing continues until a close record file NOCR command executes NOTE Drag and drop actions are also translated into commands in the record file NOTE Jlfpath is unspecified the destination directory is the current project directory S12 X Debugger Manual 537 Debugger Engine Commands Debugger Commands Usage CR fileName A fileName specifies the name of the record file Use the CR command without this parameter to open a standard Open File dialog A opens a file fileName in append mode and appends new records at the end of an existing record file Omitting this option when fileName is an existing file clears the file before writing new records Components Debugger engine Example in cr Freescale demo myrecord txt A This opens the myrecord txt file in Append mode for a recording session CYCLE In the SoftTrace component the CYCLE command displays or hides cycles When cycle is off milliseconds ms are displayed Usage CYCLE on off Components Softtrace component Example in gt CYCLE on DASM The DASM command displays the assembler code lines of an application starting at the address given in the parameter Without the parameter the DASM command displays the assembler code following the last address of the previous display Stop this command by pressing the Esc key 538 S12 X Debugger Manual Debugger Engine
386. ges the connection menu entry in the debugger main toolbar to HC12MultilinkCyclonePro S12 X Debugger Manual 353 P amp E Multilink Cyclone Pro Connection Connection Menu HC12MultilinkCyclonePro Menu Options Figure 11 1 shows MultilinkCyclonePro menu options and Table 11 1 describes menu entry use Figure 11 1 MultilinkCyclonePro Menu Options MU eT Component P Load Ctri4L Reset Ctri4R Setup Communication Select Derivative Command Files Unsecure Debugging Memory Map Trigger Module Settings Bus Trace Flash Select Core gt Help Table 11 1 MultilinkCyclonePro Menu Description Menu Entry Description Load Displays Load Executable File Dialog Box see Load Executable File Window Reset Resets project hardware and software Setup Displays P amp E Multilink Cyclone Pro Setup dialog box see Setup Menu Option Communication Displays P amp E HC S 12 Connection Manager dialog box see Communication Connect Menu Option Set Derivative 354 Displays Set Derivative dialog box which allows you to choose target MCU for P amp E Multilink Cyclone Pro connection see Figure 11 2 S12 X Debugger Manual P amp E Multilink Cyclone Pro Connection Connection Menu Table 11 1 MultilinkCyclonePro Menu Description continued Menu Entry Command Files Description Displays Connection Command Files window Each tab allows access t
387. gging information in the abs file and does not use object files Debugger Commands This section describes the commands available when you use the Simulator Debugger 510 The A command assigns an expression to an existing variable The quoted expression must be used for string and enum expressions Usage A variable valueorA variable value Components Debugger engine Example in a counter 8 The variable counter is now equal to 8 in gt A dayl monday 8U Monday_8U is defined in an Enum The variable day1 is now equal to monday_8U in gt A value 3 3 The variable value is now equal to 3 3 S12 X Debugger Manual Debugger Engine Commands Debugger Commands ACTIVATE ACTIVATE activates a component window as if you clicked on its title bar The window appears in the foreground and the title bar is highlighted If the window has active icons the title bar is activated and appears 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 ADDXPR The ADDXPR command adds a new expression in the data component Usage ADDXPR expression where the parameter expression is an expression to add and evaluate in the data component Components Data component Example in gt ADDXPR counter 10 This adds the expression counter 10 in the data compon
388. gister content is changed S12 X Debugger Manual 83 Debugger Components General Debugger Components MCURegisters Menu Figure 3 35 shows the MCURegisters component menu Figure 3 35 MCURegisters Menu MCU Registers Window Hell Show Memory Location Format gt Mode Refresh Tree gt Table 3 18 describes MCURegisters Menu entries Table 3 18 MCURegisters Menu Entry Description Menu Entry Description Show Memory Location Forces the Memory component to select the memory range where the pointed register is located applicable only for memory mapped registers Format Displays Bin binary Hex hexadecimal Oct octal Dec signed decimal UDec unsigned decimal format Mode Switches between Automatic and Periodical update mode Refresh Refreshes the display Tree Expands and collapses the whole register tree Format Submenu Figure 3 36 shows the Format submenu The Format submenu is activated by highlighting the Format entry on the MCURegisters menu 84 S12 X Debugger Manual Debugger Components General Debugger Components Figure 3 36 Format Submenu Selected gt All gt Table 3 19 describes the Format submenu entries Table 3 19 Format Submenu Entries Selected Apply changes to the selection only All Apply changes to all items NOTE Format can be applied to a register only For board module and group items Selected Format is not ticked how
389. gs window The sequencer tab reflects transitions that occur when you select a predefined sequencer mode Figure 17 39 Trigger Module Settings Window Sequencer Tab Trigger Module Settings Trigger settings Sequencer General settings Sequencer mode Any trigger When in Statel Whenin State2 ary tigger Fa leads to FnalStae x When in State3 State Sequencer Diagram State 0 Run arm va a Disarmed P statel Sy state Session complete tt N disarm Y o Final State 79 71 States You can modify the transitions in the Sequence tab only when the DBG is in User Sequencer setup mode General Settings Tab The settings in the General Settings tab indicate the default settings of the DBG user interface see Figure 17 40 Usually there is no need to change these settings However in some cases you may wish to disable some automated background processes The following checkboxes are available in this tab Automatically analyze the FIFO content Disarm automatically the module when the debugger stops Protect DBG FIFO content from unexpected reads When starting automatically step if a trigger is set at PC address otherwise warn S12 X Debugger Manual 445 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Table 17 14 describes these options Refer to Trigger Module Settings Window for additional information
390. gt e a b in 34 This evaluates the addition operation of the two previously defined variables a and b and displays the result in the Command Line window You can redirect the output to a file by using the LF command see LF and LOG commands S12 X Debugger Manual 547 Debugger Engine Commands Debugger Commands ELSE The ELSE keyword is associated with the IF command Usage ELSE Components Debugger engine Example if CUR TARGET 1000 Condition set sim else set bdi Other Condition ELSEIF The ELSEIF keyword is associated with the IF command Usage ELSEIF condition where condition is same as defined in C language Components Debugger engine Example if CUR TARGET 1000 Simulator set sim elseif CUR TARGET 1001 BDI set bdi 548 S12 X Debugger Manual Debugger Engine Commands Debugger Commands ENDFOCUS The ENDFOCUS command resets the current focus It is associated with the FOCUS command Commands following the ENDFOCUS command are broadcast to all currently open components This command is only valid in a command file Usage E NDFOCUS Components Debugger engine Example FOCUS Assembly ATTRIBUTES code on ENDFOCUS FOCUS Source ATTRIBUTES marks on ENDFOCUS This example first redirects the ATTRIBUTES command to the Assembly component using the FOCUS Assembly command and displays the code next to assembly instruction
391. guration tool If no application tool path is currently set see Setup Dialog Box the Select BDI Box Configuration Tool dialog box opens to create a link to the configuration tool application Save the link in the Setup dialog box Select Core Use to synchronize the debugger windows with a specific core when several cores are available Available only when several cores can be debugged Help Opens the Abatron BDI Connection Help File S12 X Debugger Manual Abairon BDI Connection Abatron BDI Connection Dialog Boxes Abatron BDI Connection Dialog Boxes This section describes the dialog boxes specific to the Abatron BDI Connection Those dialogs are Communication Device Specification Dialog Box Setup Dialog Box Communication Device Specification Dialog Box The Communication Device Specification dialog box appears automatically if the Abatron BDI Connection fails to establish the communication with the BDI interface You can also open this dialog box using Abatron BDI Communication or Abatron BDI Connect Figure 15 13 Communication Device Specification Edit Box Communication Device Specification Communication Device Show Protocol Connection Mode Normal Hot plug in non intrusive Cancel Help If you open the dialog using Abatron BDI gt Communication but the connection attempt was successful you cannot modify the Communication Device edit box Only the Show Protocol
392. h display value 153 156 160 Highlights Abatron BDI 381 HIPATH 680 Horiz Text Alignment 159 Horizontal Size menu entry 147 Host serial communication port choosing 220 How To information 207 365 How to Load 476 HWBPM 653 HWBPM MODE 653 712 HWBPM REMAP 22BITS 654 HWBPM REMAP 22BITS DELETE 654 HWBPM REMAP 22BITS DISPLAY 654 HWBPM REMAP 22BITS MCUID DEFAULT 654 HWBPM REMAP 22BITS RANGE 654 HWBPM SETI6BITS 654 HWBPM SET22BITS 654 HWC 30 hwl 671 hwp 671 I I O 393 ICDI2EXEC HELP 562 ICLAT 315 IDF server application name 701 IDLE 316 IF 562 569 ILIE 316 ILT 316 inDART HCS12 401 About 369 Bus Trace 369 Command Files 369 Communication 368 Debugging Memory Map 369 Flash 369 Load 368 MCU Configuration 369 Reset 368 Select Core 369 Setup 368 Trigger Module Settings 369 Indicator color 156 Indicatorcolor 153 Indicatorlength 153 INI 30 init cmd file 234 Initialization List 385 INITRG 313 Input Capture channels 314 Inspect component 135 INSPECTORUPDATE 563 564 S12 X Debugger Manual Instance currentTargetName option 612 INSTRUCTION 409 Instruction 413 Instruction at Address A and value on data bus match 421 438 and value on data bus mismatch 421 438 is executed 420 437 then at Address B executed 421 437 Instruction at Address A or Address B is executed 420 437 Instruction execution inside Address A Address B range 420 437 outside Address A Address B range 421 437 Instruction syntax 5
393. hardware and software Setup Displays SofTec HCS12 Setup dialog box Communication Displays Communication Settings dialog box Figure 13 3 allows you to fine tune critical parameters by choosing BDM clock source either system bus frequency or alternate frequency dependent on target Access from MCU Configuration Settings dialog box also S12 X Debugger Manual SofTec HCS12 Connection Connection Menu Table 13 1 inDART HCS12 Menu Entry Descriptions continued Menu Entry Command Files Description Displays Connection Command Files window Each tab allows access to a different set of connection command files cmd SofTec_HCS12_startup cmd NemdNSofTec HCS12 reset cmd cmd SofTec_HCS12_preload cmd NemdNSofTec HCS12 postload cmd NemdNSofTec HCS12 vppon cmd NemdNSofTec HCS12 vppoff cmd Debugging Displays Debugging Memory Map Dialog Box for target MCU see Memory Map Debugging Memory Map Trigger Module Displays Trigger Module Settings dialog box see On Chip DBG Settings Module for S12 S128 12G 12P S12X Platforms Bus Trace Displays a Trace component window see On Chip DBG Module for 12 S128 S12G S12P S12X Platforms Flash Displays Non Volatile Memory Control dialog box see Flash Programming MCU Displays MCU Configuration dialog box Figure 13 2 See MCU Configuration Configuration Dialog Box About Displays About dialog box
394. hat 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 directs 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 in 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 improper field value a message box appears 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
395. he Memory component to display the code location given as an argument and select the corresponding memory area SPC selects an address SMEM selects a range of memory and SMOD selects the module name where the global variable is in the window FORMAT selects the format for the list of variables The format is one of the following binary octal hexadecimal signed decimal unsigned decimal or symbolic S12 X Debugger Manual NOTE COMPLI the first Debugger Engine Commands Debugger Commands EMENT sets the display complement format of memory values one sets complement each bit is reversed none deselects the first complement MODE selects the display mode of memory words In Automatic mode default memory words update when the target stops Memory words from the currently executed module or procedure appear in the Memory component In Frozen mode value from memory words displayed in the Memory component do not updated when the target stops In Periodical mode memory words update at regular time intervals while the target runs 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 UPDATERATE sets the variables update rate see also UPDATERATE command Also refer to SMEM SPC and SMOD command descriptions for more detail about these commands Equivalent Operations Usage ATTRIBUTES FORMAT Selec
396. he OxOFFFFFOF longword value and modifies the addresses 0x2000 to 0x2003 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 specified list of word values When the range is wider than the list of word values the list of word values repeats 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 an address range constant that defines the block of memory to set to the word values in the list list a list of word values to store in the block of memory Components Debugger engine Example in WW 0x2000 0x200F OxAF00 This command fills up the memory range 0x2000 0x200F with the OxAFO00 word value ZOOM In the Data component use the ZOOM command to display the member fields of structures by diving into the structure This is in contrast to the UNFOLD command where member fields are not expanded in place The display of the member fields replaces the previous view Use ZOOM out to return to the nesting level indicated by the given identifier You do not need addresses to zoom out Simply type ZOOM out S12 X Debugger Manual 607 Debugger Engine Commands Debugger Commands NOTE This command is relevant when debugging C source c
397. he this string considered as a whole word in the Source component window and performs the search backward FINDPROC If a valid procedure name is given as parameter the source file where the procedure is defined opens in the Source Component displays the procedure s definition and highlights the procedure s title Equivalent Operation You can select Source Find Procedure or open the Source context menu and select Find Procedure to open the Find Procedure dialog Usage FINDPROC procedureName Components Source component Example in gt findproc Fibonacci Displays the Fibonacci procedure and highlights the title 554 S12 X Debugger Manual Debugger Engine Commands Debugger Commands FOCUS The FOCUS command sets the given component component as the destination for all subsequent commands up to the next ENDFOCUS command Hence the FOCUS command releases the user from repeatedly specifying the same command redirection especially in the case where command files are edited manually This command is only valid in a command file NOTE Itis not possible to visually see that a component is FOCUSed However you can use the ACTIVATE 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 This example first redirects the ATTRIBUTES command to the Asse
398. he TIMEFACTOR parameter TIMEFACTOR At event programming multiplies the number of cycles or time duration by this factor GAIN At Pin level setup multiply the level by this gain DCOFFSET At Pin level setup level offset specified after gain is applied OPTION NORMAL do nothing ONLYPOSITIVE at Pin level setup after gain and offset set 0 if signal level lt 0 ONLYNEGATIVE 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 signal level Signal IO Usage The Signal IO can handle 16 signals at the same time Each signal block is independent in parameters and options from other blocks Open the Signal component within the Open I O Component Dialog Box or with the openio signal command Release the Signal component within the same dialog or with the close signal command See Signal Commands for specific Signal IO commands S12 X Debugger Manual 337 HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins Base Signal Files Provided You can reuse the base signal files shown in Table 10 30 to create more complex signal descriptions These files are usually stored in the prog FCSsignals folder of the debugger installation path Table 10 30 Base Signal Files 338 File saw_11bit_0_5v_1Hz txt Properties Sawtooth signal 11
399. he 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 Call the command file when the Connection component is loaded Most connection components execute the command file STARTUP CMD once the connection component is loaded and initialized By adding the call command file in this file for example CALL INIT CMD it automatically executes when the connection component loads NOTE Refer to section Starting the Debugger Loading an Application 1 Choose HC12FCS gt Load The LoadObjectFile dialog box opens 2 Select an application for example FIBO ABS 3 Click OK The dialog box closes and the application loads in the Debugger 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 The Local Data component is empty The PC in the Register component is initialized with the PC value from the application entry point 234 S12 X Debugger Manual How To Starting an Application Starting an Application
400. he debugger engine and those specific to individual debugger connections It also defines the HC12 HCS12 and HC S 12 X environment variables used by the debugger engine and those specific to individual debugger connections This book is divided into the following chapters Chapter 22 Debugger Engine Commands Chapter 23 Connection Specific Commands Chapter 24 Debugger Engine Environment Variables Chapter 25 Connection Specific Environment Variables S12 X Debugger Manual 497 Book IV Contents 498 S12 X Debugger Manual 22 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 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 lt command component is the name of the component named in the component window title such as Data or Register component number is the number of the component This number does not exist in
401. he target is halted during the specified period of time while command file execution is pending the command file ignores the time delay and runs e If the target is halted command file execution does not halt command file ignores the time delay NOTE The Wait instruction ends as soon as the PC changes S12 X Debugger Manual 603 Debugger Engine Commands Debugger Commands Usage WAIT time s Components Debugger engine Example WAIT 100 T Pauses for 10 seconds before executing the T Trace instruction 604 S12 X Debugger Manual Debugger Engine Commands Debugger Commands 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 repeats as many times as necessary to fill the memory block When the range is not an integer a multiple of the length of the list and the last copy of the list is truncated accordingly This command is identical to the memory set MS command Usage WB range list range an address range constant that defines the block of memory equal to the values of the bytes in the list list a list of byte values to store in the block of memory Alias MS Components Debugger engine Example in gt WB 0x0205 0x0220 OxFF This command fills up the memory range 0x0205 0x0220 with the OxFF byte value WHILE The WHILE command allows you to execute a seque
402. her set the Refresh memory when halting option for those ranges in the DMM dialog or enter the DMM RELEASECACHES command in the Command window You can disable caching for the debug session when entering the DMM CACHINGOFF command in the Command window Update Rate This dialog box shown in Figure 3 53 allows you to modify the update rate in steps of 100ms Figure 3 53 Update Rate Dialog Box Update Rate Rate 100 ms Cancel NOTE Periodical mode is not available for all hardware connections and some hardware connections require additional configuration to work When you set the Refresh memory periodically when halted checkbox the debugger continues refreshing caches even if it is not running This allows you to see I O Register changes even if the CPU is not running Associated Context Menu The memory context menu shown in Figure 3 54 gives the user access to memory commands S12 X Debugger Manual 99 Debugger Components General Debugger Components Figure 3 54 Memory Context Menu Delete Watchpoint Show Watchpoints Set Markpoint Show Markpoints Show Location Word Size Format Mode Display Fill Address Copymem Search Pattern vvv The Memory context menu entries shown in Table 3 30 allow you to execute memory associated commands Table 3 30 Memory Context Menu Description 100 Menu Entry Description Set Appears in context menu only if no wa
403. hes to User Triggers mode Set triggers by selecting from the list or from a context sensitive menu Automatic mode is the default selection when no triggers are currently set Set trigger condition and trigger addresses from debugger Source Assembly Memory and Data components using Set Trigger A or Set Trigger B context sensitive menu entry or from Trigger Settings dialog DBG module records executed change of flows Since no triggers are currently set stopping the debugger requires a user request a breakpoint or watchpoint 435 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Table 17 10 Trigger Modes continued Mode Triggers Disabled Mode Description User makes trigger settings manually Debugger analyzes DBG module before and after the run to build up Status and Trace information but does not set up DBG module before running Requires advanced knowledge of on chip DBG module Use to set hardware breakpoints watchpoints and triggers User must handle trigger comparator addresses and DBG control registers through Memory component or by using command line commands without a dedicated GUI to access DBG module register Use selected flags within DBG control registers to enable or arm DBG module By default when debugger halts it automatically protects FIFO content from unexpected reads analyzes FIFO content and disarms DBG module user can disable this function
404. hip Simulation Connection Commands HALT_ON_TRAP Description Stops on call to exception handler This command allows you to specify the address of an interrupt handler start address of an ISR using either the ISR name or an expression During simulation of the exception processing this address is compared with the fetched vector If they match the simulation stops instead of calling the exception handler Syntax HALT ON TRAP OFF interrupt function lt expression gt Example Source code of exception handler interrupt MyISR void j Command HALT ON TRAP MyISR Instead of calling the function MyISR because of an exception the simulator stops HCS12 SUPPORT Description Enables HCS12 specific core emulation modes NOTE Typically use this command only to override automatic debugger settings done when selecting the derivative by GUI or project wizard The HCS12X_MAP4000 option may still be relevant as it is not covered by wizard project setup and is not automatically preset always set by default to FLASH Syntax HCS12 SUPPORT ON OFF Hc12 HCS12 HCS12x HCS12XE STATUS HCS12X FLASH num 646 S12 X Debugger Manual Connection Specific Commands Full Chip Simulation Connection Commands XGATE_RAM lt num gt HCS12X_MAP4000 FLASH RAM EXTERNAL Arguments OFF HC12 simulator is in legacy CPU12 mode ON or HCS12 HC12 simulator is in HCS12 core m
405. his code executes the following block10 times 10000 a 128 30000 RAISE 7 3 test_interrupt Execution starts 100000 cycles after the start of the simulation 10000 a 128 This code assigns 128 to a 10000 cycles after each start of the periodical event 30000 RAISE 7 3 test interrupt This code 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 332 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection True Time I O Stimulation END This code indicates the 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 This code raises the interrupt for the last time This instruction marks the terminating point of the Stimulation if there are no pending periodical events left Stimulation Input File Syntax This section details the input file syntax required by the FCS EBNF StimulationFile IdDeclaration TimedEvent PeriodicEvent IdDeclaration def ObjectId ObjectField ObjectField ObjectSpec BitRange BitRange StartBit NoOfBits
406. hows the returned value as text instead of Field Description Table 3 70 shows CMD Callback attributes Table 3 70 CMD Callback Attributes Attribute Description Field Description Warning text written in this field is overwritten the first time you execute specified command Command Contains command line command to be executed after clicking button Drop Into In Edit mode the drag and drop functionality supplies an 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 now contains the address of the variable 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 Inspect component pick an object from the object pool Demo Version Limitations Only one VisualizationTool window can be loaded The number of instruments is limited to three S12 X Debugger Manual 161 Debugger Components Visualization Utilities 162 S12 X Debugger Manual Control Points This chapter provides an overview of the three kinds of debugger control points Breakpoints also called data breakpoints Breakpoints are located at an address They can be temporary
407. ialization Write your code here for elo press Ft 352 aba OxIOOME Postlosd command file correctly executed main 02300048 T starto FCS Warning ID S writing to aimplemeste register at pc noo FCS Warsini ID 5 writing to saimslenested register at pc Oacoc gt S12 X Debugger Manual 11 P amp E Multilink Cyclone Pro Connection This section contains information to assist you with the P amp E Multilink Cyclone Pro connection P amp E Multilink Cyclone Pro Technical Considerations P amp E Microcomputer Systems supplies many of the debug cables that can be used to connect the 8 16 bit debugger and the CodeWarrior IDE to the HCS12 hardware When the debugger runs the P amp E Multilink Cyclone Pro connection it communicates and debugs CPU12 HC12 HCS12 HCS12X and XGATE core based hardware connected through the P amp E USB BDM Multilink P amp E Cyclone Pro via USB Serial and TCP IP NOTE Allrecent P amp E hardware interfaces such as the P amp E USB BDM Multilink and Cyclone Pro are fast enough to debug devices with a bus speed of up to 40Mhz To use the P amp E USB BDM Multilink the drivers from P amp E must be installed on the host computer NOTE The P amp E Multilink Cyclone Pro connection also works with Freescale development boards with an integrated debug circuit based on Open Source BDM Connection Menu Setting the P amp E Multilink Cyclone Pro connection chan
408. ibilities Destination Action Component Window Assembly Displays disassembled instructions starting at first address selected Highlights instructions corresponding to selected memory area in Assembly component Command Line Appends selected memory range to Command Line window Register Loads destination register with start address of selected memory block Source Displays high level language source code starting at first address selected Instructions corresponding to selected memory area are gray in source component Drop Into Table 3 32 shows the drop actions possible in the Memory component Table 3 32 Memory Component Drop Possibilities Source Component Action Window Assembly Dumps memory starting at selected PC instruction Selects PC location in memory component Data Dumps memory starting at address where selected variable is located Selects memory area where variable is located in memory component S12 X Debugger Manual 101 Debugger Components General Debugger Components Table 3 32 Memory Component Drop Possibilities continued Source Component Action Window Register Dumps memory starting at address stored in selected register Selects corresponding address in memory component Module Dumps memory starting at address of first global variable in module Selects memory area where this variable is located in memory component Dem
409. ick the OK button The Access Details dialog box disappears and the system clears the Auto Configure checkbox To abandon 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 280 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu Output You can save the current memory configuration into the file you defined at the outset Clock Frequency Setup The FCS provides 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 10 8 Clock Frequency Setup Dialog Box Clock Frequency Setup Oscillator frequency 4 000000 MHz Display in status bar CPU cycles C True Time fin ms CPU frequency 2000000 MHz v Reset cycles time Clock factor 0 500 on debugger reset Esther the Oscillator or CPU frequency can be specified The Clock factor wil then automatically determine the other value The Clock factor is derived from the CPU awareness or from the peripheral simulation model Cen tee 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 simulation is
410. ield below the combo box Cancel Help 10 Click the OK button The Monitor Setup dialog box opens again 11 Click on the Vector Table Mirroring tab a a ea NOTE We recommend that you use the Vector Table Mirroring feature Otherwise you cannot program vectors as captured or protect them from erasure or overwriting by the HCS12 Serial Monitor Figure 14 6 Monitor Setup Dialog Box Vector Table Mirroring Tab Monitor Setup Monitor Communication Vector Table Miroring Load Options E 12 To enable this feature check the Enable Vector Table Mirroring checkbox 376 S12 X Debugger Manual HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface Figure 14 7 Monitor Setup Dialog Box Vector Table Mirroring Tab Monitor Setup Monitor Communication Vector Table Miroring Load Options 13 Click Auto Detect to make the debugger search for the vector table address and vectors reserved by the HCS12 Serial Monitor 14 Once automatic detection succeeds click OK to start debugging MONITOR HCS12 Menu Options Once you set the HCS12 Serial Monitor connection MONITOR HCSI2 appears in the Debugger menu as shown below Figure 14 8 MONITOR HCS12 Menu Options MONITOR HCS12 Componen Load Ctri4L Reset R Ctri4R Setup Connect Command Files Help Table 14 1 MONITOR HCS12 Menu Options Menu Entry Description Load Displays Load Executable File dialog
411. ies are searched for files named between and Searching for files named between quotation marks starts in the directory of the source file containing include directive S12 X Debugger Manual Synchronized Debugging through DA C IDE Configuring DA C IDE for Freescale Tool Kit You can assign the list of header directories in a file To do this enter the file name absolute or relative in relation to the project root with the prefix in this field Separate directories with a semi colon or start a 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 Preinclude File In this text box specify the name of the file to include automatically at the beginning of every source module during analysis as if include string were present in the first line Use the preinclude file to specify non default predefined macros and variable and function declarations for a particular compiler We selected the one corresponding to our example M68k preinclude file adapt it to your needs Add Files to Project In the Project window the Explorer View Tab replaces Windows Explorer and supplies you with additional information on project file directories 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 Fr
412. ieved from the DBG FIFO buffer from the DBGFL DBG on chip module register 452 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Demonstration Mode Limitations Figure 17 48 Trace Window Recorded Data Display El Trace FIFO Depth Demonstration Mode Limitations During code program reconstruction the Trace window displays a limited number of frames Real time code Profiling and code Coverage are disabled Preset Predefined Instruction Memory Access or Capture Triggers are not available Only Expert triggers can be set S12 X Debugger Manual 453 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Demonstration Mode Limitations 454 S12 X Debugger Manual 18 Debugging Memory Map The Debugging Memory Map DMM is a software manager for all debugger accesses to device or chip memory and also for memory data caching The DMM provides a global approach for all different CPU families and cores each family having its own method for memory access and its own on chip memory layout and memory address range priorities The DMM gets all memory read and write calls from the debugger and also uses the low level function read write primitives to call third party cable drivers required for devices such as BDM pods and Monitors The debugger provides the DMM with core specific read write access methods called Types and core specific priority rules called Priority with
413. ight to left in a byte bit 7 is the left most bit So in bitRange noOfBits is always less than or equal to StartBit 1 ObjectSpec is defined in Requirement specification for Object Pool as below ObjectSpec ObjectName FieldName ObjectName Ident Index FieldName IdentNum IdentNum Size IdentNum Ident 4 HexNumber Size r e SB W air The identifiers declared in IdDeclaration are stored in a table of identifiers and can be also used in Expression If 4 is specified the time is absolute it is the number of cycles since FCS began f is specified the time is relative to the previous time specification If nothing is specified time is the number of cycles since execution of the Stimulation file 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 Electrical Signal Generators and Signals Application to Device Pins This section describes the FCS relevant signal generators and device pins 334 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pi
414. iles Install the drivers delivered with the BDI interface to make sure you are using the latest drivers These files are delivered on a disk from ABATRON 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 an 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 also contain information bound to the MCU and MCU version used and information 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 You can run the configuration program e g B10C12 EXE for CPU12 processor with BDI1000 or BDIHSHCI EXE for CPU16 CPU32 with BDI HS within the debugger is you browse for it using Abatron BDI gt Configure BDI Box or specify the tool path in the Abatron BDI gt Setup dialog box Otherwise run the configuration tool directly from the File Manager or Windows Explorer Example with B10C12 EXE Configuration Tool NOTE Referto the ABATRON User Manual for further details about the BDI interface and BDI setup S12 X Debugger Manual 383 Abatron BDI Connection BDI Interface Software Setup Figure 15 1 BDI100
415. imulation component source io int txt Listing 10 5 shows the listing of the Stimulation file Listing 10 5 io_int txt def a TargetObject 210 B ae ERIODICAL 200000 10 100000 RAISE 7 3 test_interrupt END 10000000 RAISE 7 3 test_interrupt 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 io_demo prm file in the same demo directory You can see at the end of this file how to set the interrupt vector adapt it to your needs VECTOR 7 Interrupt Function set vector on Interrupt 7 If the interrupt vector address is not specified in the prm file the FCS stops when an interrupt is generated The exception mnemonic matching the interrupt vector number is displayed in the FCS status bar The second argument specifies the interrupt priority and the third argument is a free chosen name of the interrupt The file io int txt is used to generate 11 interrupts Ten periodical interrupts are generated every 100 000 CPU cycles from 200 000 100 000 3007000 to 172007000 CPU cycles A last one is generated when the number of CPU cycles
416. imum name width is 16 characters By increasing the value you can adapt the window to longer names Zoom and Sort Submenus Figure 3 29 Zoom and Sort Submenus Zoom In v Not Sorted Zoomo Alphabetical By Address S12 X Debugger Manual 77 Debugger Components General Debugger Components Associated Context Menu Figure 3 30 Data Context Menu Open Module Add Expression Set Watchpoint Show Watchpoints Set Markpoint Show Markpoints Show Location Zoom Scope Mode Format Options Sort Table 3 13 describes the Data context menu entries Table 3 13 Data Context Menu 78 Menu Entry Description Open Module Opens the Open Module dialog box Set Appears only in context menu if no watchpoint is set or disabled on Watchpoint specified variable When selected sets a read write watchpoint on this variable Displays a yellow vertical bar for the variables on which a read write watchpoint is defined If variable is accessed during execution the program halts and current program state displays in all window components Delete Only appears in context menu if a watchpoint is set or disabled on the Watchpoint specified variable When selected deletes this watchpoint Enable Only appears in context menu if a watchpoint is disabled on the Watchpoint specified variable When selected enables this watchpoint Disable Only appears in context menu if a breakpoint is set on the specifie
417. in an existing project These paths are explained in the Debugger Interface chapter of this manual HCS12 Serial Monitor Interface Follow these steps to use the HCS12 Serial Monitor connection 1 Run the CodeWarrior IDE with the shortcut created in the program group 2 Create a project see the Debugger Interface chapter of this manual 3 Choose Project Make and Project Debug to start the debugger Debugger Main window opens S12 X Debugger Manual 373 HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface Figure 14 1 Debugger Main Window Component Menu Component Source Winc Open Fonts Background Color 4 Inthe debugger main window choose Component gt Set Connection to select another connection Figure 14 2 Set Connection Dialog Box HCS12 Serial Monitor Selection Set Connection Processor a ox Connection HCS12 Serial Monitor m Cancel This Connection supports Heli Freescale HCS12 Serial Monitor He C Program FilessFreescalesCode Warrior for HC812 V4 prog HCS12SERIALMON tat 5 Select HC12 as Processor then HCS12 Serial Monitor as connection in the Set Connection dialog box 6 Click the OK button The Monitor Setup dialog box appears 7 In the Monitor Setup dialog box Monitor Communication tab choose the correct Host serial communication port if necessary 374 S12 X Debugger Manual HCS12 Serial Monitor Connection HCS12 Serial Monitor I
418. in the DMM GUI The DMM GUI allows you to change the memory access method at any time Debugging Memory Map GUI The graphical user interface GUI is flexible and easy to use and displays live diagnostics within the dialog At any time you can revert to the default factory setup Most of the time you do not need to edit or change settings within the GUI Open the DMM GUI by choosing the Debugging Memory Map option in the connection menu in the debugger main window This opens the DMM Window S12 X Debugger Manual 455 Debugging Memory Map Debugging Memory Map GUI Figure 18 1 Debugging Memory Map Window MC9S12XEP100 Debugging Memory Map Comment 00000022 yes DBGTBH DBGTBL fifo regist RN 00000024 00000025 yes DBGTBH DBGTBL fifo regist 00000024 00000025 yes DBGTBH DBGTBL fifo regist 00000000 000007FF yes Registers 3 00000800 00000BFF yes eeprom window OOOOOCOO OO000FFF yes eeprom OO001000 O0003FFF yes ram 00004000 O0007FFF yes flash 4000 or Ram OO008000 O000BFFF yes flash window v New Modify Details Delete Revert to Default Information memory range from 0x22 to 0x23 is of physical type therefore accessed directly in device physical memory 0x0 Oxffff memory range from 24 to 0x25 is of global type therefore accessed in global space via BDM GPAGE register Global address sp 3 lt Ji gt Close The DMM GUI shows a list of memory address ranges called Modules in thi
419. indow component titles and headlines see Component Windows Object Information Bar You can select smaller window borders and customize the toolbar Table 2 3 describes the View menu entries Figure 2 8 View Menu View Run HCS12F v Toolbar v Status Bar Hide Title Hide headline Small Border Customize Table 2 3 View Menu Description Menu Entry Description Toolbar Check clear Toolbar to display or hide it Status Bar Check clear Status Bar to display or hide it Hide Tile Check clear Hide Title to display or hide the window title Hide Headline Check clear Hide Headline to display or hide the headline Small Borders Check clear Small Border to display or hide small window borders Customize Opens the debugger Customize Toolbar window Customizing the Toolbar When you select View gt Customize the Customize Toolbar dialog box appears You can customize the 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 9 S12 X Debugger Manual 33 Debugger Interface Debugger Main Window Figure 2 9 Customize Toolbar Dialog Box Customize Toolbar Available toolbar buttons Current toolbar buttons Gr Assembly Step Cti F11 aa Ha FB Separator pese Target Cti
420. ing replaying and pausing The current action record play or pause and path of the involved file displays in the Object Information bar of the window Recorder Operations When the window is open but no record or play session is in progress 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 recording session starts and the Stop button is enabled Click the Stop button to end the recording session S12 X Debugger Manual 109 Debugger Components General Debugger Components Clicking the replay button prompts for a file name Command files have a rec default extension and can be edited A replay session starts and enables only the stop and pause buttons Click the Pause button to stop file execution and enable the play and stop buttons Click the Play button to resume file execution from the point at which it stopped Click the Stop button to stop the replay session Terminal and TestTerm Record Data typed in the Terminal component and TestTerm component is recorded during a recording session NOTE You must record the time as well to be able to replay the recording Record Time menu entry of the recorder must be checked before recording Recorder Menu The Recorder menu shown in Figure 3 65 changes according to the current session Table 3 38 describes the menu items Figure 3 65 Recorder Menu Record Replay Record Time Tab
421. ing at Ox2FFF 256 bytes Example 0x2F00 256 Refers to the memory range starting at 0x2F00 which is 256 bytes wide This example is equivalent to the previous example fileName A DOS file name and path that identifies a file and its location The command interpreter does not assume any file name extension Use backslash or slash as a directory delimiter The parser is case insensitive If no path is specified it looks for or edits the file in the current project directory that is when no path is specified the default directory is the project directory Example d demo myfile txt Example layout hwl Example d work project hwc component The name of a debugger component Choose Component Open to display a list of all debugger components The parser is case insensitive Example S12 X Debugger Manual Debugger Engine Commands Commands Overview Memory Example SoUrCe S12 X Debugger Manual 509 Debugger Engine Commands Debugger Commands Module Names Correct module names appear in the Module component window Make sure that you use the correct module name for any command you implement Ifthe abs is in HIWARE format some debug information is in the object file 0 and module names have an 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 ELF format assigns all debu
422. ing it Figure 3 69 ToolTips Features E DEMO fibo c Line 21 fib2 1 fibo i 2 while i lt n M fibo fibl fibl fib2 fib2 fibo fib2 987 toto counter fiboCount ict Select ToolTips gt Enable from the source menu entry to enable or disable the tool tips feature Select ToolTips Mode from the source menu entry to select normal or details mode which provides more information on a selected procedure Select ToolTips Format from the source menu entry to select the tool tip display format decimal hexadecimal octal binary or ASCIT On Line Disassembling For information about performing on line disassembly refer to Consulting Assembler Instructions Generated by a Source Statement Select a range of instructions in the source component and drag it into the assembly component The corresponding range of code is highlighted in the Assembly component window as shown in Figure 3 70 Holding down the left mouse button and clicking the T key highlights a code range in the Assembly component window corresponding to the first line of code selected in 116 S12 X Debugger Manual Debugger Components General Debugger Components the Source component window in which the operation is performed This line or code range is also highlighted Figure 3 70 On Line Disassembling DER abs e 0x322011 please make su never leave this f B abs 0x32200C lt Setting
423. interface environment i e menus toolbars status bars and drag and drop facilities Chapter 3 Debugger Components contains descriptions of each basic component and visualization utility Chapter 4 Control Points describes the control points and associated windows Chapter 5 Real Time Kernel Awareness contains descriptions of the Real Time concept and related applications Chapter 6 How To provides answers for common questions and describes how to use advanced features of the Debugger Chapter 7 CodeWarrior Integration explains how to configure the Debugger for use with CodeWarrior IDE Chapter 8 Debugger COM Capabilities provides information on the Component Object Model COM Interface which allows the user to control debugger using scripts or other application Chapter 9 Synchronized Debugging through DA C IDE explains the use of tools with the DA C IDE from RistanCase S12 X Debugger Manual 23 Book Contents 24 S12 X Debugger Manual Introduction This section is an introduction to the Freescale Debugger 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 industrial control world Some typical tasks are Simulation and debugging of embedded applications Simulation and debugging of real time embedded applic
424. ion disabled enabled 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 counter value and interval counter value NOTE Current and Interval values are limited to 2 147 483 647 if entering a number greater than this value a beep occurs and the character is not appended Changing the Interval value automatically sets the Counter value 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 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 Ad
425. ion 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 BDI PROTOCOL RESET Enter these commands 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 23 1 Command Description Parameters Topic Description Description Provides a detailed description of the command and how to use it Syntax Specifies the syntax of the command Example Small example of how to use the command S12 X Debugger Manual 615 Connection Specific Commands Abatron BDI Connection Commands BDI Description The BDI command executes any ABATRON direct command See the ABATRON User Manual for your CPU for complete descriptions of ABATRON direct commands Direct commands are commonly used to download to non volatile memory areas see also the Flash Programming section Syntax BDI lt ABATRON_direct_command gt where ABATRON_direct_command has the following syntax lt Object gt lt Action gt lt parName gt lt parameterValue gt Example BDI FLASH ERASE addr 8000 size 8000 sram 0800 PROTOCOL 616 Description Use this command to switch the Show
426. ion 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 the Format menu Table 6 1 Table 6 1 Debugger Display Format Menu entry Description Hex Variable values display in hexadecimal format Oct Variable values display in octal format Dec Variable values display in signed decimal format UDec Variable values display in unsigned decimal format Bin Variable values display in binary format Symbolic Displayed format depends on variable type The following variances apply for different variable types Values for pointer variables appear in hexadecimal format Values for function pointer variables appear as function name Values for character variables appear in ASCH character and decimal format Values for other variables appear in signed or unsigned decimal format depending on the condition of the variable Activate the Format menu as follows 1 2 Right click in the Data component The Data context menu appears on the screen Choose Format from the context menu The list of all formats appears on the screen S12 X Debugger Manual 239 How To Working on Variables The format selected is valid for the whole Data component Values from all variables in the data component appear according to the sele
427. ion Program Examples The following examples demonstrate several uses of true time I O stimulation Running an Example Program Without Stimulation 1 Run the debugger with the FCS connection Figure 10 19 shows the Main window S12 X Debugger Manual 325 HC S 12 X Full Chip Simulation Connection True Time I O Stimulation Figure 10 19 FCS I O Simulation Main Window Fle Vew Run MESIZFCS Component Memory Window Heb ja g i gt e izzieiel ej D Priest 251 Pty Documenti promete E128 promcfiiacer nan c canon defines an macros 220 deriverive information foragea LINK INTO DERIVATIVE achat zeiz2 vous maia vorg 8 put your cem code bere 2 Choose Simulator gt Set gt Sim 3 Choose Component gt Open gt Visualizationtool Figure 10 20 shows the LED instruments within Visualization Tool component Figure 10 20 Configure LED Instrument VisualizationTool Display Mode ale slal amj ele Ir 4 Choose Visualization Tool gt Add New Instrument gt Analog instrument Figure 10 21 shows the Analog instrument 326 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection True Time I O Stimulation Figure 10 21 Analog Instrument EU es oN Ve fs Choose Simulator gt Load io_demo abs 5 6 Choose Run gt Start Continue or click the green arrow icon 7 Ifthe program halts in startup click the Start Continue command
428. irtual SCI ports This enables you to make a connection to any port in the Full Chip Simulation framework S12 X Debugger Manual Debugger Components General Debugger Components 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 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 choosing Input File from the context menu As soon as you click the OK button in the File Open dialog input from the file starts The file closes as soon as the end of file is reached or you choose Close Input File from the context menu When the input file reaches its end a CTRL Z character ASCII code 26 decimal is sent to all output devices receiving characters from the input file to notify them that the file transfer is finished You can redirect some input devices to an output file in a similar fashion Make sure that you have chosen your connections from input devices to the output file Then open or create your output file by choosing Output File from the context menu If the file does not exist it is created Otherwise you can choose to overwrite or append the existing file To stop writing to the output file choose Close Output File from the context menu File Control Commands It is also possible to open and close input and output files through special Esc
429. ist box containing all available environment variables Select a variable using the mouse or directional arrow keys S12 X Debugger Manual 31 Debugger Interface Debugger Main Window Command Line Arguments are displayed in the text box You can add delete or modify options and specify a directory with the browse button A second list box contains the arguments for all of the environment variables defined in the corresponding Environment section Select a variable using the mouse or directional arrow keys OK Confirms changes and saves in current project file Cancel Closes dialog box without saving changes Help Opens the help file The Load tab shown in Figure 2 7 contains the following controls e A checkbox that specifies automatic erase and program into Flash and EEPROM Advanced button specifies affected memory block Enable automatic memory image verification after loading code Enable automatic run after successful load Enable automatic stop at Function specified in text box Figure 2 7 Configuration Window Load Tab Configuration Environment Load r To specify affected memory block click here Verity memory image after loading code Ol j M Run after successful load M Stop at Function main 32 S12 X Debugger Manual Debugger Interface Debugger Main Window View Menu In the Main Window View menu Figure 2 8 you can choose to show or hide the toolbar status bar w
430. itches to Periodical mode Update Updates displayed information at regular time intervals when connection is running The update rate is 1 second Max All items Configure the maximum number to display large Elements arrays element by element It is also possible to display a dialog that prompts the user Format All items Use to display numerical values in different formats Close Single selected Closes the corresponding component Component only Drag Out Items that can be dragged depend on which icon is selected Table 3 50 gives a brief description Table 3 50 Inspector Component Drag Possibilities 142 Dragging Description Item Components The components cannot be dragged Stack The Stack Icon itself cannot be dragged 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 e Indirections Indirections can be dragged to display their content in memory S12 X Debugger Manual Debugger Components Visualization Utilities Table 3 50 Inspector Component Drag Possibilities continued Dragging Description Item Symbol The Symbol Table icon cannot be dragged out Table Subitems can be dragged depending on their type e Modu
431. ition 163 Deleting 192 Memory 190 Setting source 190 Storing triggers as 406 Marks 153 Marks menu entry 121 Match value 420 421 437 438 MCCNT 315 MCCTL 315 MCU Communication 368 MCU Configuration Option 369 mceu03cl fpp 477 mcu03c3 fpp 478 mcu03c4 fpp 479 mculd 474 MCURegisters Component 83 MCURegisters Menu 84 mcutools ini 208 668 MEM 573 Memory 410 Banked model 314 Dump 89 Word 89 Memory access inside Address A Address B range 420 436 Memory access at Address A 420 436 and value on data bus match 420 437 and value on data bus mismatch 420 437 or at Address B 420 436 then memory access at Address B 420 436 Memory component 89 243 Memory Configuration Modes 276 Memory Expansion Register 314 714 Memory menu 93 Memory model selecting 228 Memory models 314 Memory Write Access 424 443 MemoryBanker 230 Menus Assembly 57 Assembly context 58 Associated with components 45 Component 42 46 Component menu 45 Connection menu 37 Context Source 119 Split view 67 VisualizationTool 146 Context sensitive 46 Coverage 66 Data menu 72 73 Display submenu 96 File menu 30 Folding 123 Format 239 Format selected all submenu 75 Format submenu 74 94 Help 45 Memory menu 93 Mode submenu 75 95 MultilinkCyclone Pro ICD 12 215 Profiler 107 Recorder 110 Register 112 Run menu 36 Source 118 View menu 33 VisualizationTool Properties 147 Window 43 44 Word Size submenu 94 Minimal startup code selecting 231 Misa
432. k 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 PAGEb5 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 S12 X Debugger Manual 623 Connection Specific Commands DMM Commands DMM Commands You can make all DMM GUI settings using debugger command line commands within the Command component window or from a command file Debugging Memory Map Manager Commands The following list of commands allows you to fully script the debugging device memory mapping It is recommended to limit the use of these commands to special debugging purposes as the default mapping is typically sufficient and script setups can be complex and may lead to debugger errors NOTE The Debugging Memory Map Manager and associated command set are available with hardware connections only List of Commands ADD lt parameters gt DEL lt module handle gt SAVE lt mcuid gt DELETEALLMODULES RELEASECACHES CACHINGON CACHINGOFF WRITEREADBACKON WRITEREADBACKOFF HCS12MERHANDLINGON HCS12MERHANDLINGOFF OPENGUI mcuid D D D D D D D D D
433. kpoints Tab The Markpoints tab of the Controlpoints Configuration window contains List box that displays the list of currently defined markpoints Markpoint group box that displays the address of the currently selected markpoint size of the markpoint name of the procedure or variable on which the markpoint has been set and type of the markpoint General group box that contains a checkbox that allows you to save and restore the markpoint selected Add button to add new markpoints Specify the Address in hexadecimal when Hex format is checked or as an expression when Hex format is unchecked Delete button to remove currently selected markpoint and select the markpoint that is below the removed markpoint Update button to update all modifications in the window OK button to validate all modifications Cancel button to ignore all modifications Help button to display help file and related help information Setting Markpoints Markpoints may be set in a Source Data or Memory window S12 X Debugger Manual 189 Control Points Markpoints 190 Setting a Source Markpoint A blue letter L appears in front of a code line associated with a markpoint To define a markpoint in source code Use the Source Context Menu 1 Point at a code line in the Source window and right click The Source Window context menu appears see Figure 4 8 2 Choose Set Markpoint from the context menu to define a markpoint at the beginning of
434. l Awareness OSEK Kernel Awareness 206 S12 X Debugger Manual How To This chapter provides methods for accomplishing common tasks Configuring the Debugger Starting the Debugger Switching Connections Using the Stationery Wizard to Create a Project CodeWarrior IDE Integration Automating Debugger Startup Loading an Application Starting an Application Stopping an Application Stepping in the Application Working on Variables Working on the Register Modify Content of Memory Address Consulting Assembler Instructions Generated by a Source Statement Viewing Code Communicating with the Application About startup cmd reset cmd preload cmd postload cmd Configuring the Debugger If you have installed the Debugger under Windows 2000 or higher you can start the Debugger from the CodeWarrior IDE from the desktop from the Start menu or from an external editor such as WinEdit or CodeWright To work efficiently find all requested configuration and component files you must associate the Debugger with a working directory S12 X Debugger Manual 207 How To Starting the Debugger For Use from Desktop Windows 2000 When starting the Debugger from Windows without WinEdit you can define the working directory in the file MCUTOOLS INI located in the Windows directory Defining the Default Directory in the MCUTOOLS INI When starting from the d
435. l non constant data fit in the non paged RAM Choose this in either one of the following situations Your non constant data fit into 12k and you do not plan on accessing non paged RAM areas through RPAGE If you choose this and still do accesses through the RPAGE register the compiler generated code may be incorrect Accesses through RPAGE include accesses through rptr qualified pointers and accessed to variables defined in __ RPAGE SEG sections You have less than 8k non constant data If this is the case you can also do accesses through RPAGE WARNING This will induce non ANSI behavior in the compiler When accessing constant data by means of pointer to non const the compiler may produce code that will not meet the required functionality All constants and the code fit into the non paged flash Choose this in either one of the following situations Your constants and code fit into 48k of flash and you do not plan on accessing non paged flash areas through PPAGE If you choose this and still do accesses through the PPAGE register e g calling a far function the code may be incorrect S12 X Debugger Manual 229 How To Using the Stationery Wizard to Create a Project You have less than 32k constants and code If this is the case you can also do accesses through PPAGE WARNING This will induce non ANSI behavior in the compiler when accessing non constant data by means of pointer to const the com
436. l project path S12 X Debugger Manual Synchronized Debugging through DA C IDE Configuring DA C IDE for Freescale Tool Kit Filenames in the original path with referential extensions are tried before those in the referential path The specified path may be either full or relative to project root and it may not specify a subdirectory in the project root directory tree Database Directory For the purposes of this project leave this field empty You can use this text box to specify the directory in which to save the symbols and software metrics database This directory can be absolute or relative to the Project Root Directory User Help File This text box determines the user help file For this project browse in the prog directory of your Freescale installation and select the help file matching your CPU Define the hot key for the User Help File in the Keyboard definition file default is Ctrl Shift F1 Configure File Types From the Project Option window of DA C choose the File Types tab to configure the basic file types Use the text boxes on this page to determine project file types see Figure 9 2 Figure 9 2 DA C Project Options Window File Types Tab Directores File Types Names Manager Miscellaneous r Referential C Source File Original Refer fe Assembler Source File asm Header File In LL 3 aaa y Document File doc Text File dop txt pim ini eny hw hwe Ist mak bpt
437. l selective modules for the individual modules NOTE See Hardware Considerations for more information about the Flash modules of your CPU derivative Table 19 1 describes module states which may appear in the NVMC dialog box list Table 19 1 NVMC Module States State Description Enabled Currently active on the chip It is possible to read as a ROM or program an enabled module Disabled Currently inactive so programming and reading are not possible Normally you enable or disable a module by setting clearing a flag in a special register Some modules cannot be disabled Blank Empty of code You can program its full address range Each blank byte contains the value OxFF or 0x00 depending on hardware Programmed Partially programmed not all bytes contain OxFF or 0x00 You must keep track of the areas still available for programming if any 470 S12 X Debugger Manual Flash Programming NVMC Graphical User Interface Table 19 1 NVMC Module States State Description Protected Partially protected from erasure or programming Normally you protect a module by setting clearing a flag in a special register Some modules can never be protected Unprotected Can be erased and programmed To select a module or other list item left click the module To deselect a module click the lt Ctrl gt key and left click For multiple selections or deselections use the Shift key
438. lated 0039 003B Reserved 003C 003F Chip select control registers Currently not simulated 0040 0043 PLL divider Currently not simulated registers 0044 0046 Reserved 0047 Clock Control Completely simulated Register 0048 005F Reserved 0060 0069 Analog to Digital Currently not simulated Converter 006A 006E Reserved 006F PORTAD Currently not simulated 0070 007F ADRxH reserved Currently not simulated 0080 009F Timer Registers Completely simulated 00A0 00A3 Pulse Accumulator Control Registers Completely simulated 00A4 00AC Reserved 00AD 00AF Timer Test Timer Port Completely simulated 00B0 00BF Reserved S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 23 Register Block Address Map continued Register Block Description Remarks Address 00C0 00C7 SCIO Completely simulated 00C8 00CF SCH Completely simulated 00D0 00D3 SPI Completely simulated 00D4 Reserved 00D5 00D7 SPI PORTS Completely simulated 00D8 00EF Reserved 00F0 00F3 EEPROM Control Currently not simulated 00F3 01FF Reserved Related Documentation The following documents are available from Freescale e MC68HC812A4TS D Technical Summary for MC68HC812A4 16 Bit Microcontroller 1996 e CPUI2 Reference Manual CPUI2
439. 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 gt Open Module io_demo c Scroll into the procedure Interrupt_Routine So IONS tee s Set a breakpoint in the Interrupt_Routine as shown below Figure 10 23 shows the Source component window Figure 10 23 Source Component Window Sieve N NDEM No demo c l gt decreasing interrupt void Interrupt Routine void A Mair 1 operation to be executed on int B static void Delay void 0 Wait for a short time volatile char cnt 0 while cnt lt DELAY cnt a 8 Activate Stimulation Window by clicking on it 9 Choose Stimulation gt Execute 10 Choose Run gt Start Continue After about 300 000 cycles the FCS stops on the breakpoint in the interrupt routine and the corresponding source line is highlighted The interrupt has been called Start the FCS It stops approximately each 100 000 cycles on the same breakpoint Restart and repeat these S12 X Debugger Manual 329 HC S 12 X Full Chip Simulation Connection True Time I O Stimulation actions until 1 200 000 cycles Start again the FCS runs until 10 000 000 cycles and stops on the breakpoint Start the FCS It continues to run The stimulation is finished The interrupts have been invoked by the St
440. layed Only two members of a structure are visible when unfolded S12 X Debugger Manual Debugger Components General Debugger Components Only one expression can be defined Associated Commands ADDXPR ATTRIBUTES DUMP PTRARRAY SMOD SPROC UPDATERATE ZOOM HCS12XAdrMap Component The HCS12XAdrMap window shown in the Figure 3 32 displays the address on Logical Global and XGATE memory maps for HCS12X derivatives Figure 3 32 HCS12XAdrMap Window P HCS12XAdrMap HCS12x flash size 512 KBytes GATE ram size 32 KBytes Name RAM paged Logical FC1800 hex asm M VB 0xFC RPAGE asm LDAA 041800 ee Name RAM paged ECBOG hex lasm MOVB HOKOF GPAGE Global her asm GLDAA OxC800 asm LDH R4 0xC8 asm LDB R5 R4 0 The object information bar of the component window contains the derivative s memory settings HCS12XAdrMap Operations Input the address into appropriate edit box in hex format The rest two edit boxes will display representation of this address in the corresponding memory maps If any of the edit boxes is empty that means that the address cannot be mapped to the corresponding memory map Text boxes in the right part of the component window display the following information for each memory map 1 Name of the memory where the displayed address is located Flash Ram etc 2 Anexample of assembly code that illustrates how to obtain data from the displayed address S12 X D
441. le Read access watchpoints remain active until they are disabled or deleted Setting a Write Watchpoint A red vertical bar appears in front of a variable associated with a write access watchpoint The Debugger provides two ways to define a write access watchpoint S12 X Debugger Manual Control Points Watchpoints Using the Data Context Menu 1 Point at a variable in the Data window and right click The Data context menu appears 2 Choose Set Watchpoint from the context menu to define Read Write Watchpoint 3 Point in the Data component window and right click The Source context menu appears 4 Choose Show WatchPoints from the context menu The Controlpoints Configuration window Watchpoints tab appears 5 From the list select the watchpoint you want to define as write access 6 Select the Write type in the list box to define a write access watchpoint for the selected variable Using the Left Mouse Button and pressing the W Key 1 Point at a variable in the Data window 2 Hold down the left mouse button and click the W key This defines a write access watchpoint 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 appears in front of a variable associate
442. le in MESSAGE HIDE ID 1 in warning setup status WARNING SETUP STATUS CLMSG Hidden message ID 1 MESSAGE HIDE RESET Description Resets all hidden messages to display them again Components Debugger engine Syntax MESSAGE HIDE RESET Example in MESSAGE HIDE RESET All previously hidden messages are displayed again now 648 S12 X Debugger Manual Connection Specific Commands Full Chip Simulation Connection Commands MESSAGE_SHOW_ID Description Shows a message with specific ID Components Debugger engine Syntax MESSAGE SHOW ID lt message number ID gt Example in gt MESSAGE_SHOW_ID 1 PSMODE Description This command changes the power save mode Syntax PSMODE STOP WAIT WAKEUP Arguments STOP places the CPU in its lowest power consumption mode halts all internal CPU processing WAIT places the CPU in low power consumption halts all internal CPU processing except the internal clock the programmable timer SPI and SCI remain active for more detail see the appropriate microcontroller manual This option consumes more power than the STOP option WAKEUP turns off the low power consumption mode the processor resumes normal processing Example in gt PSMODE STOP The processor is completely stopped in gt PSMODE WAKEUP The processor is out of power save S12 X Debugger Manual 649 Connection Specific Comman
443. le 3 38 Recorder Menu Description Menu Entry Description Record Starts recording from a debug session Replay Starts replaying from a debug session Record Time If set records evolution time also Instant O corresponds to the beginning of the recording The code in Listing 3 2 loads an abs file sets a breakpoint and configures the assembly component to display the code and addresses The Datal component switches the display to local variables starts the application and stops at the breakpoint Listing 3 2 Record File Example at 4537 load C Freescale DEMO fibo abs at 9424 bs 0x1040 P 110 S12 X Debugger Manual Debugger Components General Debugger Components at 11917 Assembly lt attributes code on at 14481 Assembly lt attributes adr on at 20540 Data 1 lt attributes scope local at 24425 g wait s Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations Records and replays only 20 commands Register Component The Register window shown in Figure 3 66 displays the content of registers and status register bits of the target processor Figure 3 66 Register Window Register HC12 CPU Cycles 41 D 0 A 0 B IX C017 IY 0 IP 386000 PPA SP 4FD CCR SXHINZVC Register values can be displayed in binary or hexadecimal format These values are editable Status Register Bits Set bits display dark whereas reset bits displa
444. le t t Select Frames to Dump From 0 To 50 Al C Instructions Cancel Help Go to Frame Selecting Go to Frame in the Trace window context sensitive menu opens a Search Frame dialog to allow you to look for a specific frame in the Trace window 134 S12 X Debugger Manual Debugger Components Visualization Utilities Drag Out Nothing can be dragged out Drop Into Nothing can be dropped in Demo Version Limitations Limits the number of frames to 50 Associated Commands CLOCK CYCLE FRAMES RECORD RESET Visualization Utilities Besides components that provide the Debugger engine a well defined service dedicated to the task of application development the debugger component family includes utility components that extend to the productive phase of applications such as the host application builder components and process visualization components Among these components there are visualization utilities that graphically display values registers and memory cells or provide an advanced graphical user interface to simulated T O devices program variables and so forth The following components of the visualization utilities belong to the standard Debugger installation Inspect Component The Inspect window shown in Figure 3 91 displays information about loaded components the visible stack pending events pending exceptions and loaded I O devices S12 X Debugger Manual 135 Debugger Component
445. les Modules can be dragged to the source and global data window to specify a specific module e Functions Functions can be dragged to display the function or code range e Variables Variables can be dragged to display their content in memory Indirections Indirections can be dragged to display their content in memory Drop Into Nothing can be dropped in Visualization Tool 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 100 consists of a plain workspace that can be equipped with many different instruments Figure 3 100 VisualizationTool Window VisualizationTool EditMode No Instrument selected a col arua w Edit Mode Cti4 Load Layout Colt Save Layoutas Cti S Recent Layout Files S12 X Debugger Manual 143 Debugger Components Visualization Utilities 144 Edit Mode and Display Mode The VisualizationTool operates in two modes Edit mode Use Edit mode to design the workspace to suit your needs Display mode In Display mode you can use what you have done in the Edit mode to view values interact with your application and instruments and click buttons To switch between these two modes use the toolbar the context menu or the shortcut Ctrl E Add New Instrument Use the context m
446. lication after loading and set temporary breakpoint at the specified function e functionName is the name of the function to set temporary breakpoint at NORUNAFTERLOAD doesn t run application after loading default ADD SYMBOLS appends the symbol information to the existing symbol table instead of replacing it NOTE By default the LOAD command is code symbol1s with no verification NOTE Ifyou use the ADD SYMBOLS parameter the debugger plays PRELOAD and POSTLOAD files for the first loaded application only Components Debugger engine Example LOAD FIBO ABS Loads the FIBO ABS application NOTE If no path is specified the destination directory is the current project directory S12 X Debugger Manual Debugger Engine Commands Debugger Commands LOADCODE This command loads code into the target system Use this command when no debugging is needed If no target is installed the following error message appears Error no target is installed If no target is connected the following error message appears Error no target is connected Usage LOADCODE applicationName Components Debugger engine Example LOADCODE FIBO ABS Loads FIBO ABS application code 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 Use this command if the
447. licking 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 1 Select Build Extras as shown in Figure 6 29 2 In the Build Extras pane check the Use External Debugger checkbox 3 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 4 Inthe Arguments field type the arguments for example targetFilePath Target sim 5 Click on Apply to validate these changes 232 S12 X Debugger Manual How To Automating Debugger Startup Figure 6 29 IDE Target Window Build Extras Panel Full Chip Simulation Settings my_E128_project mcp Target Settings Access Paths Buld Extra Fie Mappings Source Trees OSEK Sysgen Assembler for HC12 Bumes for HC12 Comper for HC12 Importer for HC12 Linker for HC12 Editor Custom Keywords XGATE Target Assembler for XGA Compiler for XGATE Importer for XGATE xj R Use modification date caching I Cache Subprojects Generate Browser Data From Cornpiler X Dump intemal browse information after comple This setting is used by compiler developers to debug generated browser data IV Use External Debugger Application Compier prog hiwave exe Arguments jiectFileDir F ull Chip Simulation ini instance sin Indial diectory _ Project Automating Debugger Startup Often you must perform the sa
448. ligned access 275 Mismatch value 420 421 437 438 Mode menu entry 73 93 Mode Selected and All Submenu 86 Mode Submenu 86 S12 X Debugger Manual Mode submenu 75 95 Modes update 73 Modify Accumulator register content 242 Index register content 242 Memory address content 243 Modify Trigger 408 Module Source 102 Module base address 493 Module component 102 Modules 471 Modulus Down Counter 315 Monitor Bus Trace 378 Monitor Command Files 378 Monitor Communication 377 378 Monitor Debugging Memory Map 378 Monitor Load 377 Monitor Reset 377 Monitor Setup 377 MONITOR HCS12 Bus Trace 378 Command Files 378 Communication 378 Debugging Memory Map 378 Load 377 Reset 377 Setup 377 Trigger Module Settings 378 MS 574 MultilinkCyclone Pro ICD 12 menu 215 MultilinkCyclonePro Bus Trace 355 Command Files 355 Communication Connect 354 Debugging Memory Map 355 Flash 355 Load 354 Reset 354 Set Derivative 354 Trigger Module Settings 355 Unsecure 355 Multiplexed External Bus Interface MEBI 292 Multitasking operating system 195 S12 X Debugger Manual N Name 472 NB 575 NETWORK 392 New menu entry 30 New Project window 221 NF 316 NOCR 577 Nodefaults option 612 NOLF 577 NV PARAMETER FILE 474 O Object Information bar 46 OBJPATH 682 Oct menu entry 75 94 112 239 Octal 239 Octal format 239 OP_SetValue 314 OPEN 577 Open Configuration menu entry 30 Open File menu entry 319 Open Memory Block 278 Open menu
449. list of defined breakpoints at the top of the tab In the Counter group of this tab specify the interval for the breakpoint detection in the Interval field Close the window by clicking the OK button S12 X Debugger Manual Control Points Breakpoints If you continue program execution the content of the Current field decrements each time the program reaches the instruction containing the breakpoint When Current equals zero the application stops If the Temporary checkbox is unchecked not a temporary breakpoint Current is reloaded with the value stored in Interval to enable the counting breakpoint again Conditional Breakpoints Conditional breakpoints activate when a given condition is TRUE The following icon identifies a conditional breakpoint 1M Setting Conditional Breakpoints Conditional breakpoints can only be set from the Controlpoint Configuration window s Breakpoints tab There are two ways to set a conditional breakpoint Hold down the left mouse button click the S key 1 Point at a C statement in the Source component window hold down the left mouse button and click the S key The Breakpoints tab opens and inserts a new breakpoint in the list of breakpoints defined in the application 2 Select the breakpoint you want to modify by clicking on the corresponding entry in the list of defined breakpoints 3 Specify the condition for breakpoint activation in the Condition group Condition box You must
450. lities Figure 10 17 Configure Terminal Connections Dialog Box 322 Configure Terminal Connections Default Configuration MAAE Connections From Ta Input File gt Virtual SCI Keyboard gt Virtual SCI Virtual SCI gt Display Vitual SCI gt Output File Serial Port Vitual SCI DA Vitual SCI Input Port Sci SenalDutput Baud Rate 2 Vittual SCI Output Port Sci Senalinput 9 c jJ You can 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 click 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 click the Remove button In the Serial Port section you can specify which serial port to use and its properties This is only possible if there is at least one connection from or to the serial port If a connection from or to the virtual SCI port has been chosen it is also possible to specify in the Virtual SCI section which ports will be taken as virtual SCI ports This enables you to make a connection to any port in the FCS framework
451. llaneous Files 0 defaul env fibo mak O Fibo prm L myproject dep L project ini Readme t t CAPS NUM Double click on Fibo c file to open it S12 X Debugger Manual 257 Synchronized Debugging through DA C IDE Configuring DA C IDE for Freescale Too Kit Configure the Tools We will now configure the compiler and maker into DA C IDE Define procedures using Project gt User Defined Actions from the main menu of DA C Compiler Configuration First set up a new action 1 In Menu Start Actions click on New The New Action box appears 2 Type C amp ompile in the New Action box 3 Click ENTER Figure 9 7 Next associate a bitmap with each tool using the Toolbar field 1 Click on the Picture radio button 2 Browse to the Bitmap directory of your current DA C installation 3 Choose Compiler bmp This is a default bitmap delivered with DA C IDE You can also add your own bitmap Figure 9 7 DA C Compiler Settings User Defined Actions x Menu Start Actions Menu File Version Control Systems Actions Menu E New Delete Rename template Down r Tool bar C None C Text mum Picture Compiler BMP Browse Action script AM e HasModuleE xt CunFile 4Message Not a module file Cancel 5S aveAll c hiware prog cm68k exe CunFile EIFE xist edout 4Message No Messages found Cancel EnCh Compiler EnGet edout Compiler Res
452. lled through the Breakpoints tab of the Controlpoints Configuration window Open this window using the Source window context menu by following these steps 1 Point at a C statement in the Source window and click the right mouse button The Source Window context menu appears see Figure 4 1 164 S12 X Debugger Manual Figure 4 1 Source Window Context Menu Set Breakpoint Run To Cursor Show Breakpoints Show Location Set Markpoint Show Markpoints Set Program Counter Open Source File Go To Line Ctri4G Find Ctrl F Find Procedure Ctrl I Folding Freeze ToolTips gt 2 Select Show Breakpoints from this menu Control Points Breakpoints The Breakpoints tab of the Controlpoints configuration window opens Figure 4 2 Figure 4 2 Controlpoints Configuration Window Breakpoints Tab Controlpoints Configuration Breakpoints Watchpoints Markpoints S12 X Debugger Manual 165 Control Points Breakpoints 166 Breakpoints Tab The Breakpoints tab contains List box that displays the list of currently defined breakpoints Breakpoint group box that displays the address of the currently selected breakpoint name of procedure in which the breakpoint has been set state of the breakpoint disabled enabled and type of breakpoint temporary or permanent Condition group box that displays the condition string to evaluate and the state of the condit
453. loaded application fiboCount 0x800 2048 counter 0x802 2050 _startupData 0x84D 2125 Fibonacci 0x867 2151 main 0x896 2198 Init 0x810 2064 Startup 0x83D 2109 600 S12 X Debugger Manual Debugger Engine Commands Debugger Commands UNFOLD In the Source component use the UNFOLD command to display the contents of folded source text blocks for example source text that has been collapsed at program block level All text unfolds 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 gt UNFOLD UNTIL The UNTIL keyword is associated with the REPEAT command Usage UNTIL condition Where condition is defined as a C language definition Components Debugger engine Example repeat open assembly wait 20 define i i 1 until i 3 At the end of the loop i equals 3 S12 X Debugger Manual 601 Debugger Engine Commands Debugger Commands UPDATERATE In the Data component Memory component and MCURegisters component use the UPDATERATE command to set the data refresh update rate This command has an effect only if the Data Memory or MCURegisters component to which it applies is set in Periodical Mode Usage UPDATERATE rate where rate is a constant number matching a quantity of time in tenths of a second between 1 and 600 tenths of se
454. log Syntax HWBPMn lt one HWBPM Command Line command Default Defaults settings are retrieved according to the derivative from a common ini file Example HWBPMO HWBPM MODE AUTOMATIC BPM16BITS 0x28 SKIP OFF HWBPM1 HWBPM SET16BITS 0x0 0x0 0x0 0x0 HWBPM2 HWBPM SET22BITS 0x0 0x0 0x0 0x0 S12 X Debugger Manual 693 Connection Specific Environment Variables On Chip Hardware Breakpoint Module Environment Variables 694 S12 X Debugger Manual Connection Specific Environment Variables On Chip Hardware Breakpoint Module Environment Variables S12 X Debugger Manual 695 Connection Specific Environment Variables On Chip Hardware Breakpoint Module Environment Variables 696 S12 X Debugger Manual Book V Debugger Legacy Book V Contents Each section of the Debugger manual includes information to help you become more familiar with the Debugger to use all its functions and help you understand how to use the environment Book V HC S 12 X Debugger Legacy This book is divided into the following chapters Chapter 26 HC S 12 X Full Chip Simulator Components No Longer Supported Chapter 27 Debugger DDE Capabilities S12 X Debugger Manual 697 Book V Contents 698 S12 X Debugger Manual 26 HC S 12 X Full Chip Simulator Components No Longer Supported List of HC S 12 X FCS Components No Longer Supported The following legacy components are no longer supported and excluded from the prod
455. mand to complete restore regular flash programming monitor undefine variable S12 X Debugger Manual 489 Unsecure HCS12 Derivatives Unsecure Command File 490 S12 X Debugger Manual 21 On Chip Hardware Breakpoint Module On some HC12 and HCS12 derivatives you can use an on chip hardware breakpoint module to set hardware breakpoints and watchpoint To invoke this module you must first set up the debugger to use the module During the first connection the hardware breakpoints module settings resolve according to the specified derivative If you change the derivative later it is your responsibility to correctly set up the hardware breakpoint mechanism for the project using the Hardware Breakpoint Configuration dialog Hardware Breakpoint Configuration dialog Choose the HC12MultilinkCyclonePro Set Hardware BP menu command The Hardware Breakpoint Configuration dialog Break Module Settings index tab appears as shown in Figure 21 1 Figure 21 1 Hardware Breakpoint Configuration dialog Hardware Breakpoint Configuration Break Module Settings 16 bits Break Module User Mode 22 bits Break Module User Mode r Breakpoint Module Mode Breakpoint Module mode Automatic controlled by debugger fag m Breakpoint Module Description Breakpoint Module kind use 22 Bits Break Module Breakpoint Module base address hex 28 Continue on illegal break banked hardware breakpoint 16 bit
456. mat is 0x00bbggrr Grid is the new color for the channel grid the format is 0x00bbggrr Line is the new color for the channel lines the format is 0x00bbggrr Text is the new color for the channel text the format is 0x00bbggrr Components Monitor component Example in gt SETCOLORS Leds Port Register bit 0 0x00123456 0x00234567 0x00345678 0x00456789 0x00567891 This changes the color attributes from the channel Leds Port Register bit 0 to these new values SLAY Use the SLAY command 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 This saves the current debugger layout to mylayout hw1 file in the hiwave demo directory S12 X Debugger Manual 589 Debugger Engine Commands Debugger Commands SLINE The SLINE command makes a line of the source file visible If the line is not currently visible the source scrolls so that it appears on the first line If the line is currently in a folded part it is unfolded so that it becomes visible NOTE Usea line number between 1 and the number of lines in the source file or an error message appears Usage SLINE
457. may not work on the hardware Real Time Interrupt RTI and COP Both RTI and COP use CLK24 as a reference clock If OSCCLK is not equal to CLK24 the simulator adapts the RTI and COP period to the clock difference S12 X Debugger Manual 293 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 12 Simulated RTI and COP Registers Register Full Register Name Simulated Fields Acronym SYNR CRG Synthesizer Register SYN5 0 REFDV CRG Reference Divider Register REFDV3 0 CRGFLG CRG Flags Register RTIF CRGINT CRG Interrupt Enable Register RTIE CLKSEL CRG Clock Select Register PLLSEL RTICTL CRG RTI Control Register RTR6 0 Also RTDEC if supported by derivative COPCTL CRG COP Control Register WCOP RSBCK CR2 0 ARMCOP CRG COP Timer Arm Reset Register Entire register Enhanced Capture Timer ECT This I O device simulates the Enhanced Capture Timer ECT The various functionalities are cycle accurate up to 99 Instruction pipelining simulation may differ from the hardware some interruptions might be raised with a one instruction delay The functions with errors detected in the hardware are not simulated One operation mode is used as default Further information is given for unimplemented features The Delay Counter Control Register DLYCT is not simulated Modes of Operation NORMAL and STOP mode are implemented entering FREEZE or WAIT mode causes the syst
458. mber of times they have been executed That is a command file executed with the CF or CALL command without the NL option and with the CMDFILE flag of the LOG command set to TRUE Example 2 Executing the following file define i 1 FOR i 1 3 ls ENDFOR Generates the following log file Idefine i 1 IFOR i 1 3 1s i 0x1 1 ENDFOR ls i 0x2 2 ENDFOR lis i 0x3 3 ENDFOR When commands executed from a command file are logged all executed commandi that are in the WHILE loop are logged as many times as they are 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 570 S12 X Debugger Manual Debugger Engine Commands Debugger Commands Example 3 Executing the following file define i 1 WHILE i lt 3 define i i 1 ls ENDWHILE Generates the following log file define i 1 IWHILE i lt 3 define i i 1 Is i 0x2 2 ENDWHILE define i i 1 1s i 0x3 3 ENDWHIL Ej When commands executed from a command file are logged all executed commandis that are in the REPEAT loop are logged as many times as they are executed That is a command file executed with the CF or CALL command without the NL option and with the CMDFILE flag of the LOG command set to TRUE Example 4 Executing the following file define i 1 REPEAT define i i
459. mbly component using the FOCUS Assembly command and displays the code next to assembly instructions Then the ENDFOCUS command releases the Assembly component and the FOCUS Source command redirects the second ATTRIBUTES command to the Source component Marks appear in the Source window FOLD In the Source component the FOLD command hides the source text at the program block level Folded program text appears as if the program block is empty When you unfold the folded block the hidden program text reappears All text is folded once or completely until there are no more folded parts S12 X Debugger Manual 555 Debugger Engine Commands Debugger Commands Usage FOLD Where means fold completely otherwise fold only one level Components Source component Example in gt FOLD FONT FONT sets the font type size and color Equivalent Operation The Font dialog is available by selecting the Component gt Fonts menu entry Usage FONT FontName size color Components Debugger engine Example FONT Arial 8 BLUE The font type is Arial 8 points and blue FOR The FOR loop allows you to execute all commands up to the trailing ENDFOR a predefined number of times The bounds of the range and the optional steps are evaluated at the beginning Optionally you may specify a variable either a symbol or a program variable which is assigned to all values of the range that are met during execution
460. me tasks every time you start the Debugger Automate these tasks by writing a command file that contains all commands to be executed after startup of the Debugger as shown in Listing 6 1 Listing 6 1 Example of a Command File to Automate Tasks load fibo abs bs amp main t g This file above first loads an application then sets a temporary breakpoint at the start of the function main and then starts the application The application stops on entering main after executing the startup and initialization code There are several ways to execute this command file Specify the command file on the command line using the command line option c Do this in the application that starts the Debugger for example Editor Explorer or Make utility Example Freescale PROG HIWAVE EXE c init cmd S12 X Debugger Manual 233 How To Loading an Application When you start the Debugger with this command line it executes the command specified in the file init cmd after loading the layout or project file Call the command file from the project file Listing 6 2 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 After creating this file with the save command you can extend it with a call to the command file CALL INIT CMD When this project is loaded by the File gt Open command or by t
461. menu 87 Trigger A 404 406 Trigger addresses Editing 407 Trigger B 406 420 421 437 438 Trigger Module Settings 378 402 Trigger Module Settings Option 355 369 390 397 Trigger Module Settings Window 402 Troubleshooting DA C and debugger connections 266 TUPDATE 598 Type 408 S12 X Debugger Manual typical 419 U UDec menu entry 75 95 113 239 UNDEF 598 Undefined trigger address 408 UNFOLD 601 Unfold All Text menu entry 123 Unfold menu entry 123 Unfolding Mark 118 Source code 118 nprotected module state 472 nprotecting 473 nsecure Command File 487 nsecure HCS12 derivatives 485 nselecting 471 473 nsigned Decimal 239 nsigned Decimal format 239 NTIL 601 pdate modes 73 pdate Rate Dialog Box 87 JPDATERATE 602 se External Debugger checkbox 232 247 se the debugger eeprom and flash programmer check box 393 JSELIBPATH 684 ser help file DA C 253 User interface features 47 User menu entry 73 4 4 4 4 4 4 4 4 Cic cU Cic ese Cc ae are ca V VA 607 Value attributes 160 Relative 160 Variable Changing display format 239 Current scope 70 DefaultDir 208 Display 73 Display format 70 Display mode 70 Displaying Global 238 S12 X Debugger Manual Displaying Local 238 Displaying local 238 Displaying value 239 Editing value 240 Global values and types 70 Inspecting declared 199 Local values and types 70 Mode 73 Retrieving address 240 Showing location 241 Type 70 Working on 238 Variabl
462. mmand to set the components internal ports addresses used with the Programmable Couplers as memory buffers Syntax LINKADDR address ident address ident address ident 636 S12 X Debugger Manual Connection Specific Commands Full Chip Simulator Commands Arguments Address locates the port address value of the component The default format is hexadecimal many formats are allowed Ident a known identifier Its content defines the port address Components Couplers Keyboard 7 segments display Example in gt LINKADDR 0x100 0x200 0x300 0x400 0x500 All components working with the Programmable Couplers have e PortA set to 0x100 PortB set to 0x200 e PortC set to 0x300 e PortD set to 0x400 PortE set to 0x500 PBPORT Use the PBPORT command to set the port address of the Push Buttons component Syntax PBPORT address ident Arguments Address locates the port address value of the component The default format is hexadecimal various formats are allowed Ident aknown identifier Its content defines the port address Components Push Buttons component Example in gt PBPORT 0x100 0x200 Defines the ports of the Push Buttons at addresses 0x100 and 0x200 S12 X Debugger Manual 637 Connection Specific Commands Full Chip Simulator Commands PORT In the LED components the PORT command sets the port LED location Syntax PORT address Components LED component Exam
463. mmands access while running gt a0 or 1 value 1 enables memory range access while running lt access kind gt 0 for R W 1 for write only 2 for read only 3 for none DMM DEL Description Deletes one specific DMM memory range module by handle reference Syntax DEL lt module handle gt Arguments module handle a memory range module handle as given listed with the DMM command DMM SAVE Description Saves the DMM current setup in current project ini file under DMM MCUIDxxxx MODULEn keys Syntax DMM SAVE lt mcuid gt Arguments lt mcuid gt a part device MCUID value in range 0 FFFF DMM DELETEALLMODULES Description Removes all current DMM memory range modules Use to start a scripted DMM setup 626 S12 X Debugger Manual Connection Specific Commands DMM Commands Syntax DMM DELETEALLMODULES DMM RELEASECACHES Description Flushes all currently cached data once for each memory range module even if cache locking is active i e no refresh on halting is active Syntax DMM RELEASECACHES DMM CACHINGON Description Engages data caching default DMM setup Refresh on halting is inactive for memory range modules defined with this option Syntax DMM CACHINGON DMM CACHINGOFF Description Disables data caching The debugger flushes all caches even for memory range modules defined without this option Each time the debugger halts the memory data for
464. mory block refer to device specifications EEPROM memory block refer to device specifications On chip Flash EEPROM refer to device specifications Remaining external space refer to device specifications Lowest debugger a low debugger priority that you can use or define 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 MC68HC812A4 derivative Highest debugger a high debugger priority that you can use or define for the debugger Typically used to protect a memory area from being read Internal register space refer to MC68HC812A4 specifications RAM memory block refer to MC68HC812A4 specifications EEPROM memory block refer to MC68HC812A4 specifications E space external refer to MC68HC812A4 specifications CS space external refer to MC68HC812A4 specifications P space external refer to MC68HC812A4 specifications D space external refer to MC68HC812A4 specifications Remaining external space refer to MC68HC812A4 specifications Lowest debugger a low debugger priority that you can use or define for the debugger typically to protect a memory area from being read This priority is of little value but can still be used for display purposes on chip unimplemented memory range S12 X Debugger Manual 461 Debugging Memory Map CPU Core Priorities and Types 462 Types All derivativ
465. mory range Read Write Access Watchpoints activate when a read or write access occurs inside the specified memory range Counting Watchpoints activate after a specified number of accesses occur inside the memory range Conditional Watchpoints activate when an access occurs inside the memory range and a given condition is TRUE Control Watchpoints through the Watchpoints tab of the Controlpoints Configuration window Open this window through the Memory or Data component window context menu as described below To open the Controlpoints Configuration window with the Watchpoints tab exposed i 2 9 4 Position your cursor in either the Memory or Data component window Click the right mouse button Select Show Watchpoints from either menu Click the left mouse button The ControlPoints Configuration window appears Figure 4 6 shows the Watchpoints tab of this window S12 X Debugger Manual Control Points Watchpoints Figure 4 4 Memory Context Menu Set Watchpoint Show Watchpoints Set Markpoint Show Markpoints Show Location Word Size Format Mode Display Fill Address Search Pattern vvv Refresh Figure 4 5 Data Context Menu Open Module Add Expression Set Watchpoint Set Markpoint Show Markpoints Show Location Zoom Scope Format Mode Options S12 X Debugger Manual 177 Control Points Watchpoints Figure 4 6 Controlpoints Configuration Window Watch
466. mp jump 1 IF jump 10 T DEFINE jump 0 ELSEIF jump 100 DEFINE jump 1 ELSE DEFINE jump 2 ENDIF Evaluates the jump 10 condition and depending on the test result executes the T Trace instruction or evaluates the ELSEIF jump 100 test INSPECTOROUTPUT The Inspector dumps the content of the specified item and all computed sub items to the command window Uncomputed sub items are not printed To compute all information use the ATTRIBUTES EXPAND command Usage INSPECTOROUTPUT name subname The name specifies any of the root items The subname specifies a recursive path to sub items If a name contains a space you must surround the name with quotes Components Inspector component S12 X Debugger Manual 563 Debugger Engine Commands Debugger Commands Example in gt 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 update automatically To make sure that displayed values correspond to the current situation the INSPECTORUPDATE command updates all information Usage INSPECTORUPDATI Ej Components Inspector component Example in gt INSPECTORUPDATE LE LF 564 The LF command initiates logging
467. mpiler Down m Menu template i C None M i ci Picture Make BMP Browse m Action script c hiware prog maker exe fibo mak aif E xist edout 4Message No Messages found Cancel EnCh EnGet edout Debugger Interface DA C v3 5 currently integrates a Debugging support Application Programming Interface DAPI This interface enables the DA C to exchange messages with the Debugger This shows that it is possible to set or delete breakpoints from within DA C in an editor flowchart graph browser and to execute other debugger operations DA C follows the Debugger in its operation since it is always in the same file and on the same line as the debugger Thus usability of both the DA C and Debugger increases Make the following configurations to ensure efficient use of this Debugger Interface Install communication DLL Configure Debugger properties Configure the Debugger project file S12 X Debugger Manual 261 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 base communication on the DDE protocol as shown in Figure 9 10 The system contains DA C Debugger cDAPI interface implementation DLL used by DA C Cdgen32 d11 nDAPI communication DLL provided by DA C used by Debugger Debugger specific DLL for bridging its interface to the debuggi
468. mponent Window without Headline and Small Border D Profiles b13819 My Documents project2 Sources main c i 2 while i lt n fibo fibl fib2 fib2 fibo it a return fibo HB S12 X Debugger Manual 35 Debugger Interface Debugger Main Window Run Menu The Main Window Run menu shown in Figure 2 14 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 Figure 2 14 Run Menu tam HCS12FCS Component Memory Start Continue Restart Single Step FS Ctrl Shift F5 Fil Step Out zm 11 Assembly Step Ctrl F11 Assembly Step Over Ctri4F10 Assembly Step Out Ctrl Shift Fi1 Control Points Table 2 4 Run Menu Description 36 Menu Shortcut Description entry Start F5 Starts or continues execution of loaded application from Continue current program counter PC until it reaches a breakpoint or watchpoint detects a runtime error or user stops application by selecting Run gt Halt Restart CTRL Starts execution of application from its entry point Shift F5 Halt F6 Interrupts and halts a running application Examine state of each variable in the application set breakpoints watchpoints and inspect source code Single F11 Performs a single step at source level in halted application Step Execution continues until application reaches next source reference If c
469. mponent window right click and choose Set Breakpoint in the context menu or open the Controlpoints Configuration Window and choose Show Breakpoint then select the breakpoint and set its properties NOTE The Module component window displays the correct module names Make sure that the module name in your command is correct If abs is in HIWARE format some debug information is in the object file S12 X Debugger Manual 527 Debugger Engine Commands Debugger Commands o and module names have the o extension In ELF format module name extensions are c cpp or dbg dbg for program sources in assembler since the abs file contains all debugging information and object files are not used Adapt the following examples with abs application file format Usage 528 BS address function mark P T statelll cond condition state cmd command state cur current inter interval cdSz codeSize srSz sourceSize address is the address where the breakpoint is to be set Specify this address in ANSIC format You can replace address with 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 e gt Q the position is relative to the beginning of the function 0 the position is the entry point of the function default value
470. ms Trigger Module Settings Window Figure 17 32 Trigger Settings Tab Listbox Trigger Module Settings Trigger settings Sequencer General settings Automatic Miren watchpomts andaca poss s Trigger Types This section describes the types of triggers and how to use them Three types of triggers are available Memory Access Triggers nstruction Triggers Capture Triggers All triggers are available in Automatic and User Triggers modes Select either of these modes to enable access to trigger options Table 17 2 describes the trigger settings NOTE Encountering any Memory Access or Instruction triggers causes the Trace Component window to switch to Instructions Display mode and display the program flow rebuild see Trace Component Window and Instructions Display for more information 434 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window NOTE Encountering any Capture trigger causes the Trace Component window to switch to Recorded Data Display mode and display the captured byte data see Trace Component Window and Recorded Data Display for more information Table 17 10 Trigger Modes S12 X Debugger Manual Mode Description Automatic Mode Use DBG Module to set up four hardware breakpoints or two Default hardware breakpoints and one watchpoint User can see and set HCS12X trace Setting a trigger automatically switc
471. mulation 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 two I O components can be loaded Command Files Window Figure 10 5 Full Chip Simulation Connection Command Files Window Full Chip Simulation Connection Command Files X Startup Reset Preload Postload Setcpu The Setcpu command file is executed when the cpu is set modified in the simulator when the setcpu command is used or when a file is loaded and the corresponding cpu is not set cmd Full_ Chip Simulation setcpu cmd Browse IV Enable Command File 9 cw e 274 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu Setcpu Command File The Setcpu command file is a specific FCS command file executed by the Debugger after a CPU has been set or modified Set or modify the CPU using either of two methods By using the setcpu command or By loading an application in the FCS when the corresponding CPU is not set Specify the full name and status of the Setepu command file by using either the CMDFILE SETCPU Command Line command or the Setcpu property tab of the connection Command Files dialog The default Setcpu command file is SETCPU CMD located in the current project directory Other Command Files are described in the Debugger Interface section in
472. n 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 address address is the address of the breakpoint to be deleted Specify this address in ANSI C or standard Assembler format You can also replace address by an expression as shown in the example below Specifying deletes all breakpoints Components Debugger engine Example 1 in gt BC 0x8000 This command deletes the breakpoint set at the address 0x 8000 The breakpoint symbol is removed in the source and assembly window The breakpoint is removed from the breakpoint list Example 2 in gt BC amp FIBO C Fibonacci In this example an expression replaces the address FIBO C is the module name and Fibonacci is the function from which the breakpoint is cleared S12 X Debugger Manual 525 Debugger Engine Commands Debugger Commands BCKCOLOR BCKCOLOR sets the background color The background color defined with the BCKCOLOR command is valid for all component windows Using the same color for the font and background makes text in the component windows invisible Avoid using colors that have a specific meaning in the command line window These colors are Red used to display error messages Blue
473. n 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 appear in red are the register memory position local or global variables and the values that changed since the Step Out was executed Step on Assembly Level The Debugger provides two ways of stepping to the next assembler instruction Choose Run Assembly Step 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 S12 X Debugger Manual 237 How To Working on Variables Elements from Register Memory or Data components that appear in red are the register memory position local or global variables and the values that changed during execution of the assembler instruction Working on Variables This secti
474. n non intrusive Cancel Help 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 are used again in future sessions S12 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 12 Debugger Abatron BDI Menu AbatronBDI Component Command Load Ctr L Reset Ctri R Communication Select Derivative Command Files Unsecure Debugging Memory Map Trigger Module Settings Bus Trace Flash Setup Configure BDI Box If the target connection fails Connect replaces the entry Communication in the Abatron BDI menu Table 15 1 describes the Abatron BDI menu entries Table 15 1 Abatron BDI Menu Entries Menu Entry Description Load Loads the application to debug i e an ABS file See Load Executable File Window Reset Executes the Reset Command File and resets the hardware target The BDI interface automatically processes the initialization list startup init list stored in the interface Communication Displays the Communication Device Specification Dialog Box If the or Connect connection to the target has failed Connect appears instead of Communication Select Displays the Set Derivative
475. n dialog box Figure 3 17 Connection Specification Dialog Box Connection Specification Debugger Name HIWARE HI WAVE 6 0 Show Protocol Cancel The DA C debugger name must be the same as the one selected in the DA C IDE Check the Show Protocol checkbox to display the communication protocol in the Command component of the Debugger To validate the settings click the OK button A new connection is established and the Connection Specification is saved in the current Project ini file The HELP button opens the help topic for this dialog NOTE If problems exist refer to Troubleshooting in the DA C documentation Drag Out Nothing can be dragged out S12 X Debugger Manual 69 Debugger Components General Debugger Components Drop Into Nothing can be dropped into the DA C Component window Demo Version Limitations None Data Component The Data window shown in Figure 3 18 contains the names values and types of global or local variables Figure 3 18 Data Window 70 RI Data 1 DER l ddress 803D Size 24 startup c Auto Symb Global E flags 0 unsigned int nain O0x8084 PFunc stack ffset 8190 unsigned int nofZeroOuts l unsigned int El pZero ut O0x804f Range E pZeroD ut lt 4 gt Range E toCopyDownBeg 0x80ae Copy nofLibInits 32851 unsigned i The Data window shows all variables present in the current source module or procedure Changed values are in red The Component Win
476. n only be used with the Full Chip Simulation connection Stimulation Component The Debugger also supports I O Stimulation Using this feature you can generate stimulate interrupts or memory access generated by an external I O device NOTE the True Time I O Stimulation section describes in detail and with example how to take advantage of this component The Stimulation window component shown in Figure 10 12 provides the basic FCS functionality 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 10 12 Stimulation Window amp Stimulation def a TargetObject 1FA0 def b TargetObject 1FB0 def c TargetObject 1FCO B 7 3 10000 318 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Stimulation Context Menu Figure 10 13 shows functions associated with the Source component Table 10 27 describes these functions Figure 10 13 Stimulation Context Menu Open File Execute v Display Cache Size Table 10 27 Stimulation Context Menu Description Menu Entry Description Open File Opens a dialog box to load a stimulation file Execute Starts execution of the input file 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
477. n volatile memory device S12 X Debugger Manual 39 Debugger Interface Debugger Main Window Verify Code Button Loader loads no data into memory but 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 Options Area The checkboxes and buttons of this area of the Load Executable File window offer the following options e A checkbox specifying an automatic erase and program into Flash and EEPROM A checkbox to automatically verify the memory image after loading code with two radio buttons that let you define the memory image Checkbox to automatically run after successful load e A checkbox to enable automatically stopping at the function specified in the textbox Connection Command Files Window Choose Connection Command Files to open the Connection Command Files window Each tab of this window shown in Figure 2 17 corresponds to an event on which a command file can be automatically run See Startup Command File Reset Command File Preload Command File and Postload Command File Figure 2 17 Connection Command Files Window Full Chip Simulation Connection Command Files amp Startup Reset Preload Postload Setepu The Startup command file is executed to set up the target system right after the connection has been established cmd Full_Chip_ Simulation startup cmd Browse IV Enable Comm
478. n 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 gt BS 0x8000 T This sets a temporary breakpoint at the address 0x8000 in gt BS 8000 This 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 in gt BS amp main 22 P E cdSz 66 srSz 134 This 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 This 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 counter 5 cond fibl fib2 cmd bckcolor red This 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 This sets a breakpoint at the address of the Fibonacci procedure 13 where Fibonacci is a function of the FIBO C module S12 X Debugger Manual 529 Debugger Engine Commands Debugger Commands CALL Executes a command in the specified command file NOTE _ If path is unspecified the destination directory is the current project directory Usage CALL Fil
479. nacci main El 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 also contains percentages and graphic bars The Profiler window can set a split view in the Source and Assembly windows as shown in Figure 3 59 To obtain a split view in either the Source or Assembly windows select Details gt Source or Details gt Assembly or both from the Profiler menu and submenu The split windows effect ends when you close the Profiler window Figure 3 59 Split View in the Source and Assembly Windows 106 E Source f defined O I MOVB 1 388004 LDX 382007 LDY Percentage values representing the time spent in each source or assembler instruction are displayed on the left side of the instruction The split view can also display graphic bars Split views close when you close the Coverage component or if you open the split view list menu and select Delete The value displayed may reflect percentages either from total code or from module code Profiler Operations Click the fold unfold icon to unfold fold the source module S12 X Debugger Manual Debugger Components General Debugger Components Profiler Menu Figure 3 60 shows the Profiler menu entries with the Details submenu and the Base submenu Figure 3 61 shows the Profiler Output File submenu Table 3 36 describes menu en
480. name subname LECT name subname LIT pos MAXELEM ON OFF number FORMAT Hex Int COLUMNWIDTH sets the width of one column entry on the right pane of the Inspector Window The first parameter columnname specifies which column The following column names currently exist Names simple name list Interrupts interrupt list SymbolTableFunction function in the Symbol Table ObjectPoolObject Object in Object Pool without additional information Events event list Components component list SymbolTableVariable variable or differentiation in the Symbol Table ObjectPoolIOBase Object in Object Pool with additional information SymbolTableModules non IOBase derived Object in the Object Pool S12 X Debugger Manual Debugger Engine Commands Debugger Commands The column field is the name of the specific field also displayed in the Inspector Window The following commands set the width of the function names to 100 inspect lt ATTRIBUTES COLUMNWIDTH SymbolTableModules Name 100 NOTE Due to the inspect lt redirection only the Inspector handles this command EXPAND computes and displays all subitems of a specified item up to a given depth Specify an item by stating the complete path starting at one of the root items like Symbol Table or Object Pool Names with spaces must be surrounded by quotes To expand all subitems of TargetObject in the Object Pool up to four
481. nce of commands as long as a certain condition is true You may nest the WHILE command Stop this command by pressing the Esc key Usage WHILE condition Where condition is defined as in C language definition S12 X Debugger Manual 605 Debugger Engine Commands Debugger Commands Components Debugger engine Example DEFINE jump 0 WHILE jump lt 20 DEFINE jump jump 1 Ej z DWHILE H While jump 100 the jump variable increments by the instruction DEFINE jump jump 1 Then the loop ends and the T Trace instruction executes WL 606 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 repeats 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 you specify a size in the range this size represents the number of longwords to modify Usage WL range list range an address range constant that defines the block of memory to set to the longword values in the list list a list of longword values to store in the block of memory Components Debugger engine Example in WL 0x2000 OxOFFFFFOF S12 X Debugger Manual Debugger Engine Commands Debugger Commands This command fills up memory starting at address 0x2000 with t
482. nclude lt File gt Path 0 0 0 0 020 681 OBJPATH Object File Path o cai eoo ei nah eee ee eee 682 TMP Temporary directory 00 eee ec eee 683 USELIBPATH Using LIBPATH Environment Variable 684 25 Connection Specific Environment Variables 685 Abatron BDI Connection Environment Variables 685 BDICONE 224 p36 386s Sao hid Aye eed Oe OP ae 686 COMDEV 3 et ahd soa RR P PERSE ROS ROCA places ap eee haben LR 686 COMPRESS 2 cepewERLGU RUE PN HUP Ue e 687 SHOWPROT eti EUU ERO ULUSM eae ER eee 688 18 S12 X Debugger Manual Table of Contents SKIPILLEGALBREAK cd ee AAS on eR A EE ARA 688 VERIFY uie ke urgente ERR eR RR UE AE CET 689 Banked Memory Location Associated Environment Variables 690 BANKWINDOWnT cegeimtanrikace e m ph eds Re EU ere eos 690 Unsecure Environment Variable 0 0 00 eee eee eee eee 691 CHIPSEGURE iste repr LePEA enr set ee PER mete 691 On Chip Hardware Breakpoint Module Environment Variables 692 HWBPD_MCUIDnnn_BKPT_REMAPn 00 692 HWBPMR Si oo seh cies est Ree eese eu dee o RE dU eec eas 693 Book V Debugger Legacy Book V ContentS ec ERI SUA EC ie E 697 26 HC S 12 X Full Chip Simulator Components No Longer Supported699 List of HC S 12 X FCS Components No Longer Supported 699 27 Debugger DDE Capabilities 701 DDE Iniplementation usce dee eee seer ks ER oe nee ee 701 Driving
483. nd includes AUTOID the MCUID determines the parameter file provided autocheck is checked in the NVMC dialog box FLASH RELEASE releases the current FPP file loaded by the Flash Programmer disabling the Flash Programmer address mapping 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 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 S12 X Debugger Manual F di di Connection Specific Commands NVMC Commands LASH DISABLE disables the specified modules If no modules are specified all sables all available blocks This command ignores modules that cannot be sabled F ASH ERASE erases the specified modules If no modules are specified erases al F S available blocks LASH AEFSKIPERASING specifies non volatile memory blocks to protect from mass erasing at application automated programming Place this command in a tartup command file If no modules are specified no blocks are erased NOTE This command is compatible and replicated in the NVM Programming Selection dialog F F F m F F FI Fl Fl FI FI overla LAS E F Fl S
484. ndition edit box Click Cancel to clear the condition edit box Setting Watchpoints Watchpoints may be set in a Data or Memory window S12 X Debugger Manual 179 Control Points Watchpoints 180 NOTE Due to hardware restrictions the watchpoint function might not be implemented on hardware connections Setting a Read Watchpoint A green vertical bar appears in front of a variable associated with a read access watchpoint The Debugger provides two ways to define a read access watchpoint Use the Data Context Menu 1 Point at a variable in the Data window and right click to display the Data Context Menu t Choose Set Watchpoint from the context menu to define a Read Write watchpoint 3 Point in the Data window and right click to display the Data context menu Choose Show WatchPoints from the context menu The Controlpoints Configuration window Watchpoints tab appears 5 Select the watchpoint you want to define as read access from the list D Select the Read type in the list box to define a read access watchpoint for the selected variable Use the Left Mouse Button click the R Key 1 Point at a variable in the Data window 2 Hold down the left mouse button and click the R key This defines a read access watchpoint for the selected variable Once you define a read access watchpoint you can continue program execution The application stops after detecting the next read access on the variab
485. ndow 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 a WND extension This section introduces these components Connection Components Different debugger connections are available For example you can set a CPU awareness to simulate your ABS application files and also set a background debugger Different connections are available to connect the target system hardware to the debugger For example the connection may be connected using a Full Chip Simulator an Emulator a ROM monitor a BDM pod cable or any other supported device S12 X Debugger Manual 53 Debugger Components Debugger Kernel Components NOTE Connection components are covered in their respective manuals Loading Component Windows In the Debugger Main Window Menu Bar shown in Figure 3 1 you can use the Component menu to load all framework components Each Debugger component you select appears as a window in the Debugger main window Figure 3 1 Debugger Window Menu Bar Component Coverage W Open Set Connection M nd Color To open the window to choose one or more components 1 Choose Component gt Open 2 In the Open Window Component window shown in Figu
486. ndow lt n gt Specifies coordinates of the windows that must be open when the Debugger is started The syntax for a window is Window n component XPos YPos width height where n is the index of the window This index increments for each window and determines the sequence in which windows open This index determines which windows appear on top when windows overlap Values for the index must be in the range 0 99 component specifies the type of component to open for example Source or Assembly XPos specifies the X coordinate of the top left corner of the component in percentage relative to the width of the main application client window YPos specifies the Y coordinate of the top left corner of the component in percentage relative to the height of the main application client window width specifies the width of the component in percentage relative to the width of the main application client window height specifies the height of the component in percentage relative to the height of the main application client window S12 X Debugger Manual Debugger Engine Environment Variables Local Configuration File usually project ini Example Window5 Memory 50 60 50 30 Window number 5 is a Memory component its starting position is 50 from the main window width 60 from the main window height Its width is 50 from the main window width and its height is 30 from the main window height Other Parameters Y
487. ng the lt character in the command line Table 22 4 lists all available Component commands Table 22 4 List of Component Commands Command Syntax Short Description CMDFILE Specify a command file state and full name COM START lt path Creates a new Hiwave to Hiwave gt HIWAVE EXE COM EXE Executes command in the created Hiwave Instance debugger command COM EXIT Destroys the created Hiwave Instance Q COM EXIT EXIT Terminate the application HELP Displays a list of available commands RESET Resets statistics SMEM range Shows a memory range SMOD module Shows module information in the destination component SPC address Shows the specified address in a component window SPROC level Shows information associated with the specified procedure VER Displays version number of components and engine Component Specific Commands Component specific commands are associated with specific components Table 22 5 shows all available component specific commands S12 X Debugger Manual 505 Debugger Engine Commands Commands Overview Table 22 5 List of Component Specific Commands Command Syntax Short Description ADDXPR expression Adds a new expression in the data component ATTRIBUTES list Sets up the display inside a component window BASE code module Sets the Profiler base BD Displays a list of all breakpoints CF fileName C NL E
488. ng environment and DA C s nDAPI DAC wnd Figure 9 10 Communication between DA C IDE and Debugger 262 HI WAVE Debugger Command messaging Dac vmd HI WAVE DLL Cdgen32 dll DA C DLL NDAPI dll DA C DLL Notification messaging Communication DLL Installation The Debugger needs the nDAPI communication DLL provided by DA C IDE This dll called Ndapi d11 installs automatically during the Freescale Tool Kit installation However if you install a new release of DA C you must follow this procedure 1 In the Program directory of your DA C installation copy the Ndapi32 d11 Ndapi32 d11 version 1 1 or later Paste it in your current Freescale PROG directory where Debugger is located 3 Rename it to Ndapi dll S12 X Debugger Manual Synchronized Debugging through DA C IDE Debugger Interface Debugger Properties Configuration Now configure the debugger properties 1 Inthe DA C main menu choose Options gt Debugger The dialog box shown in Figure 9 11 opens Figure 9 11 DA C Debugger Options Dialog Box Debugger Options 2 x E about Startup Switches SOS Load binary C SHIWARESWORK ME8KC fibo abs Browse Ask before sending to debugger Timeouts feo s Iv Check debugging through non project files 2 In the Debugger Options box select the corresponding debugger HI WAVE 6 0 3 Now specify the binary file to open
489. ngs and Bus Trace Figure 17 1 shows an example with the SofTec inDART HCS 12 connection Figure 17 1 Connection Menu Added DBG Options True Time Simulator amp Real Time Debugger D Profiles SKrylov Wy Documents Wroject_18 SofTec_HCS12 ini fiboCount counter LITT C8021 ANDCC 3C8023 CLRB 3C8024 CLRA 3C8025 STD 0x0502 Register HC12 D 0 A IX C017 IY 0 IP 3C8021 PC 8021 PPAGE 3C A lMooooso 07 07 00 20 05 00 00 00 000086 80 00 00 00 00 00 00 FF Choose Trigger Module Settings to open the Trigger Module Settings Window Choose Bus Trace to open the Trigger Module Settings Window Context Menu Entries This section describes the functions available from the Source Assembly Data and Memory windows Source and Assembly Windows Source and Assembly windows have menu entries to set or delete triggers a Trigger Settings entry to set the DBG module triggers and a Trigger Module Usage entry to set 402 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries the DBG module functionality globally Figure 17 2 shows the context menu available in the Source and Assembly windows Figure 17 2 Source Context Menu Added Options S12 Platform True Time Simulator amp Real Time Debugger D Profiles SKrylov WWy DocumentsVProject 16W amp E Multilink Cyclone File View Run Mulk nkCydonePro Component Source Window Help ela e Vid o 9
490. ns Signal IO Component This Signal IO is the first implementation of a Signal Generator reading a file describing electrical levels in real debugger time Levels are applied and available at a virtual IO pin called SignalPin as float value Levels are programmed one after the other during the debugger internal FCS Event queue If level durations 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 This section shows the signal file format and some example signal files 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 ONLYNEGATIVE OPTION NORMAL ONLYPOSITIVE ABSOLUTE Signal Data Description lt level double value gt lt time double value duration in seconds or cycles gt File Example 1 FILI ELOOP INF S12 X Debugger Manual 335 HC S 12 X Full Chip Simulation Connection Electrical Signal Generators and Signals Application to Device Pins LOOP 4 TIMEUNIT SECONDS TIMEFACTOR 0 5 GAIN 1 DCOFFSET 0 OPTION NORMAL 0 000000e 000 051758e
491. nt Table 2 10 Dragging from the Data Component Window Destination Action Component Window Command Line Appends address range of variable to current command in Command Line window Dragging appends variable value to current command in Command Line window Memory Dumps memory starting at the address where selected variable is located Selects the memory area where the variable is located in memory component Register Dragging the name loads destination register with address of selected variable Dragging the value loads destination register with variable value Source Dragging the name of a global variable in the source window displays the module in which the variable is defined Source text is searched for the first occurrence of the variable and is highlighted S12 X Debugger Manual 49 Debugger Interface Features of the User Interface NOTE Itis not possible to drag an expression defined with the Expression Editor The forbidden cursor appears Dragging from Source Component Window Table 2 11 summarizes dragging from the Source Component Table 2 11 Dragging from the Source Component Window Destination Component Window Assembly Action Displays disassembled instructions starting at first high level language instruction selected Highlights assembler instructions corresponding to selected high level language instructions in Assembly component Register Loads d
492. nt Variables SHOWPROT 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 Syntax SHOWPROT 1 0 Default The default value is 0 Example SHOWPROT 1 NOTE The Show Protocol is a useful debugging feature if there is a communication problem SKIPILLEGALBREAK 688 Description This variable is set according to the Continue on illegal break banked hardware breakpoint option check box of the Setup Dialog Box The Continue on illegal break banked hardware breakpoint option check box is only available for the HC12 CPU12 derivative Check this check box to override the 2 byte address size on chip break module which does not handle the PPAGE Note that internally the hardware breakpoint halts the target in Flash memory compared with the breakpoint that you set then relaunched if not using matching Syntax SKIPPILLEGALBREAK 1 0 S12 X Debugger Manual Connection Specific Environment Variables Abatron BDI Connection Environment Variables Default The default value is 0 Example SKIPILLEGALBREAK 1 VERIFY Description This variable sets the BDI download mode with data verification By default use Verify only fir
493. ntains the currently selected instruction Double clicking a procedure in the Procedure component highlights the procedure s current assembly statement in the Assembly component Assembly Menu The Assembly menu shown in Figure 3 4 contains all functions associated with the assembly component Table 3 1 describes these entries Figure 3 4 Assembly Menu 56 Address Code Symbolic Format gt v Address k Freeze v Absolute ASdress S12 X Debugger Manual Debugger Components General Debugger Components Table 3 1 Assembly Menu Description 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 of Address the disassembled instruction Setting Breakpoints Use the context menu to set edit and delete breakpoints Right click on any statement in the Source component window then choose Set Breakpoint Delete Breakpoint etc NOTE For information on using breakpoints see Control Points Show PC Dialog Box If a hexadecimal address is entered in the Show PC dialog box shown in Figure 3 5 memory contents are interpreted and displayed as assembler instru
494. ntent and disarms DBG module can be disabled by user Stopping an application does not reset DBG module Debugger does not set DBG module S12 X Debugger Manual 419 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Table 17 3 Trigger Types 420 Type Memory Access at Address A Description Set trigger on a program instruction read or write at memory location labeled Address A Memory Access at Address A or Address B Set trigger on a program instruction read or write at memory location labeled Address A or Address B Memory Access Inside Address A Address B Range Set trigger on a program instruction read or write that occurs within Address A to Address B memory range Memory Access at Address A then Memory Access at Address B Set trigger on a program instruction sequence that first reads or writes at Address A memory location then reads or writes at Address B memory location Memory Access at Address A and Value on Data Bus Match Set trigger on a program instruction read or write of a specific matching byte value at Address A memory location Uses trigger B address as match value rather than address location Select this trigger type without setting match value and an error message prompts for match value Replaces standard trigger editing dialog box with Triggers Address Settings dialog box see Figure 17 7 Match Value edit box
495. nterface Figure 14 3 Monitor Setup Window Monitor Communication Tab Monitor Setup Monitor Communication Vector Table Miroring Load Options HOST Serial Communication Port Please select in this dialog the serial communication port used to connect to the hardware HOST Serial Communication Port B Communication protocol Show Monitor TX RX 8 Click the OK button The HCS12 Serial Monitor connection reads the device silicon ID and opens the Derivative Selection dialog box The device silicon ID can match several derivatives 9 Select the derivative that matches your hardware in the Derivative Selection dialog box If debugger is aware about PARTID returned by the connected derivative then you can filter derivative list by PARTID Figure 14 4 Set Derivative Dialog Box Set Derivative MC3512E128 MCSS12E 256 MCSS12E32 MCSS12E64 MC39S12GC128 MC39S12GC16 MC9S12GC32 MCSS12GC64 MC9S12H128 MC9S12H256 MCSS12HN64 MC3S12H2128 If debugger has no information about PARTID returned by the connected derivative then CPU specific derivative list is used S12 X Debugger Manual 375 HCS12 Serial Monitor Connection HCS12 Serial Monitor Interface Figure 14 5 Set Directive Dialog Box Set Derivative DESH The MCUID of this derivative is 0x3D0 Full Chip Simulation is supported Please choose the preferred derivative in the combo box above The MCUID can be found in the description f
496. ntry 75 239 Syntax watchpoint 179 T T 596 T option 611 T8 316 Target application 25 Target commands 615 653 Target option 611 Target processor Choosing 219 Target Settings panel 232 247 Task description language 196 719 Task descriptor 195 Defining 199 Task state displaying 196 Task state inspecting 195 TBDML Connection 395 TBDML HCS12 Bus Trace 397 Command Files 397 Debugging Memory Map 397 Flash 397 Load 396 Reset 396 Reset To Normal Mode 397 Select Core 398 Select Derivative 396 Select HC12 MCU 398 Set Derivative 396 Set Speed 397 Setup 396 Show Status 397 Trigger Module Settings 397 Unsecure 397 TC 316 TCIE 316 TCNT 315 TCRE 314 315 TCTL1 315 TCTL2 315 TCTL3 315 TCTL4 315 TCx 315 TDRE 316 TE 316 Temporary breakpoints 163 170 termbgnd c file 393 Terminal 393 Address 394 Area 393 Component 245 Symbol meanings 197 Work space 393 Terminal Emulation 393 with BDI 393 TESTBOX 597 720 TestTerm component 245 Text Mode 159 Textcolor 159 Textual display 449 TFLGI 315 TFLG2 315 TIE 316 Tile menu entry 44 Timer 314 315 Timer Counter Reset Enable TCRE 314 Timer Module TIM 300 Timer Update menu entry 66 107 TIOS 315 TMP 683 TMSKI1 315 TMSK2 315 TOI 315 Tool tips 28 Toolbar Customizing 33 Main window 28 Toolbar menu entry 33 ToolTips Activation 116 Format 116 Mode 116 ToolTips menu entry 121 Top menu entry 146 Top Position is 158 Trace component 447 Trace window 447 Tree Sub
497. nts when the bit is cleared 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 and AUTO The ORTI file defines the possible values Inspect Stack The Stack displays the current state of OSEK stack trace When selecting Stack in the hierarchical tree on the left side additional information concerning the stack appears 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 S12 X Debugger Manual 203 Real Time Kernel Awareness OSEK Kernel Awareness Stack Size displays the size of the stack Inspect SystemTimer The SystemTimer shown in Figure 5 2 displays the current state of OSEK SystemTimer trace Figure 5 2 Inspector SystemTimer n Inspect Name MAXALLOWEDVALUE TICKSPERBASE MINCYCLE Current Value Activated Alarm SYSTEMTIMER OxFFFF 10 0 Ox12c ALARM When selecting SystemTimer in the hierarchical tree on the left side additional information concerning the timer appears on the right side of the window under the following headings Name displays name of the sys
498. nu Options 0 0 0 e eee eee eee 402 Context Menu Entries srs Ri ERI uii ERAI ew ect 402 Source and Assembly Windows sese 402 Storing Triggers as Markpoints llle 406 Data and Memory Windows 00 0 0 cece eee eee eee 410 Trigger Set ngs cu coc cee ews euer RERUR QU NODE 413 Trigger Module Usage llle 414 DBG Support Status Bar Item 0 00 0 0 eee eee 416 Trigger Module Settings Window 0 eee eee eee 416 S12 DBG Module T bs ove Re me RR Re Rad pgs 416 12G SI2P S128 DBG Module Tabs 0 0004 426 S12X DBG Module Tabs 22 0 0 ea eee 433 General Settings Tab wo cca hee eeu ep onn 445 Trace Component Window 00 ce eee cee eee eee 447 Instructions Display 0 0 cee ee eee eee nee 448 Recorded Data Display 0 0 0 0 eee eens 452 Demonstration Mode Limitations 0 0 0 0 eese 453 18 Debugging Memory Map 455 Debugging Memory Map GUI 00 0 455 Enabling the Memory Module and Changing the Memory Range 457 Remarks cs kd Ganga visa eh ak cies Ge ee eee prae 460 CPU Core Priorities and Types 460 HCT2 CPUT2 CORB crise ELD presens eorrieepL ede 461 HC 812 Core atn Seine ita gels dar werte e mer hatha pude 462 10 S12 X Debugger Manual Table of Contents HCS12X COI8 ott et o eSI als ah eh 464 DMM Comiands 2i eceeR ERO eee Mesa ton be ee gah ee HINAUS 4
499. nu entry 147 Grid Size menu entry 147 GUI Graphical User Interface 470 H Halt menu entry 36 Halt when the FIFO is full 422 424 Hardware Breakpoint 491 Hardware Breakpoint module Automatic controlled by debugger mode mode 493 Disabled mode 492 User controlled mode 494 Hardware breakpoints 393 419 428 435 688 Hardware Breakpoints Settings 653 Hardware considerations 477 Hardware design simulation 25 HC S 12 X Debugger connections 269 Flash Programming 467 Full Chip Simulation 271 HC12 Debugging 221 Switching connections 232 Switching to SofTec HCS12 218 HC12B32 477 HC12D60 478 HC12DG128 479 HCS08 Open Source BDM 711 First Steps from within existing project 208 HCS12 401 inDart HCS12 Connection Menu Options 367 MCU Configuration dialog box 219 MultilinkCyclonePro Connection Menu Options 353 Serial Monitor 401 421 Serial monitor connection 219 Serial monitor considerations 373 Set Connection dialog box 218 SofTec technical considerations 367 Switching to HCS12 serial monitor connection 219 TBDML HCS12 Connection Menu Options 395 Technical Considerations 353 367 381 395 HCS12 Unsecure Target commands 657 Height 148 HELP 561 Help 390 Help menu 45 Help Topics menu entry 45 Hex Component format 242 Hex menu entry 75 94 112 239 Hexadecimal 239 Displaying register content in 241 Hexadecimal format 239 Hide Headline menu entry 33 Hide Tile menu entry 33 hidefaults 668 679 680 683 HIENVIRONMENT 679 Hig
500. o Apply Signal on ATD Pin The following example loads the Pinconn and Signal IO components and creates a signal generator generating the signal described in square 1 5v 1kHz txt The generator output signal pin is connected to the on chip ADC via the PADO pin openio Pinconn openio Signal setsignalfile 0 square 1 5v 1kHz txt connect SignalGenerator0 SignalPin AtdO0 PADO 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 fully functional example exists This chapter contains the following sections Guess the Number PWM Channel 0 Guess the Number In this tutorial we create step by step the demonstration run in the executive tutorial The application uses the SCI and a terminal window from the debugger At the end the user S12 X Debugger Manual 339 HC S 12 X Full Chip Simulation Connection FCS Tutorials can guess a number between 0 and 9 using the Terminal window The final application runs on real hardware as well Environment Setup The tutorial uses Processor Expert You can get a free Processor Expert license Special Edition at www codewarrior com Torun the example on real hardware you need a serial cable This cable must connect COMI PC with the SCIO Hardware Board Create the project l 2 ios Cie oor ON T ope Launch the CodeWarrior IDE In the Code
501. o Flash use either The NVMC dialog box explained in the NVMC Dialog Box section Flash commands within a command file Connection Specific Commands 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 19 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 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 Follow the loading command example in Connection Specific Commands or follow these instructions 476 S12 X Debugger Manual Flash Programming Hardware Considerations 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
502. o Version Limitations No limitations Associated Commands ATTRIBUTES FILL SMEM SMOD SPC UPDATERATE Module Component The Module window shown in Figure 3 55 gives an overview of source modules building the application Figure 3 55 Module Window calc c terminal c termport c inout c startup c printf c rts 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 102 S12 X Debugger Manual Debugger Components General Debugger Components 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 33 shows the drag actions possible from the Module component Table 3 33 Module Component Drag Possibilities Destination Action Component Window Data gt Global Displays global variables from selected module in data component Memory Dumps memory starting at address of first global variable in module Select memory area at which this variable is located in memory component Source Displays source code from selected module Drop Into Nothing can be dropped into the Module component window Demo Ver
503. o a different set of connection command files emd P amp E_Multilink_CyclonePro_startup cmd NemdNP amp E Multilink CyclonePro reset cmd NecmdNP amp E Multilink CyclonePro preload cmd NemdNP amp E Multilink CyclonePro postload cmd NemdNP amp E Multilink CyclonePro vppon cmd NcmdNP amp E Multilink CyclonePro vppoff cmd NecmdNP amp E Multilink CyclonePro erase unsecure hcs1 2 cmd Unsecure Runs project s Unsecure command file script This script mass erases target device then programs target device security byte to an unsecure state to enable BDM communication Debugging Displays Debugging Memory Map dialog box for target MCU see Memory Map Debugging Memory Map Trigger Module Displays Trigger Module Settings dialog box see On Chip DBG Settings Module for S12 S128 S12G S12P S12X Platforms Bus Trace Displays a Trace component window see On Chip DBG Module for 12 S128 12G S12P S12X Platforms Flash Displays Non Volatile Memory Control dialog box see Flash Programming Select Core Use to synchronize debugger windows to a specific core when several cores are available Appears only when several cores are available for debugging Help Displays P amp E Multilink Cyclone Pro User Manual section S12 X Debugger Manual 355 P amp E Multilink Cyclone Pro Connection Connection Menu Figure 11 2 Set Derivative Dialog Box Set Derivative The MCUID
504. o specified meaning bits 7 1 unused bit O ninth bit sent from the SCI Seriallnput Non memory mapped register is an alias for the SClinput register Connects the SCI to the terminal window but does not support the ninth bit A read access to Seriallnput has no specified meaning bits 7 0 data sent from terminal window to SCI SerialOutput Non memory mapped register is an alias for SClOutput register Connects the SCI to the terminal window but does not support the ninth bit Write access to SerialOutput has no specified meaning bits 7 0 data sent from SCI to terminal window S12 X Debugger Manual 317 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities FCS Visualization Utilities Besides components that give 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 and process visualization components Among these components there are visualization utilities that graphically display values registers and memory cells or provide an advanced graphical user interface to simulated T O devices and program variables The following components of visualization utilities belong to the standard Debugger installation WARNING The following visualization components ca
505. ocessor Header Directories 254 Preinclude file 255 Project file analysis 256 Project file configuration 264 Project overview 257 Project root directory 252 Referential project root directory 252 Requirements 251 Setting and deleting breakpoints 261 Source 254 S12 X Debugger Manual Synchronized debugging 265 Troubleshooting 266 User help file 253 Working directories 252 DAPI 261 DASM 538 Data 410 Component 70 Compression 393 687 Value 452 Window 410 Data access Formulas 201 Data menu 72 Data operation 70 Data window Global attribute 235 Local attribute 235 Database directory DA C 253 Database building DA C 256 DB 540 DBG 448 DBG FIFO Data 452 DBGCA 412 413 426 DBGCB 413 426 DBGFH 447 452 DBGFL 447 452 DBGT 425 DDE Capabilities 701 HI WAVE server 701 Implementation 701 DDECLient 702 DDEPROTOCOL 541 Debug Module DBG 290 Debugger Activating services 47 Application 25 Assembly component 55 Automating startup 233 Configuration 207 Configuring 232 247 Connection components 53 Connections 269 707 Copyright information 45 DDE capabilities 701 DDE support 701 Default Layout Configuration 670 Demo version limitations 26 Drag and drop 48 Driving through DDE 701 Engine 23 25 Features 25 Interface DA C 261 Kernel components 53 Layout 671 Main window components 53 Order of commands 211 Project 671 project ini 670 Running from a command line 211 Starting 208 Status bar 29 Tool tip 28 Toolbar
506. ode Usage ZOOM address in out Where address is the address of the structure or pointer variable to zoom in or zoom out respectively Components Data component Example in gt ZOOM Ox1FEO0 in Zooms in the variable structure located at address 0x1 FEO in gt zoom amp startupData Zooms in the startupData structure amp startupData is the address of the _startupData structure Signal Commands Use the following commands to specify files and file parameters in the Signal component SETSIGNALFILE Command SETSIGNALFILE specifies the signal file to use Syntax SETSIGNALFILE value 0 15 gt file name gt Remarks The SETSIGNALFILE X command creates a virtual SignalGeneratorX module having a SignalPin The file name can include the path of the file If you specify no path the Signal component first searches in the current project folder then in the prog FCSsignals folder of the debugger installation path 608 S12 X Debugger Manual Debugger Engine Commands Debugger Commands Example Create three generators setsignalfile 0 sinus 11bit 0 5v 1Hz txt setsignalfile 1 saw 11bit 0 5v l1Hz txt setsignalfile 2 square 1 5v 1Hz txt Then create virtual pin connections with the Pinconn Commands CONNECT command connect SignalGenerator0 SignalPin Atd0 PADO connect SignalGeneratorl SignalPin Atd0 PAD1 connect SignalGenerator2 SignalPin Atd0 P
507. ode HCS12X enables the HCS12X family instruction set HCS12XE enables the instruction set of the HCS12XE family superset of HCS12X STATUS returns the current state of emulation XGATE_FLASH sets the size of the device Flash XGATE_RAM sets the size of the XGATE RAM HCS12X_MAP4000 Supports alternative mapping of memory range 0x4000 0x7FFF and defines the mapping of the memory range 0x4000 to Ox7FFF to one of these memory types FLASH maps non banked FLASH default RAM maps non banked RAM EXTERNAL maps external space NOTE The HCS12X_MAP4000 option is designed for the HCS12XE family for the MMCCTLI register ROMHM and RAMHM flags CAUTION Match the setup of the debugger with the HCS12X_MAP4000 option with the HC12 Compiler Code Generation Define mapping for memory space 0x4000 0x7FFF option in the compiler options settings dialog i e MapRAM MapF lash or MapExternal command line options Example in HCS12 SUPPORT HCS12XE HCS12X MAP4000 RAM XJ in HCS12 SUPPORT status HC12 simulator is currently in HCS12XE mode HCS12X FLASH size is 0x80000 XGATE RAM size is 0x8000 0x4000 0x7FFF maps to RAM S12 X Debugger Manual 647 Connection Specific Commands Full Chip Simulation Connection Commands MESSAGE HIDE ID Description Hides a message with a specific ID Components Debugger engine Syntax MESSAGE HIDE ID lt message number ID Examp
508. ode may interfere with this trigger type Debugger may fail for executed code not belonging to user application Instructions at Address A then at Address B Were Executed Set a trigger on a program instruction execution program counter occurring first at Address A then Address B Instruction at Address A and Value on Data Bus Match Set a trigger on a program instruction execution at Address A with an instruction opcode that matches a specific byte value at Address A memory location Uses trigger B address as match value rather than an address location Select this trigger type without setting match value and an error message prompts for match value Replaces standard trigger editing dialog box with Triggers Address Settings dialog box see Figure 17 7 Match Value edit boxes replace Trigger Editing dialog Instruction at Address A and Value on Data Bus Mismatch Set a trigger on a program instruction execution of a non matching byte value at Address A memory location Uses trigger B address as mismatch value rather than an address location Select this trigger type without setting match value and an error message prompts for match value Replaces standard trigger editing dialog box with Triggers Address Settings dialog box see Figure 17 7 Match Value edit boxes replace Trigger Editing dialog Capture Read Write Values at Address B Use to capture data used in a read or write access to address location
509. of commands and responses to an external file or device While logging remains in effect any line that is appended to the command window is also written to the log file Logging continues until a close log file NOLF command executes When you use the LF command with no filename the Open File Dialog appears to allow you to specify a filename Use the logging option LOG command to specify information to be logged If you specify a path in the file name this path must be a valid path When you specify a relative path ensure that the path is relative to the project directory S12 X Debugger Manual Debugger Engine Commands Debugger Commands 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 so that LF appends logged lines at the end of an existing log file If you omit the A option and fileName is an existing file LF clears the file before logging begins Components Debugger engine Example in lf mcuez demo logfile txt A Opens the logfile txt file as a Log File in append mode NOTE Ifthe path is unspecified the destination directory is the current project directory LOAD The LOAD command loads a framework application abs file for a debugging session When no application name is specified the LoadObjectFile dialog opens If no ta
510. of this derivative is 0x2D3 In order to perform some operations the MCU type connected to the interface has to be set correctly Please select the MCU which fits the connected MCU If your MCU is not listed in the box above set Filter by PARTID to unchecked Cancel Help Setup Menu Option The Communication Connect menu option displays the P amp E Multilink Cyclone Pro Setup dialog box This dialog box contains the Communication tab and the Debug Options tab Figure 11 3 Communication Tab P amp E Multilink Cyclone Pro Setup 356 S12 X Debugger Manual P amp E Multilink Cyclone Pro Connection Connection Menu Figure 11 4 Debug Options tab P amp E Multilink Cyclone Pro Setup Communication Debug options Disable maskable ISR s when stepping Table 11 2 P amp E Multilink Cyclone Pro Setup Description Checkbox Description Show Protocol Checked enables a debug protocol displayed in the Command window Enable this option only when requested by the Freescale Support team to resolve debugger issues Disable maskable ISRs Checked Automatically sets I bit in device core CCR and when stepping disables maskable interrupts Debugger automatically calculates final 1 flag value according to stepped instruction Communication Connect Menu Option The Communication Connect menu option displays the P amp E HC S 12 Connection Manager dialog box S12 X Debugger Manual 357 P amp E Multilink
511. of trigger see DBG Module Mode Setup To set a trigger select a location choose one of the Set Trigger Address options and select the kind of access Read Write Read Write Setting the trigger from the Data or Memory window automatically selects the corresponding READACCESS WRITEACCESS or READWRITEACCESS markpoint type The trigger appears in the Data window and at the corresponding address in the Memory window To distinguish triggers from watchpoints trigger A appears with a dotted red vertical line and trigger B with a dotted blue vertical line Figure 17 13 Figure 17 12 Data Window Context Menu Set Trigger A Option S12X True Time Simulator amp Real Time Debugger D Profiles SKrylov My DocumentsV roject 19W amp E Multilink CyclonePro ini File View Run inDART MCSI2 Component Data Window Help S td e e 5 zig O X O Assembly HC12 _D Profides SKrylov My Documents Project_1S Sources man c HCI man a M Oe fi 0 3 9 for fi 03 1 lt 20 8 shared_counter B _XCIsP31 HB XGATE VectorTable B INT CFADDR B INT CFDATAD B XoMCTL B _xcsvr fiboCount counter Add Expression Set Trigger Address 8 Set Trigger Address C Set Trigger Address D Sequencer Setup Trace Setup Open Trigger Settings Dialog Trigger Module Usage Set Watchpoink Show Watchpoints Set Markpornt FE8043 CLRW FE8047 CLRX FESO49 INCV FE80S0 PSHX Register 0x2104 0x2104 0x2104
512. oints Set Program Counter Open Source File Copy Ctrl C Go To Line Ctrl G Find Ctrl F Find Procedure Ctrl I Folding gt Freeze Marks ToolTips gt NOTE Setting Expert mode grays out preset Instruction Memory Access or Capture trigger designs Setting automatic mode or a predefined preset trigger grays out the Expert mode trigger designs The Markpoints tab of the Controlpoints Configuration window stores expert triggers as DBGCA and DBGCB markpoints These markpoint names are therefore reserved by the debugger Use the Save and Restore on load option to automatically save the application with the current DBG module setup and trigger positions Trigger Settings You can use the Trigger Settings option of a context menu to set all kinds of triggers without opening the Trigger Module Settings Window However the amounts and combinations of trigger types are dynamic depending on how many triggers are defined which triggers are defined and the trigger type Instruction Read Access Read Write L512 platform only S12 X Debugger Manual 413 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries Access Write Access The menu displays only those trigger conditions and combinations that are currently available You can also directly edit the DBG Module Options Figure 17 15 Triggers Setting Menu Option Extended Menu S12 414
513. oints Case 2 if FIBO 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 This saves only the flag and removes the breakpoints NOTE _ Ifonly one ora few functions change after a recompilation not all BPs are lost To achieve that BPs are disabled only if the size of a function changes The size of a function is evaluated in bytes when it is compiled and in characters number of characters contained in the function source text When an ABS file is loaded and the matching BPT file exists for each BS command the Debugger checks if the code size in bytes and the source size in characters are different in the matching function given by the symbol table If there is a difference the breakpoint is set and disabled If there is no difference the breakpoint is set and enabled NOTE For more information about this syntax see BS and SAVEBP commands Setting Breakpoints The Debugger supports different types of breakpoints Temporary breakpoints activate the next time the instruction executes Permanent breakpoints activate each time the instruction executes Counting breakpoints activate after the instruction executes a certain number of times Conditional breakpoints activate when a given condition is TRUE Set breakpoints in a Source or Assembly component window Possibl
514. ollowing 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 executes and execution stops at the first instruction after the BSR instruction For instructions that are not in the above list the P and T commands are equivalent When the instruction specified in the P command executes 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 an address constant expression the address at which execution begins If you omit address execution begins with the instruction indicated by the current value of the program counter Components Debugger engine Example in gt p A 0x0 HX 0x450 SR 0x70 PCZOxFO0AE SP 0xFF OOFO4E 94 TXS STEPPED Contents of registers are displayed and the current instruction is disassembled S12 X Debugger Manual 579 Debugger Engine Commands Debugger Commands PAUSETEST Displays a modal message box shown in Figure 22 1 for testing purpose Figure 22 1 Test Pause Message Box Test Pause Usage PAUSETEST Components Debugger engine Example in gt pausetest PRINTF The PRINTF is the standard ANSI C command
515. olved in switching from another project such as the SofTec inDart 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 gt Set Connection as shown below Figure 6 4 Component Menu 212 Component Source Winc Open Fonts Background Color The Set Connection dialog box now appears S12 X Debugger Manual How To Switching Connections Figure 6 5 Set Connection Dialog Box Set Connection Processor nci2 Connection Full Chip Simulation X C Program Files Freescale CodeW arrior for 2 Set the Processor as HC12 and the Connection as Full Chip Simulation 3 Click the OK button The Debugger main menu entry bar for the connection now changes to HCS12X FCS Figure 6 6 HCS12X FCS Menu HCS12XFCS Component Comm Load Ctri4L Reset Ctrl4R Set Derivative Reset RAM Reset MEM Reset Statistic Load IOs Close IOs Clock Frequency Command Files Bus Trace Select Core Help You have successfully switched connections to the FCS connection The values and use of each HCS12X FCS menu entry is explained in the Full Chip Simulation chapter of this manual S12 X Debugger Manual 213 How To Switching Connections Loading the P amp E Multilink Cyclone Pro Connection To load the Multilink Cyclone Pro
516. om 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 you wish to use in the future Load the configuration at startup using one of three ways use the command line option prod the project ini file in the current directory or Open Project entry from the file menu S12 X Debugger Manual 669 Debugger Engine Environment Variables Local Configuration File usually project ini If you use the prod option then the current directory is the directory containing the project file Specifying a directory with prod loads the project ini file in this directory Default Layout Configuration PROJECT INI The PROJECT INI file located in the project directory defines the default layout activated when starting the Debugger as shown in Listing 24 1 The DEFAULTS section contains all default layout related parameters Listing 24 1 Example Content of PROJECT INI HI WAVE 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 670 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 Wi
517. on 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 bb1 BPT Debugger Breakpoint file e g fibo bpt uQ CPP C and C source files CHM Compiled HTML help file CMD Command File Script e g Reset cmd CNF Specific CPU configuration file CNT Help Contents File e g cxa cnt CPU Central Processor Unit Awareness file DBG Debug listing files e g Fibo dbg DEFAULT ENV Debugger Default Environment file DLL A DLL file 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 uH Header file HIWAVE EXE The Debugger for Windows executable program HWL Debugger Layout file e g default hw1 HWC Debugger Configuration file e g project hwc EXE Other Windows executable program e g LINKER EXE FPP CPU specific Flash Programming Parameters files e g mcu0e36 fpp HLP Application Help file e g Hiwave hlp IO I O simulation file e g sample11 io S12 X Debugger Manual Debugger Engine Envir
518. on as program code location or program data in Location Source Data Assembly and Memory windows NOTE Pressing OK in this dialog box does NOT update the trigger database You must press the Modify Trigger button in the Trigger Module Settings window before closing the dialog box to update the trigger database Use the panel on the left to find a trigger address in the debugger symbol database Select a variable to copy the variable address into the Address edit box Select a function to copy the entry point of the function into the Address edit box Select regular markpoints from the markpoint list to copy the address of the markpoint into the Address edit box S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries Figure 17 9 Finding Trigger Address in Editor Dialog Box Trigger Module Settings Trigger settings Expert triggers General settings Memory access at Address M Triggers Address Settings Madify Trigger A Address A O 0500 Memory AZW Access Browse for Trigger A eee Address 500 hex FIFO Normal mode amp Markpoints Meer Type R wW Access v Size at Address A memory D Write Access Information U R w Access DIETER a Trigger amp 53 Symbol Table main c 3 0 Variables Modify Trigger amp Delete Trigger A a Q counter Show Location Functions E Startl2 c Cancel Help Can
519. on automatically are given below Listing 19 2 In xxxx_Preload cmd file reset the device to get default settings ESET initialize Flash programming process LASH select the Flash modules LASH SELECT erase the Flash modules ASH ERASE arm the Flash for programming LASH ARM ma n Msg n DJ Listing 19 3 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 S12 X Debugger Manual 483 Flash Programming Hardware Considerations 484 TIP You can replace this Legacy implementation by using the Automated Application Programming feature Clean or disable both command files then engage the Automatically erase and program option in debugger Preferences 12G S12P S12X S12XE S12XS D Flash memory D Flash memory is fully supported on these platforms Please refer to TN263 for details here C Program Files Freescale CWS12v5 1 Help PDF S12 X Debugger Manual 20 Unsecure HCS12 Derivatives HCS12 derivatives include a security circuitry to prevent unauthorized access to contents of Flash EEPROM and RAM memory when background debugging The HC12MultilinkCyclonePro Target interface provides an Unsecure function The HC12MultilinkCyclonePro gt Unsecure menu
520. on File MCUTOOLS INI PC Only ENVIRONMENT Environment File Specification Tools Compiler Linker Decoder Librarian Maker Burner Debugger Synonym HIENVIRONMENT Syntax ENVIRONMENT file S12 X Debugger Manual 679 Debugger Engine Environment Variables Environment Variables Arguments lt file gt file name with path specification without spaces Default None Description You must specify this variable at the system level Normally the application looks in the The Current Directory for an environment file named default env Use the ENVIRONMENT variable to specify a different file name NOTE This is a system level global environment variable It CANNOT be specified in a default environment file DEFAULT ENV hidefaults Example ENVIRONMENT Freescale prog global env GENPATH include File Path Tools Compiler Linker Decoder Burner Debugger Synonym HIPATH Syntax GENPATH lt path gt Arguments path Paths separated by semicolons without spaces Default Current directory 680 S12 X Debugger Manual Debugger Engine Environment Variables Environment Variables Description If you include a header file 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 see LIBRARYPATH include lt File gt Path
521. on runs Default update rate is 1 second but can be modified by steps of up to 100 ms using associated dialog box Frozen Selects Frozen mode Does not update memory dump displayed in the memory component when connection stops S12 X Debugger Manual 95 Debugger Components General Debugger Components Display Submenu With the Display submenu shown in Figure 3 48 you can set the memory display Address ASCII Table 3 29 describes the menu entries Figure 3 48 Display Submenu v Address v ASCII Table 3 29 Display Submenu Description Address Toggle the display of address dump ASCII Toggle the display of ASCII dump Fill Memory Dialog Box The Fill Memory dialog box shown in Figure 3 49 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 49 Fill Memory Dialog Box Fill Memory from Address 830 to Address 800 Value 53 Iv Hex Format NOTE If Hex Format is checked numbers and letters are interpreted as hexadecimal numbers Otherwise type expressions and prefix Hex numbers with Ox or Display Address Dialog Box With the Display Address dialog box shown in Figure 3 50 the memory component dumps memory starting at the specified address 96 S12 X Debugger Manual Debugger Components General Debugger Components Figure 3 50 Display Address Dialog Box Display Address Address B4FO
522. on 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 Drag a function name from the Procedure component to a Data component with attribute local Using Double click 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 values 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 1 Choose Component Open The list of all available components appears on the screen 2 Double click the entry Module A module component opens 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 238 S12 X Debugger Manual How To Working on Variables Using Context Menu 1 Right click in a Data component with attribute Global M p Choose Open Module in context menu A dialog box opens 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 destinat
523. onment Variables Debugger Files Table 24 1 Debugger Files and File Extensions continued File Extension Description ISU Uninstall Application File PIT Debugger configuration Settings File e g Project pjt INI Debugger configuration Settings File e g Project ini LST Assembler Listing File e g fibo 1st MCP Freescale CodeWarrior IDE project file MAK Make file e g demo mak MAP Mapping file e g macrodem map MEM Memory Configuration file e g 000p4v01 mem MON Firmware loading file that allows loading a specified target e g Firm0508 mon Object file code e g Fibo o PDF Portable Document Format file PRM Linker parameter file e g ibo prm Debugger Project Initialization File REC Recorder File REG Register Entries files e g mcu081e reg SIM CPU Awareness file e g st7 sim SX S Record file e g fibo sx TXT General Text Information file TGT Target File for the Debugger e g xtend g3 tgt WND Debugger Window Component File e g recorder wnd XPR Debugger User Expression file e g Fibo xpr S12 X Debugger Manual 677 Debugger Engine Environment Variables Environment Variables Environment Variables This section describes each of the environment variables available for the Debugger The options are listed in alphabetical ord
524. onous communication channels With older computers download speed may be faster without data compression HC12 CPU12 derivatives only Use the Continue on illegal break banked hardware breakpoint check box to overcome the 2 byte address size on chip break module which does not handle PPAGE Internally the target halts at the hardware breakpoint in Flash memory compares that breakpoint with the breakpoint you set then relaunches if not bank matching NOTE This feature is available as an option Setting this option prevents code execution break handling and illegal code execution detection Use this option carefully The Use the debugger eeprom and flash programmer check box allows you to activate the debugger internal Flash Programmer engine and GUI instead of the Abatron on board non volatile memory programmer the Abatron on board NVM programmer is the default except for HCS12X core devices Terminal Emulation The Abatron BDI Connection supports terminal emulation for CPU12 HC12 HCS12 and HCS12X cores This allows the target application to write into the debugger Terminal component Also you can direct the characters typed on the host s keyboard to the target application To use terminal emulation open the Terminal component in the debugger by choosing Component Open Terminal To simulate the terminal I O a 4 byte work space is needed Configure the work space address with the setup program from ABATRON For mo
525. ons DER Set CLKSW bit in BDM control register MC9512 only Resynchronize from hardware reset COP etc Default Settings S12 X Debugger Manual 359 P amp E Multilink Cyclone Pro Connection Connection Menu Table 11 3 P amp E HC S 12 Connection manager Description Element Interface listbox Description Selects the P amp E hardware interface that is used to connect to the target Port listbox After the interface is chosen this specifies which port should be used The available selections are dependent on the selected interface Add LPT Port button This button guides the user through the series of steps needed to add a LPT port to the Connection Manager This is necessary if additional LPT ports are added through the use of expansion cards such as PCI Refresh List button This button attempts to detect all P amp E hardware devices specified by the Interface selection This is necessary if these devices are reset or need to be plugged in after the Connection Manager has been shown Advanced button Opens HC S 12 Advanced Options dialog box which allows the user to modify the following settings set CLKSW 0 bit in BDM control register resynchronize from hardware reset Set CLKSW bit in BDM control register MC9S12 only checkbox in P amp E HC S 12 Connection Manager Advanced Options dialog box Checked uses BDM status register CLKSW bit to set bus clo
526. onverter FCS ignores other PLL functionalities in the hardware Reference Clock The CRG module reference clock is CLK24 given at the output The CLK3 and CLK23 clocks are not simulated When you clear PLLSEL to 0 the oscillator clock frequency used by the RTI and COP is the same as the reference clock frequency When you set PLLSET to 1 OSCCLK frequency CLK24 REFDV 1 2 SYNR 1 Since some systems do not work with a CLK24 frequency less than the hardware OSCCLK frequency the simulation does not accept CLK24 frequencies less than the hardware OSCCLK frequency and generates a warning message Any OSCCLK frequency greater than the CLK24 frequency has the same frequency as CLK24 Blocks The CRG PLL Control Register PLLCTL is not simulated The following blocks are simulated Phase Lock Loop PLL The simulated PLL clock divider functionality includes the REFDV and the SYNR registers and the PLLSEL bit in the CLKSEL register Changing the value of PLLSEL automatically updates the COP and the RTI events This may cause cycle irregularities as described in the manual For proper use of the COP and RTI change PLLSEL before enabling these modules The simulated PLL stabilization time ranges from 100 to 1500 clock cycles after modifying the REFDV or SYNR registers Setting PLLSEL to 1 before this stabilization time elapses generates a warning message The FCS operates properly but the corresponding program
527. oose Set Watchpoint from the context menu to define a read write watchpoint Point in the Data window and right click The Source context menu appears F ipan den ES Choose Show WatchPoints from the context menu The Controlpoints Configuration window Watchpoints tab appears yi Select the watchpoint you want to define as a conditional watchpoint 6 From the list box select the type of access you want to track 7 Specify the condition for the watchpoint in the Condition field The condition must be specified using the ANSI C syntax Example counter 7 8 Click OK to close the window and define a conditional watchpoint for the selected variable Use the Left Mouse Button and click the S Key 1 Point at a variable in the Data window 2 Hold down the left mouse button and click the S key The Watchpoints tab of the Controlpoints Configuration window appears 3 Select the watchpoint you want to define as a conditional watchpoint 4 From the list box select the type of access you want to track 5 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 S12 X Debugger Manual 183 Control Points Watchpoints 6 Click OK to close the window and define a conditional watchpoint for the selected vari
528. oose Show WatchPoints from the context menu The Controlpoints Configuration window Markpoints tab appears 5 Make any modifications to any markpoints listed 6 Click OK to close the window S12 X Debugger Manual 191 Control Points Halting on a Control Point Deleting a Markpoint To delete a markpoint Use the Left Mouse Button click the D Key 1 Point at the markpoint variable in the Data window the memory range in the Memory window or the codeline in the Source window 2 Hold down the left mouse button and click the D key 3 This deletes the markpoint and removes the blue letter L in front of the variable memory range or codeline Choose Show Markpoints from Appropriate Context Menu 1 Point in the Data Memory or Source component window and right click The associated context menu appears 2 Choose Show Markpoints from the context menu The Markpoints tab of the Controlpoints Configuration window appears 3 In this tab s list box select the markpoints you want to delete 4 Click Delete This removes the selected markpoint from the list of defined markpoints 5 Click OK to close the window This deletes the markpoint and removes the blue letter L in front of the variable memory range or code line Halting on a Control Point Code execution halts when the program reaches either a breakpoint or a watchpoint if the conditions specified in the definition of the breakpoint or watchpoint have been re
529. option adds an additional target to the project with the name PC Lint Using the PC lint plug in requires a professional license 24 Click the Finish button The IDE opens 25 In the IDE main window choose Project gt Make 26 Now choose Project gt Debug to start the debugger S12 X Debugger Manual 231 How To CodeWarrior IDE Integration Figure 6 28 Your Project in Debugger Main Window Fle Ven Run MCSIIFCS Component Memory Window Hep jela gt e el zziele D Profiles b 38199 Documents proci umy E126 proci Sources ean c include hidef ho common defines and macros include cmcsidel2t h derivative information pragua LINK INFO DERIVATIVE mc 312e122 void main void E se sn Ern own code here for z2 MM wait forever please make sure that you never leave this function m 1p sssoo0 wc soo0 penge ss se em omasin manc fiblefib usdefised expression unknown identifier 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 04 00 00 anne na nn nn 2n nn SIARTED pae Breakpoint For Help press Ft Zooomr 4 MC95126128 Bresiport CodeWarrior IDE Integration This section provides information on how to use and configure the Simulator Debugger within the CodeWarrior IDE using the CodeWarrior IDE HC12 version 4 5 or later Debugger Configuration To configure the Simulator Debugger in the CodeWarrior IDE open the Target Settings Panel by c
530. or change the DBG sequence in the Sequencer tab of the Trigger Module Settings window Version 3 and later devices incorporate an extended trigger sequencer with preset sequences providing more complex trigger combinations Figure 17 37 Trigger Sequence Control Trigger Module Settings Trigger settings Sequencer General settings User Triggers trace possible no automatic breakpoints and watchpoints A RAWAcces B Notdefined C Notdefined D Not defined Modify Trigger Address 02102 e Address Compare to 0x0000 With Mask 00000 C Inside Range C Outside Range Compare mismatch Always stop on this trigger Triggeron HCS12 C XGATE Trace HCS12X only v Record continuously v FIFO Nemalmode x This mode is used to trigger on any trigger address Ary bigger means Address A or B or C of D Trace mechanism activated for the HCS12X core The DBG module records change of flows until the condition is met or the debugger is Any trigger then Any tigger Any trigger then Any trigger then Any trigger C then D A of B then D C then Any trigger 4 then D or B then C C then D then A C then A or 8 then D C then B A restarts then D then D C restarts C odd number of times then D AIB IC then D Chen A BID User Sequence setup Display Information A large gray box provides dynamic information about the current triggers and selected options As
531. or each memory block You can modify such entries without restriction NOTE To simulate an absolute file generated in Freescale object file format you must open the Memory Configuration dialog box set the auto on load mode then add a new RAM segment The start and end addresses of this segment must match the associated prm file Once you close the dialog box you can load your application and start a simulation S12 X Debugger Manual 277 HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu 278 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 Configur
532. orary PortlO object is created in the Object Pool It contains no fields If the instrument is removed the temporary PortlO object will be removed too The Instrument exchanges data with fieldname field of PORTB object Subscribe TargetObject 210 New temporary PortlO object is created in the Object Pool It contains no fields If the instrument is removed the temporary PortlO object will be removed too The Instrument exchanges data with the field located at 0x210 151 Debugger Components Visualization Utilities Attribute Description Example PORTA is defined in the MEBI block The name of the field for Pind from PORTA is PORTAPinO In order to be able to stimulate this Pin by means of visualization tool Add a LED component Set Kind of port to subscribe Set Port to display to Mebi PORTAPinO Set Visualization tool to Display Mode Starting from here you can toggle the Pin by clicking on the LED in the component Variable Used to display value of a variable with given name Variable counter Register Used to display value of a register with given name Register SP Memory Used to display value of memory with given address you can also specify width of memory to display Memory 0x210 Analog Instrument The Analog instrument Figure 3 102 represents the classical pointer instrument Figure 3 102 Analog Instrument AXIS 2 Table 3 56 show
533. ore cannot be used when debugging in non volatile memory if the hardware breakpoint module is disabled S12 X Debugger Manual On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog Automatic controlled by debugger mode This is the default mode for the debugger If you select the Automatic controlled by debugger mode you have the option to set up to two breakpoints or one watchpoint in Non Volatile Memory as shown in Figure 21 3 Figure 21 3 Module base address edit box Hardware Breakpoint Configuration Break Module Settings 16 bits Break Module User Mode 22 bits Break Module User Mode r Breakpoint Module Mode Breakpoint Module mode Automatic controlled by debugger Y r Breakpoint Module Description Breakpoint Module kind use 16 Bits Break Module Breakpoint Module base address hex use 22 Bits Break Module J Continue an illegal break banked hardware breakpoint 16 bits Break Madule anly use 16 Bits Break Module Cancel Help Table 21 1 describes the available options Table 21 1 Description of Settings S12 X Debugger Manual Setting Description Breakpoint Select hardware breakpoint module supported by connected Module kind derivative e Select Use 16 Bits Break Module for an HC 12 derivative Select Use 22 Bits Break Module for an HCS12 derivative Breakpoint Use to set address of hardware breakpoint module in Module base
534. ossible commands and associated Escape sequences in which filename is a sequence of characters terminated by a control character e g CR and is a valid filename ESC is the ESC Character ASCII code 27 decimal Table 10 28 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 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 suppress output to terminal display You can give these commands 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 terminal h is used to send such commands from a target via SCI to the terminal Listing 10 2 shows the source code in terminal c S12 X Debugger Manual 323 HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Listing 10 2 TERM_Direct Source Code void TERM Direct TERM_DirectKind what const char fileName sets direction of the terminal i
535. ot 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 specified value is interpreted as an address and the memory component dumps memory starting at this address Select a memory range and hold down the left mouse button R key to set a Read watchpoint for the selected memory area Memory ranges at which a read watchpoint is defined are underlined in green If read access on the memory area is detected during execution the program halts and the current program state displays 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 at which a write watchpoint is defined are underlined in red If write access on the memory area is detected during execution the program halts and the current program state displays 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 at which a read write watchpoint is defined are underlined in black If the memory range is exceeded during execution the program halts and the current program state displays 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
536. ou can load a previously saved layout from a file by inserting the following line in your PROJECT INT file Layout lt LayoutName gt Where LayoutName is the name of the file describing the layout to be loaded for example Layout lay1l hwl NOTE You can specify the layout path if the layout is not in the project directory NOTE If you define Layout in PROJECT INI the Layout parameter overwrites any Window lt n gt definition describing the default windows layout You can load a previously saved project from a file by inserting the following line in your PROJECT INT file Project lt ProjectName gt where ProjectName is the name of the file describing the project to be loaded for example Project Projl hwc NOTE You can specify the project path if the project is not in the project directory Use this option for compatibility with the old hwp format Project oldProject hwp The file opens as a new project file See File Menu for more information about Projects NOTE Ifyou define both Layout and Project in PROJECT INT the Project parameter overwrites the Layout parameter which also contains 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 Use this variable to save and load the Debugger main window states positions size maximized minimized icons used when open etc This entry is
537. ource component window SREC The SREC command initiates the loading of Freescale S Records from a specified file NOTE Ifthe path is unspecified the destination directory is the current project directory Usage SREC fileName offset offset isa signed value added to the load addresses in the file when loading the file contents Components Debugger engine Example in gt SREC DUMP SX Loads the DUMP SX file into memory S12 X Debugger Manual 59 wo Debugger Engine Commands Debugger Commands 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 TRACED TRACED in the status line indicates that the application is stopped by an assembly step function STEPOUT The STEPOUT command executes the remaining lines of a function in which the current execution point lies The next statement displayed is the statement following the procedure call All of the code is executed between the current and final execution points Using this command you can quickly finish executing the current function after determining that a bug is not present in the function NOTE This command works
538. out Drop Into Nothing can be dragged in Demo Version Limitations Generates only 15 interrupts and memory accesses Terminal Component Use the Terminal component window shown in Figure 10 15 to simulate input and output It can receive characters from several input devices and send them to other devices 320 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection FCS Visualization Utilities Figure 10 15 Terminal Window ZH 06 test file ZH 06 C Date Oct 04 1996 15 28 10 You can use a virtual SCI port provided by the framework for communication with the target but it is also possible to use the keyboard the display 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 10 16 Figure 10 16 Terminal Menu and Context Menu Clear Input File Close Input File Output File Close Output File Configure Connections Cache Size To open the context menu right click in the terminal window Configure Terminal Connections Using the terminal window you can redirect characters received from any available input device to any available output device Specify these connections by choosing Configure Connections in the context menu of the terminal component This opens the dialog box shown in Figure 10 17 S12 X Debugger Manual 321 HC S 12 X Full Chip Simulation Connection FCS Visualization Uti
539. ow To Using the Stationery Wizard to Create a Project Figure 6 23 Add Additional Files Screen HC S 12 X Microcontrollers New Project Wizard M tam map Add existing files to the project Device and Connection My Documents XGATE Setup My Computer B13819 on B1381 Project Parameters My Network Places Det office zRemove Add Additional Files C3 s1200 5 0 1 1 14804276 20090211 pdf prostia Epen 19 February 2009 ppt C C Options AN3784 suggestion sg pdf I Copy files to project 4 Compiler HC12 IR PW 1 pdf M Nd Memory model options 3 Compiler HC12 IR PW 1 pdf g ve I Create main c msin asm file gt PC Lirkt lt 11 Select files to be added to the new project and click Add button You can also select checkbox to Copy files to project To copy the added files to the project folder Create main c main asm file To have the wizard generate default main c and or main asm files 12 Click Next to continue The Processor Expert screen appears Figure 6 24 Processor Expert Screen HC S 12 X Microcontrollers New Project Wizard Map Device and Connection XGATE Setup Project Parameters Add Additional Fies Processor Expert C C Options lo device intialization code is generated Only Memory model options jates startup code See readme b4 in project how ocessor Expert can be enabled if not done here PC Lint 226 S12 X Debugger Manual How To Using the Stationery Wizard to
540. p is available when you point the mouse at an icon 28 S12 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 3 contains a context sensitive help line for connection specific information including the number of CPU cycles for the Simulator connection and execution status Figure 2 3 Debugger Status Bar For Help press F1 2 000000 MHz HALTED Main Window Menu Bar The Debugger Main Window Menu Bar shown in Figure 2 4 is associated with the main function of the debugger application connection and selected windows Figure 2 4 Debugger Window Menu Bar File View Run HC12FCS Component Command Window Help NOTE You can select menu commands from the keyboard by clicking the ALT key A line appears under the initial letter in each item in the menu bar Click the key corresponding to the menu of your choice and click enter Or use the directional arrows to move to the menu entry you want and click enter again Table 2 1 describes menu entries available in the menu bar Table 2 1 Description of the Main Menu Toolbar Entries Menu Entry Description File Use to manage debugger configuration files View Use to configure the toolbar Run Use to monitor a simulation or debug session Connection Use to select the debugger connection Once you select a connection the heading name changes
541. piler may produce code that will not meet the required functionality This is also true when accessing constant members of structures that are not constant by means of pointer to const 20 Select the Memory Mapping format by clicking the appropriate radio button The Memory Mapping option is supported on some of HCS12X devices as new mode The default selection is FLASH Selecting any of the options results in the following conditions RAM Maps accesses to 0x4000 0x7FFF to 0xOF_C000 0x0F_FFFF in the global memory space RAM area More RAM will be available in the local memory map FLASH Maps accesses to 0x4000 0x7FFF to 0x7F_4000 0x7F_7FFF in the global memory space FLASH More flash will be available in the local memory map External Maps accesses to 0x4000 0x7FFF to 0x14_4000 0x14_7FFF in the global memory space external access 21 Select the Use MemoryBanker by clicking the appropriate check box MemoryBanker is an automation tool that optimizes the layout of code and data in order to minimize the application s memory footprint In the first pass it gathers information about the application and generates the layout while in the second pass it generates the optimized code It can be used to generate an optimal distribution for functions for data or for both functions and data Selecting any of the options results in the following conditions Code The project will be setup for code optimization Data
542. places executable programs in the prog subdirectory of the CodeWarrior installation directory For example if you install the CodeWarrior IDE software inC Program Files Freescale all program files are in the folder C Program Files Freescale CWS12v5 1 Prog The CodeWarrior IDE uses the following files for C C debugging hiwave exe Debugger executable file hibase dll Debugger main function d11 elfload dll Debugger loader d11 wnd Debugger component files tgt Debugger target files cpu Debugger CPU awareness files S12 X Debugger Manual 27 Debugger Interface Debugger Main Window 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 Figure 2 1 Debugger Main Window True Time Simulator amp Real Time Debugger _D Profiles b13819 My Documents project2 Full_Chip_Simulation ini X Assembly D Profles b1 381 9 My Documents project2 Sources man c include hidef h ca nes include mc9s12dp256 h hf 002 BRA o sabs 02308002 pragza LINK INFO DERIVATIVE O Procedure IX coi IY in 0 IP 305000 PC 000 PPAGE 30 8 Data 1 LI 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 2 identifies each default icon Figure 2 2 Debugger Main Window Toolbar A tool ti
543. ple in gt PORT 0x210 REGBASE 638 This command allows you to change the base address of the I O registers or to set Reset this address to 0 Syntax Regbase lt Address gt lt R gt Arguments Address an address to define the base address of the I O registers R sets this address to 0 Reset Components Debugger engine Example in gt regbase 0x500 Ox 500 is now the base address of the I O registers S12 X Debugger Manual Connection Specific Commands Full Chip Simulator Commands RESETCYCLES This command sets the Simulator CPU cycles counter to the user defined value If not specified the value is 0 The Debugger status and Register component displays the cycles counter This command does not affect the context Syntax RESETCYCLES lt Value gt Arguments Value 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 0 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 Marks the given range of memory RAM ROM as uninitialized undefined Syntax RESETMEM range S12 X Debugger Manual 639 Connection Specific Commands Full Chip Simulator Commands Components Simul
544. points Tab Controlpoints Configuration Disable E Continue kterval i Add Delete sete 9 c jJ 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 is set state of the watchpoint disabled or not read access of the watchpoint enabled or not and write access of the watchpoint enabled or not Condition group box that displays the condition string to evaluate and the state of the condition disabled or not Command group box that displays the command string to execute and state of the command disabled or continue after command execution Counter group box that displays the current value of the counter and interval value of the counter 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 Update button to Update all modifications in the dialog Delete button to remove currently selected watchpoint and select the watchpoint that is below the removed watchpoint OK button to validate all modifications 178 S12 X Debugger Manual Control Points Watchpoints NOTE Current and Interval values are limit
545. possible 95086660 RESET A The status bar displays the current DBG module mode setup as shown above or the current preset Instruction triggers Memory Access triggers or Capture triggers in use Figure 17 19 Status Bar Item For Help press F1 Trigger condition Instruction at Address A or Address B is executed leso8cBe0 RESET Ui Trigger Module Settings Window You can open this window from context sensitive menus in the Source Data Memory and Assembly component windows from the Connection menu or by clicking on a Status Bar item You can fully control the on chip DBG module from this window S12 DBG Module Tabs e 12G SI2P S128 DBG Module Tabs e 12X DBG Module Tabs S12 DBG Module Tabs It consists of Trigger Settings Tab Expert Triggers Tab Trigger Settings Tab Use the Triggers Settings tab to set the trigger mode and trigger address if this option is available in the selected mode 416 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window Figure 17 20 Trigger Module Settings Window Trigger Settings Tab S12 Trigger Module Settings Trigger settings Expert triggers General settings Automatic triggers breakpoints watchpoints and trace possible M EX seien The DBG module is setup to record the executed change of flows No trigger is set the debugger must be stopped on the user request In this
546. programming or loading it can communicate via Ethernet USB or serial interfaces P amp E Cyclone PRO TCP IP Connect to P amp E Cyclone PRO via Ethernet port This flexible tool is designed for in circuit flash programming debugging and testing of Freescale HCS12 X microcontrollers in development and production environments The Cyclone PRO can be operated in interactive or batch mode Once loaded with data it can be disconnected and operated manually in stand alone mode via the LCD menu and control buttons The Cyclone PRO has over 3 MB of non volatile memory which allows the onboard storage of multiple programming images When connected to a computer for programming or loading it can communicate via Ethernet USB or serial interfaces OSBDM Connect to Freescale Open Source BDM circuit via USB port This on board interface provides basic run control and internal FLASH programming support for a resident processor on an evaluation platform SofTec HCS12 Connects to any of the USB based SofTec Microsystems tools for the HC12 inDart HCS12 etc Depending on derivative selected the following connections may also be available Abatron BDI Connect to the hardware board using Abatron hardware BDI HS or BDI 1000 through the BDM connection TBDML Connect to a board through Freescale TBDML TurboBDM Light NOTE CodeWarrior IDE provides Change MCU Connection wizard to easily modify a project later For mor
547. propriate information about the BDM communication speed is saved into this field for all future sessions This setting reduces the amount of time needed to connect to the microprocessor since the correct BDM communication speed is known OSBDM connection OSBDM automatically detects communication speed with the target thus IO DELAY CNT settings are disabled for this hardware interface MCU Internal Bus Frequency For programming S12 X Debugger Manual These settings are currently unused 361 P amp E Multilink Cyclone Pro Connection Connection Menu Element Description Reset Options Delay after Reset The target microprocessor is reset during the initial startup sequence in order to establish communications In some cases the rise delay of the Reset signal is considerable This setting allows the user to specify an amount of time to wait for the Reset signal to rise to logic high levels before trying to communicate with the target microprocessor Cyclone Pro Power Control The P amp E Cyclone Pro if used can directly provide power to the target microprocessor eliminating the need for a separate external power supply Please note that the appropriate jumper settings must first be configured on the Cyclone Pro Refer to the user manual for more details Provide power to target This setting must be checked if the Cyclone Pro should provide power to the target microprocessor Power o
548. ption Field Description Contains additional description to display in front of value Add a colon and or space as you wish The default setting is Value Format mode Defines format Choose from Decimal Hexadecimal Octal and Binary formats Use Relative Value for showing a value in a range of 0 up to 100 or 1000 c Table 3 68 shows Relative Value attributes Table 3 68 Relative Value Attributes 160 Attribute Description Field Description Add additional description text to display in front of value Add a colon and or space if desired The default setting is Value Low Display Fixes minimal value that will represent 0 Values below this Value definition appear as an error ERROR High Display Fixes maximal value that will represent 100 Values above this Value definition appear as an error ERROR Relative Mode Switches between percent and permill Use Command instrument mode to specify a command that will be executed by clicking on this field For more information about commands read the chapters on Debugger Commands Table 3 69 shows Command mode attributes S12 X Debugger Manual Debugger Components Visualization Utilities Table 3 69 Command Attributes Nue Pesetnton Cd Field Description Contains text that will be displayed on the button Command Contains command line command to be executed after clicking button CMD Callback is the same as Command but s
549. ptions El Trace DER DBG FIFO data Show Location Textual Graphical v Instructions Items Dump Go to Frame Clear Display DBG FIFO data Open Trigger Settings Dialog Selecting Show Location in the Trace window context sensitive menu displays the frame matching source and assembly code in the Source and Assembly windows 448 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trace Component Window Graphical Display Activate this display mode by selecting Graphical in the Trace window context sensitive menu It provides a graphical representation of the same information Figure 17 43 Trace Window Graphical Display El Trace Frame Address Data 24 Instruction BCC 42 Remark DEG FIFO dataj Textual Display Activate this display mode by selecting Textual in the Trace window context sensitive menu when using Instruction or Memory Access triggers When using this mode the DBG module does not record read or write accesses while program change of flow information is recorded Textual display mode simply expands instruction assembly code in the Trace window S12 X Debugger Manual 449 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trace Component Window Figure 17 44 Trace Window Textual Display El Trace 02 DBG FIFO data Column Display and Moving Select Items in the Trace window context sensitive menu to open
550. quivalent to 10FEE Flash even page 4 479 Flash Programming Hardware Considerations Table 19 5 HC12DG128 Flash Module Details continued Module Module Remarks Name Number FLASH_ 7 16 Kilobytes paged Flash accessed in bank window 0x8000 PAGE5 OxBFFF equivalent to 10FEE Flash odd page 7 Boot sector unprotectable protectable 8 Kilobytes in range 0xA000 0xBFFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register FLASH 8 16 Kilobytes paged Flash accessed in bank window 0x8000 PAGE6 OxBFFF equivalent to 11FEE Flash even page 6 Also equivalent to FLASH 4000 module FLASH 9 16 Kilobytes paged Flash accessed in bank window 0x8000 PAGE7 OxBFFF equivalent to 11FEE Flash odd page 7 Also equivalent to FLASH_C000 module Boot sector unprotectable protectable 8 Kilobytes in range 0xA000 0xBFFF via BOOTP bit in FEEMCR register and LOCK bit in FEELCK register 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 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 pp files having been simplified to increase programming speed as devices may have up to 1 Megabyte of on chip Flash Changing programming methods for each
551. r 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 Figure 3 19 Edit Expression Dialog Box Edit Expression ibo Cancel S12 X Debugger Manual 71 Debugger Components General Debugger Components Example With two variables variable 1 variable 2 Entering the expression variable 1 variable 2 OxFF lt 0x1000 results in a boolean type Entering the expression variable_1 gt gt variable_2 0x1000 results 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 fibo abs the debugger executes Fibo xpr Data Menu Figure 3 20 shows the Data component menu the Scope submenu is shown in Figure 3 21 the Format submenu in Figure 3 22 the Mode submenu in Figure 3 24 the Options submenu in Figure 3 26 and the Zoom and
552. r appears in the Source window and at the corresponding address in the Assembly window just like a breakpoint icon To be distinguishable from breakpoints trigger A is marked with a red A icon and trigger B with a red B icon Figure 17 5 Figure 17 5 Triggers Set in Source and Assembly Windows True Time Simulator amp Real Time Debugger 0 Wrofiles SKrylov y DocumentsProject_18PRE_Multilin fa om Ele yew Run Mul nkCydonePro Component Assembly Window Help mig e X 5 zz se e OIX O Assembly D ProfilesNSKeylovAMy Documents Project 195 ources wnain c i man put z own code here 3C8002 CALL 0x8031 0x3C 432 main call the assembly function B3cs006 BRA 740 abs 0x3C80 v A YRS AIR Bfor BES vait forever mlense make mre thar onn never laane this fumcrion Y O Procedure Once you set a trigger you can delete it by opening any context sensitive menu that contains the Delete Trigger Address options LAB on S12 platform A B C on S12S P A B C D on S12X S12 X Debugger Manual 405 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries Storing Triggers as Markpoints The debugger stores triggers as special Trigger A and Trigger B markpoints You can view markpoints by choosing Show Markpoints in the menu The markpoint names are reserved by the debugger When you set the trigger from the Source or Assembly window the debugger automati
553. r component the SPC command scrolls the Assembly component shows the location the assembler address and select highlights the assembler instruction of the address given as parameter In the Memory component the SPC command scrolls the memory dump component and 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 This scrolls the Assembly component window to the address 0x8000 and highlights the associated instruction SPROC 592 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 in the procedure chain level 0 is the current procedure level level 1 is the caller stack level and so on S12 X Debugger Manual Debugger Engine Commands Debugger Commands NOTE This command is relevant when debugging C source code NOTE Giving a procedure level greater than 0 as parameter to the SPROC command selects the statement corresponding to the call of the lower procedure 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 S
554. r if Bit 1 Defines color if the given bit is set Color if Bit 0 Defines color if the given bit is not set 7 Segment Display Instrument This is a 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 109 Figure 3 109 7 Segment Display Instrument Table 3 63 shows 7 Segment Display instrument attributes Table 3 63 7 Segment Display Instrument Attributes Attribute Description Decimalmode Displays first or second four bits of one byte in hexadecimal mode When switched off each segment represents one bit of one byte Sloping Switches sloping on or off Display Version Selects appearance of instrument Two versions available Color if Bit 1 Defines color of activated segment Color may be set to transparent S12 X Debugger Manual 15 N Debugger Components Visualization Utilities Table 3 63 7 Segment Display Instrument Attributes continued EAR HEN O O Color if Bit 0O Defines color of deactivated segment May be set to transparent Outlinecolor Defines color of segment outlines Color may be set to transparent Switch Instrument Use the Switch instrument to set or view a definite bit Figure 3 110 The Switch instrument also provides an interesting debugging feature you can let it simulate bounces and thus check whether your algorithm is robus
555. r the input value depends on the format selected for the Memory component Ifthe format for the component is Hex the input value is treated as a Hex value If input value is 10 the memory address will be set to 0x10 16 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 S12 X Debugger Manual 243 How To Consulting Assembler Instructions Generated by a Source Statement To stop editing and validate the last input value click either the Enter or Tab key or select another variable To stop editing and restore the previous memory value click the Esc key Consulting 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 Perform online disassembly 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 click the R key The disassembled code associated with the selected source instruction appears gray in the Assembly component Viewing Code The Debugger allows you to vi
556. race window from specific connection menus from context menus and from the DBG Support Status bar Save this window in the debugger layout by pressing the debugger Save icon NOTE The debugger may run faster with the Trace component window closed because this allows the debugger to discard the code program flow rebuild The Trace component window displays either instructions or recorded data depending on the type of triggers activating the window S12 X Debugger Manual 447 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trace Component Window Instructions Display Using Instruction triggers and Memory Access triggers automatically activates this display mode It is also the default display in Automatic mode In this mode the Trace component window displays four columns Frame This column shows a number representing an information item stored in the Trace component database Address This column shows the instruction program counter Instruction This column shows the code program flow instruction disassembly FIFO Analyze remark This column shows debugger information DBG FIFO data means that the on chip DBG module recorded this data Traced means an item or instruction obtained by debugger or user single step or assembly step Program flow rebuild gap means that the debugger was unable to completely track the code program flow between two frames Figure 17 42 Trace Window Context Menu O
557. ral settings Automatic breakpoints watchpoints and trace possible Switch DBG modes by displaying the list menu as shown above and selecting any one of the three modes With some modes some of the Trigger Settings tab options are not available Use the sub tabs of the Trigger Settings tab of this window with their text fields radio buttons and check boxes to set up the individual triggers Trigger Settings Tab Use the Triggers Settings tab to set the trigger mode and trigger address if this option is available in the selected mode DBG Module Mode Setup Three modes are available Automatic Disabled S12 X Debugger Manual 427 On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window User triggers Table 17 6 Trigger Modes 428 Mode Automatic Mode Default Description Use DBG Module to set up three hardware breakpoints or two hardware breakpoints and one watchpoint Set triggers by selecting from the list or from a context sensitive menu Automatic mode is the default selection when no triggers are currently set Set trigger condition and trigger addresses from debugger Source Assembly Memory and Data components using Set Trigger A or Set Trigger B context sensitive menu entry or from Trigger Settings dialog DBG module records executed change of flows Since no triggers are currently set stopping the debugger requires a user request a bre
558. range fileName Saves a memory block in S Record format offset A SETCOLORS Name Changes the color attributes of the Name channel Background Cursor from the Monitor component Grid Line Text SREC fileName offset Loads a memory block in S Record format TUPDATE on off Switches on off time update for statistics UNFOLD Unfolds a source block UPDATERATE rate Sets the data and memory update mode ZOOM address in out Zooms in out a variable Command Syntax Terms The following lists includes all relevant syntax terms address A number matching a memory address This number must be in ANSI format i e or Ox for hexadecimal value 0 for octal Example 255 0377 OxFF FF NOTE address can also be an expression if constant address is not specifically 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 or numerical constants S12 X Debugger Manual 507 Debugger Engine Commands Commands Overview 508 Example DEFINE IO_PORT 0x210 WB IO PORT OxFF range A composition of two addresses to define a range of memory addresses Syntax is shown below address address or address size where size is an ANSI format numerical constant Example Ox2F00 0x2FFF Refers to the memory range starting at 0x2F00 and end
559. range starting at 0x8000 and ending at 0x8007 as longword 4 byte values in gt DL 0x8000 2 8000 FE8045FD 80432710 Displays the content of two longwords starting at 0x8000 as longword 4 byte values Memory longwords appear in the Command Line component window DUMP The DUMP command writes names of all visible items in the Data component and MCURegisters component to the command line component In MCURegisters component if the visible item is a register item its name and value are written Usage DUMP Components Data and MCURegisters component Example 1 in Data 1 DUMP Example 2 in MCURegisters 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 you specify a size in the range this size represents the number of words to display in the command line window Stop this command by pressing the Esc key S12 X Debugger Manual 545 Debugger Engine Commands Debugger Commands 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 this command displays the address of the first word When you omit address and range
560. rating can cause irregularities that affect 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 The End of Period Time represents the number of bus clock cycles remaining before the counter is reset The End of Duty Time represents the number of bus clock cycles remaining before the output changes state In center aligned mode The End of Period Time represents the number of bus clock cycles remaining 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 remaining before the output changes state An End of Duty Time is set after the end of each Period Event Table 10 14 Simulated PWM Registers Register Full Register Name Simulated Fields Acronym PWME PWM Enable Register PWME7 0 PWMPOL PWM Polarity Register PPOL7 0 PWMCLK PWM Clock Select Register PCLK7 0 PWMPRCLK PWM Prescale Clock Select Register PCKB2 0 PCKA2 0 PWMCAE PWM Center Align Enable Register CAE7 0 298 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Table 10 14 Simulated PWM Registers contin
561. ration window Open the window with the Source Memory or Data window context 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 Click the right mouse button 3 Select Show Watchpoints from the window s context menu 4 Click the left mouse button The ControlPoints Configuration window appears with the Markpoints tab of this window exposed as shown in Figure 4 6 Figure 4 8 Source Window Context Menu Set Breakpoint Run To Cursor Show Breakpoints Show Location Set Markpoint Show Markpoints Set Program Counter Open Source File Go To Line Ctrl G Find Ctrl F Find Procedure Ctri41 Folding gt Freeze Marks ToolTips b S12 X Debugger Manual 187 Control Points Markpoints Figure 4 9 Memory Context Menu Set Watchpoint Show Watchpoints Set Markpoint Show Markpoints Show Location Word Size Format Mode Display Fil Address Search Pattern vvv Refresh Figure 4 10 Data Context Menu 188 Open Module Add Expression Set Watchpoint Set Markpoint Show Markpoints Show Location Zoom LI Scope b Format LI Mode Options b S12 X Debugger Manual Control Points Markpoints Figure 4 11 Controlpoints Configuration Window Markpoints Tab Controlpoints Configuration Mar
562. re 3 2 select the desired component NOTE To open more than one component select multiple components Figure 3 2 Open Window Component Window Open Window Component Icon List Details ej Recorder En Command Register f Commaster s Source Z Coverage Ek Stimulation RAI Dac Terminal Data Trace Hes 2xadrmap B winlift Inspect E Memory If Module p Procedure amp Profiler B Ddemasl Visualizationtool Help H Browse 3 In the Open Window Component window use the mouse to select a component 54 S12 X Debugger Manual Debugger Components General Debugger Components 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 descriptions Multiple Component Windows If you load a project that targets both HC12 and XGATE cores the Debugger shows 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 Sourc
563. re information see the Terminal section in the ABATRON User Manual and check the termbgnd c source file for communication primitives on the BDI installation disk from ABATRON Refer to Terminal Component Example The following structure is located in unpaged data memory on the target 0x00 RX Flag Byte S12 X Debugger Manual 393 Abatron BDI Connection Terminal Emulation 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 section While the target is running the BDI periodically checks to make sure TX String Pointer is not zero The BDI writes characters received from the host to RX Char and sets RX Flag The following is a possible target implementation Listing 15 1 CPU12 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
564. reaches 10 000 000 Example of a Larger Stimulation File Listing 10 6 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 LED instrument 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 330 S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection True Time I O Stimulation Listing 10 6 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 ae ERIODICAL 100000 10 10000 a 128 30000 RAISE 7 3 test interrupt END 1000000 RAISE 7 3 test_interrupt Detailed Explanation def TargetObject 210 B o Il This code defines a as byte mapped at address 0x210 in TargetObject def x TargetObject 212 This code defines x as byte mapped at address 0x212 in TargetObject Size can be omitted B for byte is default def b TargetObject 216 W This code defines b as word W mapped at address 0x216 in TargetObject def c TargetObject 220 L This code defin
565. reakpoints without attempting to try to use BGND software breakpoint patching 662 S12 X Debugger Manual Connection Specific Commands Other Hardware Connection Commands TIP Use this command when implementing and debugging flash programming algorithms executed from Flash This avoids the Flash access error flag caused by a BGND instruction write attempt in the array Syntax HWBREAKONLY OFF ON STATI Ei TIP For some connections this command might be associated to a GUI checkbox in the connection setup dialog Example HWBREAKONLY ON ISRDISABLEDSTEP Description This command forces the debugger to disable maskable interrupts while stepping by setting the CCR I bit each time some assembly or single steps occur The debugger cares about setting back the flag to its initial state based on the results of the stepped instruction that might also affect the I flag NOTE The debugger corrects the I flag stacking according to the initial flag value TIP For some connections this command might be associated to a GUI checkbox in the connection setup dialog Syntax ISRDISABLEDSTEP OFF ON STATE Example ISRDISABLEDSTEP ON S12 X Debugger Manual 66 49 Connection Specific Commands Other Hardware Connection Commands 664 S12 X Debugger Manual Connection Specific Commands Other Hardware Connection Commands S12 X Debugger Manual 665 Connection Specific Commands Other Hard
566. record SREC command NOTE If no path is specified the destination directory is the current project directory Usage SAVE range fileName offset A offset an optional offset to add or subtract from addresses when writing S records The default offset is 0 586 S12 X Debugger Manual Debugger Engine Commands Debugger Commands A appends the saved S records to the end of an existing file If the file specified by fileName exists then omitting this option clears the file before saving the S records Components Debugger engine Example in gt SAVE 0x1000 0x2000 DUMP SX A Appends the memory range 0x1000 0x2000 to the DUMP SX file SAVEBP The SAVEBP command saves all currently loaded ABS file breakpoints into the matching breakpoints file The matching file has the name of the loaded ABS file but with the BPT extension 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 Setting on stores all breakpoints defined in the current application into the matching BPT file Setting off prevents the breakpoints defined in the current application from being stored in the matching BPT file Use this command only in BPT files It is similar to the Save amp Restore on load checkbox in the Controlpoints Configuration Window which is used to store curr
567. recording options described in Table 17 4 Figure 17 22 Change of Flow Recording Control 422 Trigger Module Settings Trigger settings Expert triggers General settings Instruction at Address A or Address B is executed Triggers Address Settings Address A O0 3C8011 Instruction opcode fetch Modify Trigger Address B 0x3C8015 Instruction opcode fetch Modify Trigger B Record continuously and halt on trigger hit v FIFO Normal mode Record continuously and halt on trigger hit Record continuously and DO NOT halt on trigger hit Start recording after trigger hit and halt when fifo is full L Start recording after trigger hit and DO NOT halt when fifo is full d In Normal mode the DBG module will record program change of flow or data value ram counter at Address Cancel Help S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Option Record continuously and halt on trigger hit Trigger Module Settings Window Table 17 4 Recording Options in Trigger Settings Tab Description Begins recording program flow information immediately after run Halts processor debugger when trigger condition match occurs Record continuously and DO NOT halt on trigger hit Begins recording program flow information immediately after run Does not halt the processor debugger when trigger condition match occurs Start recording after trigger hit and halt when the FIF
568. red processor 2 Use the Connection context menu to select the desired connection A text panel displays information about the selected connection NOTE When a connection cannot be loaded the combo box displays the path where the missing d11 must be installed 3 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 How To section of this manual Window Menu In this menu shown in Figure 2 20 you can set the general arrangement of the component windows Figure 2 21 shows the Submenu Window Options and Figure 2 22 shows the Submenu Window Layout S12 X Debugger Manual 43 Debugger Interface Debugger Main Window Figure 2 20 Window Menu Tile Arrange Icons Options b Layout gt v 1 Source 2 Assembly 3 Procedure 4Register 5 Memory 6 Data 1 7 Data 2 8 Command Figure 2 21 Window Menu Options Submenu v Autosize v Component Menu Figure 2 22 Window Menu Layout Submenu Load Store Table 2 7 describes the Window menu entries Table 2 7 Window Menu Description Menu entry Description Cascade Use to arrange all open windows in cascade overlapping Tile Use to display all open windows in tile format non overlapping Arrange Icons Arranges icons at the bottom of windows Options Component windows always fit into debugger window when you Autosize modify debugger window size
569. rget is installed the following error message appears Error no target is installed If no target is connected the following error message appears Error no target is connected Usage LOAD applicationName or LOAD applicationName CODEONLY SYMBOLSONLY NOPROGRESSBAR NOBPT NOXPR NOPRELOADCMD NOPOSTLOADCMD VERIFYFIRST VERIFYAL VERIFYON Y AUTOERASEANDFLASH NORUNAFTERLOAD RUNANDSTOPAFTERLOAD functionName RUNAFTERLOAD DELAY ADD_SYMBOLS S12 X Debugger Manual 565 Debugger Engine Commands Debugger Commands 566 Where applicationName is the name of the application to load CODEONLY and SYMBOLSONLY loads only the code or symbols NOPROGRESSBAR loads the application without progress bar NOBPT loads the application without loading breakpoints file with BPT extension NOXPR loads the application without playing Expression file with XPR extension NOPRELOADCMD loads the application without playing PRELOAD file NOPOSTLOADCMD loads the application without playing POSTLOAD file Ij e DI AY loads the application and waits one second e Vi Ej RIFYFIRST matches the First bytes only code verification option VERIFYALL matches the All bytes code verification option VERIFYONLY matches the Read back only code verification option RUNAFTERLOAD runs application after loading RUNANDSTOPAFTERLOAD runs app
570. rget manual for details ini File Activation Activating a project file PROJECT INI initiates the following actions from first action to last Closes the old Project file Unloads the Target Component Adds the environment variable Path from the Project file Select HI WAVE section from which to retrieve the value S12 X Debugger Manual Debugger Engine Environment Variables Local Configuration File usually project ini If you can retrieve aWindows0 or Target entry from the HI WAVE section then use HI WAVE If you can retrieve aWindows0 or Target entry from the DEFAULTS section then use DEFAULTS Otherwise use HI WAVE The debugger loads the environment variables from the default env file If an entry Layout 111 exists the debugger loads and executes the layout file 111 hbwl The debugger sets the target if entry Target ttt exists load target ttt If an entry Project ppp exists the debugger executes the ppp command file The debugger loads the configuration file hwc 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 DirectoryName Example GENPATH C INSTALL LIB D PROJECTS TESTS usr local hiwave lib home me my project
571. rget section ICD12 GDI SETTINGS CHIPSECURE CHIPSECURE ETUP OxFFOF 0x3 0x2 Uu CHIPSECURE Description The CHIPSECURE variable specifies the HCS12 Unsecure mechanism setup using a CHIPSECURE Command Line command Syntax CHIPSECURE CHIPSECURE SETUP Command Line command Example CHIPSECURE CHIPSECURE SETUP OxFFOF 0x3 0x2 S12 X Debugger Manual 691 Connection Specific Environment Variables On Chip Hardware Breakpoint Module Environment Variables On Chip Hardware Breakpoint Module Environment Variables This section describes the Hardware Breakpoint Settings environment variables used by the Target Interface These variables are HWBPD MCUIDnnn BKPT REMAPn HWBPMn These variables are stored in the targetName GDI SETTINGS section Listing 25 4 Example of the ICD12 target section from a project file ICD12 GDI SETTINGS HWBPD MCUID3C7 BKPT R HWBPD MCUID3CA BKPT R HWBPD MCUID3CA BKPT R Ej B B MAP1 HWBPM MAPO HWBPM MAP1 HWBPM HWBPMO HWBPM MODE AUTOMATIC BPM16BITS 0x28 SKIP OFF HWBPM1 HWBPM SET16BITS HWBPM2 HWBPM SET22BITS HWBPD MCUID3C6 BKPT REMAPO HWBPM HWBPD MCUID3C6 BKPT REMAP1 HWBPM HWBPD MCUID3C7 BKPT REMAPO HWBPM 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 REMAP_22BITS RANGE 0x4000 Ox7FFF 0x3E REMAP 22BITS RANGE 0xC000 OxFFFF Ox3F REMAP 22BITS RANGE 0x4000 Ox7FFF Ox3E REMAP 22BITS RAN
572. ribe typical objects their attributes and their presentation NOTE Objects and their attributes depend on the OSEK implementation and OSEK configuration and therefore may differ from this description S12 X Debugger Manual Real Time Kernel Awareness OSEK Kernel Awareness Inspector Task The Task shown in Figure 5 1 displays the current state of the OSEK task trace Figure 5 1 Inspector Task f Inspec t True Tene MotorDrive Task WAITING x x UP EVENT S MotorDriveTask EXTENDED F Sy ControlTask e a WAITING hi x KEY EVENT ConkrolTask STACK EXTENDED F 99 InkTask 3 SUSPENDED 0x x MAIN STACK BASIC NONP 93 InputTask R SUSPENDED x x MAIN_STACK BASIC FULL 33 LockTask SUSPENDED Ox x MAIN STACK BASIC FULL When selecting a Task in the hierarchical tree on the left side of the Inspect window additional information concerning tasks appears 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 SUSPENDED WAITING RUNNING or INVALID TASK The ORTI file defines the different states Events State the event is represented by its mask The event mask is a number in the range from 1 to OXFFFFFFFF Setting the event mask value to 1 activates the event Clearing the event mask value to 0 disables the event Waited Eve
573. rnal functions are indicated by a line and an icon symbol of the function attached CPU and Port 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 modules Creating PWM Bean Select Bean Categories gt CPU internal peripherals gt Timer gt PWM 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 checkmark indicates if the named methods or event is selected and a red cross indicates that code has not been generated Locate the previously created bean with the name PWM8 PWM under Beans Bean Inspector PWM8 PWM In this window you can modify the behavior of the bean to your needs Modify general settings in the Properties tab Modify software drivers under the Methods tab and the Events tab 1 Select Properties tab 2 Select Period and enter 100 ms 3 Select Starting pulse width and enter 10 ms Generate Driver Code Now we will 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 displays several messages One message indicates that we have started the
574. ron BDI connection 615 Flash 617 NVMC 617 Communication Abatron BDI 389 Serial 382 Setting speed 217 with application 245 Communication Device Specification dialog 391 Communication option 368 Communication Connect option 354 COMn 391 Compare 314 Compiler configuration DA C 258 Compiler settings DA C 258 Compiler bmp default bitmap 258 COMPLEMENT DATA Component 517 Memory Component 519 Register Component 514 Component Assembly 55 234 235 Command Line 61 Connection 53 Context menu 46 Coverage 65 705 CPU 53 DA C 264 DA C link 68 Data 70 238 Debugger kernel 53 Framework 26 Global Data 234 Inspect 135 Local Data 234 Main menu 45 Memory 89 243 Menu 42 Module 102 Object Information bar 46 OSEK RTK Inspector 202 Procedure 103 Profiler 105 Recorder 109 Register 111 234 241 Source 114 234 235 Stimulation 318 Terminal 245 TestTerm 245 VisualizationTool 143 Window 53 Component files 46 Component windows layout 27 Component associated menus 45 COMPOPTIONS 669 COMPRESS 687 Compression 393 687 Conditional Breakpoints 173 Control points 193 Configuration file 385 Configuration menu entry 30 Configuration Tool 383 Configuration window 31 Configure BDI Box 383 390 Configure menu entry 272 Configuring Compiler 258 Debugger 207 232 247 Linker 259 706 Maker 260 Connect 389 Connection Switching 212 232 Connection component 53 54 Connection menu 37 Entri
575. rt J Pull Up Pulldown Select Register Implemented Meaning 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 FCS does not implement Port D register mapping in wide expanded modes or in special expanded narrow mode with the MODE Register bit EMD set Memory Mapped Page Registers Table 10 22 describes the memory mapped page registers Acronym Port F Register Full Name Implemented Meaning CS Chip Select General Purpose I O Bits 0 6 Not implemented no physical outputs Port G Register ADDR Memory Expansion Not implemented no physical outputs General Purpose I O Bits 0 5 DDRF Port F Data Direction Not implemented no physical outputs Register Bits 0 6 DDRG Port G Data Direction Not implemented no physical outputs Register Bits 0 5 PDA Data Page Selects the data page PPA Program Page Selects the program page PEA Extra Page Selects the extra page Window Definition Registers DWEN Data Window Enable Enables paging of data space S12 X Debugger Manual HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 22 Memory Mapped Page Registers continued Non Supported Modules A D Converter Device ADC Acronym Full Name Implemented Meaning PWEN Program Win
576. running Accumulated elapsed time will not be affected and a new cycle time is applied to next simulated instructions in real time Open the Clock Frequency Setup dialog Simulator Clock Frequency menu entry to set enter or edit either the oscillator frequency or the CPU frequency However the frequency saved in the project is the oscillator frequency Two radio buttons allow you to choose whether cycles or true time displays in the debugger status bar Unchecking Reset cycles time makes the debugger accumulate cycles time other than CPU reset The true time unit is the microsecond The TRUETIME debugger command line command gives the time as a number in microseconds The OSCFREQUENCY variable displays sets the oscillator frequency Bus Trace The FCS can record all executed instructions and memory accesses in the Trace component up to one million frames To enable recording open the Trace component and use the Trace menu context sensitive menu S12 X Debugger Manual 281 HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu NOTE Refer to the HCS12 or HCS12X Onchip DBG Module manual for Trace window common functionality and common menu entries Figure 10 9 Trace Window Context Menu Set Time Base Show Location v Textual Graphical Instructions Items Dump Go to Frame Enabled Records memory accesses Clear By default the FCS records instructions only faster Check Record memory acc
577. ry 36 Size menu entry 147 Size of Port 149 SKIPILLEGALBREAK 688 SLAY 589 SLINE 590 Sloping 157 Small Borders menu entry 33 Small memory model 228 SMEM 590 SMOD 591 SofTec HCS12 Connection 367 Selection 218 Software demonstration 143 Sort menu entry 73 Source code folding 118 Source code unfolding 118 Source component 114 234 235 Source context menu 119 Source file opening dialog 120 Source menu 118 Source modules 102 SPC 592 Split view 65 Split view context menu 67 SPROC 592 SREC 593 Stack inspecting 195 Start 110 472 Start recording 441 Start recording after trigger hit and DO NOT halt when the FIFO is full 422 423 and halt when the FIFO is full 422 423 Start Continue menu entry 36 Starting an Application 235 Startup 669 Startup code selecting 231 Startup command file 41 Startup command file executing 41 S12 X Debugger Manual Startup Init List 385 startup cmd file 246 Executing 246 State 472 States 472 Statistics 107 Status bar 29 416 Status Bar menu entry 33 Status register bits displaying 111 Step In 235 Assembly instruction 237 Source Instruction 236 Step Out Function Call 237 Step Out menu entry 36 Step Over Function call flat 236 Step Over menu entry 36 STEPINTO 594 STEPOUT 594 STEPOVER 595 STEPPED in status line 236 Stepping functions Assembler level 235 Source level 235 Stimulation 314 Stimulation Menu 319 STOP 596 Stopping an Application 235 Switch Color 156 Symbolic menu e
578. s Programmable Parallel Couplers component Example in gt CPORT 0x100 0x200 0x300 This defines the ports of the programmable parallel couplers at addresses 0x100 0x200 and 0x300 DELCHANNEL Use the DELCHANNEL command to delete a specific channel for the Monitor component S12 X Debugger Manual 633 Connection Specific Commands Full Chip Simulator Commands Syntax DELCHANNEL Name Arguments Name the name of the channel to delete Components Monitor component Example in gt DELCHANNEL Leds Port_Register bit 0 Deletes the channel Leds Port_Register bit 0 in the Monitor component ITPORT 634 Use the ITPORT command to set the line and column port addresses of the IT Keyboard component Syntax ITPORT address ident address ident address ident Arguments Address locates the port address value of the component The default format is hexadecimal various formats are allowed Ident a known identifier Its content defines 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 S12 X Debugger Manual Connection Specific Commands Full Chip Simulator Commands ITVECT Use the ITVECT command to set the interrupt vector port address of the IT_Keyboard component Syntax ITVECT address ident Arguments Address locates the port ad
579. s Then the ENDFOCUS command releases the Assembly component and the FOCUS Source command redirects the second ATTRIBUTES command to the Source component Marks appear in the Source window ENDFOR The ENDFOR keyword is associated with the FOR command Usage ENDFOR Components Debugger engine S12 X Debugger Manual 549 Debugger Engine Commands Debugger Commands Example for i 1 5 define multi5 5 i endfor After the ENDFOR instruction i equals 5 ENDIF The ENDIF keyword is associated with the IF command Usage ENDIF Components Debugger engine Example if CUR CPU 12 DW amp counter else DB amp counter endif ENDWHILE The ENDWHILE keyword is associated with the WHILE command Usage ENDWHILE Components Debugger engine 550 S12 X Debugger Manual Debugger Engine Commands Debugger Commands Example while i 5 define multi5 5 i define i i 1 endwhile After the ENDWHILE instruction i equals 5 EXECUTE In the Stimulation component the EXECUTE command executes a file containing stimulation commands Refer to the I O Stimulation documentation Usage EXECUTE fileName Components Stimulation component Example in gt EXECUTE stimu txt EXIT In the Command line component the EXIT command closes the Debugger application Usage EXIT Components Debugger engine Example in gt EXIT
580. s Visualization Utilities Figure 3 91 Inspect Component Window Fi ins pect J Components InitValue Flags WatchPoints 0 000000 Long NotifyAnyChanges NotMem gt BreakPoints 0 000000 Long NotifyAnyChanges NotMem Bl stack 22 Symbol Table Events The hierarchical content of the items displays in a tree structure Select any item on the left side and additional information displays on the right side In the figure above for example the Object Pool is expanded The Object Pool contains the TargetObject which contains LEDs and Swap peripheral devices Select the Swap peripheral device to display Swap device registers Components Icon Select the components icon in the Inspect window as shown in Figure 3 92 and the right side displays various information about all loaded components A Component is the unit of dynamic loading therefore all windows the CPU the connection and perhaps the connection simulator are listed Figure 3 92 Inspect Window Components Icon 136 AB6 2 VER Stack Icon The Stack icon shown in Figure 3 93 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 S12 X Debugger Manual Debugger Components Figure 3 93 Inspector Window Stack Icon R Inspect Z Components WatchPoints gt BreakPonts Bl Stack 99 Symbol Table Events
581. s 266 Book Il HC S 12 X Debug Connections Book II Contents 7 5 uec CEPS REN GR NA Se cates 269 10 HC S 12 X Full Chip Simulation Connection 271 Technical Considerations 0 0 ccc eee RR III 271 Full Chip Simulation Menu 0 0 00 eee ee 271 Memory Configuration llle 275 Clock Frequency Setup 0 02 cece cee ee 281 Bus Tracie CERE a UE Ghee oe Bie we SA ee De EE 281 S12 X Debugger Manual 7 Table of Contents Full Chip Simulation Warnings 00 0 eese 283 FCS and Silicon On Chip Peripherals Simulation 284 Supported HC S 12 X Derivatives lsseeeeeeeee eee 285 Communication Modules leseleeee eee 285 Analog to Digital Converter Module 00 000005 288 Memory Modules sseleeeeeee eh 289 Miscellaneous Modules 2 0 0 0 c eee cece ee eens 290 Port T O Modules cese tet ete ee eR eR 291 Timer Modules ss oe ke aes x pet ede ee eh waa aS 292 Legacy HC12 CPU12 Derivatives Simulation 300 FCS Visualization Utilities 318 Stimulation Component 1 0 0 0 ee eee eee 318 Terminal Component 0 0 0 0 eee eee e 320 True Time I O Stimulation 2 0 00 0 0 0 eee eee 325 Stimulation Program Examples 0 000 eee ee eee eee 325 Stimulation Input File Syntax 0 0 2 eee eee 333 Electrical Signal Generators and Signals Application to Device Pins
582. s Break Module anly S12 X Debugger Manual 491 On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog Breakpoint Module Mode The Mode combo box allows you to select one of three different modes Disabled Automatic controlled by debugger and User controlled see Figure 21 2 This dialog allows you to set up the hardware breakpoint module of your HC12 or HCS12 derivative Figure 21 2 Hardware Breakpoint Configuration Breakpoint Module mode 492 Hardware Breakpoint Configuration Break Module Settings 16 bits Break Module User Mode 22 bits Break Module User Mode r Breakpoint Module Mode Breakpoint Module mode Automatic controlled by debugger r Breakpoint Module Description User controlled Breakpoint Module kind use 22 Bits Break Module Breakpoint Module base address hex 28 Continue an illegal break banked hardware breakpoint 16 bits Break Madule anly NOTE This feature is available only if the HC S 12 X derivative is connected to the device via a P amp E hardware interface and also has an embedded hardware breakpoint module Check your MCU documentation Disabled mode In Disabled mode it is not possible to set a breakpoint in Flash or in EEPROM It is also not possible to set any watchpoint even if the application is loaded in RAM NOTE Some actions like stepping over or stepping out use one internal breakpoint and theref
583. s manual defined to access device memory The Type column displays the memory type for a given range corresponding to the memory address range in the Range column The Range column gives the memory address range The Active column indicates whether the defined range is active or mapped by the DMM If No the DMM considers the range undefined NOTE The DMM considers all undefined memory ranges as inaccessible or unimplemented The debugger displays some dashes in the Memory window in that case The DMM NEVER attempts to read or write unimplemented memory The Comment column contains information about the defined memory address range The scrollable Information window gives a general diagnostic of the DMM This diagnostic has less information then the edit mode diagnostic Clicking the New button opens the Debugging Memory Map dialog box to create a new memory address range 456 S12 X Debugger Manual Debugging Memory Map Debugging Memory Map GUI Clicking the Modify Details button opens the Debugging Memory Map dialog of the selected memory address range to modify it More memory range information appears in the dialog and an enhanced diagnostic is also displayed Clicking the Delete button leads to memory range removal after a warning dialog Cliking the Revert to default button removes after a warning dialog the current setup usually saved in the current project and retrieves the default factor
584. s the SofTec HCS12 connection it communicates and debugs HCS12 HCS12X and XGATE core based hardware through the SofTec in circuit debugger programmer units SMH Technologies HCS12 ISP Debuggers Programmers inDART Series Starter Kits AK SK PK ZK and newer Series Refer to the inDART HCS12 In Circuit Debugger Programmer for Freescale HCS12 Family Flash Devices User s Manual from SMH Technologies for communication hardware requirements and SMH Technologies product installation Connection Menu Setting the SofTec HCS12 connection changes the connection menu entry in the debugger main toolbar to inDART HCS12 inDART HCS12 Menu Entries Figure 13 1 shows the inDART HCS12 menu entries and Table 13 1 describes their use S12 X Debugger Manual 367 SofTec HCS12 Connection Connection Menu Figure 13 1 inDART HCS12 Menu Entries True Time Simulator amp Real Time Debugger File View Run Bie aul amp Source DAProflesvsKr Communication a include lt Command Files include lt pragma LI Component Memory Winc os Load Ctrl L Reset Ctrl R g Setup n m t Debugging Memory Map z Trigger Module Settings Bus Trace void main Flash put y MCU Configuration Table 13 1 inDART HCS12 Menu Entry Descriptions 368 Menu Entry Description Load Displays Load Executable File dialog box see Load Executable File Window Reset Resets project
585. s the analog instrument attributes 152 S12 X Debugger Manual Debugger Components Visualization Utilities Table 3 56 Analog Instrument Attributes Attribute Low Display Value Description Defines zero point of the indicator Values below this definition are not displayed High Display Value Defines highest position of the indicator the value at which indicator reads 100 Indicatorlength Defines length of the small indicator Minimal value is set to 20 Indicator Defines color of the indicator Default color is red Marks Defines color of the marks Default color is black Bar Instrument Using the Bar instrument values are displayed by a bar strip This instrument see Figure 3 103 may be used as a position state of a water tank Figure 3 103 Bar Instrument Table 3 57 shows bar instrument attributes Table 3 57 Bar Instrument Attributes Attribute Low Display Value Description Defines zero point of the indicator The values below this definition are not displayed High Display Value Defines highest position of the indicator the value at which the indicator reads 100 Bardirection Sets desired direction of the bar that displays the value Barcolor Specifies color of the bar Default color is red Bitmap Instrument You can use the Bitmap instrument to give a special look to your visualization or to display a
586. s 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 and the action to be performed when an alarm expires Notified Task defines the task to be notified by activation or event setting when the alarm expires Event to Set alarm management allows the user to link event setting to a certain counter value the assignment of an alarm to a counter and 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 Inspect Message The Message shown in Figure 5 4 displays the current state of OSEK message trace Figure 5 4 Inspect Message jel ny Message Type Notified Task Event to be set 43 Msg Input UNQUEUED ControlTask KEY EVENT 88 Msg Lock UNQUEUED LockTask When selecting Message in the hierarchical tree on the left side additional information concerning task appears on the right side Name displays the name of the message Message Type displays message type Possible values are UNQUEUED QUEUED Notified Task displays the task that activates when the message is sent Event to be set displays the event to set when the message is sent S12 X Debugger Manual 205 Real Time Kerne
587. secure Debugging Memory Map Trigger Module Settings Bus Trace Flash Reset to Normal Mode Show Status Set Speed Select HC12 MCU Table 16 1 TBDML HCS12 Menu Entries 396 Menu Entry Description Load Option Displays the Load Executable File dialog box See Load Executable File Window Reset Option Resets the project hardware and software Setup Displays the TBDML Setup dialog box select appropriate TBDML cable for current debug session When debugging with several cables and debuggers Cable number is relative to connection order to PC s USB hub At each new debug session check which device the project addresses as there is no way to ensure addressing the same cable with the same project Select Displays Set Derivative dialog box Allows you to choose target MCU Derivative for TBDML connection S12 X Debugger Manual TBDML Connection Connection Menu Table 16 1 TBDML HCS12 Menu Entries continued Menu Entry Command Files Description Displays Connection Command Files window Each tab allows access to a different set of connection command files cmd TBDML_startup cmd NcmdNTBDML reset cmd cmd TBDML_preload cmd cmd TBDML_postload cmd cmd TBDML_vppon cmd cmd TBDML_vppoff cmd cmd TBDML_erase_unsecure_hcs12 cmd Normal Mode Unsecure Runs the Unsecure command file script of the project The Unsecure script mass erases targ
588. select what you want to display You can also specify a range to be logged in your file Usage FILTER Options lt range gt Options modules functions lines modules displays modules only functions displays modules and functions lines displays modules functions and code lines Range a number between 0 and 100 Components Coverage component Example in coverage FILTER functions 25 75 FIND In the Source component use the FIND command to search for a specified pattern in the source file currently loaded and highlights the pattern if found Search forward default backward B match case sensitive MC or match whole word sensitive WW The operation begins at the currently highlighted statement or from the beginning of the file if nothing is highlighted If the item is found the Source window scrolls to the position of the item and the highlights the item in grey Equivalent Operation You can select Source gt Find or open the Source context menu and select Find to open the Find dialog S12 X Debugger Manual 553 Debugger Engine Commands Debugger Commands Usage FIND string B MC WW Where string is the pattern to match You must enclose string in quotes See the example below B searches backwards default is forwards MC matches case sensitive WW matches on the whole word Components Source component Example in FIND this B WW Searches for t
589. ses 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 off such linker optimizations Figure 3 10 Coverage Window F3 Coverage El calc c Eval Echo terminal c El termport 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 A red check mark is displayed in front of each source or assembler instruction that has been executed Split views are removed when the Coverage window is closed or by selecting Delete in the split view context menu Figure 3 11 Split Views Coverage Operations Click the fold unfold icons EH EJ to unfold fold the source module and display hide the functions defined S12 X Debugger Manual 65 Debugger Components General Debugger Components Coverage Menu The Coverage menu and submenus are shown in Figure 3 12 Figure 3 12 Coverage Menu Reset Source Details Assembly v Giaphics Timer Update Filler Output Fie SaveAs 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 graphic bars Timer Update Switches periodic update on or off If activated updates statistics each second O
590. sing Configure Connections in the context menu of the terminal component This opens the dialog box shown in Figure 3 81 Figure 3 81 Configure Terminal Connections Dialog Box 126 Configure Terminal Connections Detaut Coroana Connections From z Taf z Input File gt Vitual SCI Keyboard gt Virtual SCI Virtual SC gt Display Virtual SCI gt Output File Serial Port Virtual SCI Virtual SCI Input P t Sci0 SeriaIOutput Baud Rate Virtual SCI Output Port ScOSeianpa 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 list boxes and then click the Add button The new connection then appears in the list below which shows all active connections To remove connections select them in the list of active connections and click the Remove button In the Serial Port section you can specify which serial port to use and its properties This is only possible if there is at least one connection from or to the serial port If a connection from or to the virtual SCI port has been chosen it is also possible to specify in the Virtual SCI section which ports will be taken as v
591. sion Limitations Displays only two modules Procedure Component The Procedure window shown in Figure 3 56 displays the list of procedure or function calls that have been made up to the moment the program halts This list is known as the procedure chain or the call chain S12 X Debugger Manual 103 Debugger Components General Debugger Components Figure 3 56 Procedure Window H Procedure fibo c Address 8055 main Startup In the Procedure component window entries in the call chain display in reverse order from the last call most recent on top to the first call initial on bottom Types of procedure parameters are also displayed The Object Information bar of the component window contains the source module and address of the selected procedure Procedure Operations Double clicking on a procedure name forces all open windows to display information about that procedure the Source component window shows the procedure s source the local Data component window displays the local variables and parameters of the selected procedure The current assembly statement inside this procedure is highlighted in the Assembly component NOTE When a procedure of a level greater than 0 the top most is double clicked in the Procedure component the statement corresponding to the call of the lower procedure is selected in the Source window and Assembly window Procedure Menu Figure 3 57 shows the Procedure menu and Table 3 3
592. sition local or global variables and the values that 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 Choose Run Step Over Click the Step Over icon from the Debugger tool bar z STEPPED OVER STEPOVER or STOPPED STOP in the status line indicates that the application is stopped by a step over function 236 S12 X Debugger Manual How To Stepping in the Application If the application was previously stopped on a function invocation a Step Over stops the application on the source instruction following the function invocation The display in the Assembly component is always synchronized with the display in the Source component The highlighted instruction in the Assembly component is the first assembler instruction generated by the highlighted instruction in the Source component Elements from Register Memory or Data components that appear in red are the register memory position local or global variables and the values that 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 Choose Run gt Step Out Click the Step Out icon from the debugger tool bar sz STOPPED STOP in the status line indicates that the application is stopped by a step out function If the application was previously stopped in a functio
593. some value fields can be edited by double clicking on them Only accessible values 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 Enter values in hexadecimal with preceding 0x decimal octal with preceding 0 or binary with preceding amp To see the component in the Inspector for example VisualizationTool as shown in Figure 3 98 open the VisualizationTool with the context menu Component Open and then open the Inspector If the Inspector is already loaded select Update from the context S12 X Debugger Manual 139 Debugger Components Visualization Utilities menu in the Inspector Then click on the Components icon to see the Component list which now includes the VisualizationTool component Figure 3 98 Seeing the VisualizationTool in the Inspect Window 13 Inspect Components watcPonts gt BreakPoints BR Stak 92 Symbol Table Q Events 93 RTK 4 Exceptons 1 GP Object Pool E 10 Regster VisualizationTool EditMode Moving X 222 Y 45 W 100 H 20 10 3 fs g a x e en Now you can create the instrument in the VisualizationTool and view it in Inspector Window Use Add New Instrument menu in the VisualizationTool and select required instrument type for example Value as Text please see Visualization Tool Component on page 143 for more details Specify kind of port as Substitute and
594. sor Select to set a temporary breakpoint on specified instruction and continue program execution Disabling a permanent breakpoint at this position disables the temporary breakpoint as well and the program will not halt Temporary breakpoints are automatically removed once reached Show Breakpoints Opens Controlpoints Configuration Window Breakpoints Tab and displays list of breakpoints defined in application refer to Control Points Show Location Select to highlight source statement that generated the specified assembler instruction and the assembler instruction Also highlights the memory range corresponding to this assembler instruction in memory component S12 X Debugger Manual Debugger Components General Debugger Components Table 3 2 Assembly Context Menu Description continued Menu Entry Description Set Markpoint Select to set a markpoint at this location Delete Appears in context menu only if a markpoint is set at the nearest Markpoint code position visible with marks When selected disables markpoint Show Opens Controlpoints Configuration Window Markpoints Tab and Markpoints displays list of markpoints defined in application refer to Control Points Address Table 3 1 describes remaining context menu entries Retrieving Source Statement Retrieve a source statement using one of these methods Point to an instruction in the Assembly component window drag and
595. splayed in the title bar of the dialog For some connections the CPU core might be displayed instead of the processor name Types are internal rules to read and write a kind of memory For example the HCS12 banked type requires first setting a register called PPAGE to read the memory then restoring this value as it was before reading Also this banked type does not physically S12 X Debugger Manual Debugging Memory Map Debugging Memory Map GUI provide a memory access while running Memory access while running is possible in physical memory RAM registers Figure 18 3 Debugging Memory Map Dialog Box Type List Menu MC9S12XEP100 Debugging Memory Map v Enable memory module active Start 22 End 23 hex accesskind write v Type physical ad physical Priority no memory access while running V refresh memory when halting ers Information memory range from 0x22 to 0x23 is of physical type therefore accessed directly in device physical memory 0x0 Oxffff Each time the debugger is stopped or reset the memory data is retrieved from hardware lt is protected from being read OK Cancel NOTE CPU core specific memory types and Priorities are listed at the end of this manual section Priorities The Priority list menu provides all of the memory overlap priority available for a type of processor core The debugger can have a higher priority highest debugger to set up an upper address
596. sponse ERRORS Error messages NOTICES Asynchronous event notices such as breakpoints Where state is on or off state is the new state of type When ON enables logging of the type When OFF disables logging of the type S12 X Debugger Manual Debugger Engine Commands Debugger Commands Components Debugger engine Example LOG ERRORS OFF CMDLINE on Does not record error messages in the Log File Records commands entered in the Command Line component window Logging of IF FOR WHILE and REPEAT When commands executed from a command file are logged all executed 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 Example 1 Executing the following command file define truth 1 IF truth bckcolor blue at 2000 bckcolor white else bckcolor yellow at 1000 bckcolor white ENDIF Generates the following log file define truth 1 IF truth bckcolor blue at 2000 bckcolor white lelse bckcolor yellow at 1000 bckcolor white ENDIF S12 X Debugger Manual 569 Debugger Engine Commands Debugger Commands When commands executed from a command file are logged all executed commands that are in the FOR loop are logged the nu
597. ssage 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 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 Another way to load an FPP parameter file is by clicking the Browse button This brings up a standard Open dialog box which you can use to select the file When you do so the Open dialog box disappears and the NVMC utility loads the file automatically clearing the Auto select according to MCUID checkbox In case of any error during loading the utility displays an appropriate message Figure 19 7 Open Dialog Box Look in Fpp befaul tpp s M fpp s Mcu03c3 fpp amp Mcu03c4 fpp amp McuDe33 fpp E Files of type Flash monitoring file pp E Cancel If you check the Auto select according to MCUID checkbox the NVMC utility searches for and loads the corresponding FPP parameter file 474 S12 X Debugger Manual Flash Programming NVMC Graphical User Interface 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
598. st option If necessary you can set a different option to improve transfer speed or security Set this variable using to the Data Transfer Verification radio buttons of the Setup Dialog Box Syntax VERIFY 0 1 2 3 with O 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 Example VERIFY 1 S12 X Debugger Manual 689 Connection Specific Environment Variables Banked Memory Location Associated Environment Variables Banked Memory Location Associated Environment Variables The following sections describe the Banked Memory Location environment variables used by the Abatron BDI connection These variables are BANKWINDOWn This variable is stored in the targetName section from the project file Listing 25 2 Example of the BDIK target section from a project file BDIK BANKWINDOWO BANKWINDOW PPAG ON 0x8000 0xBFFF 0x30 64 BANKWINDOW1 BANKWINDOW DPAGE OFF 0x7000 0x7FFF 0x34 256 BANKWINDOW2 BANKWINDOW EPAG OFF 0x400 0x7FF 0x36 256 The following sections describe the variable available for this connection BANKWINDOWn 690 Description The BANKWINDOWn variable specifies a command file definition using BANKWINDOW Command Line command Usually three or four of those entries are present in the project file depending on the connection Those variables are
599. stepping functions at the application source level and assembler level Figure 6 30 S12 X Debugger Manual 235 How To Stepping in the Application On Source Level Figure 6 30 Stepping on Source Level 5 True Time Simulator amp Real Time Debugger D Profiles b13819 My Docu DAR Fie View Run HCS12FCS Component Assembly Window Help ela ee lele el Bi Source fox A Assembly DEAR D Profiles b13819 My Documents projectz Line S main EnableInterrupts 388000 ANDCC 239 388002 BRA 0 77 ioe wait forever 388004 OxCO0D please make sure that you never l 388007 OxCOOB a 38800A BEQ 16 38800C PSHY lu On the Next Source Instruction The Debugger provides two ways of stepping to the next source instruction Choose Run gt Single Step Click the Single Step icon from the Debugger tool bar ze STEPPED in the status line indicates that the application is stopped by a step function If the application was previously stopped on a subroutine call instruction a Single Step stops the application at the beginning of the invoked function The display in the Assembly component is always synchronized with the display in the Source component The highlighted instruction in the Assembly component is the first assembler instruction generated by the highlighted instruction in the Source component Elements from Register Memory or Data components that appear in red are the register memory po
600. ster 1 Entire register XGR2 XGATE Register 2 Entire register XGR3 XGATE Register 3 Entire register XGR4 XGATE Register 4 Entire register XGR5 XGATE Register 5 Entire register XGR6 XGATE Register 6 Entire register XGR7 XGATE Register 7 Entire register Port I O Modules The following Port I O modules are not simulated External Bus Interface EBI Module Mapping Control MMC Table 10 11 shows the simulated MMC registers Table 10 11 Simulated MMC Registers Register Full Register Name Simulated Acronym Fields GPAGE Global Page Index Register Entire register DIRECT Direct Page Register Entire register S12 X Debugger Manual 291 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives Table 10 11 Simulated MMC Registers continued Register Full Register Name Simulated Acronym Fields RPAGE RAM Page Index Register Entire register EPAGE EEPROM Page Index Register Entire register PPAGE Program Page Index Register Entire register The following MMC registers are not simulated Miscellaneous System Control Register MTSTO Reserved Test Register Zero 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 ports A B E and K the IRQ and XIRQ signals and the operating
601. t Menu that you can open by right clicking in an active window component Component Main Menu This menu shown in Figure 2 24 is always between the Component entry and the Window entry of the Debugger main window toolbar It contains general entries of the S12 X Debugger Manual 45 Debugger Interface Component Associated Menus current active component Hide this menu by clearing Window gt Options gt Component Menu Figure 2 24 Example of Source Component Main Menu BREET Window rep Open Source File Ctri4G Find Ctrl F Find Procedure Ctrl I Folding L Freeze Marks ToolTips gt Component Files Each component is a windows file with a wnd extension Component Windows Object Information Bar The object information bar of the debugger window shown in Figure 2 25 provides information about the selected object Figure 2 25 Object Information Bar of Debugger Component Windows Data 1 DER Auto Symb Global fiboCount 4181 unsigned int counter 20 unsigned int Component Context Menu The context menu is a dynamic context sensitive menu It contains entries for additional facilities available in the current component Context menus differ depending on the position of the mouse in the window For example if you click the mouse on a breakpoint menu options allow you to delete enable or disable the breakpoint 46 S12 X Debugger Manual Debugger Interface Features of the User Interface
602. t MyField New temporary PortlO object is created in the Object Pool It contains field with name MyField The field s address equals to zero Instrument displays and controls the field s value If the instrument is removed the temporary PortlO object will be removed too Example Substitute TargetObject 0x210 New temporary PortlO object is created in the Object Pool It contains field that has no name The address of this field equals to 210 Instrument displays and controls the field s value If the instrument is removed the temporary PortlO object will be removed too S12 X Debugger Manual Debugger Components Visualization Utilities Attribute S12 X Debugger Manual Description Used to subscribe to a field of an object from the Object Pool Objects can subscribe to other objects fields The subscribing object is called subscriber and the subscribed object is called actor If a subscribed field of an actor changes it notifies all subscribers of that fact Objects fields are identified by their names Names have the following syntax objSpec objname fieldname objname ident index fieldname identnum identnum size identnum ident f hexnumber size B w rn Example e Use it to subscribe the instrument to existing IO Port field of an object from the Object Pool Subscribe PORTB fieldname check exact spelling using Inspector New temp
603. t are set to 1 appear in black whereas mnemonic characters for bits that are cleared to 0 appear in gray Toggle single bits inside the bit register by double clicking the corresponding mnemonic character S12 X Debugger Manual How To Modify Content of Memory Address Start Memory Dump at Selected Register Address The Debugger provides two ways to dump memory starting at the address to which a register points Using Drag and Drop drag a register from the Register component to Memory component Choose Address Figure 6 33 Memory menu Display Address Display Address Address 84 Hex Format Cancel Help Right click in the Memory component The Memory context menu appears Noe Choose Address from the context menu The Memory dialog box shown in Figure 6 33 opens 3 Enter the register content in the Edit Box and choose OK to close the dialog box 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 treated as hexadecimal numbers Otherwise type expressions and prefix Hex numbers 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 The format fo
604. t demo ort Otherwise the debugger cannot use the ORTI file 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 ORTI Aware Debugging System 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 the CodeWarrior debug tool The static information is useful for display of general information and in combination with the dynamic data The dynamic data gives information about the current status of the system The information given to the CodeWarrior debug tool is represented in an ORTI text file The file describes the different objects configured in the OS and their properties The information is presented as direct text enumerated values symbolic names or an equation that may be used for evaluating the attribute Building the project through the OSEK System Generator generates the ORTI file The generated file has the same name and location as the executable file but with the ort extension S12 X Debugger Manual 201 Real Time Kernel Awareness OS
605. t enough Four different looks of the switch are available slide switch toggle switch jumper or push button Figure 3 110 Switch Instrument 4 X 80 e Table 3 64 shows Switch instrument attributes Table 3 64 Switch Instrument Attributes Attribute Description Bitnumber to Specifies number of bit to display Display Display 0 1 Allows display of the bit value in its upper left corner Top Position is Specifies whether the up position is zero or one Especially useful to easily transform push button into a reset button Kind of Switch Changes look of the instrument The following kinds of switches are available Slide Switch Toggle Switch Jumper Push Button The behavior of the Push Button slightly differs from the others since it returns to its initial state as soon as it has been released Switch Color Specifies color of switch Bounces If enabled gives access to following other attributes to configure the way the switch bounces Nb Bounces Specifies the number of bounces before stabilization Bounces on Specifies whether switch bounces on falling rising or both edges Edge 158 S12 X Debugger Manual Debugger Components Visualization Utilities Table 3 64 Switch Instrument Attributes continued Figure 3 111 Attribute Description Type of Unit Synchronizes frequency of bouncing either on timer of host machine or on CPU cycles Pulse Width Defin
606. t has been modified using HWBPM REMAP 22BITS RANGE or HWBPM REMAP 22BITS DELETE e Use HWBPM REMAP 22BITS DELETE range number gt to delete a specific range Display the range number using HWBPM REMAP22BITS DISPLAY NOTE The remapping range is stored in the targetName section of the PROJECT file using variable HWBPD MCUIDnnn BKPT REMAPn HWBPM MODE lt MODE gt BPM16BITS BPM22BITS module adr gt S12 X Debugger Manual Connection Specific Commands On Chip Hardware Breakpoint Module Commands SKIP OFF SKIP ON with MODE DISABLED AUTOMATIC USER HWBPM SET16BITS BRKCTO value lt BRKCT1 value BRKA value BRKD value HWBPM SET22BITS BKPCTO value BKPCT1 value lt BKPO value BKP1 value HWBPM REMAP 22BITS RANGE start address end address mask HWBPM REMAP 22BITS DISPLAY HWBPM REMAP 22BITS MCUID DEFAULT HWBPM REMAP 22BITS DELETE range number Example Retrieve the Hardware Breakpoints mechanism settings by typing HWBPM without any parameters in the Command Line component in gt HWBPM Hardware Breakpoints Module Settings Module kind 22BITS Module mode Automatic Module address 0x28 Skip illegal BP 16bits only off HWBPM 16 bits BRKCTO 0x0 BRKCT1 0x0 BRKA 0x0 BRKD 0x0 HWBPM 22 bits BKPCTO 0x0 BKPCT1 0x0 BKPO 0x0 BKP1 0x0 S12 X Debugger Manual 655 Connection Specifi
607. t menu Memory Format ATTRIBUTES WORD Select menu Memory Word Size ATTRIBUTES ADR Select menu Memory Display Address ATTRIBUTES ASC Select menu Memory Display ASCII ATTRIBUTES ADDRESS Select menu Memory Address ATTRIBUTES COMPLEMENT Select menu Memory Format ATTRIBUTES SMEM Drag and drop from Data component variable to Memory component ATTRIBUTES SMOD Drag and drop from Source component to Memory component ATTRIBUTES MODE Select menu Memory Mode ATTRIBUTES UPDATERATE Select menu Memory gt Mode gt Periodical ATTRIBUTES list where 1ist command command command FORMAT bin oct hex signed unsigned WORD S12 X Debugger Manual 519 Debugger Engine Commands Debugger Commands 520 number ADR ON OFF ASC ON OFF ADDRESS address SPC address SMEM range SMOD module MODE automatic periodical frozen UPDATERATE rate COMENT NONE ONE Example Memory lt ATTRIBUTES ASC OFF ADR OFF This removes the ASCII dump and addresses from the Memory component window In the Inspector Component The ATTRIBUTES command allows you to set the display and state of the Inspector component window Usage ATTRIBUTES list where list command command command COLUMNWIDTH columnname columnfield columnsize Col SEI SPI EXPAND name subname deep LLAPSE
608. t window before opening the Find dialog the first line of the selection is copied into the Find what edit box S12 X Debugger Manual Debugger Components General Debugger Components Find Procedure Use the Find Procedure dialog box shown in Figure 3 77 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 77 Find Procedure Dialog Box Find Procedure Enter Procedure Name z l Cancel Help If a valid procedure name is given as a parameter the source file where the procedure is defined opens in the Source Component The procedure s definition displays and highlights the procedure s title 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 78 allows you to select the Fold functions described in Table 3 43 Figure 3 78 Folding Menu Unfold Fold Unfold All Text Fold All Text All Text Folded At Loading Table 3 43 Folding Menu Description Menu Entry Description Unfold Unfolds the displayed source code Fold Folds the displayed source code Unfold All Text Unfolds all
609. tchpoint is set or disabled on Watchpoint selected memory range When selected sets a Read Write watchpoint at this memory area Memory ranges at which a read write watchpoint is defined are underlined in yellow If memory area is accessed during application execution program halts and current program state displays in all window components Delete Appears in context menu only if a watchpoint is set or disabled on Watchpoint selected memory range When selected deletes this watchpoint Show When selected brings up the Controlpoints Configuration Window Watchpoints Watchpoints Tab This is the interface through which watchpoints are controlled see Control Points Set Markpoint Appears in Context Menu only if no watchpoint is set or disabled on selected memory range When selected sets a Read Write watchpoint at this memory area Show Markpoints When selected brings up Controlpoints Configuration Window Markpoints Tab This is the interface through which markpoints are controlled see Control Points S12 X Debugger Manual Debugger Components General Debugger Components Table 3 30 Memory Context Menu Description continued Show Forces all opened windows to display information about selected Location memory area Word Size Table 3 25 describes remaining menu entries Drag Out Table 3 31 describes the drag actions possible from the Memory component Table 3 31 Memory Component Drag Poss
610. te Word LWord Table 3 26 Word Size Submenu Description Menu Entry Description Byte Sets display unit to byte size Word Sets display unit to word size 2 bytes Lword Sets display unit to long word size 4 bytes Format Submenu With the Format submenu shown in Figure 3 46 you can set the memory display format Table 3 27 describes the menu entries Figure 3 46 Format Submenu v Hex Oct Bin Dec UDec BitReverse Table 3 27 Format Submenu Description Menu Entry Description Hex Selects hexadecimal memory display format Bin Selects binary memory display format Oct Selects octal memory display format Dec Selects signed decimal memory display format 94 S12 X Debugger Manual Debugger Components General Debugger Components Table 3 27 Format Submenu Description continued UDec Selects unsigned decimal memory display format Bit Reverse Selects bit reverse memory display format reverses each bit Mode Submenu With the Mode submenu shown in Figure 3 47 you can set the memory mode format Table 3 28 describes the menu entries Figure 3 47 Mode Submenu v Automatic Periodical Frozen Table 3 28 Mode Submenu Description Menu Entry Description Automatic Selects Automatic mode default Updates memory dump when connection stops Periodical Selects Periodical mode Updates memory dump at regular time intervals while connecti
611. te Address 0x1800 Size 1 byte SOPT1 xC Read Write Address 0x1602 Size 1 byte SPMSC1 Read Write Address 0x1609 Size 1 byte SPMSC2 Read Write Address xl80A Size 1 byte SDIDL Not available Read Write Address 0x1807 Size 1 byte SDIDH Not available Read Write Address 0x1806 Size 1 byte SOPT2 Read Write Address 0x1803 Size 1 byte SI ATD EB RTC RTCSC ReadMWrite Address Ox006C Size 1 byte RTCCHT ReadMWrite Address Ox006D Size 1 byte RTCMOD ReadMWrite Address Ox006E Size 1 byte amp MSCAN amp CAN CTL CANCTLO l Read Write Address 0x1880 Size 1 byte CANCTL1 17 Read Write Address 0x1881 Size 1 byte CAHBTRO ReadXWrite Address 0x1882 Size 1 byte CAHBTR1 Read Write Address 0x1883 Size 1 byte CAHRFLG ReadMWrite Address 0x1884 Size 1 byte The purpose of the MCURegisters component is to provide the user with convenient representation of the CPU and device registers The changed register values are displayed in red Register values can be displayed in binary hexadecimal octal decimal or unsigned decimal format When binary or hexadecimal format is set the values are formatted to the size of the register These values can be edited Editing Registers To modify the value double click on a register to open an edit box Click the ESC key to ignore changes and retain previous content of the register Click the Enter key to confirm the chnages If the new value is valid the re
612. te etri we NERO EE 638 REGBASE Uc bce 4e LA Seed Ga 638 RESETGYGLES 2 o Je sGaks otled erg br PCRULS PERPE 639 RESETMEM zic xe RARE e REED 639 RESETRAM osse ea a SE P RE Ae E Ss di 640 RESEISTAT keen RR he eite eR ede Ua reg 641 SEGPORT eere p pu be ERI Ren etie 641 SEICONEROP 22e we tee Mae te es OS ee E SE RERIT RSS 642 SETCPU ses oes ere utes pu ang teas UON eee Syl asec 642 SHOWCYCLES uleenpeve l4 oe teed a EET Red 643 WPORT eR ERR RS a ERE Ee b aia 643 Full Chip Simulation Connection Commands 005 644 ADCX SEFLPAD beers EE keeps alates ha RS 645 BGND CYCLES 25 46 EIE LU a a Lites patie 645 HALT ON TRAD od eU US UDEREPCMEPU EUM 646 HC512 SUPPORT eager eR ERR RE etia 646 MESSAGE HIDE JD 4er RA peRUSeRER PRSE 648 MESSAGE HIDE RESET seeseeeeeee e 648 MESSAGE SHOW ID eeesseeeee e eens 649 PSMODE breit eer EE PEARCE E ERLEPER TUNES 649 SELECTCORE 7 rsen eq ve qe NIRE 650 STACK AREA CHECK 0 0 05 0 E m e 650 STACK POINTER INFO sindri ease RR RR aree emn o ade 651 WARNING SETUP Ree REUS HERR EE DE 651 On Chip Hardware Breakpoint Module Commands 653 HWBPM fice eese re E eese tol re 653 Unsecure Commands sss crror ner eiaa top aae R eens 657 CHIPSECURE iea xr oea RR wea eae dea Pee ER OAY 658 XGATE Specific Hardware Connection Commands 658 HCS12X MAPA4000 foc sale reme boe exe Re Re RIPE Rd 659 SEEBCTCORE eyo E NE
613. tem timer MAXALLOWEDVALUE displays the maximum allowed counter value When the counter reaches this value it rolls over and restarts the count 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 Inspect Alarm The Alarm shown in Figure 5 3 displays the current state of OSEK alarm trace Figure 5 3 Inspect Alarm ry vd Inspect Alarm State Assigned Counter Notified Task Time to expire Cycle period ALARMSTOP SYSTEMTIMER ControlTask Oxfed4 0x0 99 POLLINPUTS Al AL ALARMRUN SYSTEMTIMER InputTask 0x3 0x3 33 STALL END AL END AL ALARMSTOP SYSTEMTIMER ControlTask Oxfed4 0x0 TH eig ALARMSTOP SYSTEMTIMER CortrolTask Oxfed4 0x0 204 S12 X Debugger Manual Real Time Kernel Awareness OSEK Kernel Awareness When selecting Alarm in the hierarchical tree on the left side additional information concerning the alarm appears on the right side of the window under the following headings Name displays the name of the alarm Alarm State displays the current state of the alarm Possible values are ALARMRUN and ALARMSTOP Assigned Counter based on counters the OSEK OS offers an alarm mechanism to the application software Assigned Counter i
614. tension Copy selected text in the Command Line window to the clipboard by Selecting the menu entry Command gt Copy Pressing CTRL C Clicking the ea button in the toolbar The Command gt Copy menu entry and the Bz button are only enabled if something is selected in the Command Line window Paste the first line of text contained in the clipboard where the caret is blinking end of current line by Selecting the menu entry Command gt Paste Pressing CTRL V Clicking the ie 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 Figure 3 9 Cache Size Dialog Box Size of the Cache Iv Limited Size of Cache Number of lines to be cached 1000 OK 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 The command line component appends corresponding items of the current command S12 X Debugger Manual 63 Debugger Components General Debugger Components Table 3 5 Drop Into Command Component 64 SourceComponent Action Window Assembly Command Line component appends address of specified instruction to current command
615. ter ATTRIBUTES VSCROLLPOS 0 Returns to the default display The first line of registers appears on the top of the register component in DEFINE vpos 5 in gt Register ATTRIBUTES HSCROLLPOS vpos Scrolls five positions right The second column of registers appears on the left of the register component in gt Register ATTRIBUTES HSCROLLPOS 0 Returns to the default display The first column of registers appears on the left of the register component in gt Register ATTRIBUTES COMPLEMENT One Sets the first complement display option All registers appear in reverse bit In the Source Component The ATTRIBUTES command allows you to set the display and state options of the Source component window SMEM show memory range and SPC show PC address load the corresponding module s source text scroll to the corresponding text range location or text address location and highlight the corresponding statements SMOD show module loads the corresponding module s source text If the module is not found a message appears in the Component Windows Object Information Bar S12 X Debugger Manual 515 Debugger Engine Commands Debugger Commands SPRCC show procedure loads the corresponding module s source text scrolls to the corresponding procedure and highlights the statement in the procedure chain numberAssociatedToProcedure is the level of the procedure in the procedure chain MARKS
616. ter 19 Flash Programming Chapter 20 Unsecure HCS12 Derivatives Chapter 21 On Chip Hardware Breakpoint Module S12 X Debugger Manual 21 Manual Contents Book IV Commands and Environment Variables lists available debugger commands and connection specific commands with a brief description of each Lists environment variables for the debugger engine and connection specific environment variables with provides a brief description of each Chapter 22 Debugger Engine Commands Chapter 23 Connection Specific Commands Chapter 24 Debugger Engine Environment Variables Chapter 25 Connection Specific Environment Variables Book V Debugger Legacy Chapter 26 HC S 12 X Full Chip Simulator Components No Longer Supported Chapter 27 Debugger DDE Capabilities 22 S12 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 understand how to use the environment Book I the Debugger Engine defines the HC12 HCS12 and HCS12X common and base features and their functionality and gives a description of the available debugger components This book is divided into the following chapters Chapter 1 Introduction describes the Debugger application and its features Chapter 2 Debugger Interface provides all details about the Debugger user
617. ternal breakpoint and therefore reduce the number of available hardware breakpoints to one The MC68HC812A4 does not have a Hardware Breakpoint module User Controlled mode This mode allows you to fully set up the breakpoint module according to documentation Depending on the breakpoint module kind selected using the Breakpoint Module Description box in the Break Module Setup index tab select either the 76 bits Break Module User Mode or 22 bits Break Module User Mode The controls are grayed in the User Mode index tab if the correct Mode and correct breakpoint module kind are not selected 16 Bits Break Module User Mode The 6 bits Break Module User Mode index tab allows you to set up the hardware breakpoint module of the connected HC 2 derivative when the Breakpoint Module mode is set to User controlled and the Breakpoint Module Kind is set to use 16 Bits Break Module S12 X Debugger Manual On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog Figure 21 4 16 bits Break Module User Mode index tab Hardware Breakpoint Configuration Break Module Settings 16 bits Break Module User Mode 22 bits Break Module User Mode BRKCT1 BRKA hex o BRKD hex 0 BKDBE Enable Data Bus BRKCTO BKMBH Breakpoint Mask High BKMBL Breakpoint Mask Low BKIRWE RAV Compare Enable Disabled SW Dual Address Mode BKIRW RAW Compare Value BDM Full Breakpoint Mode BKORWE
618. terpreted in milliseconds Components Debugger engine S12 X Debugger Manual 523 Debugger Engine Commands Debugger Commands Example AT 10 OPEN Command This command in command file opens the Command Line component 10 ms after the command file begins executing AUTOSIZE AUTOSIZE enables disables windows autosizing When on the size of component windows are automatically adapted to the Simulator Debugger main window when it is resized Usage AUTOSIZE on off Components Debugger engine Example in gt AUTOSIZE off Windows autosizing is disabled Ej BASE 524 In the Profiler component the BASE command sets the profiler base to code total code or module each module code Usage BASE code module Components Profiler component Example in gt BASE code S12 X Debugger Manual Debugger Engine Commands Debugger Commands BC BC clears a breakpoint at the specified address Specifying clears all breakpoints You can also point to the breakpoint in the Assembly or Source component window right click and choose Delete Breakpoint in the context menu or open the ControlPoints Window select the breakpoint from the list and click Delete NOTE Correct module names appear in the Module component window Make sure that you use the correct module name in your command if the abs is in HIWARE format some debug information is in the object file o and module names have a
619. that browsing for a C file does not change the current directory To overwrite this behavior use the DEFAULTDIR environment variable see DEFAULTDIR Default Current Directory Global Initialization File MCUTOOLS INI PC Only All 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 no MCUTOOLS INT file exists in this directory the tool looks for the file in the MS Windows installation directory for example C WINDOWS Example C WINDOWSNMCUTOOLS INI D INSTALL PROG MCUTOOLS INI 668 S12 X Debugger Manual Debugger Engine Environment Variables Local Configuration File usually project ini If you start a tool in the D INSTALL PROG DIRECTORY the tool uses the project file located in the same directory as the tool D INSTALL PROG MCUTOOLS INI If you start the tool outside the D INSTALL PROG directory the tool uses the project file located in the Windows directory C WINDOWS MCUTOOLS INT NOTE For more information about MCUTOOLS INI entries see the compiler manual Local Configuration File usually project ini The debugger does not change the read only de ault env file The configuration file contains and stores all configuration properties Different applications can use the same configuration file The shell only uses the configuration file named project ini located
620. the Debugger Engine book Memory Configuration The memory configuration interface is an FCS advanced configuration feature that divides the emulated memory into blocks A memory manager handles the list of memory blocks The memory configuration facility allows you to specify types and properties of memory blocks such as RAM and ROM and offers a degree of automation but does not restrict the flexibility of manual adjustment The memory configuration facility uses a binary file format to read and set the FCS configuration The extension for binary files is mem the default memory file is default mem Memory Configuration Dialog Box Features The memory configuration dialog box Figure 10 6 lets you perform these memory block operations interactively Select the configuration mode for simulation Define a memory block name Define how the FCS 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 S12 X Debugger Manual 275 HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu Open and save memory configuration Add delete or update memory blocks Figure 10 6 Memory
621. the Data and Memory windows context menus you can set or delete Memory Access Triggers A B set the DBG module triggers settings and globally set the DBG module functionality Figure 17 11 Data Window Context Menu Delete Trigger A Option S12 True Time Simulator amp Real Time Debugger D W rofilessKrylovWy DocumentsW roject 18V amp E Multilin Fle View Run MutiinkCydonePro Component Source Window Help zu jej PIN e zz z 9 amp Source DER lAssembly D Profles SKrylov My Documents Project_18 Sources man c m Set Breakpoint LDD 0x Acounter 0 Run To Cursor n for i 0 i lt 20 i ShowBreskporis 0x0502 8 Show 0x8000 0x3C fiboCount Fibonacci SSS NN 00500 Set Trigger Address B Triggers Settings Open Trigger Settings Dialog Trigger Module Usage Set Markpoink Show Matports PC 802A PPAGE 3C Set Program Courter 88 Data 1 Open Source File manc fiboCount 0 unsigned int 080 07 07 00 20 counter 0 unsigned int 084 05 00 00 00 088 80 00 00 00 A M Data 2 Trigger condition Memory access at Address A LAB on 12 platform A B C on S12S P A B C D on S12X 410 S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Context Menu Entries You can set or delete a trigger in the Data window The on chip DBG module provides combinations of trigger conditions and according to the number of triggers defined you can choose a different type
622. the source S12 X Debugger Manual 121 Debugger Components General Debugger Components component the selected line displays at the top of the source window If the line number is incorrect a message displays Figure 3 75 Go To Line Dialog Box Go To Line Enter Line Number jio 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 Use the Find dialog box shown in Figure 3 76 to perform find operations for text in the Source component Enter the string you want to search for in the Find what edit box To start searching click Find Next the search starts at the current selection or at 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 displays Figure 3 76 Find Dialog Box 122 Find what enable Find Next Match whole word only Direction Cancel r Match case 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 are 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 componen
623. tilink Cyclone Pro Connection Chapter 12 OSBDM Connection Chapter 13 SofTec HCS12 Connection Chapter 14 HCS12 Serial Monitor Connection Chapter 15 Abatron BDI Connection Chapter 16 TBDML Connection S12 X Debugger Manual 269 Book Il Contents 270 S12 X Debugger Manual 10 HC S 12 X Full Chip Simulation Connection This section provides information about debugging with the CodeWarrior debugger and the HC S 12X Full Chip Simulation connection Technical Considerations 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 unique simulation engine to accurately simulate the memory ranges I O and peripherals for a given derivative for more information on selecting a specific derivative see Supported HC S 12 X Derivatives Full Chip Simulation Menu This menu shown in Figure 10 1 is associated with the Full Chip Simulation connection and allows you to load an application in the FCS Table 10 1 describes the FCS menu entries S12 X Debugger Manual 271 HC S 12 X Full Chip Simulation Connection Full Chip Simulation Menu Figure 10 1 HCS12 FCS Menu HCS12FCS Component Memor Load Ctr Reset Ctri4R Set Derivative Configure Reset MEM Reset Statistic Load IOs Close IOs Clock Frequency Command Files Bus Trace Help
624. tion Activate this display mode by selecting Graphical in the Trace window menu Figure 3 88 Trace Window Graphical Display El Trace Frame Address Data Instruction BCC Remark DBG FIFO data Column Display and Moving The information columns shown by the Trace component can be configured with the configuration dialog shown on Figure 3 89 The Items menu item shall be used to open this dialog This dialog allow to specify columns to view in each display mode The S12 X Debugger Manual 133 Debugger Components General Debugger Components Displaying mode list allows selection for Textual Instructions or Graphical mode Use the right arrow to move items to the Displayed Items list and the left arrow to hide the item Moving the item Up in the list moves it to the left in the Trace component window Select More for more options Select OK to save your changes Figure 3 89 Items Configuration Dialog Box Items configuration Displaying mode Instructions Defined items Displayed items Address Instruction Instruction FIFO analyse remark FIFO analyse remark Remark Cancel Dumping Frames to File Selecting Dump in the Trace window contest sensitive menu opens a dialog that allows you to specify the number of Trace component frames to save and the name of the text file to which to save the frames Figure 3 90 Dump Trace Frames Dialog Box Dump Trace Frames Dump File M ly Dump Fi
625. tion code p with programming runtime algorithm Execute this command after the last H command H PROTOCOLON displays the Flash Programmer debug protocol H PROTOCOLOFF stops displaying the Flash Programmer debug protocol 619 Connection Specific Commands NVMC Commands FLASH SKIPSTATUSON skips the Flash Programmer device Non Volatile Memory blocks diagnostic Use this command to speed up project application loading and programming from the IDE debug run When used the Flash Programmer does NOT verify whether blocks are programmed or erased FLASH SKIPSTATUSOFF removes the SKIPSTATUSON mode and therefore diagnostics are performed again FLASH NOUNSECURE asserts that the security byte location is not programmed to set the device to unsecure mode WARNING Unless the user application programs the security byte location to an unsecured state then after the next hardware reset the debugger will be unable to communicate via BDM with the device and debugging will fail FLASH UNSECURE asserts that the security byte location is programmed to set the device to unsecure mode CAUTION The user application cannot overwrite the security byte and linked byte cells 2 byte word programming or 8 byte row programming are usually required by specifications FLASH NVMFREQUENCY lt frequency in Hz gt specifies the non volatile memory programming frequency in Hertz typically the device bus speed after reset When
626. tionTool Load Edit mode None Loads a VisualizationTool Layout vt 1 Layout Save Always None Saves current layout to a file vt1 Layout Add New Edit mode None Shows new context menu with all available Instrument instruments Properties Only one Ctrl P Shows property dialog box for currently instrument selected instrument selected Remove At least one Delete Removes all currently selected selection instruments Copy At least one Ctrl C Copies data of currently selected selection instruments into clipboard Cut At least one Ctrl X Cuts currently selected instruments into selection clipboard Paste Edit mode Ctrl V Adds instruments which are temporarily stored in clipboard to workspace Send to At least one None Sends current instrument to back of Z Back selection order Send to At least one None Brings current instrument to front of Z Front selection order Clone More than Ctrl Clones common attributes to all selected Attributes one selection Enter gt instruments according to the last selected Align At least two None Gives access to new menu for alignment selections Top Align None Aligns instruments to top line of last selected instrument S12 X Debugger Manual Debugger Components Visualization Utilities Table 3 52 VisualizationTool Context Menu continued Menu Appearsin Shortcut Description entry Menu Bottom Align None Aligns instruments to bottom line of last selected instrument Le
627. tionTool Properties continued Grid Color Specifies color of the grid points Automatic Periodical Each access CPU Cycles Refresh Mode Specifies window refresh mode You may choose between 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 the instrument Table 3 54 shows attributes common to all instruments Table 3 54 Instruments Properties Attributes Attribute Description X Position Specifies X coordinate of the upper left corner Y Position Specifies Y coordinate of the upper left corner Height Specifies instrument height Width Specifies instrument width Bounding Box Specifies look of the bounding box Available displays are No Box Flat outline only Raised Sunken Etched and Shadowed Backgroundcolor Defines color of instrument s background Allows setting a color or letting instrument be transparent Kind of Port Specifies kind of port to be used to get the value to display The location must be specified in Port to Display field 148 S12 X Debugger Manual Debugger Components Visualization Utilities Table 3 54 Instruments Properties Attributes continued Attribute Description Port to Display Defines location of value to be use
628. tries Figure 3 60 Profiler Menu and Submenus Reset Source Details gt Assembly Base gt v Total Code w Graphics Module Timer Update Output File gt Figure 3 61 Profiler Output File Submenu Filter Save As Table 3 36 Profiler Menu Entries Description Menu Entry Description Reset Resets all statistics Details Sets a split view in chosen component Source or Assembly Base Sets base of percentage total code or module code Graphics Toggles display from graphics bar Timer Update Switches periodic update of the Coverage component on or off If activated statistics update once per second Output File Sets up Profiler Output File Functions Split View Associated Context Menu Figure 3 62 shows the Profiler context menu Table 3 37 describes the Delete and Graphics menu entries Figure 3 62 Profiler Split View Associated Context Menu Delete Graphics S12 X Debugger Manual 107 Debugger Components General Debugger Components Table 3 37 Profiler Split View Associated Context Menu Description Delete Removes split view from host component Graphics Toggles graphic bars display in split view Profiler Output File Functions You can redirect the Profiler component results to an output file by choosing Output File gt Save As in the menu or context menu Output File Filter By choosing Output Filter the dialog box shown in Figure 3 63 lets you
629. trol Points Breakpoints 172 Counting Breakpoints Counting breakpoints activate after the instruction executes a certain number of times The following icon identifies a Counting breakpoint Setting Counting Breakpoints Counting breakpoints can only be set using the Breakpoints tab There are two ways to set a counting breakpoint Hold down the left mouse button click the S key Point at a C statement in the Source window Hold down the left mouse button and click the S key The Controlpoints Configuration window with the Breakpoints tab opens and inserts a new breakpoint in the list of breakpoints defined in the application 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 In the Counter group of this tab specify the interval for the breakpoint detection in the Interval field Close the window by clicking the OK button Use the Source Context Menu 1 Point at a C statement in the Source window and right click to display the Source context menu Choose Set BreakPoint from the context menu This defines a breakpoint on the selected instruction 3 Point in the Source window and right click again Choose Show Breakpoints from the context menu to display the Controlpoints Configuration Window Breakpoints Tab Select the breakpoint you want to modify by clicking on the corresponding entry in the
630. uct MicroC Softtrace Segments display Wagon Adc dac Push buttons S12 X Debugger Manual 699 HC S 12 X Full Chip Simulator Components No Longer Supported List of HC S 12 X FCS Components No Longer Supported 700 S12 X Debugger Manual 2 Debugger DDE Capabilities The DDE is a form of interprocess communication that uses shared memory to exchange data between applications Applications can use DDE for one time data transfers and for ongoing exchanges in applications that send updates to one another as new data becomes available NOTE The DDE capabilities of the Debugger are deprecated Future versions of the Debugger will have no DDE capabilities Use the Component Object Model COM Interface Debugger COM Capabilities instead 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 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 DD
631. uction selected Highlights assembler instructions corresponding to selected high level language instructions in Assembly component Memory Displays disassembled instructions starting at first address selected In Assembly component highlights instructions corresponding to selected memory area Register Displays disassembled instructions starting at address stored in source register Highlights instruction starting at address stored in register Procedure In Assembly component highlights current assembly statement inside procedure Demo Version Limitations No limitations Associated Commands Following commands are associated with the Assembly component ATTRIBUTES SMEM SPC S12 X Debugger Manual Debugger Components General Debugger Components Command Line Component The Command Line window shown in Figure 3 7 interprets and executes all Debugger commands and functions The command entry always occurs in the last line of the Command component Characters can be typed in or pasted on to the edit line Figure 3 7 Command Line Window I Command rce lt attributes MARKS off OPEN assembly 60 0 40 31 Assembly lt attributes ADR on CODE off ABSADR on SYMB off IOPPC Oxi il gt 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 the
632. ucture Configuration Connection to the Host Connection to the Target Configuration and Working Modes are described in ABATRON User Manuals The BDI interface connects to the host computer either by a serial communication link or by an Ethernet connection You can use any available communication port of your host system The communication protocol between the BDI and your target system is handled by the BDI Target driver which loads automatically with the Abatron BDI Target Component You can adapt your target system to the BDI interface The BDI to target system communication uses a single wire serial connection You must equip the target system with a BDM connector port see the BDI User Manual from ABATRON Make sure that your hardware target board has a Background Debug Mode BDM port for background interfacing with the BDI interface and the debugger Check the technical specifications provided by ABATRON User Manuals and Freescale Make sure your computer has one free serial communication port to communicate with the BDI interface You may need to set it up even if you use Ethernet communication instead of an RS 232 serial communication medium 382 S12 X Debugger Manual 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 f
633. ued Supported HC S 12 X Derivatives Register Acronym PWMCTL Full Register Name PWM Control Register Simulated Fields CON45 CON23 CONO 1 PFRZ is not simulated but system acts as if PFRZ is always set to 1 PWMSCLA PWM Scale A Register Entire register PWMSCLB PWM Scale B Register Entire register PWMCNTx PWM Channel Counter Registers 0 5 7 Entire register PWMPERx PWM Channel Period Registers 0 5 7 Entire register PWMDTYx PWM Channel Duty Registers 0 5 7 Entire register PWMSDN PWM Shutdown Register PWMIF PWMIE PWMRSTRT PWMLVL PWM7IN PWMTINL PWM7EN PORTP Port P Functionality linking the PWM module and port P are simulated using the PTP Port P I O Register S12 X Debugger Manual 299 HC S 12 X Full Chip Simulation Connection Supported HC S 12 X Derivatives 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 PWMoutO to PWMout7 Only PWMout7 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 called PACNT_H and PACNT_L Both registers are simulated For more information see Enhanced
634. uencer Tab You can choose or change the DBG sequence in the Sequencer tab of the Trigger Module Settings window The sequencer tab reflects transitions that occur when you select a predefined sequencer mode Figure 17 31 Trigger Module Settings Window Sequencer Tab 432 Trigger Module Settings Trigger settings Sequencer General settings Sequencer mode Any trigger WheninStatel When in State2 When in State3 Mate 0 Disarmed a N _ disarm State Sequencer Diagram Run arm P gi Statel Pad State Ay Session complete H F J Final State c S12 X Debugger Manual On Chip DBG Module for S12 S12S S12G S12P S12X Platforms Trigger Module Settings Window You can modify the transitions in the Sequence tab only when the DBG is in User Sequencer setup mode 12X DBG Module Tabs Trigger Settings Tab Use the Triggers Settings tab to set the trigger mode and trigger address if this option is available in the selected mode DBG Module Mode Setup The on chip DBG module provides some exclusive debugging features Three modes are available Automatic Disabled User triggers All three modes offer Code rebuilding from Change of Flow in the Trace component window Breakpoint watchpoint and trigger setting for either the HCS12X core or the XGATE core S12 X Debugger Manual 433 On Chip DBG Module for S12 S12S S12G S12P S12X Platfor
635. ugger Manual 581 Debugger Engine Commands Debugger Commands When you specify the RD command lists the content of the currently loaded register file If no register file is loaded the RD command displays a No register file loaded error message Specifying the RD command with no parameter processes the previous RD command again The first RD command of a session displays all CPU registers If you omit list the RD command uses the 1ist and any other parameters from the previous RD command Components Debugger engine Example 1 in gt rd a hx A 0x14 HX 0x2 Example 2 in gt rd cpu A 0x0 HX 0x450 SR 0x70 PCZOxFOAE SP 0xFF RECORD In the SoftTrace component the RECORD command switches frame recording on or off while the target is running Usage RECORD on off Components SoftTrace component Example in gt RECORD on 582 S12 X Debugger Manual Debugger Engine Commands Debugger Commands REPEAT Use the REPEAT command to execute a sequence of commands until a specified condition is true You may nest the REPEAT command Click the Esc key to stop this command Usage REPEAT Components Debugger engine Example DEFINE var 0 REPEAT DEFINE var var 1 UNTIL var 2 The REPEAT UNTIL loop is identical to the ANSI C loop The operation DEFINE var var 1 is done twice then var 2 and the loop ends RESET In the Profiler and Coverage
636. ump Checking unchecking Address in the Display menu entry adds or removes the location address on the left side of the numerical dump To specify the start address for the memory dump use the Address menu entry The Component Windows Object Information Bar contains the procedure or variable name structure field and memory range matching the first selected memory word uu memory value means not initialized for Simulation only pp memory value means protected from being read or protected from being read and written rr memory value means not accessible because the hardware is running memory values mean not configured no memory available S12 X Debugger Manual 89 Debugger Components General Debugger Components 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 Memory Address Spaces Some devices might have one or more additional address spaces Select the Address Space menu entry to display the different address spaces in the Memory window TIP HCS12X devices have three address spaces The Logical address space covers physical local and logical displays see Banked Window Paged Memory Physical Local vs Logical display for further details The Global address space covers the Global Memory range covering the memory as one single linear range
637. urce Window Context Menu 1 Point in the Source component window and right click to display the Source context menu 2 Choose Show Breakpoints from the context menu The Controlpoints Configuration window with the Breakpoints tab displayed appears In the Breakpoints tab of the Controlpoints Configuration window 1 Select the breakpoint to modify by clicking on the corresponding entry in the list of defined breakpoints 2 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 Associate a command file with a breakpoint using the command CALL or CF Example CF breakCmd cmd 3 Click OK to close the window When the breakpoint is detected the command executes and the application stops The Continue check button of the Controlpoints Configuration window allows the application to continue after the command executes Demo Version Limitations Only two breakpoints can be set S12 X Debugger Manual 175 Control Points Watchpoints Watchpoints 176 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 activate when a read access occurs inside the specified memory range Write Access Watchpoints activate when a write access occurs inside the specified me
638. urrent statement is a procedure call the debugger steps into procedure Treats a function call as multiple statements and steps into function Step Over F10 Similar to Single Step but does not step into called functions Treats a function call as one statement Step Out Shift If application halts inside a function Step Out continues F11 execution and stops at instruction following current function invocation Has no effect if no function calls are present S12 X Debugger Manual Debugger Interface Debugger Main Window Table 2 4 Run Menu Description continued Menu Shortcut Description entry Assembly CTRL Performs a single step at assembly level in halted Step F11 application Execution continues for one CPU instruction from the point at which it halted Similar to Single Step command but executes one machine instruction rather than a high level language statement Assembly CRTL Similar to Step Over but steps over subroutine call Step Over F10 instructions Assembly CTRL If application halts inside a function command continues Step Out Shift execution and stops on CPU instruction following current F11 function invocation Similar to Step Out but stops before assignment of result from function call Control None Opens Controlpoints Configuration Window to allow you to Points control breakpoints watchpoints and markpoints see Control Points You can provi
639. use ANSI C syntax to specify the condition for example counter 7 You can use register values in the breakpoint condition field with the following syntax RegisterName for example RX 0x10 4 Close the window by clicking OK Use the Source Window Context Menu 1 Point at a C statement in the Source component window and right click to display the Source context menu 2 Select Set BreakPoint from the context menu to define a breakpoint on the selected instruction 3 Point in the Source component window and right click to display the Source context menu S12 X Debugger Manual 173 Control Points Breakpoints 174 4 Select Show Breakpoints from the context menu The Breakpoints tab opens and inserts a new breakpoint in the list of breakpoints defined in the application 5 Select the breakpoint you want to modify by clicking on the corresponding entry in the list of defined breakpoints 6 Specify the condition for breakpoint activation in the Condition group Condition box You must specify the condition using the ANSI C syntax for example counter 7 You can use register values in the breakpoint condition field with the following syntax RegisterName for example RX 0x10 7 Close the window by clicking OK If you continue program execution the condition is evaluated each time the program reaches the instruction containing the conditional breakpoint When the condition is TRUE the application stops
640. used the Flash Programmer does not try to evaluate this speed and the debugger gain 2 3 seconds at application loading time A value of 0 reengages the speed detection FLASH NVMIF2RELOCATE address tells the Flash programmer to load the Flash driver in RAM to a non default location default is the start of on chip RAM This provides more flexibility for EB386 Example 1 Layout device RAM memory relocation The data to program buffer follows the same address translation This command is a Legacy command FLASH NVMIF2WORKSPACI is more user friendly and performs a secured relocation A value of 0 resets the location LE FLASH NVMIF2WORKSPACE address address tells the Flash programmer to load the Flash driver in RAM to a non default location default is at the start of on chip RAM The command also resizes the workspace by passing a range as a parameter The command is more powerful than FLASH NVMIF2RELOCATE although you must set up the range correctly to match the targeted part FLASH NVMIF2RELOCATE 0 resets any setup made with the FLASH NVMIF2WORKSPACE or FLASH NVMIF2RELOCATE commands Ideally execute this command from a Startup cmd file For example FLASH NVMIF2WORKSPACE 0x3800 Ox3FFF 620 S12 X Debugger Manual Connection Specific Commands NVMC Commands The command implies that on chip RAM is available at relocation position and range before loading any Flash driver This command
641. used for internal purposes only S12 X Debugger Manual 671 Debugger Engine Environment Variables Local Configuration File usually project ini 672 You can specify the toolbar status bar heading line title bar and small border in the default section Show or hide the toolbar using the following parameters and syntax Toolbar 0 1 Specify 1 to show the toolbar otherwise it is hidden Show or hide the status bar using the following parameters and syntax Statusbar 0 1 Specify 1 to show the status bar otherwise it is hidden Show or hide the title bars using the following parameters and syntax Hidetitle 0 1 Specify 1 to hide the title bars otherwise they show Show or hide the heading lines using the following parameters and syntax Hideheadlines 0 1 Specify 1 to hide the heading lines otherwise they show Reduce the border using the following parameters and syntax Smallborder 0 1 Specify 1 for thin borders otherwise they appear 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 INI file Refer to the specific ta
642. used to echo commands Green used to display asynchronous events NOTE Using WHITE as a parameter sets all component windows to their default background colors Usage BCKCOLOR color Where color can be one of the following BLACK GREY LIGHTGREY WHITE RED YELLOW BLUE CYAN GREEN PURPLE UJIGHTRED LIGHTYELLOW IIGHTBLUE UIGHTCYAN LIGHTGREEN LIGHTPURPLE Components Debugger engine Example in gt BCKCOLOR LIGHTCYAN This sets the background color of all currently open component windows to Lightcyan To return to the original display enter BCKCOLOR WHITE 526 S12 X Debugger Manual 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 in gt BD Fibonacci 0x805c T Fibonacci 0x8072 P Fibonacci 0x8074 T main 0x8099 T This sets one permanent and two temporary breakpoints in the function Fibonacci and one temporary breakpoint in the main function NOTE From the list it is not possible to know if a breakpoint is disabled or not BS BS sets a temporary T or a permanent P breakpoint at the specified address If P or T is unspecified the default is a permanent P breakpoint Equivalent Operation Point at a statement in the Assembly or Source co
643. utput File Opens Output File options Output File You can redirect Coverage component results to an output file by selecting Output File gt Save As in the menu or context menu Output File Filter Select Output Filter to display the dialog box shown in Figure 3 13 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 66 S12 X Debugger Manual Figure 3 13 Output File Filter Dialog Box Output File Filter Content C Modules Modules Functions Modules Functions Code Lines Range to dump From jo E To 100 Cancel Help Output File Save Debugger Components General Debugger Components The Save As entry opens a Save As dialog in which you can specify the output file name and location Listing 3 1 shows an example Listing 3 1 Example Output File with Modules and Functions FULL Application fibo c Fibonacci main startup c Init _Startup Split View Associated Context Menu The context menu for the split view Figure 3 14 contains the Delete entry which is used to remove the split view S12 X Debugger Manual 67 Debugger Components General Debugger Components Figure 3 14 Coverage Split View Associated Context Menu ISI E BR D Profiles b1 381 9 My Documents project2 my_E128_project Sour Line 255 Figure 3 15
644. ve groups Kernel Commands Kernel commands are commands that can be used to build command programs You can only use Kernel commands in a debugger command file since the Command Line component can only accept one command at a time Table 22 1 contains all available Kernel commands Table 22 1 List of Kernel Commands 500 Command Syntax Short Description A Affects a value AT Sets a time delay for command execution CALL fileName C NL Executes a command file DEFINE symbol expression Defines a user symbol ELSE Other operation associated with IF command ELSEIF condition Other conditional operation associated with IF command ENDFOCUS Resets the current focus refer to FOCUS command ENDFOR Exits a FOR loop S12 X Debugger Manual Debugger Engine Commands Commands Overview Table 22 1 List of Kernel Commands continued Command Syntax Short Description ENDIF Exits an IF condition ENDWHILE Exits a WHILE loop FOCUS component Sets the focus on a specified component FOR variable range FOR loop instruction step FPRINTF fileName format FPRINTF instruction parameters GOTO label Unconditional branch to a label in a command file GOTOIF condition Label Conditional branch to a label in a command file ICD12EXEC HELP Output a list and the descriptions of all P amp E available debugger commands to the Command Window
645. volatile RAM User Defined depending on configuration Use Memory Configuration dialog box to construct definition interactively or read it in from a file 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 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 DWAREF 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 is 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 f
646. ware Connection Commands 666 S12 X Debugger Manual 24 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 Debugger Environment Use environment variables to set the various debugger parameters 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 You can define the debugger parameters in several ways Use system environment variables supported by your operating system e Put 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 Put definitions in a file given by the value of the system environment variable ENVIRONMENT NOTE Set the default directory using the DEFAULTDIR system environment variable see DEFAULTDIR Default Current Directory When looking for an environment variable all programs first search the system environment then the DEFAULT ENV file and finally the global environment file given by ENVIRONMENT If no definition can be found the debugger assumes a de
647. warning picture S12 X Debugger Manual 153 Debugger Components Visualization Utilities Figure 3 104 Bitmap Instrument Additionally it can also be used as a bitmap animation Table 3 58 shows the Bitmap instrument attributes Table 3 58 Bitmap Instrument Attributes Attribute Description Filename Specifies location of the bitmap With the button behind you can browse for files AND Mask Performs bitwise AND operation with this value AND the value of selected port Default value is 0 EQUAL Mask Compares this value to the result of the AND operation Bitmap displays only if both values are the same Default value is 0 In general to show the bitmap the following condition must be true port_memory amp ANDmask EQUALmask Example using the AND and EQUAL masks You want to show a taillight of a car in the visualization 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 whether a lamp is on e g bit 0 says that the flasher is on where bit 1 says that the brake light is on For your simple application you need the following bitmaps with their settings no light on bitmap AND mask 3 EQUAL mask 0 flasher on bitmap AND mask 3 EQUAL mask 1 brake light on bitmap AND m
648. with 241 Register assignments RTK awareness 200 Register Block 313 Register component 111 234 241 S12 X Debugger Manual Register contents displaying 111 Register menu 112 Register values 174 183 Using with breakpoints 173 Registration information displaying 45 Relative Mode 160 Relative value attributes 160 Remove menu entry 146 REPEAT 569 583 Replay menu entry 110 Requirements 381 RESET 583 617 Reset command file 41 Reset Mem menu entry 272 Reset menu entry 38 66 107 272 389 Reset Option 354 368 396 Reset RAM menu entry 272 Reset Statistic menu entry 272 reset cmd file 246 Executing 246 RESETCYCLES 639 RESETMEM 639 RESETRAM 640 RESETSTAT 641 RESTART 584 Restart menu entry 36 RETURN 584 RIE 316 Right menu entry 147 ROMs 383 RS 585 RS 232 serial communication 381 RSRC 316 RTC 314 RTK Application example 197 Awareness register assignments 200 Interface 196 Procedure Chain window 196 Run menu 36 Run To Cursor menu entry 58 119 RWU 316 717 S S 586 S12 platfotm only 413 SAVE 586 Save and Restore on load 406 413 Save Configuration menu entry 30 Save Layout menu entry 145 146 Save Memory Block 278 Save Project As menu entry 30 SAVEBP 587 SBK 316 SBR 316 SCOBDH 316 SCOBDL 316 SCOCRI 316 SCOCR2 316 SCODRH 316 SCODRL 316 SCOSRI 316 SCOSR2 316 SCIBDH 316 SCIBDL 316 SCICRI 316 SCICR2 316 SCIDRH 316 SCIDRL 316 SCISRI 316 SCISR2 316 Scalable CAN MSCAN 285 SCIInput 315 317 SCUnputH 315
649. work unless a user defined Sci0 object with the specified register name is loaded Write access to the target application is done with the Object Pool function OP_SetValue at the address Sci0 SerialInput Input from the target application is handled with a subscription to an Object Pool register with the name Sci0 SerialOutput When this register changes sends a notification a new value is received For implementations of this register with help of the IOBase class use the IOB NotifyAnyChanges flag Otherwise only the first of two identical characters are received Itis also possible to configure the terminal to use another object in the Object Pool instead of Sci0 with which to communicate Refer to Configure Terminal Connections for information about how to do this Cache Size The item Cache Size in the context menu allows you to set the number of lines in the terminal window with the dialog shown in Figure 3 82 Figure 3 82 Size of the Cache Dialog Box Size of the Cache V Limited Size of Cache Number of lines to be cached 1000 Cancel Help Trace Component The Trace window shown in Figure 3 83 records and displays instruction frames and time or cycles if the information is available from the hardware The capability of the trace component depends on the selected derivative and connection S12 X Debugger Manual 129 Debugger Components General Debugger Components Figure 3 83 Trace Window Trace DE
650. xecutes a command file CLOCK frequency Sets the clock speed COPYMEM lt Source addr Copies memory range gt dest addr CYCLE on off Switches cycles and milliseconds in SofTrace component DETAILS assembly source Sets split view DUMP Displays data component content E expression Evaluates a given expression O D x c B EXECUTE fileName Executes a stimulation file FILL range value Fills a memory range with a value FILTER Options lt range gt Selects the output file filter options FIND string B MC Finds and highlights a pattern WW FINDPROC ProcedureName Opens a procedure file FOLD Folds a source block FRAMES number Sets the maximum number of frames GRAPHICS on off Switches graphic bars on off INSPECTOROUTPUT name Prints content of Inspector to Command window subname INSPECTORUPDATE Updates content of Inspector 506 S12 X Debugger Manual Debugger Engine Commands Commands Overview Table 22 5 List of Component Specific Commands continued Command Syntax Short Description LS symbol 1 C S Displays the list of symbols NB base Sets the base of arithmetic operations OUTPUT fileName Redirects the coverage component results PTRARRAY on off Switches on off the pointer as array display RECORD on off Switches on off the frame recorder SLINE linenumber Shows the desired line number SAVE
651. y setup from an internal database Enabling the Memory Module and Changing the Memory Range Figure 18 2 shows the DMM Memory Map dialog box Figure 18 2 Debugging Memory Map Dialog Box MC9S12XEP100 Debugging Memory Map v Enable memory module active Start 22 End 23 hex accesskind R W v Type physical Y Iv refresh memory when halting Priority default device v nomemory access while running Comment DBGTBH DBGTBL fifo registers Information WARNING This module is overlapping with module having Comment Register memory range from 0x22 to 0x23 is of physical type therefore accessed directly in device physical memory Ox0 Ostfff Each time the debugger is stopped or reset the memory data is retrieved from hardware lt The Enable memory module option checkbox maps the module memory range in the debugger Unchecking this option makes the module completely transparent for the DMM and the debugger The Start edit box contains the first address of a memory range and the End edit box contains the last address of a memory range Range boundaries are always limited to an overlapped range with a higher priority For example if two bytes are defined in a range which overlaps another range these two bytes S12 X Debugger Manual 457 Debugging Memory Map Debugging Memory Map GUI 458 are accessed using the type and rules of this 2 byte range The memory on both sides of these two
652. y the dialog box will prompt accordingly Once you enter the correct clock divider value click OK to start the unsecure process executing the Unsecure Command File CAUTION Ifthe Unsecure Command File has not been set up in the Target Interface Command Files dialog the warning shown in Figure 20 2 appears Figure 20 2 Unsecure command file warning 486 HI WAVE wd Unsecure command file is disabled ae The unsecure process checks the security byte to see if the device is unsecured according to a mask and a compare value if value in security byte amp mask compare value then the chip is secured NOTE Modify the address of the security register the mask and the compare value using the CHIPSECURE SETUP command Those parameters are then stored in the project file S12 X Debugger Manual Unsecure HCS12 Derivatives Unsecure Command File Unsecure Command File Set up the Unsecure command file using the HC12MultilinkCycloneProTarget Interface Command Files dialog Choose HC12MultilinkCyclonePro Command Files and click the Unsecure index tab The project created with New Project Wizard will have appropriate unsecure command file configured Execute this command file to unsecure a secured HCS12 derivative using HC12MultilinkCyclonePro gt Unsecure menu entry Figure 20 3 Unsecure Command Flle tab HC1 2MultilinkCyclonePro Connection Command Files Startup Reset Preload Postload Vppon
653. y gray 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 Information bar of the window contains the number of CPU cycles as well as the processor s name S12 X Debugger Manual 111 Debugger Components General Debugger Components Editing Registers Double click on a register to open an edit box over the register so that the value can be modified Press the ESC key to ignore changes and retain previous content of the register Pressing the Enter key outside the edited register validates the new value and changes the register content Pressing the Tab key validates the new value changes the register content and selects the next register value for modification if desired Double clicking a status register bit toggles it Holding down the left mouse button and clicking the A key changes the contents of Source Assembly and Memory component windows The Source window shows the source code located at the address stored in the register The Assembly window shows the disassembled code starting at the address stored in the register The Memory window dumps memory starting at the address stored in the register Register Menu Format Submenu The Register menu contains the items shown in Figure 3 67 Table 3 39 describes the menu entries Figure 3 67 Register Menu Format gt y Hex Bin Oct De
654. you to the Set Derivative dialog box This dialog box allows you to choose the target MCU for the connection 216 S12 X Debugger Manual How To Switching Connections Figure 6 11 Set Derivative Dialog Box Set Derivative The MCUID of this derivative is 0x3C0 In order to perform some operations the MCU type connected to the interface has to be set correctly Please select the MCU which fits the connected MCU If your MCU is not listed in the box above ask for the updated configuration fles ok cei e The menu selection MultilinkCyclonePro Set Communication Speed lets you control the various factors associated with communication speed for the connection Figure 6 12 Set Communication Speed Dialog Box Set Communication Speed I0 DELAY COUNT 0 asclckdiider Search I Auto detect Use Search to find a valid 10_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 oscillator frequency in MHz 1 3 ce tw The menu selection MultilinkCyclonePro Command Files takes you to the Command Files window S12 X Debugger Manual 217 How To Switching Connections Figure 6 13 Command Files Window P amp E Multilink Cyclone Pro Connection Command Files E Startup Reset Preload Postload Vppon Vppoff Unsecure The Startup command file
Download Pdf Manuals
Related Search
Related Contents
Triarch 32500/1 User's Manual Philips CTX125BLK 1.44" 68g Black USER MANUAL - Kramer Electronics 300 series (Gen 2) Manual Eizo FlexScan® 21.3 inch LCD Sommaire - Ubifrance this publication as PDF T3 / T3 IP Comfort collegabile a Integral 55 ZC-GSM015 MANUAL KNOW YOUR THERMOMETER TURN THE Copyright © All rights reserved.
Failed to retrieve file