Home
ICD-12 Target Interface
Contents
1. 2 2 2 2 2 2 2 77 Disabled mode ee ee ee ee ee ee ee Automatic controlled by an meds Oe out he eee eew ee Se User Controlled mode 2 2 81 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Table of Contents 7 2 Associated Commands 2 2 2 2 2 ee ew ew ew we 84 7 3 Associated Environment Variables 2 2 2 222 87 8 Running Standard EVBs with a BDM pod 91 8 1 Connection between a BDM pod and an EVB board 91 8 2 MC68HC812A4EVB Evaluation Board 2 2 2 2 2 2 2 92 8 3 MC68HC912B32EVB Evaluation Board 2 2 2 2 2 2 2 93 8 4 MC68HC912D60EVB Evaluation Board 2 2 2 2 2 2 2 2 93 8 5 MC68HC912DG128EVB Evaluation Board 2 2 2 2 2 2 2 93 8 6 EVB912DP256 Evaluation Board 2 2 2 2 2 2 2 2 94 8 7 Axiom CML12S DP256 2 2 2 2 94 Index 95 ICD 12 Target Manual 5 For More Information www freescale com Freescale Semiconductor Inc Table of Contents 6 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Overview 1 1 About this guide This document includes information to become familiar with the JCD 2 Target Interface and to help you understand how to use this Target Interface This document 1s divided into following sections The Introduction section introduces the CD 12
2. Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more How to load an Application in Flash EEPROM Figure 2 13 Programming The Non Volatile Memory Modules Configuration File M HW 6Q HC12SPROGSFPPSmcu03C4 fop M Auto select according to MCU ld Ox03C4 Save and restore work space content End OOO0FFFF Enabled Programmed OOO0BFFF EnabledBlark Erate QOO0FFFF Enabled Programmed Unprotected D0DIBFFF Enabled Blank Unprotected Disable QOOO02BFFF Enabled Blank D0DABFFF Enabled Blank Unprotected QOOO46FFF Enabled Blank ah PAGE I QOO056FFF Enabled Blank Unprotected FLASH PAGES 000 OO06BFFF Enabled Blank FLASH FAGE 0007a000 0007BFFF Enabled ProgrammedUnprotected Protect protect Erase Load OF Cancel Help 9 Close the Non Volatile Memory Control Dialog dialog 10 Choose ICD 12 gt Reset Figure 2 14 shows the FLASH Warning dialog box which is displayed Figure 2 14 Flash Warning Dialog FLASH Warning E Attempt to run or to step an application while FLASH modules are selected Do you want to unselect all modules and run step 11 Choose Run gt Start Continue or click The application is started 12 Choose Run gt Halt or click H The execution of the program is stopped ICD 12 Target Manual 19 For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and
3. ICD 12 Target Interface Manual ICD 12 Target Interface Dialogs Figure 3 11 Creation of a New MCU Name MEU M ame MCESH 2391206128 MCU ID 040304 Cancel Help Through this dialog the MCU name can be adapted If the specified MCU ID does not exist a new entry is created in the MDSEMCU INT file located in the windows directory of the host computer 3 4 3 Set MCU Speed Choose ICD 12 gt Set MCU Speed to open this dialog Figure 3 12 Figure 3 12 Set MCU Speed Dialog BOM Clock Frequency 11 as clock divider Search Use Search to search Auto detect for a valid frequency This dialog shows the current settings of the clock divider also called IO_DELAY_ COUNT to be used by the MCU When Ok is clicked the debugger tries to verify the communication with the set clock divider IO_DELAY_COUNT Clock divider The clock divider IO_DELAY_COUNT has to be known by the CD 12 Target Interface for proper communication through the BDM The clock divider IO_DELAY_COUNT used depend on the connected P amp E Cable e for CABLE12 16 oscillator frequency in MHz e for CABLE12HS BDM MULTILINK 200 oscillator frequency in MHz 1 32 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Dialogs Search If the Search button is used the debugger automatically search for a valid clock divider IO_DEL
4. e BRKA Breakpoint Address Register e BRKD Breakpoint Data Register For more information about those registers please refers to your MCU reference manual section Breakpoints of the Background Debug Mode Development Support part of the manual CAUTION When a hardware breakpoint or watchpoint is set in User controlled mode the message displayed in the status bar when the breakpoint or watchpoint is reached is ILLEGAL_BP If the control point set is a breakpoint it is needed to perform a single step before running again the target otherwise the target will endlessly break on the same address bus access 7 1 3 2 22 bits Break Module User Mode The 22 bits Break Module User Mode index tab allows to set up the hardware breakpoint module of the connected Motorola HCS12 derivative when the Breakpoint 82 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog Module mode is set to User controlled and the Breakpoint Module Kind is set to use 22 Bits Break Module Figure 7 5 22 bits Break Module User Mode index tab Hardware Breakpoints Configuration Break Module Settings 16 bits Break Module User Mode 22 bit Break Module User Mode BEPCT1 BE PO hex mas Ox 3FFFFF I E BKOMBH Mask high byte 1st adr BEP1 hex max Ox3FFEFF o BROMBL Mask low byte 1st adr BK1MBH Mask
5. or 1f the code has been changed the application is rebuild 10 If the Error message shown in Figure 2 3 is displayed it means that the debugger did not found the board on your LPT1 port Figure 2 3 The board could not be found on your LPT1 port Communication to ICD 12 failed ICD 12 is not connected or has no power 11 Click Ok You will be prompted to specify the communication port in the dialog shown in Figure 2 4 Figure 2 4 Communication Device Edit Box Communication Device Specification Communication Device er F Show Protocol I Set CLES bitin BOM control register MC9572 only At connection detect if the target is running Cancel Help 12 In the Communication Device edit box type the correct parallel port Click the Connect button The debugger tries then to connect to the target 13 If the Target Interface is started for the first time in the directory the dialog shown in Figure 2 5 is displayed ICD 12 Target Manual 11 For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more First Steps with CodeWarrior and the ICD 12 Target Interface Figure 2 5 MCU ID not specified HI WAVYE x xX The MCU ID was not specified 14 Close it with OK The MCU selection dialog is then displayed see Figure 2 6 In the drop down list box select the derivative which is on your target system Figure 2 6 MCU Sel
6. BDM target section from the project file NORAL FLEX BDM CMDFILEO CMDFILE STARTUP ON startup cmd CMDFILE1 CMDFILE RESET ON reset cmd CMDFILE2 CMDFILE PRELOAD ON preload cmd CMDFILE3 CMDFILE POSTLOAD ON postload cmd CMDFILE4 CMDFILE VPPON ON vppon cmd CMDFILE5 CMDFTLE VPPOFF ON vppoff cmd The following section describes each variable available for the Target Interface The variables are listed in alphabetical order Topic Description Short Description Provides a short description of the variable Syntax Specifies the syntax of the variable in a EBNF format Default Shows the default setting for the variable Description Provides a detailed description of the variable and how to use it Example Small example of how to use the variable CMDFILEn Short Description Contains a CMDFILE Command Line command to be used to define a command file on a event ICD 12 Target Manual 75 For More Information www freescale com Freescale Semiconductor Inc Target Interface Commands Files Associated Environment Variables Syntax CMDFILEn lt command file specified using CMDFILE Command Line command gt Default All command files are enabled by default The default Startup command file is STARTUP CMD The default Reset command file is RESET CMD The default Preload command file is PRELOAD CMD The default Postload command file is POSTLOAD CMD The default Vppon command file is VPPON CMD The default Vppoff command file is VP
7. Breakpoint Module Mode Automatic cor Disabled Automatic controlled by debugger User controlled Breakpoint Module mode Breakpoint Module Description Breakpoint Module kind fuse 2 Bite Break Module Break pont Module base address hen 28 D Continue on ilegal break benked herdwere breakpoint Eos Break Module ario ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog NOTE This feature is available only if the Motorola HC12 or HCS12 derivative connected to the debugger through the P amp E Cable12 or BDM MULTILINK has an embedded hardware breakpoint module Check your MCU documentation 7 1 1 Disabled mode When the hardware breakpoint module is disabled it is not possible to set 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 therefore can not be used when debugging in non volatile memory if the hardware breakpoint module is disabled 7 1 2 Automatic controlled by debugger mode This is the default mode for the debugger If the Automatic controlled by debugger mode is selected you have the possibility to set up to two breakpoints in Non Volatile Memory or one watchpoint as shown in Figure 7 3 ICD 12 Target
8. Erasing The Non Volatile Memory Modules Non Volatile Memory Control Dialog FLASH_4000 Enabled Blank FLASH_PAGEO Enabled B lank FL4SH_E000 Enabled BlankUnprotected FLASH _PAG 00 EnabledBlank Unprotected FLASH PAGE Of 00 Enabled Blank 5 GE3 O EnabledBlankUnprotected FLASH PAGE4 0 Enabled Blank FLASH PAGES 00 Enabled BlankUnprotected FLASH PA4GEE OD Enabled Blank FLASH FAGE D0078000 Enabled Blank LUnprotected 6 Click Load The Load Executable File dialog is opened see Figure 2 12 ICD 12 Target Manual 17 For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more How to load an Application in Flash EEPROM Figure 2 12 Opening The Load Executable File Dialog Non Yolatle Memory Control Dialog x Configuration File 3 N SH Ww EQ HC12SPROGSFPP mcul3C4 top 5 l A eee eee fe Auto Load Executable File H E T Save Look jr E Dgl28 E Modules Hame File name ffibo128 abs Piles of type Executables abs elf Cancel OF Cancel Help 7 Select the file you want to load in Flash memory 8 Click Open The Load Executable File dialog is closed Wait a few seconds Some of the modules which were marked Blank in the Modules list are now marked Programmed as shown in Figure 2 13 The application has been written in the Flash EEPROM 18 ICD 12 Target Manual For More Information www freescale com
9. Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more How to Set Breakpoints in Non Volatile Memory Figure 2 15 Hardware Breakpoint Configuration Hardware Breakpoints Configuration x Break Module Settings 16 bits Break Module User Mode 2 bite Break Module User Mode Breakpoint Module Mode Breakpoint Module mode Automatic controlled by debugger Breakpoint Module Descnption Breakpoint Module kind use 16 Bits Break Modul use 16 Bits Break Module Breakpoint Module base address hen use 22 Bite Break Module Continue on illegal break banked hardware breakpoint 16 bits Break Cancel Help If your application is loaded in RAM breakpoints are software breakpoints In this case the Hardware Breakpoint module gives you the possibility to debug with breakpoints and watchpoint only one watchpoint is available NOTE In Automatic mode the AC12 and HCS12 hardware breakpoint modules allow only two breakpoints or one watchpoint at the same time If you are debugging your code in FLASH you can not set more than two breakpoints or one watchpoint Some actions like stepping over or stepping out use one internal breakpoint and therefore reduce your amount of hardware breakpoint to one NOTE If you are using a Motorola HC12 derivative and would like to set hardware breakpoints in Banked Memory Location set the Continue
10. The Unsecure derivative dialog offers to connect using the last used IO_DELAY_COUNT please check the value For Cable12 IO_DELAY_COUNT 16 oscillator frequency in MHz For Cablel12HS BDM Multilink IO_DELAY_COUNT 200 oscillator frequency in MHz 1 CAUTION The IO_DELA Y_COUNT must be calculated It is not possible for the debugger to detect automatically the IO_DELA Y_COUNT when the chip is secured Once the correct IO_ DELAY COUNT has been entered click OK to start the unsecure process The debugger will then attempt to connect to the target using this specified IO_DELAY_COUNT If basic connection is established the Unsecure Command File is executed CAUTION In case the Unsecure Command File has not been set up in the Target Interface Command Files dialog the following dialog box is displayed ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Unsecure Motorola HCS12 derivatives Unsecure Command File Figure 5 2 Unsecure command file disabled dialog box Unsecure command File is disabled 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 The address of the security register the mask and the compare value can be modified using command CHIPSECURE SETUP those parameters are then stored in t
11. allow to set a breakpoint in bank To solve this problem when the debugger stops on a hardware breakpoint the address if compared to an internal breakpoint list If the low 16 bits part of the address compare to the low 16 bits part of the address of a set breakpoint the breakpoint is located in an alternate bank The debugger then automatically restarts the target When those settings are done any breakpoint which is set in Non Volatile Memory is considered by the debugger as an Hardware Breakpoint If your application is loaded in RAM breakpoints are software breakpoints In this case the Hardware Breakpoint module gives you the possibility to debug with breakpoints and watchpoint only one watchpoint is available 80 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog NOTE In Automatic mode the Motorola HC12 or Motorola HCS12 hardware breakpoint modules allow only two breakpoints or one watchpoint at the same time If you are debugging your code in FLASH you can not set more than two breakpoints or one watchpoint Some actions like stepping over or stepping out use one internal breakpoint and therefore reduce your amount of hardware breakpoint to one The M68HC812A4 does not have any Hardware Breakpoint module 7 1 3 User Controlled mode This mode allows you to fully set up the breakpoint m
12. allows 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 Using HWBPM MODE you can set up which module to use the usage the debugger will do of the on chip hardware breakpoint module the on chip module address etc This command will have the same effect than using the Break Modules Settings index tab in the Hardware Breakpoint Configuration dialog Using HWBPM SETI6BITS command will have the same effect than using the 6 bits Break Module User Mode index tab in the Hardware Breakpoint Configuration dialog Parameters set up through this command are only relevant when the User controlled mode is active and the 16 bits break module is used Using HWBPM SET22BITS command will have the same effect than using the 22 bits Break Module User Mode index tab in the Hardware Breakpoint Configuration dialog Parameters set up through 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 The HWBPM REMAP _22BITS commands are used for the 22 bits module to perform remapping of pages in order to be able to set breakpoints in non banked memory areas when using this on chip break module When selecting a derivative this command is used by the debugger to set up the
13. bar has been selected 3 5 2 5 BREAKPOINT Execution of the application has been stopped because a breakpoint has been reached 3 5 2 6 WATCHPOINT Execution of the application has been stopped because a watchpoint has been reached ICD 12 Target Manual 35 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Default Environment 3 6 ICD 12 Target Interface Default Environment 3 6 1 Default Target Setup As any other target the CD 2 Target Interface can be loaded from the Target menu or can be set as a default target in the PROJECT file which should be located in the working directory Typically the target is set in the HI WAVE section from the PROJECT file as shown above However if the target is not defined yo can load the CD 12 Target Interface interactively Please refer to section Loading the ICD 12 Target Interface of this manual Listing 3 1 Example of HI WAVE section from PROJECT file HI WAVE Window0 Source 0 0 60 30 Windowl Assembly 60 0O 40 30 Window2 Procedur 0 30 60 25 Window3 Register 60 30 40 30 Window4 Memory 60 60 40 40 Window5 Data O 55 60 23 Window6 Data 0 78 60 22 Targeb CD12 NOTE Please see the Manual Engine HC12 pdf for further information about the PROJECT file 3 6 2 ICD 12 Target Interface Environment Variables 36 This section describes the environment variables which are used by the CD 2 Ta
14. corresponding remapping needed for the specified derivative e HWBPM REMAP_22BITS DISPLAY display all the currently set remapping for the currently set derivative e HWBPM REMAP_22BITS RANGE allows to specify that the prefix lt mask gt must be used to set a hardware breakpoint in range lt start address gt lt end address gt e HWBPM REMAP_22BITS MCUID_DEFAULT allows to retrieve the derivative default setting in case it has been modified using HWBPM REMAP_22BITS RANGE or HWBPM REMAP_22BITS DELETE ICD 12 Target Manual 85 For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Associated Commands 86 e HWBPM REMAP_22BITS DELETE lt range number gt allows to delete a specific range The range number is displayed when using HWBPM REMAP22BITS DISPLAY NOTE The range remapping are stored in the targetName section of the PROJECT file using variable HWBPD MCUIDnnn BKPT REMAPn Example The Hardware Breakpoints mechanism settings can be get 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 The current Module mode can be modified to User controlled and the used on chip hardware b
15. default Startup command file is STARTUP CMD e the default Reset command file is RESET CMD e the default Preload command file is PRELOAD CMD e the default Postload command file is POSTLOAD CMD e the default Vppon command file is VPPON CMD e the default Vppoff command file is VPPOFF CMD NOTE The settings performed in this dialog are stored for a later debugging session in the targetName section of the PROJECT file using variables CMDFILEO CMDFILE1 CMDFILEn 6 3 Associated Commands This section describes the Command Files command which can be used when the Target Interface is set The Target Interface specific commands are CMDFILE Those commands can be entered in the command files or in the Command Line component of the Metrowerks debugger This section describes each command available for the Target Interface The commands are listed in alphabetical order Topic Description Short Description Provides a short description of the command Syntax Specifies the syntax of the command in a EBNF format Description Provides a detailed description of the command and how to use it Example Small example of how to use the command ICD 12 Target Manual 73 For More Information www freescale com Freescale Semiconductor Inc Target Interface Commands Files Associated Commands CMDFILE Short Description Defines a command file path name and status enable disable Syntax CMDFILE lt file kind gt ON OFF l
16. high byte 2nd adr BKIMBL Mask low byte 2nd adr BKORWE RAw Cmp Enable 1st adr O BRORMW AW Cmp Value 1st adr TT BKIRMWE AAw Cmp Enable 2nd adr BKIRW RAW Cop Value 2nd adr Cancel Help The following registers can be modified BRPCTO TT BEKEN Breakpoint Enable T BEFULL Full Breakpoint Mode Enable BEKBOM Breakpoint BOM Enable BETAG Breakpoint on Tag e BKPCTO Breakpoint Control Register O e BKPCT1 Breakpoint Control Register 1 e BKPO Breakpoint Address Register e BKP1 Breakpoint Data Register For more information about those registers please refers to your MCU reference manual section Breakpoints of the Background Debug Mode Development Support part of the manual CAUTION When a hardware breakpoint or watchpoint is set in User controlled mode the message displayed in the status bar when the breakpoint or watchpoint is reached is ILLEGAL_BP If the control point set is a breakpoint 1t is needed to perform a single step before running again the target otherwise the target will endlessly break on the same address bus access ICD 12 Target Manual 83 For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Associated Commands 7 2 Associated Commands The following sections describe the Hardware Breakpoint Settings Command Line commands which are used by the Target Interface These variables are HWBPM Those commands can
17. on illegal break check box WARNING The M68HC812A4 does not have any Hardware Breakpoint module ICD 12 Target Manual 21 For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more How to Set Breakpoints in Non Volatile Memory 22 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual 3 1 Introduction An advanced feature of Metrowerks debugger for the embedded systems development world is the ability to load different Target Interfaces which implements the interface with target systems In this document the specific features of the JCD 2 Target Interface are described The CD 12 Target Interface allows to debug using P amp E Cable12 and BDM MULTILINK The P amp E Cable12 and BDM MULTILINK are interfaces developed by P amp E Microcomputer Systems and used by the Metrowerks debugger to communicate with a target system based on a Motorola HC12 or HCS12 With this interface you can download an executable program from the Metrowerks CodeWarrior HC 12 Studio to an external target system based on a Motorola HC12 or HCS12 which will execute the program You will also have the feedback of the real target system behavior to Metrowerks debugger The debugger will fully supervise and monitor the MCU of the target system 1 e control the CPU execution You can read and write in internal exte
18. supply 25 PPAGE 52 PPAGE Banked Memory Area 32 Preload command file 70 Profiling 23 PROJECT File 36 PROJECT INI 25 PROTOCOL 47 Protocol 25 R READY 34 REGBLKADR 47 Requirements 8 RESET 48 Reset 28 Reset command file 70 RUNNING 34 running 31 S Set Bank 29 Set BDM Speed 28 Set CLKSW bit in BDM control register 30 Set Hardware BP 29 Set MCU Speed 32 Set MCU Type 28 SETCLKSW 42 Show Protocol 30 SHOWPROT 43 Simulation 23 Startup command file 70 Status Message 34 HALTED 35 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc READY 34 Reset 35 RUNNING 34 STEPPED 35 STEPPED OVER 35 Stepping Message 35 STEPPED 35 STOPPED 35 TRACED 35 STOPPED 35 T Target Command Files 69 Target commands 73 Target Interface Associated Command Files 69 Target Interface Command Files dialog 72 Target Interface Dialogs 51 Target Interface Command Files dialog 72 TRACED 35 U unit_12z dll 24 Unsecure Command File 63 Unsecure derivative dialog box 61 Unsecure HCS12 derivatives 61 Unsecure 29 V Variable 36 Variables 67 Various index tab 54 Vppoff command file 71 Vppon command file 71 W WATCHPOINT 35 Watchpoint WATCHPOINT 35 98 ICD 12 Target Manual For More Information www freescale com
19. the ICD 12 Target Interface Select in the main menu Component gt Set Target as shown in Figure 3 3 ICD 12 Target Manual 25 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual Interfacing Your System with the Target Figure 3 3 Set Target dialog y HI WAYE CAHPMWAREADEMOAH CT 2 Icd 121D061 284 proje Data Window Help Osa s a Seen The Set Target dialog is displayed Choose CD12 Target Interface in the list of proposed targets and click OK File View Run Target Maa Fonts Background Color Figure 3 4 List of available targets interfaces Set Target Processor Target Interface ico 2 Target Interface Cancel BOE Target Interface D Bugl2 Target Interface Hites Emulator Target Interface Hel ILD12 Target Interface 2 Motorola Motosil Target Intlstace Moral Target Interface Simulator T arget Interface Trace32 Target Interface The debugger tries then to connect to the target if the CD 2 Target Interface is used for the first time the MCU ID of the derivative must be entered Figure 3 5 shows the dialog which is displayed Figure 3 5 MCU ID is not specified HI WAYE x x The MCU ID was not specified 26 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Menu Entries Click OK The MCU Selection di
20. value to store in ECLKDIV FCLKDIV is equal to oscillator frequency kHz 1400 0x40 to set PRDIV8 flag Datasheet proposed values oscillator frequency ECLKDIV FCLKDIV value hexadecimal 16 MHz S49 8 MHz S27 4 MHz 13 2 MHz S9 1 MHz S4 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Unsecure Motorola HCS12 derivatives Unsecure Command File 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 OxFF FPROT all protection disabled wb 0x105 0x30 clear PVIOL and ACCERR in FSTAT register ww 0x108 0xD000 write to FADDR address register ww 0x10A 0x0000 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 0x11A 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
21. you must set the start address and the end address of this memory range The number of pages must be specified in decimal e g 0 to 256 for HC812A4 The DPAGE register address must be specified in hexadecimal e g 0x34 for HC812A4 NOTE For the Hitex Target Interface the DPAGE index tab does not appear in this dialog box if the DPAGE register is not available on the currently connected Motorola HC12 derivative For this Target Interface it is not needed to enter the DPAGE register address 4 1 3 EPAGE index tab The EPAGE index tab of the Banked Memory Location dialog box lets you set up the EPAGE banked memory area ICD 12 Target Manual 53 For More Information www freescale com Freescale Semiconductor Inc HC12 and HCS12 Banked Memory support Banked Memory Location Dialog Box Figure 4 3 Banked Memory Location dialog EPAGE index tab Banked Memory Location E PPage DPage EPage Various Start Address hex 400 Register Address hex 35 End Address hex FF Number of pages dec 1256 W Enable Banked Memory rea Once you have enabled EPAGE memory banking by checking the Enable Banked Memory Area check box you must set the start address and the end address of this memory range The number of pages must be specified in decimal e g 0 to 256 for HC812A4 The EPAGE register address must be specified in hexadecimal e g 0x36 for HC812A4 NOTE For the Hitex Target Interface the EPAGE index ta
22. 00 End O00007FFF O0006FFF OOOOFFFF O001BFFF O002BFFF OOOSE FFF O0048FFF O00s56FFF OOOGBFFF OO07BFFF OF Cancel Enabled Programmed Enabled Programmed Enabled Programmed Protected Enabled Blank Protected Enabled Blank Enabled Programmed Protected Enabled Programmed Enabled Blanik Protected Enabled Blank Enabled Programmed Protected Help Browse Enable Wisane Protect Urnpatect 2 Check that the correct FPP file is selected in the Configuration panel This FPP file has to match with your derivative MCU ID set up through the MCU Selection dialog 3 Click on the Select All button as shown in Figure 2 9 All the non volatile memory modules present in the Module list are selected 14 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more How to load an Application in Flash EEPROM Figure 2 9 Selection Of All The Non Volatile Memory Modules Non Yolatle Memory Control Dialog FLASH_ 4000 FLASH_PAGEO FLASH _COOD FLASH_PAG FLASH_P FLASH Fe FLASH PAGES FLASH_ PAGES FLASH PAGE 4 Click the Unprotect button Enabled Programmed Enabled Blank Enabled Programmed Protected Enabled BlankProtected Enabled Blank Enabled Blank Protected Enabled Blank Enabled Blank Protected Enabled Blank Enabled Programmed Protected The module which were marked Protected i
23. 012 OxFO OxFO 0x00 0x08 0x11 NOTE MODE forcing the Normal Exp Wide mode this forcing must be done twice INITRG INITRM INITEE move on chip EEPROM from F000 to 1000 You will notice that the hardware setup steps 4 and 5 given by Motorola force the HC12A4 operating mode to Single Chip this to enable to start the background debugger Then you must force by software as shown above in the RESET CMD file the Expanded Wide mode to be able to access the on board 16 Kilobytes RAM mapped from C000 to SFFFF After the setup given above the new HC12A4 memory map is 0000 01FF CPU registers on chip MCU 0800 SOBFF user data area 1 Kilobyte on chip RAM MCU 1000 1FFF user code area 4 Kilobyte on chip EEPROM MCU ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Running Standard EVBs with a BDM pod MC68HC912B32EVB Evaluation Board SCO00 SFFFF user code data area 16 Kilobytes external RAM U4 USA 8 3 MC68HC912B32EVB Evaluation Board This Evaluation Board for the HC12 from Motorola is read to work in BDM mode It supports a M68HC912B32 processor To run a BDM pod with the MC68HC9 2B32EVB the jumper settings are the default of the board 8 4 MC68HC912D60EVB Evaluation Board This Evaluation Board for the HC12 from Motorola is read to work in BDM mode It supports a M68HC912D60 processor To run a BDM pod with the MC6SHC9 2D60EVB the ju
24. 9 Unsecure Motorola HCS12 derivatives Motorola HCS12 derivatives include a security circuitry to prevent unauthorized access to contents of FLASH EEPROM and RAM memory when background debugging The CD 12 Target interface provides a Unsecure function The ICD 12 gt Unsecure menu command and corresponding command line command CHIPSECURE UNSECURE allows to connect to the target through the Unsecure derivative dialog box and to execute the Unsecure Command File in order to unsecure the connected derivative NOTE Some of the Motorola HCS12 derivatives can NOT be unsecured while in Special mode this is not possible with all MC9S12DP256 derivatives mask please check Motorola User Manuals for the connected derivative 5 1 Unsecure derivative dialog box When selecting ICD 12 gt Unsecure the Unsecure derivative dialog is displayed ICD 12 Target Manual 61 For More Information www freescale com Freescale Semiconductor Inc Unsecure Motorola HCS12 derivatives Unsecure derivative dialog box Figure 5 1 62 Unsecure derivative dialog Unsecure derivative x In order to check the derivative status secured or unsecured the value of the l0_DEL4r _COLINT ts needed to connect to the target for CABLE12 16 oscillator frequency in MHz for CABLE12H5 200 oscillator frequency in MHz 1 0 DELS COUNT 11 Cancel Help In order to connect to the derivative the correct IO_ DELAY COUNT must be entered
25. AY HWBPM Remappings for 0x3CA RangeoO 0x4000 0x7FFF mask Ox3e Rangel 0x8000 OxBFFF 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 0x3CA RangeoO 0x4000 0x7FFF mask Ox3e Rangel 0xC000 OXFFFF mask 0x3f 7 3 Associated Environment Variables The following sections describe the Hardware Breakpoint Settings environment variables which are used by the Target Interface These variables are HWBPD MCUIDnnn BKPT REMAPn HWBPMn These variables are stored in the targetName section from the project file Example of the ICD 12 target section from a project file ICD12 HWBPMO HWBPM MODE AUTOMATIC BPM16BITS 0x28 SKIP_OFF HWBPM1 HWBPM SET16BITS 0x0 0x0 0x0 0x0 HWBPM2 HWBPM SET22BITS 0x0 0x0 0x0 0x0 ICD 12 Target Manual 87 For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Associated Environment Variables HWBPD_MCUID3C6_BKPT_REMAPO HWBPM REMAP_22BITS RANGE 0x4000 OX7FFF 0x3E HWBPD_MCUID3C6_BKPT_REMAP1 HWBPM REMAP_22BITS RANGE 0xC000 OxFFFF 0x3F HWBPD_MCUID3C7_BKPT_REMAPO HWBPM REMAP_22BITS RANGE 0x4000 OX7FFF 0x3E HWBPD_MCUID3C7_BKPT_REMAP1 HWBPM REMAP_22BITS RANGE 0xC000 OXFFFF 0x3F HWBPD_MCUID3CA_BKPT_REMAPO HWBPM REMAP_22BITS RANGE 0x4000 OX7FFF 0x3E HWBPD_MCUID3CA_BKPT_REMAP1 HWBPM REMAP_22BITS RANGE 0xC000 OXFFFF 0x3F The Hardware Break
26. AY_COUNT The divider is then updated in the edit box At start up the debugger will use the clock divider IO_DELAY_COUNT stored in the PROJECT file through variable BDMClockSpeed Auto detect At start up if connection attempts fail and the check box Auto detect is checked the debugger will try to find a fitting clock divider IO_DELAY_COUNT value If it was not possible to establish proper communication the dialog is displayed NOTE Selections are saved in the PROJECT file and used as default for the next session through variables BDMClockSpeed and BDMAutoSpeed 3 4 4 Non Volatile Memory Control Dialog Select entry ICD 12 gt Flash to display the Non Volatile Memory Control Dialog dialog as shown in Figure 3 13 Figure 3 13 Non Volatile Memory Control Dialog Non Yolatile Memory Control Dialog Configuration File M HW 6Q HC12SPROGSFPPSmcu03C4 fpp IY Auto select according to MCU ld Ox03C4 D Save and restore work space content FLASH_4000 FLASH _PAGEO FLASH_COOU FLASH_PAGE FLASH_PAGE FLASH_PAGES FLASH_PAGE4 FLASH PAGES FL4SH_PAGES FLASH_PAGE 00004000 00008000 OOWOCOO 0001000 00028000 00038000 00048000 00058000 nogesot 00078000 End 0000 FFF OD00BFFF O000 FFFF 00016FFF 00026FFF O003BFFF O004BFFF OD05BFFF OD06BFFF O00 BFFF OF Cancel Enabled Programmed Enabled Programmed Enabled Programmed Protected Enabled Blank Protected Enabled Blank Ena
27. BPD_MCUID3C6_BKPT_REMAPO HWBPM REMAP_22BITS RANGE 0x4000 OX7FFF 0x3E HWBPMn Short Description Contains a HWBPM Command Line command to be used to set up the Hardware Breakpoint Settings support Syntax HWBPMn lt one HWBPM Command Line command gt Default Defaults settings are retrieved according to the derivative from a common ini file Description The HWBPMn variable specifies the configuration of the Hardware Breakpoints module using HWBPM Command Line command Three entries should be present 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 dialog ICD 12 Target Manual 89 For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Associated Environment Variables Example HWBPMO HWBPM MODE AUTOMATIC BPM16BITS 0x28 SKIP_OFF HWBPM1 HWBPM SET 16BITS 0x0 0x0 0x0 0x0 HWBPM2 HWBPM SET22BITS 0x0 0x0 0x0 0x0 90 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc 8 Running Standard EVBs with a BDM pod 8 1 Connection between a BDM pod and an EVB board Motorola s Evaluation Boards also called EVB and other standard boards from other manufacturers are equipped with a BDM connector and therefore can be connected to any BDM interface Figure 8 1 represe
28. Command File The Preload command file is executed by the Metrowerks debugger right before an application is loaded to the target system through the Target Interface The Preload command file full name and status enable disable can be specified either with the CMDFILE PRELOAD Command Line command or using the Preload index of the Command Files dialog 70 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Target Interface Commands Files Target Interface Associated Command Files By default the PRELOAD CMD file located in the current project directory is enabled as the current Preload command file 6 1 4 Postload Command File The Postload command file is executed by the Metrowerks debugger right after an application has been loaded to the target system through the Target Interface The Postload command file full name and status enable disable can be specified either with the CMDFILE POSTLOAD Command Line command or using the Postload index of the Command Files dialog By default the POSTLOAD CMD file located in the current project directory is enabled as the current Postload command file 6 1 5 Vppon Command File The Vppon command file is executed by the Metrowerks debugger right before a Non Volatile Memory is erased or right before a file is programmed in Non Volatile Memory to the target system through the Target Interface Non Volatile Memory Control dialog Flash menu e
29. Freescale Semiconductor Inc ICD 12 Target Interface Revised 12 12 2002 metrowerks Software Starts Here lt q For More Information www freescale com Freescale Semiconductor Inc Metrowerks the Metrowerks logo and Code Warrior are registered trademarks of Metrowerks Corp in the US and or other countries All other tradenames and trademarks are the property of their respective owners Copyright O Metrowerks Corporation 2003 ALL RIGHTS RESERVED The reproduction and use of this document and related materials are governed by a license agreement media it may be printed for non commercial personal use only in accordance with the license agreement related to the product associated with the documentation Consult that license agreement before use or reproduction of any portion of this document If you do not have a copy of the license agreement contact your Metrowerks repre sentative or call 800 377 5416 if outside the US call 1 512 996 5300 Subject to the foregoing non commercial personal use no portion of this documentation may be reproduced or transmitted in any form or by any means electronic or mechanical without prior written permission from Metrowerks Metrowerks reserves the right to make changes to any product described or referred to in this document without further notice Metrowerks makes no warranty representation or guarantee regarding the merchantability or fitness of its prod ucts for any particular purpose nor d
30. ILINK to calculate the BDM frequency This variable is set according to the value entered in the edit box in the Set MCU Speed dialog For Example ICD 12 Target Manual 39 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Default Environment BDMClockSpeed 5 COMDEV Short Description Communication device Syntax COMDEV LPTn Alias None File PROJECT file Section ICD 12 Components ICD 12 Target Interface Description The communication port to be used on the host computer can be specified using the variable COMDEV LPT1 is the default communication device This variable is set according to the Communication Device edit box of the Communication Device Specification dialog For example 40 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Default Environment COMDEV LPT1 DETECTRUNNING Short Description Running target at connection detection on off Syntax DETECTRUNNING 0 1 Alias None File PROJECT file Section TEDLA Components ICD 12 Target Interface Description The DETECTRUNNING variable is used to store the status of the mechanism which detects if the derivative connected through the P amp E Cable12 or BDM MULTILINK cable is running at connection time This variable is set accordin
31. Location Command Line commands which are used by the Target Interface These variables are BANKWINDOW Those commands can be entered in the Target Interface associated command files or in the Command Line component of the debugger ICD 12 Target Manual 55 For More Information www freescale com Freescale Semiconductor Inc HC12 and HCS12 Banked Memory support Associated Commands The Banked Memory Location commands which are used by the Target Interface are described as shown in the following table Topic Description Short Description Provides a short description of the command Syntax Specifies the syntax of the command in a EBNF format Description Provides a detailed description of the command and how to use it Example Small example of how to use the command The following sections describe each command related to the Banked Memory Location available for the Target Interface The variables are listed in alphabetical order BANKWINDOW Short Description Specify a banked memory area and its status enable disable Syntax BANKWINDOW lt bank gt OFF ON lt range gt lt reg gt lt numofpages gt with bank PPAGE DPAGE EPAGE or BANKWINDOW VARIOUS DLGATCONNECT NODLGATCONNECT Description The command BANKWINDOW allows to set up the debugger to work in banked memory model Three different Banked Memory Area can be defined DPAGE EPAGE and PPAGE Each banked memory area has an associated bank
32. Manual 79 For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog Figure 7 3 Module base address edit box Hardware Breakpoints Configuration Break Module Settings 16 bits Break Module User Mode 2 bite Break Module User Mode Breakpoint Module Mode Breakpoint Module mode Automatic controlled by debugger Breakpoint Module Description Break point Module kind use 16 Bits Break Module use 16 Bits Break Module Breakpoint Module base address hen use 22 Bite Break Module Continue on illegal break banked hardware breakpoint 16 bits Break Cancel Help Breakpoint Module kind select here the hardware breakpoint module supported by the derivative currently connected use 16 Bits Break Module for a Motorola HC12 derivative and use 22 Bits Break Module for a Motorola HCS12 derivative Breakpoint Module base address hex in order to set the debugger correctly the address of the hardware breakpoint module must be set in the Module base address edit box The Module base address is typically 0x20 for the Motorola HC12 derivatives M68HC912B32 M68HC912D60 and M68HC912DG128 The Module base address is typically 0x28 for the Motorola HCS12 derivatives Continue on illegal break this feature allows when using the 16 Bits break module to debug in banked memory model The 16 bits break module does not
33. NDOW e CHIPSECURE e HWBPM e CMDFILE Those commands can be entered in the file or in the Command Line component of the debugger BDMAREASUPPORT Short Description step in BDM ROM Syntax BDMAREASUPPORT STATE OFF ON lt first address gt lt last address gt Alias None Components ICD 12 Target Interface Description This command allows to step in BDM ROM range Typically not useful as no program code should be stored in this area HWBREAKONLY Short Description force the debugger to use only hardware breakpoints ICD 12 Target Manual 45 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Command Line commands Syntax HWBREAKONLY OFF ON STATE Alias None Components ICD 12 Target Interface Description By default the debugger first tries to set a software breakpoint then if it is not possible it tries to set a hardware breakpoint Using this command you can disable this mechanism and force the debugger to use only hardware breakpoints without attempting to use first SWI software breakpoint LISTALLMCUIDS Short Description to list all the MCU IDs Syntax LISTALLMCUIDS OFF I ON STATE 46 Alias None Components ICD 12 Target Interface Description This command has been added as MCU Selection dialog lists by default only the HCI12 and HCS12 derivatives ICD 12 Target Manual Fo
34. POFF CMD Description The CMDFILEn variable specifies a command file definition using CMDFILE Command Line command If there are four Target Interface Commands Files for the Target Interface four of those entries should be present Those variables are used to store the command files status enable disable and full name specified either with the CMDFILE Command Line command or using the Command Files dialog Example CMDFILEO CMDFILE STARTUP ON startup cmd CMDFILE1 CMDFILE RESET ON reset cmd CMDFILE2 CMDFILE PRELOAD ON preload cmd CMDFILE3 CMDFILE POSTLOAD ON postload cmd CMDFILE4 CMDFILE VPPON OFF vppon cmd CMDFILE5 CMDFILE VPPOFF OFF vppoff cmd 76 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module On some HC12 and HCS12 derivatives an on chip hardware breakpoint module can be used to set triggers The Metrowerks debugger takes advantage of this embedded hardware breakpoint module to set hardware breakpoints and watchpoint To invoke this module it is necessary to set up the debugger to use this on chip hardware breakpoint module During the first connection the hardware breakpoints module settings are resolved according to the specified derivative Afterwards if the user change the derivative it is the user responsibility to setup correctly the hardware breakpoints mechanism for the project This can be done using the Hardw
35. Reset executes the Reset Command File and resets the target system processor 3 3 3 Communication or Connect Select entry ICD 12 gt Communication or ICD 12 gt Connect to display the Communication Device Specification dialog If the connection to the target has failed the entry Communication of menu ICD 12 is replaced with Connect 3 3 4 Command Files Select entry ICD 12 gt Command Files to display the CD 12 Target Interface Command Files dialog 3 3 5 Set MCU Type Choose ICD 12 gt Set MCU Type to open the MCU Selection dialog 3 3 6 Set BDM Speed Choose ICD 12 gt Set BDM Speed to open the Set MCU Speed dialog 28 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Dialogs 3 3 Set Hardware BP This menu entry is available only if the connection with the target system has been established Choose ICD 12 gt Set Hardware BP to open the Hardware Breakpoint Configuration dialog 3 3 8 Set Bank This menu entry is available only if the connection with the target system has been established Choose ICD 12 gt Set Bank to open the Banked Memory Location Dialog Box 3 3 9 Unsecure This menu entry is available only if the connection with the target system has been established Choose ICD 12 gt Unsecure to open the Unsecure derivative dialog box 3 3 10 Fla
36. Target Interface concept The Getting Started with CodeWarrior and ICD 12 and more section gives answers for common questions and describes how to use advanced features of the ICD 12 Target Interface You will find out First Steps with Code Warrior and the ICD 12 Target Interface How to load an Application in Flash EEPROM and How to Set Breakpoints in Non Volatile Memory The Interfacing Your System with the Target section contains information about the connection between the P amp E Cablel2 and BDM MULTILINK and the debugger The ICD 12 Target Interface Menu Entries section gives a description of the ICD 12 Target Interface specific menu entries The ICD 12 Target Interface Dialogs section gives a description of the I CD 12 Target Interface specific dialog boxes The Status Bar Information for the ICD 12 Target Interface section describes the status bar messages for the ICD 12 Target Interface The ICD 12 Target Interface Default Environment section lists all the variables used by this Target Interface to store the configuration The ICD 12 Target Interface Command Line commands section lists all the commands specific to this Target Interface The Unsecure Motorola HCS12 derivatives section describes how to use this Target Interface to unsecure a HCS 2 derivative The Running Standard EVBs with a BDM pod section describes how to connect to standard evaluation boards using the CD 12 ICD 12 Target Manual 7 For More Inform
37. _BKPT_REMAP1 HWBPM REMAP_22BITS RANGE 0xC000 OxFFFF 0x3F HWBPM1 HWBPM SET 16BITS 0x0 0x0 0x0 0x0 HWBPM2 HWBPM SET22BITS 0x0 0x0 0x0 0x0 BDMAutoSpeed 1 ICD 12 Target Manual 37 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Default Environment NOTE Please see the Flash Programming manual for NV_PARAMETER_FILE NV_SAVE_WSP and NV_AUTO_ID variables description BDMAutoSpeed Short Description Set 1f the debugger must check automatically for BDM frequency at connection Syntax BDMAutoSpeed 0 1 Alias None File PROJECT file Section ICD12 Components ICD 12 Target Interface Description If the BDMAutoSpeed variable is set to 1 the debugger automatically searches for the correct BDM frequency at connection This variable is set according to the Auto Detect check box in the Set MCU Speed dialog For example 38 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Default Environment BDMAutoSpeed 1 BDMClockSpeed Short Description Divider used to calculate the BDM frequency Syntax BDMCLockSpeed lt frequency divider gt Alias None File PROJECT file Section ICD12 Components ICD 12 Target Interface Description The BDMClockSpeed contains a divider which allows the P amp E Cable12 or BDM MULT
38. ablel2 or BDM MULTILINK The BDM port 6 pin connector is shown below Figure 3 2 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual Interfacing Your System with the Target Figure 3 2 The BDM port 6 pin connector Ground Reset Yee not connected not connected BGND The P amp E Cable12 or BDM MULTILINK to target system communication is serial The communication protocol is defined by Motorola in the CPU 12 Reference Manual section 8 Development and Debug Support However the user does not need to know this protocol to run an CD 2 Target Interface debugging session The P amp E Cable12 or BDM MULTILINK are power supplied by the target system This power supply must be conformed to the TTL standard If not the P amp E Cable12 or BDM MULTILINK should have its own supply Please also refer to the P amp E Cablel2 or BDM MULTILINK hardware manual from P amp E 3 2 2 Loading the ICD 12 Target Interface Usually the target is set in the HI WAVE section of the PROJECT file through the statement Target ICD12 In this way the CD 12 Target Interface detects automatically that the target is connected to your system However if nothing is detected the Communication Device Specification dialog pops up the target is not connected or is connected to a different port If no target is set in the PROJECT file or if a different target is set you can load
39. alog is opened as shown in Figure 3 6 Figure 3 6 MCU Selection dialog Unknown 000 MCL ID foao In order to initialise the Debugger and to pertorrn some operations the MCU type connected to the 20 12 cable has to be set corectly Please select the MCU which fits the connected MEL New Cancel Help In the drop down list box shown in Figure 3 7 select the derivative which is on your target system Figure 3 7 Drop down list box of the MCU Selection dialog MCBSHCS 06128 MCLU ID o 03c4 El LM Y E E bugger and to perform tupe connected to the correctly Please select nected MCU r New Cancel Help Close the MCU Selection dialog clicking OK connection to target 1s established 3 3 ICD 12 Target Interface Menu Entries After loading the CD 12 Target Interface the Target menu item is replaced by ICD 12 The different entries of the CD 12 menu are described in Figure 3 8 ICD 12 Target Manual 27 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Menu Entries Figure 3 8 ICD 12 Menu entries 1ED 12 Load Ckrl L Reset Ctrl F Communication Command Files Set MEU Type Set MCU Speed Set Hardware BP Unsecure h Flash 3 3 1 Load Choose ICD 12 gt Load to load the application to debug i e e g a abs file 3 3 2 Reset The menu entry ICD 12 gt
40. are Breakpoint Configuration dialog 7 1 Hardware Breakpoint Configuration dialog Choose ICD 12 gt Set Hardware BP menu command The Hardware Breakpoint Configuration dialog Break Module Settings index tab is displayed as shown in Figure 7 1 ICD 12 Target Manual 77 For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog Figure 7 1 Figure 7 2 78 Hardware Breakpoint Configuration dialog Hardware Breakpoints Configuration xl Break Module Settings 16 bits Break Module User Mode 22 bit Break Module User Mode Breakpoint Module Mode Breakpoint Module mode automatic controlled by debugger Breakpoint Module Description Breakpoint Module kind fuse 2e Bits Break Module Breakpoint Module base address hen ee T Continue on ilegal break banked hardware breakpoint 16 bits Break Module only Cancel Help Breakpoint Module Mode The Mode combo box allows to select between three different modes Disabled Automatic controlled by debugger and User controlled See Figure 7 2 This dialog allows to set up the hardware breakpoint module of the used Motorola HC12 or HCS12 derivative Hardware Breakpoint Configuration Breakpoint Module mode Hardware Breakpoints Configuration Break Module Settings 16 bits Break Module User Mode 2 bite Break Module User Mode
41. are used by the Target Interface These variables are BANKWINDOWn These variables are stored in the targetName section from the project file ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc HC12 and HCS12 Banked Memory support Associated Environment Variables Example of the BDIK target section from a project file BDIK BANKWINDOWO BANKWINDOW PPAGE ON 0x8000 OxBFFF 0x30 64 BANKWINDOW1 BANKWINDOW DPAGE OFF 0x7000 0x7FFF 0x34 256 BANKWINDOW2 BANKWINDOW EPAGE OFF 0x400 0x7FF 0x36 256 The Banked Memory Location environment variables which are used by the Target Interface are described as shown in the following table Topic Description Short Description Provides a short description of the variable Syntax Specifies the syntax of the variable in a EBNF format Default Shows the default setting for the variable Description Provides a detailed description of the variable and how to use it Example Small example of how to use the variable The following sections describe each variable available for the Target Interface The variables are listed in alphabetical order BANKWINDOWn Short Description Contains a BANK WINDOW Command Line command to be used to set up the Banked Memory support Syntax BANKWINDOWn lt one BANKWINDOW Command Line command gt Default All available banked memory area are disabled by default ICD 12 Target Manual 59 For More Informati
42. ation www freescale com Freescale Semiconductor Inc Overview Highlights e The On Chip Hardware Breakpoint Module section explains how to use the Hardware Breakpoint Configuration dialog to set hardware breakpoints and watchpoints e The Index contains all keywords of the JCD 2 Target Interface 1 2 Highlights The CD 12 Target Interface allows you to debug with the P amp E Cablel2 and P amp E BDM MULTILINK e Debugging in Flash is supported flash programming and hardware breakpoints e Periodical update for variables and memory is available for the JCD 2 Target Interface e The CD 12 Target interface offers the possibility to unsecure a secured Motorola HCS12 derivative see Unsecure derivative dialog box e Breakpoint insertion while the target is running intrusive e At connection the Target Interface can detect if the target processor is running The target processor 1s not reset and can be halted later see Communication Device Specification dialog e Register block moving handling on HCS 2 derivatives the Target Interface can automatically track device Registers block 0 3FF relocated via INITRG register setup For HC 2 derivatives a new command has been implemented to specify the new location of the register block REGBLKADR 1 3 Requirements In order to use the P amp E Cable12 or P amp E BDM MULTILINK the drivers from P amp E must be installed on the host computer A copy of those drivers are i
43. atives in gt CHIPSECURE SETUP OxFFOF 0x3 0x2 in gt 5 4 Associated Environment Variables The following sections describe the HC12 Unsecure environment variables which are used by the Target Interface These variables are CHIPSECURE These variables are stored in the targetName section from the project file Example of the ICD12 target section from a project file ICD12 CHIPSECURE CHIPSECURE SETUP OxFFOF 0x3 0x2 ICD 12 Target Manual 67 For More Information www freescale com Freescale Semiconductor Inc Unsecure Motorola HCS12 derivatives Associated Environment Variables The HCS12 Unsecure environment variables which are used by the Target Interface are described as shown in the following table Topic Description Short Description Provides a short description of the variable Syntax Specifies the syntax of the variable in a EBNF format Default Shows the default setting for the variable Description Provides a detailed description of the variable and how to use it Example Small example of how to use the variable The following sections describe each variable available for the Target Interface The variables are listed in alphabetical order CHIPSECURE Short Description Contains a CHIPSECURE Command Line command to be used to set up the HCS12 Unsecure mechanism Syntax CHTPSECURE lt CHIPSECURE SETUP Command Line command gt Description The CHIPSECURE variable specifies the HCS12 Unsecure me
44. b does not appear in this dialog box if the EPAGE register is not available on the currently connected Motorola HC12 derivative For this Target Interface it is not needed to enter the EPAGE register address 4 1 4 Various index tab not all Target Interfaces The Various index tab of the Banked Memory Location dialog box is not available for all Target Interfaces 54 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc HC12 and HCS12 Banked Memory support Associated Commands Figure 4 4 Banked Memory Location xl PPage DPage EPage Warious M Display dialog at connection if banked memory locations not defined If you are using an HC 2 derivative which supports banking and you don t want to enable this mechanism or if you want to use only one bank out of three you can suppress the automatic display of the Banked Memory Location dialog by checking the Display dialog at connection if banked memory locations not defined check box NOTE The settings entered in this dialog box are stored for a later debugging session in the targetName section of the project file NOTE When using the Hitex Target Interface and the M68HC12DG128 DProbeHC12 DG at least one page must be defined from 0x8000 to OxBFFF Otherwise some display problems might be encountered in the Memory component of the Metrowerks debugger 4 2 Associated Commands The following sections describe the Banked Memory
45. be entered in the Target Interface associated command files or in the Command Line component of the debugger The Hardware Breakpoint Settings commands which are used by the Target Interface are described as shown in the following table Topic Description Short Description Provides a short description of the command Syntax Specifies the syntax of the command in a EBNF format Description Provides a detailed description of the command and how to use it Example Small example of how to use the command The following sections describe each command related to the Banked Memory Location available for the Target Interface The variables are listed in alphabetical order HWBPM Short Description Hardware Breakpoints module usage settings Syntax HWBPM HWBPM MODE lt MODE gt BPM16BITS BPM22BITS lt module adr gt SKIP_OFF SKIP_ON with MODE DISABLED AUTOMATIC USER HWBPM SETIL6BITS lt BRKCTO value gt lt BRKCT1 value gt lt BRKA value gt lt BRKD value gt HWBPM SET22BITS lt BKPCTO value gt lt BKPCT1 value gt lt BKPO value gt lt BKP1 value gt 84 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Associated Commands HWBPM REMAP_22BITS RANGE lt start address gt lt end address gt lt mask gt HWBPM REMAP 22BITS DISPLAY HWBPM REMAP 22BITS MCUID DEFAULT HWBPM REMAP 22BITS DELETE lt range number gt Description The command HWBPM
46. bled Programmed Protected Enabled Programmed Enabled Blank Protected Enabled Blank Enabled Programmed Protected Help Browse Enable Digable Protect Urnpotect Erase Load ICD 12 Target Manual 33 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual Status Bar Information for the ICD 12 Target Interface The CD 12 Target Interface has a build in FLASH Programming interface to program on chip FLASH EEPROM modules that you can open when choosing ICD 12 gt Flash entry in the CD 12 menu Please see the Flash Programming manual to know more about the usage of this interface NOTE This FLASH Programming utility must be licensed to work without size limitation Check your license configuration 3 5 Status Bar Information for the ICD 12 Target Interface When the CD 12 Target Interface has been loaded specific information are given in the debugger s status bar see Figure 3 14 Figure 3 14 Status bar IMCESHCA 06123 CD12 ready Zz From left to right the name of the selected MCU and the status target status are displayed 3 5 1 Status Messages 3 5 1 1 ICD 12 ready Metrowerks debugger is ready and waits until a new target or application is loaded This message is generated once the Metrowerks debugger has been started and the connection to target system has been established 3 5 1 2 No Link To Target Connection to the target syst
47. chanism setup using a CHIPSECURE Command Line command Example CHIPSECURE CHIPSECURE SETUP OxFFOF 0x3 0x2 68 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Target Interface Commands Files 6 1 Target Interface Associated Command Files The Target Interfaces offer the possibility to play a specific command file on different events at connection Startup Command File at reset Reset Command File right before a file is loaded Preload Command File right after a file has been loaded Postload Command File right before a Non Volatile Memory is erased or right before a file is programmed in Non Volatile Memory Vppon Command File This command file can be used for example to enable a programming voltage by software This command file is not available for all Target Interfaces right after a Non Volatile Memory has been erased or right after a file has been programmed in Non Volatile Memory Vppoff Command File This command file can be used for example to disable a programming voltage by software This command file is not available for all Target Interfaces The command files full name and status enable disable can be specified either with the CMDFILE Command Line command or using the Command Files dialog You can use any Metrowerks debugger command in those files and take advantage of the wide set of commands introduced in the Metrowerks debugger manual to set
48. ection MCU Selection x MCBSHC91206128 MCLU ID Jox03c4 MCBBHCS1 2061 28 bugger and to perform tupe connected to the corectly Please select nected MCL New Cancel Help 15 Close the MCU Selection dialog clicking OK Connection to target is established 16 The debugger s main menu contains a CD 12 entry see Figure 2 7 from where your can reset the application when selecting Reset set the communication parameters when selecting Communication or load a ABS application to debug when selecting Load etc 12 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more How to load an Application in Flash EEPROM Figure 2 7 ICD 12 Menu Entry 2 True Time Simulator amp Real Time Debugger Ch temp mesi File View Pun ICD 12 Component Memory Window Help E E Load Cbrl L Reset Crrl R CET Communication CAtempimos921 Command Files called Set MCU Type erated by th fori Set MCU Speed e the progr Set Hardware BP oe ter E Ursz aura z ALI mar tht H Flash LA ha in arte a o S 2 3 How to load an Application in Flash EEPROM The CD 12 Target Interface offers the possibility to directly program the on board Flash EEPROM of your MCU The following steps show you how to load an application in the on chip Flash EEPROM of a d
49. em has failed 3 5 1 3 RUNNING The application is currently executing on the target 34 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual Status Bar Information for the ICD 12 Target Interface 3 5 1 4 HALTED Execution of the application has been stopped on user request The menu entry Run gt Halt or the Halt icon in the tool bar has been selected 3 5 1 5 RESET This message is generated when the Metrowerks debugger has been reset on user request The menu entry ICD 12 gt Reset or the Reset icon in the tool bar has been selected or the command Reset has been used 3 5 2 Stepping and Breakpoint Messages 3 5 2 1 STEPPED Execution of the application has been stopped after a single step on source level The menu entry Run gt Single Step or the Single Step icon in the tool bar has been selected 3 5 2 2 STEPPED OVER Execution of the application has been stopped after a step over a function call The menu entry Run gt Step Over or the Step Over icon in the tool bar has been selected 3 5 2 3 STOPPED Execution of the application has been stopped after a step out from function call The menu entry Run gt Step Out or the Step Out icon in the tool bar has been selected 3 5 2 4 TRACED Execution of the application has been stopped after an single step on assembler level The menu entry Run gt Assembly Step or the Assembly Step icon in the tool
50. erivative debugged using the JCD 2 Target Interface Those steps imply the target board is correctly power supplied and the programming voltage for flash programming is applied to the target system CAUTION When using stationery the application is automatically loaded in flash using the Preload Command File and Postload Command File When Flashing using the Non Volatile Memory Control dialog ICD 12 Target Manual 13 For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more How to load an Application in Flash EEPROM please make sure the Preload and Postload command files are disabled 1 Make sure the Preload and Postload command files are disabled in the CD 12 Command Files dialog menu command ICD 12 gt Command Files 1 Once the debugger is started and the connection with the board is correctly established choose ICD 12 gt Flash The Von Volatile Memory Control Dialog dialog is then opened as shown in Figure 2 8 Figure 2 8 Non Volatile Memory Control Dialog Configuration Files 3 N SHWwEO HC12SPROGSFPPYmcu03C4 top M Auto select according to MCU 4d 0x0304 Save and restore work space content FLASH_4000 FLASH_PAGEO FLASH_COOO FLASH_PAGE FLASH_PAGE FLASH_PAGES FLASH_PAGE4 FLASH_PAGES FLASH_PAGES FLASH_PAGE 00004000 OOOOsO00 OOOOCOON 0001 8000 00028000 00038000 0004000 00058000 DO006S000 000780
51. 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 wb 0x106 0x20 write MEMORY PROGRAM command in FCMD register wb 0x105 0x80 clear CBEIF in FSTAT register to execute the command wait 20 wait for command to complete reset ICD 12 Target Manual 65 For More Information www freescale com Freescale Semiconductor Inc Unsecure Motorola HCS12 derivatives Associated Commands FLASH MEMMAP restore regular flash programming monitor undef CLKDIV undefine variable 5 3 Associated Commands The following sections describe the HCS12 Unsecure Command Line commands which are used by the Target Interface These variables are CHIPSECURE Those commands can be entered in the Target Interface associated command files or in the Command Line component of the debugger The HCS12 Unsecure commands which are used by the Target Interface are described as shown in the following table Topic Description Short Description Provides a short description of the command Syntax Specifies the syntax of the command in a EBNF format Description Provides a detailed description of the command and how to use it Example Small example
52. g At connection the Target Interface can detect if the target processor is running The target processor is not reset and can be halted later Then application file ABS symbols can be reloaded to match current code with initial application file and keep on debugging This option can be enabled disabled default using this check box TIP The Show Protocol is a useful debugging feature if there is a communication problem 3 4 2 MCU Selection Select entry ICD 12 gt Set MCU Type to display the MCU Selection dialog as shown in Figure 3 10 Figure 3 10 MCU Selection dialog MCBSHCS 206128 MCU ID AE In order to initialize the Debugger and to perform some operations the MCU type connected to the 20 12 cable has to be set corectly Please select the MCU which fits the connected MCU New Cancel Help This dialog allows you to select the MCU currently used There are two drop list Combo controls They show the currently selected MCU name and the corresponding MCU ID The information will be taken from the file MDSEMCU INI If a specific MCU is not found in this file the user is advised to update his installation The selection will be saved and used as default for the next session If the expected MCU name is not contained in the MCU list press the New button to open the following dialog Figure 3 11 ICD 12 Target Manual 31 For More Information www freescale com Freescale Semiconductor Inc
53. g to the At Connection detect if the target is running check box in the Communication Device Specification dialog For example DETECTRUNNING 1 ICD 12 Target Manual 41 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Default Environment MCUID Short Description MCU ID of the connected derivative Syntax MCUID lt MCU ID of the connected derivative gt Alias None File PROJECT file Section ICD12 Components ICD 12 Target Interface Description The MCUID variable is used to store the MCU ID of the derivative connected through the P amp E Cablel2 or BDM MULTILINK cable Each MCU has its own MCU ID which is assigned by Motorola This variable is set according to the MCU ID selected in the MCU Selection dialog For example MCUID 0x3c4 SETCLKSW Short Description CLKSW on off 42 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Default Environment Syntax SETCLKSW 0 1 Alias None File PROJECT file Section ICD12 Components ICD 12 Target Interface Description The SETCLKSW variable is used to store the status of the mechanism which uses the CLKSW bits of the BDCSCR register to synchronize the communication This variable is set according to the Set CLKSW bit in BDM control register check box in the Co
54. get Interface Figure 2 1 New Project dialog Mew Project x Select project stationery Project Stationery E DP256B e Absolute Assembly Assembly Cand Assembly C with Processor Expert oe OPSIZZE Cancel 4 From the available project stationery select the stationery which corresponds to the derivative connected to your hardware and press OK 5 Now you have a project with all files set up Use the menu Project gt Set Default Target gt P amp E to use the CD 12 Target Interface Figure 2 2 Selecting P amp E Build Target A A Ml E 0 Simulator E Y lt A Pa p Pe E awn OOOO A readme tet HE Sources 0 1 03 Startup Code 0 4 03 Pim 0 4 03 Libs 0 o ELUS Debranar Crad Eilas o o o o ___ ll O H E Debugger Project File 6 files 6 Make sure that the board hardware settings are the default settings for the BDM mode please see your user manual 7 Then connect the P amp E Cable12 or BDM MULTILINK to the parallel communication port LPT1 or LPT2 of your PC using a parallel cable 8 Power supply the board with the appropriate voltage 10 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more First Steps with CodeWarrior and the ICD 12 Target Interface 9 Start the debugger using the menu Project gt Debug which loads automatically the application into the target The first time
55. he project file 5 2 Unsecure Command File The Unsecure command file can be set up using the CD 12 Target Interface Command Files dialog Choose ICD 12 gt Command Files and click the Unsecure index tab This command file is executed in order to unsecure a secured Motorola HCS12 derivative using ICD 12 gt Unsecure menu entry ICD 12 Target Manual 63 For More Information www freescale com Freescale Semiconductor Inc Unsecure Motorola HCS12 derivatives Unsecure Command File Figure 5 3 64 Unsecure index tab ICD 12 Target Interface Command Files The Ungecure command file is executed to unsecure the connected MC39512 derivative Acmdpee erase unsecure hczl2 cmd Browse Startup Reset Preload Postload ppon Wppof Unsecure W Enable Command File Cancel Help Here is an example of command file to be used to unsecure an HCS 2 derivative a Ld 2 Pi El S A if El del if a 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
56. is possible to backup the monitor by flashing the monitor to the chip again The monitor program can be found on the Axiom CD 94 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Index Symbols abs 28 Numerics 16 bits Break Module User Mode 81 22 bits Break Module User Mode 82 A Associated Environment Variables 67 At Connection detect 1f the target is running 31 Axiom CML12S DP256 94 B Banked Memory Location dialog 51 Banked Memory Location Target commands 55 BDM 91 BDM connector 24 25 BDM MULTILINK 32 BDM Multilink 62 BDMAREASUPPORT 45 BDMAutoSpeed 38 BDMClockSpeed 39 BREAKPOINT 35 Breakpoint 21 79 81 BREAKPOINT 35 Message 35 C CABLE12 32 Cablel2 62 CABLE12HS 32 CLKSW 30 clock divider 32 CMDFILE 74 CMDFILEn 75 COMDEV 40 Command Files 28 69 Commands 55 66 73 84 Communication 28 Communication Device 30 Communication device 30 Communication Device Specification 30 ICD 12 Target Manual Connect 28 Connection 24 Coverage 23 D DETECTRUNNING 41 Display Bank Memory Location dialog at connection 55 DPAGE 52 DPAGE Banked Memory Area 52 E Environment variables 36 EPAGE 53 EPAGE Banked Memory Area 53 EVB 91 EVB912DP256 94 F Flash Programming 33 Flash programming 71 Flash 29 H HALTED 35 Hardware Breakpoint 77 Hardware Breakpoint module Automatic controlled by debugger mode mode 79 Disabled mode 79 User c
57. la HC12 CPU12 or HCS12 The Banked Memory Location dialog box can be opened by selecting the menu entry TargetName gt Set Bank In this section TargetName is the name of the Target Interface like SDI Hitex BDIK ICD 12 Noral BDM etc Using some Target Interfaces the Banked Memory Location dialog box automatically pops up when the Target Interface is used with a Motorola HC12 or HCS12 derivative that supports banking In this case it also pops up when the banked memory area locations are not defined in the project file of the current project directory In this dialog box you can define which banked memory you want to use and its location The PPAGE DPAGE and the EPAGE indexes are supported if they are available on the currently connected HC12 or HCS12 derivative The Banked Memory Location dialog box can have up to four index tabs e The PPAGE index tab e The DPAGE index tab e The EPAGE index tab e The Various index tab not all Target Interfaces ICD 12 Target Manual 51 For More Information www freescale com Freescale Semiconductor Inc HC12 and HCS12 Banked Memory support Banked Memory Location Dialog Box 4 1 1 PPAGE index tab The PPAGE index tab of the Banked Memory Location dialog box lets you set up the PPAGE banked memory area Figure 4 1 Banked Memory Location dialog PPAGE index tab Banked Memory Location E PPage DPage EPage Various Start Address hex poog Register Address he
58. lick OK or Connect to try to connect to the target system through the P amp E Cable12 or BDM MULTILINK connected to the parallel port specified in the Communication Device edit box When clicking Cancel in the Communication Device Specification dialog the dialog box and the environment can be quit Communication Device The Communication Device edit box allows to specify the current communication port The default device is LPT1 Show Protocol The Show Protocol check box allows to switch on off the displays of the messages sent between the CD 12 Target Interface and the debugger If the Show Protocol box is checked all the commands and responses sent and received are reported in the Command Line window Set CLKSW bit in BDM control register With some Motorola HCS12 derivatives e g MC9SI2DP256 mask 0K79X when the PLL is enabled and the BDC is set to use the external oscillator frequency this is the default CLKSW 0 the BDC will no longer operate properly chip defect This problem did not affect the original HC 2 and HCS12 devices Solution before the user code enables the PLL the CLKSW bit ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Dialogs in the BDCSCR must be set This can be done using this check box We do not set this automatically because it may affect other devices At Connection detect if the target is runnin
59. mmunication Device Specification dialog For example SETCLKSW 1 SHOWPROT Short Description Set Show Protocol On Off Syntax SHOWPROT 1 0 Alias None ICD 12 Target Manual 43 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Command Line commands File PROJECT file Section ICD12 Components ICD 12 Target Interface 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 For example SHOWPROT 1 TIP The Show Protocol is a useful debugging feature if there is a communication problem 3 7 ICD 12 Target Interface Command Line commands This section describes the JCD 2 Target Interface specific commands which can be used when the CD 2 Target Interface is set 44 The CD 12 Target Interface specific commands are BDMAREASUPPORT HWBREAKONL Y LISTALLMCUIDS PROTOCOL REGBLKADR RESET ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Command Line commands Some other common Target Interface features are using commands Those commands are e BANKWI
60. more How to Set Breakpoints in Non Volatile Memory 2 4 How to Set Breakpoints in Non Volatile Memory Once an application has been loaded in non volatile memory the hardware breakpoint module must be configured in order to allow you to debug using breakpoints During the first connection the hardware breakpoints module settings are resolved according to the specified derivative Afterwards if the user change the derivative it is his responsibility to setup correctly the hardware breakpoints mechanism for the project 1 Select ICD 12 gt Set Hardware BP menu entry The Hardware Breakpoint Configuration dialog is displayed as shown in Figure 2 15 2 Select the Automatic controlled by debugger mode in the Mode list 3 Select the Breakpoint Module kind of the hardware breakpoint module supported by the derivative currently connected use 16 Bits Break Module for a Motorola HCT12 derivative and use 22 Bits Break Module for a Motorola HCS12 derivative 4 In order to set the debugger correctly the address of the hardware breakpoint module must be set in the Module base address edit box e The Module base address is typically 0x20 for the Motorola HC12 derivatives e The Module base address is typically 0x28 for the Motorola HCS12 derivatives 5 When those settings are done any breakpoint which is set in Non Volatile Memory is considered by the debugger as an Hardware Breakpoint 20 ICD 12 Target Manual For More
61. mper settings are the default of the board The BDM connector of the BDM cable must be connected to the BDM connector of the board J17 8 5 MC68HC912DG128EVB Evaluation Board This Evaluation Board for the HC12 from Motorola is ready to work in BDM mode It supports a M68HC91I2DG128 processor To run a BDM pod with the MC68HC9I2DGI28EVB the jumper settings are the default of the board The BDM connector of the BDM cable must be connected to the BDM connector of the board J16 ICD 12 Target Manual 93 For More Information www freescale com Freescale Semiconductor Inc Running Standard EVBs with a BDM pod EVB912DP256 Evaluation Board 8 6 EVB912DP256 Evaluation Board This Evaluation Board for the HCS12 from Motorola is ready to work in BDM mode It supports a MC9S12DP256 processor To run a BDM pod with the EVB912DP256 the jumper settings are the default of the board The BDM connector of the BDM cable must be connected to the BDM IN connector of the board J19 8 7 Axiom CML12S DP256 Code Warrior does not support the Axiom MON 12 monitor But the board can be monitored by using the BDM interface To run a BDM pod with the CML12S DP256 make sure the MODC jumper is installed Without it the BDM application may cause communication problems with the host All other jumpers can be left on default settings WARNING By Flashing the board with an application the Axiom MON12 monitor will be overwritten It
62. n the Modules list are now marked Unprotected see Figure 2 10 ICD 12 Target Manual 15 For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more How to load an Application in Flash EEPROM Figure 2 10 Unprotecting The Non Volatile Memory Modules Non Yolatile Memory Control aaa E Configuration File N SH60_HC12SPROGSFPP mcu0sC4 ipp M Auto select according to MCU ld 0x0304 Save and restore work space content FLASH_ 4000 FLASH _PAGEO FLASH_COOO FLASH_PAGE FLASH_PAGE FLASH_PAGES FLASH_PAGE4 FLASH _PAGES FLASH_PAGEE FLASH PAGE End O0007FFF OOOOB FFF QOOOFFFF O 00018FFF DO028FFF DO04BFFF OOOSE FFF OOOBE FFF 00 DOO BFFF Browse i Select All Enabled Programmed Enabled Blank A o Unprotected EnabledBlank Unprotected Enabled Blank EnabledBlank Unprotected Enabled Blank Enabled Blank LUnprotected Enabled Blank Enabled Programmed Linprotected Enable Disable Protect Whproterct Erase Load terei OF Cancel Help 5 Click the Erase button The module which were marked Programmed in the Modules list are now marked Blank as shown in Figure 2 11 16 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more How to load an Application in Flash EEPROM Figure 2 11
63. nstalled while installing Metrowerks Code Warrior for HC12 Studio For more information please see section Interfacing Your System with the Target 8 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more Thanks for choosing CodeWarrior This section guides you through installation licensing registration and first steps with CodeWarrior and the CD 12 Target Interface It does not replace all the documentation provided but gives you a good starting point 2 1 Technical Considerations about ICD 12 Target Interface A parallel cable should be used for the communication between the P amp E Cablel2 or BDM MULTILINK and the host computer The communication protocol between the P amp E Cablel2 or BDM MULTILINK and host is fully handled by the unit_12z dll Target driver which is automatically loaded with the CD 2 Target Interface 2 2 First Steps with CodeWarrior and the ICD 12 Target Interface ICD 12 Target Manual 1 Run the CodeWarrior IDE with the shortcut created in the program group 2 Choose the menu File gt New to create a new project from a stationery 3 Select HC12 Stationery type in a project name and specify the project location Press OK For More Information www freescale com Freescale Semiconductor Inc Getting Started with CodeWarrior and ICD 12 and more First Steps with CodeWarrior and the ICD 12 Tar
64. ntry or FLASH PROGRAM ERASE commands from Flash Programming utilities The Vppon command file full name and status enable disable can be specified either with the CMDFILE VPPON Command Line command or using the Vppon index of the Command Files dialog By default the VPPON CMD file located in the current project directory is enabled as the current Vppon command file This command file can be used for example to enable a programming voltage by software WARNING This command file is not available for all Target Interfaces 6 1 6 Vppoff Command File The Vppoff command file is executed by the Metrowerks debugger right after a Non Volatile Memory has been erased or right after a file has been programmed in Non Volatile Memory to the target system through the Target Interface Non Volatile Memory Control dialog Flash menu entry or FLASH PROGRAM ERASE commands from Flash Programming utilities ICD 12 Target Manual 71 For More Information www freescale com Freescale Semiconductor Inc Target Interface Commands Files Command Files dialog The Vppoff command file full name and status enable disable can be specified either with the CMDFILE VPPOFF Command Line command or using the Vppoff index of the Command Files dialog By default the VPPOFF CMD file located in the current project directory is enabled as the current Vppoff command file This command file can be used for example to disable a programming voltage b
65. nts a typical layout of an evaluation board Figure 8 1 Layout of a Motorola Evaluation Board o MCU 1 0 and Bus Signal Connectors ft Memory Sockets yi Power Supply Connector MCU Socket serial Connector M6SHC7ZA4EVB Evaluation Board Some boards have a 6 pin BDM male connector and some have a 10 pin BDM male connector ICD 12 Target Manual 91 For More Information www freescale com Freescale Semiconductor Inc Running Standard EVBs with a BDM pod MC68HC812A4EVB Evaluation Board On the ribbon cable the red wire is the wire number 1 Pin 1 of the male BDM in connector of EVB boards is identified by the number 1 written on the board or by a square pad copper side of the board under the connector 8 2 MC68HC812A4EVB Evaluation Board This Evaluation Board for the HC12 from Motorola is ready to work in BDM mode It supports a HC12A4 processor This procedure is extracted from the ACI2A4EVBUM D hardware manual from Motorola Appendix F to run the MC68HC812A4EVB with a BDM interface 1 Remove the jumper on header W11 from CSD 2 Move the CSPO jumper on W11 to pins 2 3 3 Remove the BKGD jumper W30 4 The MODA jumper W34 must short cut the pin and pin 2 5 The MODB jumper W42 must short cut the pin 1 and pin 2 wh wb wb wb wb 92 6 Software setup to be inserted in the Startup Command File and in the Reset Command File of your current project Ox000B Ox000B 0x0011 0x0010 0x0
66. nvironment Gate ioe ee amp Fe oe AO ICD 12 Target Interface Command Line commands 44 HC12 and HCS12 Banked Memory support 51 Banked Memory Location Dialog Box a ee esa PPAGE index taD 4 5 es amp eee Ge ewe ee Oe ses OZ DPAGE index tab s o a s a 0 Se we we we ee www we we we ew OZ EPAGE index tab l oe eee Gee 6 eee a E Various index tab not all Target edi AAA A Associated Commands 0 eee ee ee ee we SS Associated Environment Variables eee ee 58 Unsecure Motorola HCS12 derivatives 61 Unsecure derivative dialog box eee eee G1 Unsecure Command File 2 2 63 Associated Commands 2 0 0 02 ee ee ew ee 66 Associated Environment Variables ee eee ee ee 67 Target Interface Commands Files 69 Target Interface Associated Command Files 2 2 2 2 2 69 Startup Command File 2 70 Reset Command File 2 2 2 2 2 70 Preload Command File 2 2 2 70 Postload Command File 2 ee ee ew TI Vppon Command File 2 a ee 1 Vppoff Command File 2 2 2 71 Command Files dialog 2 2 2 2 2 2 72 Associated Commands o TB Associated Environment Variables 2 we ee ee ee ee ee 75 On Chip Hardware Breakpoint Module 77 Hardware Breakpoint Configuration dialog
67. odule according to Motorola s documentation According to the selected breakpoint module kind selected through the Breakpoint Module Description combo box in the Break Module Setup index tab the 16 bits Break Module User Mode or 22 bits Break Module User Mode must be selected the control are grayed in the User Mode index tab if the correct Mode User Controlled and correct breakpoint module kind is not selected 7 1 3 1 16 bits Break Module User Mode The 6 bits Break Module User Mode index tab allows to set up the hardware breakpoint module of the connected Motorola HC12 derivative when the Breakpoint Module mode is set to User controlled and the Breakpoint Module Kind is set to use 16 Bits Break Module ICD 12 Target Manual 81 For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Hardware Breakpoint Configuration dialog Figure 7 4 16 bits Break Module User Mode index tab Break Module Settings 16 bite Break Module User Model 2 bite Break Module User Mode BRECT1 BRKA hes 0 BRKD hex f FT BKDBE Enable Data Bus BEMBH Breakpoint Mask High TT BEMBL Breakpoint Mask Low TT BRKIRWE Aw Compare Enable O BEIRW Asa Compare Value BEORWE Rew Compare Enable TT BKORW RA Compare Value Cancel Help The following registers can be modified e BRKCTO Breakpoint Control Register 0 e BRKCT1 Breakpoint Control Register 1
68. oes Metrowerks assume any liability arising out of the application or use of any product described herein and specifically disclaims any and all liability Metrowerks software is not authorized for and has not been designed tested manufactured or intended for use in developing applications where the fail ure malfunction or any inaccuracy of the application carries a risk of death serious bodily injury or damage to tangible property including but not limited to use in factory control systems medical devices or facilities nuclear facilities aircraft navigation or communication emergency systems or other applications with a simi lar degree of potential hazard USE OF ALL SOFTWARE DOCUMENTATION AND RELATED MATERIALS ARE SUBJECT TO THE METROWERKS END USER LICENSE AGREEMENT FOR SUCH PRODUCT How to Contact Metrowerks Corporate Headquarters Metrowerks Corporation 7700 West Parmer Lane Austin TX 78729 U S A World Wide Web http www metrowerks com Sales Voice 800 377 5416 Fax 512 996 4910 Email sales O metrowerks com Technical Support Voice 800 377 5416 Email support metrowerks com For More Information www freescale com Freescale Semiconductor Inc Table of Contents 1 Overview 1 1 About this guide 1 2 Highlights 1 3 Requirements 2 Getting Started with CodeWarrior and ICD 12 and more 2 1 Technical Considerations about ICD 12 Target Interface 2 2 First Steps with CodeWar
69. of how to use the command The following sections describe each command related to the Banked Memory Location available for the Target Interface The variables are listed in alphabetical order CHIPSECURE Short Description Setup the HCS 12 Unsecure mechanism and unsecure the connected derivative 66 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Unsecure Motorola HCS12 derivatives Associated Environment Variables Syntax CHIPSECURE UNSECURE CHIPSECURE SETUP lt addr reg to check gt lt mask gt lt compare value gt Description The command CHIPSECURE SETUP allows to set up the debugger unsecure mechanism lt addr reg to check gt address of the security register by default Ox FFOF lt mask gt comparison mask for the security register by default 0x03 lt compare value gt comparison value for the security register by default 0x02 The command CHIPSECURE UNSECURE allows to unsecure the connected derivative same than selecting ICD 12 gt Unsecure using the settings performed using the CHIPSECURE SETUP command When using CHIPSECURE UNSECURE the Unsecure command file is executed and the secured derivative check process is performed to check if the derivative is unsecured the debugger reads lt addr reg to check gt mask it with lt mask gt and compare it to lt compare value gt Example The following command setup the CHIPSECURE for most HCS12 deriv
70. on www freescale com Freescale Semiconductor Inc HC12 and HCS12 Banked Memory support Associated Environment Variables 60 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 Ox 7FFF 256 pages allowed with PPAGE register at address 0x34 The default EPAGE memory banked area is 0x400 to Ox 7FF 256 pages allowed with PPAGE register at address 0x36 The default settings for the VARIOUS page is that the Banked Memory Location dialog is displayed automatically when connecting when settings are not done do only apply to the Hitex Target Interface Description The BANKWINDOWn variable specifies a command file definition using BANKWINDOW Command Line command Three or four of those entries should be present in the PROJECT file depending on the Target Interface Those variables are used to store the Banked Memory Location definition range address number of pages and status enable disable specified either with the BANKWINDOW Command Line command or through the Banked Memory Location Dialog Box Example BANKWINDOWO BANKWINDOW PPAGE OFF 0x8000 OxBFFF 0x30 64 BANKWINDOW1 BANKWINDOW DPAGE OFF 0x7000 0x7FFF 0x34 256 BANKWINDOW2 BANKWINDOW EPAGE OFF 0x400 0x7FF 0x36 256 BANKWINDOW3 BANKWINDOW VARIOUS DLGATCONNECT ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc
71. ontrolled mode 81 Hardware Breakpoints SettingTarget commands 84 Hardware Connection 24 HCS12 Unsecure Target commands 66 Highlights 8 How To Loading an Application in Flash EEPROM 13 Setting Breakpoints in Non Volatile Memory 20 HWBPM 85 HWBPM MODE 85 HWBPM REMAP_22BITS 85 HWBPM REMAP_22BITS DELETE 86 HWBPM REMAP_22BITS DISPLAY 85 95 For More Information www freescale com Freescale Semiconductor Inc HWBPM REMAP_22BITS MCUID_DEFAULT 85 HWBPM REMAP_22BITS RANGE 85 HWBPM SETI6BITS 85 HWBPM SET22BITS 85 HWBREAKONLY 45 I I O 23 ICD 12 Default target 36 Menus 36 ICD 12 gt Command Files 28 ICD 12 gt Communication 28 ICD 12 gt Connect 28 ICD 12 gt Flash 29 ICD 12 gt Load 28 ICD 12 gt Reset 28 ICD 12 gt Set Bank 29 ICD 12 gt Set BDM Speed 28 ICD 12 gt Set Hardware BP 29 ICD 12 gt Set MCU Type 28 ICD 12 gt Unsecure 29 icd12 tgt 36 INITRG 48 IO_DELAY_COUNT 32 62 L LISTALLMCUIDS 46 Load 28 Loading an application 28 LPT1 10 LPT2 10 M MC68HC812A4EVB 92 MC68HC912B32EVB 93 MC68HC912D60EVB 93 MC68HC912DG128EVB 93 MCU Selection dialog 27 MCUID 42 MDSEMCU INI 31 32 Metrowerks Debugger Status Bar 34 Module base address 80 96 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc N Non Volatile Memory 71 0 Overview 7 P P amp E Microcomputer Systems 23 PLL 30 Postload command file 71 Power
72. ormation is passed to the target and the debugger is updated This command must be performed after the register block address has been changed by the user application when the application is stopped after a step a stop a breakpoint or any other event Short Description reset of the target board Syntax Alias None ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Command Line commands Components ICD 12 Target Interface Description With this command it is possible to reset the target from the Command Line component of the debugger The target board is reset and the reset vector is read in the target memory from the vector table address OXFFFE For example RESET ICD 12 Target Manual 49 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Command Line commands 50 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc 4 HC12 and HCS12 Banked Memory support The PPAGE DPAGE and the EPAGE banked memory location are supported by the Metrowerks debugger Target Interfaces depending on the debugged application and on the debugged HC 2 HCS12 derivative 4 1 Banked Memory Location Dialog Box The Banked Memory Location dialog box is available only if the connected derivative is a Motoro
73. point Settings variables which are used by the Target Interface are described as shown in the following table Topic Description Short Description Provides a short description of the variable Syntax Specifies the syntax of the variable in a EBNF format Default Shows the default setting for the variable Description Provides a detailed description of the variable and how to use it Example Small example of how to use the variable The following sections describe each variable available for the Target Interface The variables are listed in alphabetical order HWBPD_MCUIDnnn_BKPT_REMAPn Short Description Contains a HWBPM Command Line command to be used to set up the Hardware Breakpoint Remapping Syntax HWBPD_MCUIDnnn BKPT_REMAPn lt one HWBPM REMAP22BITS Command Line command gt Default Defaults settings are retrieved according to the derivative from a common ini file 88 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Associated Environment Variables Description The HWBPD_MCUIDnnn_BKPT_REMAPn variable specifies a command file definition using HWBPM REMAP22BITS 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 Example HW
74. r More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Command Line commands LISTALLMCUIDS allows to display all the defined MCU IDs PROTOCOL Short Description switch on off the Show Protocol functionality Syntax PROTOCOL ON OFF Alias None Components ICD 12 Target Interface Description If this command is used all the messages sent to and received from the CD 12 interface are reported in the Command Line window of the debugger For Example PROTOCOL ON TIP The Show Protocol is a useful debugging feature if there is a communication problem REGBLKADR Short Description register block moving handling ICD 12 Target Manual 47 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Command Line commands Syntax REGBLKADR lt new register block address gt RESET RESET 48 Alias None Components ICD 12 Target Interface Description On HCS12 derivatives the Target Interface can automatically track device registers block 0 3FF relocated via INITRG register setup For HC12 derivatives a command has been implemented to specify the new location of the register block REGBLKADR e At connection the register block address is O e When a reset command is issued the register block address is set to O e When REGBLKADR is executed the inf
75. reakpoint module to the 16 bits one 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 SET 16BITS Oxa4 0x0 0xc004 0x0 1n 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 Oxa4 BRKCT1 0x0 BRKA 0xc004 BRKD 0x0 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc On Chip Hardware Breakpoint Module Associated Environment Variables HWBPM 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 Rangel 0x4000 0x7FFF mask Ox3e Rangel 0xC000 OxXFFFF mask 0x3f Add a new remapping in gt HWBPM REMAP _22BITS RANGE 0x8000 Oxbfff 0x47 in gt HWBPM REMAP 22BITS DISPLAY HWBPM Remappings for 0x3CA RangeoO 0x4000 0x7FFF mask Ox3e Rangel 0xC000 OxXFFFF mask 0x3f Rangez 0x8000 OxBFFF mask 0x47 Delete a remapping in gt HWBPM REMAP_22BITS DELETE 1 in gt HWBPM REMAP_22BITS DISPL
76. register which is displayed in the Register component of the Metrowerks debug ger 56 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc HC12 and HCS12 Banked Memory support Associated Commands Using BANWINDOW PPAGE command will have the same effect than using the PPAGE index tab in the Banked Memory Location Dialog Box Using BANWINDOW DPAGE command will have the same effect than using the DPAGE index tab in the Banked Memory Location Dialog Box Using BANWINDOW EPAGE command will have the same effect than using the EPAGE index tab in the Banked Memory Location Dialog Box Using BANWINDOW VARIOUS command will have the same effect than using the Various index tab in the Banked Memory Location Dialog Box A banked memory area is defined by its start address end address and the address of the Bank register The maximum number of pages parameter allows to see in the memory component only the available pages The status of the banking mechanism in the debugger is also monitored through this command a command can be defined but the debugger banking mechanism can be disabled Consider the command BANKWINDOW PPAGE ON O0x8000 0xXBFFF 0x30 64 This command allows to use the banked memory model in the debugger using the MC9S12DP256B This commands means the PPAGE register located at address 0x30 must be used to build the PC address when the code is located in banked memor
77. rget Interface The CD 12 Target Interface specific environment variables are e BDMAutoSpeed e BDMClockSpeed e COMDEV ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Default Environment e DETECTRUNNING e MCUID e SETCLKSW e SHOWPROT Some other common Target Interface features are using variables Those variables are e BANKWINDOWn CHIPSECURE CMDFILEn HWBPD MCUIDnnn BKPT REMAPn e HWBPMn These variables are stored in the ICD12 section from the PROJECT file Listing 3 2 Example of ICD12 section from PROJECT file ICD12 CMDFILE0 CMDFILE CMDFILEL CMDFILE CMDFILE2 CMDFILE CMDFILE3 CMDFILE CMDFILE4 CMDFILE CMDFILE5 CMDFILE CMDFILE6 CMDFILE STARTUP ON cmd p amp e_startup cmd RESET ON cmd p amp e_reset cmd PRELOAD ON cmd p amp e_preload cmd POSTLOAD ON cmd p amp e_postload cmd VPPON ON cmd p amp e_vppon cmd VPPOFF ON cmd p amp e_vppoff cmd UNSECURE OFF cmd p amp e_erase_unsecure_hcs12 cmd BANKWINDOWO BANKWINDOW PPAGE ON 0x8000 OxBFFF 0x30 64 BANKWINDOW1 BANKWINDOW DPAGE OFF 0x7000 0x7FFF 0x34 256 BANKWINDOW2 BANKWINDOW EPAGE OFF 0x400 0x7FF 0x36 256 CHIPSECURE CHIPSECURE SETUP OxFFOF 0x3 0x2 MCUId 0x3C6 SETCLKSW 1 BDMClockSpeed 11 HWBPMO HWBPM MODE AUTOMATIC BPM22BITS 0x28 SKIP_OFF HWBPD_MCUID3C6_BKPT_REMAPO HWBPM REMAP_22BITS RANGE 0x4000 Ox7FFF 0x3E HWBPD_MCUID3C6
78. rior and the ICD 12 Target Interface 2 3 How to load an Application in Flash EEPROM 2 4 How to Set Breakpoints in Non Volatile Memory 3 ICD 12 Target Interface Manual 3 1 Introduction 3 2 Interfacing Your ten with the Target 3 2 1 Hardware Connection 3 2 2 Loading the ICD 12 Target ta 3 3 ICD 12 Target Interface Menu Entries dAl Load 3 3 2 Reset a es 3 3 3 Communication or Connect 3 3 4 Command Files 3 3 5 Set MCU Type 3 3 6 Set BDM Speed 3 3 7 Set Hardware BP 3 3 8 Set Bank 3 3 9 Unsecure 3 3 10 Flash l 34 ICD 12 Target Hines Dialogs 3 4 1 Communication Device Specification 3 4 2 MCU Selection 3 4 3 Set MCU Speed 3 4 4 Non Volatile Memory Control Dialog 3 5 Status Bar Information for the ICD 12 Target miernie 3 5 1 Status Messages 3 5 2 Stepping and Breakpoint Me ICD 12 Target Manual For More Information www freescale com co oN N o o oO 20 23 23 24 24 e 29 21 28 28 28 28 28 28 29 29 29 29 29 30 31 32 33 34 34 35 Freescale Semiconductor Inc Table of Contents 3 6 3 6 1 3 6 2 Sl 4 1 4 1 1 4 1 2 4 1 3 4 1 4 4 2 4 3 5 1 5 2 5 3 5 4 6 1 6 1 1 6 1 2 6 1 3 6 1 4 6 1 5 6 1 6 6 2 6 3 6 4 Tal 7 1 1 Taz TELS ICD 12 Target Interface Default Environment 36 Default Target Setup E TEST ee ee ee ee ICD 12 Target Interface E
79. rnal memory when the MCU is in Background Mode You have full control over the CPU state with the possibility to stop execution to proceed in single step mode and to set breakpoints in the code NOTE Unconcerned Components As the code is executed by an external processor memory statistics are not available with the CD 12 Target Interface Therefore Profiling Coverage analyzing and I O simulation will not work with the CD 12 Target Interface ICD 12 Target Manual 23 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual Interfacing Your System with the Target 3 2 Interfacing Your System with the Target 3 2 1 Hardware Connection Figure 3 1 24 A parallel cable should be used for the communication between the P amp E Cablel2 or BDM MULTILINK and the host computer A parallel to serial interface is used for the communication between the target board and the host computer as shown Figure 3 1 The communication to the target 1s serial The communication protocol between the P amp E Cablel2 or BDM MULTILINK and host is fully handled by the P amp E unit_I2z dll target driver which is automatically loaded with the CD 2 Target Interface Description of the hardware LPT n parallel communication ICD Link ICD cable Target System Host Computer serial communication The target hardware has to be equipped with a BDM connector which connects the P amp E C
80. sh This menu entry is available only if the connection with the target system has been established Choose ICD 12 gt Flash to open the Non Volatile Memory Control Dialog 3 4 ICD 12 Target Interface Dialogs This section describes the dialogs which are specific to the JCD 12 Target Interface Those dialogs are e the Communication Device Specification dialog e the ICD 12 Target Interface Command Files dialog e the MCU Selection dialog e the Set MCU Speed dialog e the Hardware Breakpoint Configuration dialog e the Banked Memory Location Dialog Box e the Unsecure derivative dialog box ICD 12 Target Manual 29 For More Information www freescale com Freescale Semiconductor Inc ICD 12 Target Interface Manual ICD 12 Target Interface Dialogs e the Non Volatile Memory Control Dialog 3 4 1 Communication Device Specification Figure 3 9 30 Select entry ICD 12 gt Communication to display the Communication Device Specification Communication Device Specification dialog box Communication Device Specification Communication Device er Show Protocol M Set CLES bit in BOM control register MC95172 only At connection detect if the target is running Cancel Help If the connection to the target has failed the entry Communication of menu ICD 12 is replaced with Connect In this case it is possible to modify the parallel port used in the Communication Device edit box C
81. t file name and path gt and file kind STARTUP RESET PRELOAD POSTLOAD VPPON VPPOFF 74 Description The CMDFILE command is to be used set up a command file full name and status disabled enabled This command allows to perform the same settings than using the Command Files dialog through the Command Line component The settings of a command file are stored in the targetName section of the PROJECT file using variable CMDFILEn Example The list of available command files and their status can be get typing CMDFILE without any parameters in the Command Line component in gt CMDFILE Hitex Target Interface Command Files STARTUP ON startup cmd RESET ON reset cmd PRELOAD ON preload cmd POSTLOAD ON postload cmd The status of the Startup command file can be changed in gt CMDFILE STARTUP OFF my own startup cmd in gt CMDFILE Hitex Target Interface Command Files STARTUP OFF my own startup cmd RESET ON reset cmd PRELOAD ON preload cmd POSTLOAD ON postload cmd ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Target Interface Commands Files Associated Environment Variables 6 4 Associated Environment Variables This section describes the Command Files dialog environment variables which are used by the Target Interface CMDFILEn These variables are stored in the targetName section from the project file Listing 6 2 Example of the NORAL FLEX
82. up the target hardware on one of those events ICD 12 Target Manual 69 For More Information www freescale com Freescale Semiconductor Inc Target Interface Commands Files Target Interface Associated Command Files Listing 6 1 Example of a command file content WB 0x0035 0x00 WB 0x0012 0x11 PROTOCOL OFF The WB 0x0035 0x00 command sets memory location 0x35 to 0 The WB 0x0012 0x11 command sets memory location 0x12 to Ox11 The command PROTOCOL OFF switch of the Show Protocol 6 1 1 Startup Command File The Startup command file is executed by the Metrowerks debugger straight after the Target Interface has been loaded The Startup command file full name and status enable disable can be specified either with the CMDFILE STARTUP Command Line command or using the Startup index of the Command Files dialog By default the STARTUP CMD file located in the current project directory is enabled as the current Startup command file 6 1 2 Reset Command File The Reset command file is executed by the Metrowerks debugger straight after the reset button menu entry or Command Line command has been selected The Reset command file full name and status enable disable can be specified either with the CMDFILE RESET Command Line command or using the Reset index of the the Command Files dialog By default the RESET CMD file located in the current project directory is enabled as the current Reset command file 6 1 3 Preload
83. x 35 End Address hex BFFF Number of pages dec E Y Enable Banked Memory Area Cancel Help Once you have enabled PPAGE memory banking by checking the Enable Banked Memory Area check box you must set the start address and the end address of this memory range The PPAGE register address must be specified in hexadecimal e g 0x35 for HC812A4 OxFF for HC912DG128 0x30 for MC9S12DP256B The number of pages must be specified in decimal e g 0 to 256 for HC812A4 8 for HC912DG128 64 for the MC9S12DP256B NOTE For the Hitex Target Interface the PPAGE index tab does not appear in this dialog box if the PPAGE register is not available on the currently connected Motorola HC12 derivative For this Target Interface it is not needed to enter the PPAGE register address 4 1 2 DPAGE index tab The DPAGE index tab of the Banked Memory Location dialog box lets you set up the DPAGE banked memory area 52 ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc HC12 and HCS12 Banked Memory support Banked Memory Location Dialog Box Figure 4 2 Banked Memory Location dialog DPAGE index tab Banked Memory Location E PPage DPage EPage Various Start Address hen 000 Register Address hex 35 End Address hex FFF Number of pages dec 1256 W Enable Banked Memory Area Once you have enabled DPAGE memory banking by checking the Enable Banked Memory Area check box
84. y software WARNING This command file is not available for all Target Interfaces 6 2 Command Files dialog Figure 6 1 72 The Target Interface Command Files dialog can be opened selecting menu entry TargetName gt Command Files In this section TargetName is the name of the target like SDI Hitex BDIK ICD 12 Noral BDM etc Target Interface Command Files dialog Target Interface Command Files Startup Reset Preload Postload ppor Wppott The Startup command file is executed to set up the target system right after the connection has been established startup cmd Browse Cancel Help Each index of this dialog corresponds to an event on which Target Interface Commands Files can be automatically run from the Metrowerks debugger Startup Command File Reset Command File Preload Command File Vppon Command File not available for all targets Vppoff Command File not available for all targets or any other Target Interface specific command file The command file in the edit box is executed when the corresponding event occurred ICD 12 Target Manual For More Information www freescale com Freescale Semiconductor Inc Target Interface Commands Files Associated Commands Using the Browse button you can set up the path and name of the command file The Enable Command File check box allows to enable disable a command file on a event By default all command files are enabled e the
85. y area from 0x8000 to OxBFFF The 64 first page in the memory map are visible page Ox3F is the last one The PPAGE register located at address 0x30 will be displayed in the register component The bank settings are stored in the targetName section of the PROJECT file using variable BANKWINDOWn Example The bank memory area status can be get typing BANKWINDOW without any parameters in the Command Line component in gt bankwindow PPAGE Settings Status enabled Reg Adr 0x30 Range 0x8000 to Oxbfff Number of Pages 64 ICD 12 Target Manual 57 For More Information www freescale com Freescale Semiconductor Inc HC12 and HCS12 Banked Memory support Associated Environment Variables DPAGE Settings Status disabled Reg Adr 0x34 Range 0x7000 to OXT E Number of Pages 0 EPAGE Settings Status disabled Reg Adr 0x36 Range 0x400 to Ox7ff Number of Pages 0 in gt The status of the PPAGE Banked Memory area can be changed in gt BANKWINDOW PPAGE OFF in gt BANKWINDOW PPAGE Settings Status disabled Reg Adr 0x30 Range 0x8000 to Oxbfrr Number of Pages 64 DPAGE Settings Status disabled Reg Adr 0x34 Range 0x7000 to 0x7fff Number of Pages 0 EPAGE Settings Status disabled Reg Adr 0x36 Range 0x400 to Ox7ff Number of Pages 0 in gt 4 3 Associated Environment Variables 58 The following sections describe the Banked Memory Location environment variables which
Download Pdf Manuals
Related Search
Related Contents
D0140XXXX VALREX SATINADO User Guide JBL ESC-300 Speaker 取扱説明書 - 株式会社マーフィード Cary 100/300/4000/5000/6000i /7000 Spectrophotometers Copyright © All rights reserved.
Failed to retrieve file