Codewarrior IDE 培训教程

合集下载

codewarrior介绍及安装流程

codewarrior介绍及安装流程

CodeWarrior 5.1软件安装流程本文档主要用来说明CodeWarrior软件安装流程。

2 软件介绍CodeWarrior Development Studio是一个全面的集成开发环境(IDE),提供了高度可视化和自动化的框架,可加快最复杂的嵌入式应用的开发速度。

CodeWarrior包括构建平台和应用所必需的所有主要工具 - IDE、编译器、调试器、编辑器、链接器、汇编程序等。

而且得益于各种处理器和平台(从Motorola 到TI到Intel)间的通用功能性,CodeWarrior IDE支持开发人员插入他们所喜爱的工具,使他们可以自由地以希望的方式工作。

另外,它是一个单一的开发环境,在所有所支持的工作站和个人电脑之间保持一致。

在每个所支持的平台上,性能及使用均是相同的,则无需担心主机至主机的不兼容。

其主要功能如下:1、项目管理器:为软件开发人员处理最高级别的文件管理;按照主要组别组织项目条目;追踪状态信息(例如文件修改日期);确定每个构建中特定文件的构建顺序及内容;协调插件程序以提供箱版本控制和RTOS支持这样的业务。

2、文本编辑器:支持源代码和其他文本文件的创建和处理。

与其他的IDE 功能完全集成。

3、搜索引擎:查找特定的文字串;以替代文字替换找到的文字;支持常规表达的使用;提供文件比较及差别功能。

4、源浏览器:保存用于程序的符号数据库;包括变量及功能的名称和值的符号的举例;使用符号数据库协助代码浏览;将每个符号与此符号相关代码的其他位置链接;处理目标导向和程序语言。

5、构建系统:使用编译器从源代码生成可重新定位的目标代码,并使用链接器从目标码生成最后的可执行图像。

CodeWarrior C/C++*编译器工具包括业内领先的C/C++*语言CodeWarrior编译器,包括标准模板库(STL)及各种其他工具。

6、源级别调试器:提供高性能窗口的源级别调试器,配备最新的高效率增强型图形性能,缩短板的bring-up和应用开发时间;使用符号数据库,提供源级别调试;支持符号格式,例如CodeView、Debug With Arbitrary Records Format (DWARF)和STABS。

最新我的整理CodeWarrior生成lib文件一

最新我的整理CodeWarrior生成lib文件一

写给CodeWarrior初学者1.运行CodeWarrior IDE,打开软件界面;2.点击“File”菜单下的“New”选项,然后在“Project”选项卡中选择“HC(S)12 New Project Wizard”,也就是新建工程向导,在右侧输入你要键入的工程名和你要放在哪个文件夹下面;3.点击“确定”后下面选择你采用的单片机型号,比如你选择“MC9S12D64”或者“MC9S12NE64”;(其中如果选择MC9S12NE64,则必须安装光盘上的NE64补丁插件)4.点击“下一步”后,选择你采用哪种编程语言,尽量不要选第三个“C++”,因为好像我试的有问题,如果你单纯的C,则选择第二个,如果你是C和汇编混合编程,则前两个都要选的;5.选择是否采用“处理器专家”,该项功能可以方便程序的寄存器设置,但我用过感觉比较糊涂,所以我一般选择“No”;6.下面就是选择是否采用“PC-lint”,选择“No”;7.选择是不是支持浮点数,如果你的工程采用浮点数则选择下面的两个中一个,否则选择“No”;8.选择采用哪种内存定位模式,一般选择第一个“Small”模式9.最后一步,选择前面两项,如果仅选择第一项,则仅可以软件调试,前两项都选择可以支持软件和硬件调试。

10.完成后,软件会自动创建一个工程,如下图所示,,其中左侧的sources 文件夹下面的main.c就是你的主程序文件,你可以在里面添加代码,同时在左侧按鼠标右键,会弹出菜单,里面有“Add Files”或“Create Group”等,可以根据你的需要往新创建的工程里添加你自己的头文件或者C文件。

11.你可以在main.c里面编辑你的代码,如果需要加入中断,则在左侧找到Prm文件夹下面打开“P&E_ICD_Linker.prm”,然后在右侧该文件里你可以加入你自己的中断函数和中断向量入口地址,记住:你在这个Prm里定义的自己的中断函数名,要和主函数里面的中断函数名对应起来;比如我在Prm文件里定义了串口接收中断:VECTOR ADDRESS 0XFFD6 SCI0Recive_ISR则在主函数(main.c)里面这样引用该中断函数:interrupt void SCI0Recive_ISR(void){里面是你自己的代码}12.现在一个简单的工程基本创建完成,点击下面的编译按钮进行或者调试按钮就进入调试环境13.如果您点击调试(绿色类似箭头按钮)的时候没反应,那可能是您设置的Debug路径有问题,如果您采用我的方法,比如CW3.0仅安装了Compiler,然后安装了CW4的Debugger,这样的话就要设置一下Debug的路径。

CodeWarrior+USBTAP调试U-Boot技巧

CodeWarrior+USBTAP调试U-Boot技巧

CodeWarrior+USBTAP调试U-Boot2010-07-15 15:55:50分类:LINUX!# U-Boot 编译调试 ## 请参考Pro_&_Linux_App_Edition_Targeting_Manual.chm./ltib ## install ltib$ ./ltib -p u-boot -m prep ## get U-Boot source$ cd rpm/BUILD/u-boot-1.1.3$ vim config.mkDBGFLAGS = -g2 -gdwarf-2AFLAGS_DEBUG = -Wa,-gdwarf2OPTFLAGS = -O1$ vim u-boot-1.1.3/lib_ppc/board.c ## line624: debug => printfdebug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);=> printf ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);$ make ## 编译,最好用 ./ltib -p u-boot -m scbuild注意: 用ltib 编译,要修改confing/platform/mpc8349itx/.config中CLFAGS参数编译常用(make distclean ; make MPC8349ITX_config ; make )启动linux samba服务,将u-boot目录做共享目录由windows访问在windows上访问uboot共享目录,打开后右键点击共享目录,映射为磁盘驱动器z启动CodeWarrior IDE,@ IDE: File > Open , find and open ELF file: u-boot , click OK@ IDE: Choose Debugger : CodeWarrior USB TAP , click OK按照提示选择添加缺少的文件start.S(前提是将源码完全复制),其余会自动添加,不能自动添加的,手动添加。

codewarrior v10.x快速指南

codewarrior v10.x快速指南

Quick Startfor Microcontrollers V10.1CodeWarrior Development Studiofor Microcontrollers V10.x Quick StartSYSTEM REQUIREMENTSHardware Windows® OS: PC with 1 GHz Intel® Pentium®compatible processorLinux® OS: 1.8 GHz Intel Pentium class processor(or better)2GB of RAMCD-ROM driveDepending on host-target connection: ParallelPort, 9-pin Serial Port, or USB PortOperating System Microsoft® Windows XP 32-bit and 64-bit(Professional Edition),Microsoft Windows Vista® 32-bit and 64-bit (HomePremium Edition and Business Edition), orMicrosoft Windows 7 32-bit and 64-bit (HomePremium Edition and Professional Edition)Red Hat Enterprise Edition 5.2Disk Space 2 GB total400MB on Windows system diskThis Quick Start explains how to install the CodeWarrior Development Studio for Microcontrollers V10.x software on Windows and Linux operating systems, and how to use the CodeWarrior IDE to create, build, and debug a project.NOTE This section describes how to download and installCodeWarrior for Microcontrollers V10.x from the Web or installit from the CD. The Web version has a time-bombed license.NOTE Special Edition: The Special Edition license is automatically installed with your product and you do not need to register it.This license allows you to develop projects with unlimitedassembly code, up to 32KB of C code for HC(S)08/RS08derivatives, up to 64KB of C code for ColdFire V1 derivativesand up to 128 KB of C code for ColdFire V2-V4 derivatives. NOTE Evaluation Edition: The Evaluation Edition license isautomatically installed with your product and you do not needto register it. This license allows you to develop projects asProfessional Edition within the 30-day evaluation period. After30 days, the license works as Special Edition license (freepermanent, but feature limited) which supports unlimitedassembly code, up to 32KB of C code for HC(S)08/RS08derivatives, up to 64KB of C code for ColdFire V1 derivativesand up to 128 KB of C code for ColdFire V2-V4 derivatives. NOTE CodeWarrior Eclipse usage on a Microsoft® Windows Vista® or Microsoft Windows 7 system:Administrator rights are required to install CodeWarriorsoftware on Microsoft Windows Vista and Microsoft Windows 7systems, since the installer copies files into the System andProgram Files folders.The default CodeWarrior installation folder is C:\ProgramFiles\Freescale CodeWarrior\CW MCU v10.1. Toprotect against malware, Windows Vista and Windows 7 do notallow normal processes to change files in the Program Filesfolder; therefore, you must have administrator rights to installand run CodeWarrior software from this location. If you will berunning CodeWarrior software with a non-administratve useraccount, then you need to install CodeWarrior software inanother folder (e.g., C:\Freescale CodeWarrior\CW MCUv10.1).Your project workspace needs to be setup in any folder thatyou can fully access.1.Download CodeWarrior software from the Weba.Go to /cwmcu10 — the CodeWarrior forMicrocontrollers v10.x Product Summary page appears.b.Click the Downloads tab — the page displays separate downloads forthe Windows and Linux operatings systems.c.Click Download next to the required Microcontrollers V10.x download.You will be directed to the Freescale log-in page if you are not logged inalready.d.Enter your user name and password and click Log in.NOTE If you are not a registered user, click Register Now and follow the on-screen instructions.e. A dialog box appears asking you to save the installer file. The extensionof the installer file is .exe for Windows and .tar for Linux.f.Specify the location where you want to save the installer file.2.Install CodeWarrior software downloaded from WebWindows OSa.When the download finishes on the Windows host computer, navigate tothe CodeWarrior installer EXE file you have downloaded, double-click theEXE file — the install wizard appears.b.Follow the wizard instructions to install the CodeWarrior software.When software installation is finished, wizard displays the installationcomplete page.c.Check the Display Start Here page checkbox and click Finish to close thewizard.d.The start here page appears in your default browser. The page gives youinformation about the different documents, such as getting started, userguides, application notes, and cheat sheets available in the product. NOTE CodeWarrior Eclipse usage on a Linux system:The CodeWarrior installer must be run from a root account.CodeWarrior service packs are installed with the EclipseUpdater. The updater must also be run from a root account. Tostart the Eclipse Updater select 'Window > Install newsoftware' in the menu.Eclipse needs read/write access to the installation folder. Makesure the eclipse installation folder has the appropriatepermissions for all users.Make sure your project workspace has read and writepermissions.If the CodeWarrior software does not restart automatically aftera successful CodeWarrior update operation, run ‘./cwide -clean' to launch the CodeWarrior software.Linux OSa.When download finishes on the Linux host computer, navigate to thefolder containing the CodeWarrior installer TAR file you havedownloaded.b.Right-click the TAR file and select Extract Here. The system extracts thecontents of the TAR file. A new folder appears next to the TAR file in thefile browser window; usually, the new folder's name is disk1.c.Open a new terminal window — the shell session starts.d.In the terminal window, log in as root or super user.e.Issue command: xhost +.f.Change working directory to the disk1 directory.g.Issue command: ./setuplinux — the install wizard starts; the welcomepage appears.h.Follow wizard instructions to install the CodeWarrior software.i.When software installation is finished, wizard displays the installationsummary page.NOTE Using P&E hardware via the USB port within the CodeWarrior software requires the Jungo USB drivers. During theCodewarrior software installation on a Linux operating system,it attempts to install the drivers automatically. However, if thedriver installation fails and a warning message is displayed,then please refer to the Readme.pdf found within[CodewarriorInstallDir]\Drivers\pemicro tomanually install the P&E drivers.j.Click Finish.3.Install CodeWarrior Software from CDa.Insert CodeWarrior Development Studio CD into CD-ROM drive — CWAuto Install begins.NOTE If Auto Install does not start, navigate to the CodeWarrior installer EXE file, double-click the EXE file — the install wizardappears.b.Follow the wizard instructions to install the CodeWarrior software.4.Restart your computer — operating system reboots which ensuresthat CodeWarrior IDE finds newly installed drivers.NOTE Before starting the CodeWarrior IDE in Linux, make sure that LD_LIBRARY_PATH is set to empty.1.Start CodeWarrior IDEa.For Windows, select Start > Programs > Freescale CodeWarrior > CWfor MCU v10.1 > CodeWarrior — the Workspace Launcher dialog boxappears.For Linux, open a new terminal window and change the working directory as shown below:CWInstallDir/eclipse/where, CWInstallDir is the directory in which you installed theCodeWarrior software.Issue command: ./cwide — the Workspace Launcher dialog boxappears.Workspace Launcher Dialog BoxNOTE If you want to store your projects in the default location, click OK and proceed to step 2, otherwise follow the steps givenbelow.b.Click Browse — the Select Workspace Directory dialog box appears.Select Workspace Directory Dialog Boxc.Select required folder or click Make New Folder to create a new folder forstoring your projects.d.Click OK — the Select Workspace Directory dialog box closes. NOTE Check the Use this as the default and do not ask again checkbox in the Workspace Launcher dialog box to set thechosen path as the default location for storing all your projects.e.Click OK — the CodeWarrior IDE launches and the Welcome pageappears.NOTE The Welcome page appears only if the CodeWarrior IDE or the selected Workspace is opened first time. Otherwise, theWorkbench window appears. Switch directly to step 2a if theWorkbench window appears.Welcome Pagef.In the Welcome Page, click Go to Workbench — the Workbenchwindow appears.Workbench Window2.Create new projecta.From the IDE menu bar, select File > New > Bareboard Project — theNew Bareboard Project wizard starts; the Create an MCU bareboardProject page appears.b.Enter Project_1 in the New Project Name field.Create an MCU bareboard Project PageNOTE The Location field shows the default project location. If you wish to change this location, clear the Use default locationcheckbox. Click Browse and use the subsequent dialog box tospecify a new location. Click OK. The Create an MCUbareboard Project page now shows new location.c.Click Next — the Devices page appears.d.Expand the tree control and select HCS08 > HCS08G Family >MC9S08GB32.Devices Pagee.Clcik Next — the Connections page appears.Connections Pagef.Select the desired connection.NOTE In the Connections page, you can select multiple connections at once.g.Click Next — the Add Files page appears.Add Files Pageh.Click Next — the Languages page appears.NOTE The page displayed may vary depending on the derivative or board selected. For example, if you select ColdFire V2 >MCF5221X > MCF52210 and click Next, the ColdFire BuildOptions page appears.i.Select the C language.Languages Pagej.Click Next — the C/C++ Options page appears.NOTE If you check only the Relocatable Assembly or Absolute Assembly checkbox and click Next, the Rapid ApplicationDevelopment page appears instead of the C/C++ Optionspage.C/C++ Options Pagek.Click Next — the Rapid Application Development page appears.Rapid Application Development Pagel.Select None from the Rapid Application Development options.m.Click Finish — the IDE creates the project.n.Select Project > Build Project from the IDE menu bar— the IDE builds the project. Expand the project directory in the CodeWarrior Projectsview to view the list of files and folders in the project.CodeWarrior Projects ViewNOTE To set Linker, Complier, and Assembler options for a project, select the project in the CodeWarrior Projects view and selectProject > Properties from the IDE menu bar. In theProperties dialog box that appears, select C/C++ Build >Settings. You can make the required settings in the ToolSettings tab page.1.Debug programa.From the IDE menu bar, select Run > Debug Configurations — theDebug Configurations dialog box appears.b.Expand the CodeWarrior Download tree control in the left pane andselect Project_1 - MC9S08GB32 - PnE Full Chip Simulator.Debug Configurations Dialog Boxc.Click the Debugger tab — the Debugger page opens in the right pane.Debug Configurations Dialog Box — Debugger Paged.Make the appropriate changes in the Debug tab.e.Click Apply to save the changes in the settings, if any.f.Click Debug — the debugger downloads program to simulator and theDebug Perspective appears. The execution halts at the first statement ofmain()and program counter icon on the marker bar points to the next statement to be executed.Debug Perspective2.Set and run to breakpointa.Double-click on the marker bar next to a statement — the breakpointindicator (blue dot) appears next to the statement.b.From the Debug view, click Resume — the debugger executes allstatements up to but not including the breakpoint statement.3.Control programa.From the Debug view, click Step Over — the debugger executesbreakpoint statement and halts at next statement.b.From the Debug view, click Resume — the simulator resumesprogram execution.c.From the Debug view, click Terminate — the debug session ends.4.Select File > Exit from the IDE menu bar to exit the CodeWarrior IDE.Congratulations!You have created, built, and debugged an Microcontrollers project using CodeWarrior for Microcontrollers V10.xsoftware!Freescale, the Freescale logo, CodeWarrior and ColdFire are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Flexis and Processor Expert are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners.© 2010–2011 Freescale Semiconductor, Inc. All rights reserved.Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document.Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including “Typicals”, must be validated for each customer application by customer's technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part.How to Contact UsCorporate Headquarters Freescale Semiconductor, Inc. 6501 William Cannon Drive West Austin, Texas 78735U.S.A.World Wide Web /codewarrior Technical Support /supportRevised:2 February 2011Freescale, the Freescale logo and CodeWarrior are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. All other product or service names are the property of their respective owners.© 2010, 2011 Freescale Semiconductor, Inc.。

codewarrior注释

codewarrior注释

codewarrior注释CodeWarrior是一种集成开发环境(IDE),可用于编写和调试嵌入式系统的软件。

它最初是由Metrowerks开发的,后来被Freescale收购,现在是NXP半导体的一部分。

CodeWarrior 具有众多功能和工具,可以帮助开发者编写和调试高效、可靠的嵌入式代码。

在CodeWarrior中,注释是一种常见的编程实践,用于解释代码的功能、目的和工作原理。

注释对于代码维护和合作开发非常重要,可以提高代码的可读性和可维护性。

以下是一些常见的CodeWarrior注释的示例和参考内容:1. 函数注释:函数注释应该解释函数的功能、输入参数、返回值和任何可能的副作用。

这些注释应该放在函数定义的前面。

例如:```/** computeSum函数计算两个整数的和** @param a: 第一个整数* @param b: 第二个整数* @return: 两个整数的和* @throws: 无异常情况*/int computeSum(int a, int b) {// 函数体省略}```2. 类和结构注释:对于类和结构,应该在其定义之前加入注释,解释其目的和用法。

```/** Point类表示一个二维平面上的点*/class Point {// 类定义省略};```3. 代码段注释:有时候,较复杂的代码段可能需要解释其执行逻辑。

在这种情况下,可以将注释放在代码段之前或之后。

```// 初始化变量sum为0int sum = 0;// 计算数组中的所有元素的和for (int i = 0; i < size; i++) {sum += array[i]; // 累加每个元素到sum}```4. TODO注释:TODO注释用于指示代码中需要完成或改进的部分。

这对于团队合作和代码维护非常有用。

```// TODO: 实现排序算法逻辑void sortArray(int array[], int size) {// 未完待续...}```5. Bug注释:Bug注释用于记录代码中已知的问题或bug。

CodewarriorLicense制作教程

CodewarriorLicense制作教程

CodewarriorLicense制作教程⽬录第1章 Codewarrior License制作教程 (1)1.1 准备⼯作 (1)1.2 制作步骤 (1)1.2.1 确定FlexLm版本号 (1)1.2.2 找FEATURE (2)1.2.3 找vendor (5)1.2.4 找计算seed的关键数据 (6)1.2.5 计算ENCRYPTION_SEED (8)1.2.6 制作License⽣成器 (9)1.2.7 ⽣成License (9)第1章Codewarrior License制作教程声明作者出于学习的⽬的撰写此⽂,读者需承担⽂章使⽤或传播过程中产⽣的⼀切后果,作者概不负责。

我们以飞思卡尔Codewarrior for HC08 v6.0为例,来介绍制作过程。

1.1 准备⼯作我们需要事先准备如下软件:z Lmtoolsz OllyICEz Calcseedz Lmcryptgui1.2 制作步骤破解Flexlm最主要的是找到4样东西:z确定Flexlm版本号z找FEATUREz找vendorz计算ENCRYPTION_SEED1.2.1确定FlexLm版本号运⾏Lmtools,选择Utilities标签页,点击Browse选择Codewarrior安装⽬录bin⽬录下lmgr8c.dll,然后点击Find Version,如图 1.1。

图 1.1 确定Flexlm版本号1.2.2找FEATURE运⾏OllyICE,界⾯如图 1.2。

图 1.2 OllyICE运⾏界⾯点击“⽂件/打开”,选择Codewarrior安装⽬录bin⽬录下IDE.exe,界⾯如图 1.3。

图 1.3 打开IDE.exe界⾯在反汇编窗⼝中点击右键,选择“查看”,打开模块‘LMGR8C’,如图 1.4。

图 1.4 打开模块‘LMGR8C’在反汇编窗⼝中点击右键,选择“查找”,打开“所有参考⽂本字串”,如图 1.5。

codewarrior介绍及安装流程【精选】

CodeWarrior 5.1软件安装流程信入党组形式组织一次“坚持根讨论不,开展党邀请党话,做合格党员”党规、学在全市号),结育,基础实党的”专题教优,进一持问题导为协调面小1目的本文档主要用来说明CodeWarrior软件安装流程。

2 软件介绍CodeWarrior Development Studio是一个全面的集成开发环境(IDE),提供了高度可视化和自动化的框架,可加快最复杂的嵌入式应用的开发速度。

CodeWarrior包括构建平台和应用所必需的所有主要工具- IDE、编译器、调试器、编辑器、链接器、汇编程序等。

而且得益于各种处理器和平台(从Motorola到TI到Intel)间的通用功能性,CodeWarrior IDE支持开发人员插入他们所喜爱的工具,使他们可以自由地以希望的方式工作。

另外,它是一个单一的开发环境,在所有所支持的工作站和个人电脑之间保持一致。

在每个所支持的平台上,性能及使用均是相同的,则无需担心主机至主机的不兼容。

其主要功能如下:1、项目管理器:为软件开发人员处理最高级别的文件管理;按照主要组别组织项目条目;追踪状态信息(例如文件修改日期);确定每个构建中特定文件的构建顺序及内容;协调插件程序以提供箱版本控制和RTOS支持这样的业务。

2、文本编辑器:支持源代码和其他文本文件的创建和处理。

与其他的IDE 功能完全集成。

3、搜索引擎:查找特定的文字串;以替代文字替换找到的文字;支持常规表达的使用;提供文件比较及差别功能。

4、源浏览器:保存用于程序的符号数据库;包括变量及功能的名称和值的符号的举例;使用符号数据库协助代码浏览;将每个符号与此符号相关代码的其他位置链接;处理目标导向和程序语言。

5、构建系统:使用编译器从源代码生成可重新定位的目标代码,并使用链接器从目标码生成最后的可执行图像。

CodeWarrior C/C++*编译器工具包括业内领先的C/C++*语言CodeWarrior编译器,包括标准模板库(STL)及各种其他工具。

CodeWarrior以及BDM使用


编译不成功会提示出错的位置和原因,请改错 后重新编译
DEBUG (自动编译,保 存然后下载)
MAKE (编译并且 同时保存)
Hale Waihona Puke 下载时注意丌要将接口插反,否则无法下 载 codewarrior4.7已经集成了BDM驱动, 装好codewarrior4.7后,连接上BDM会自 动弹出找到新硬件,一直下一步安装即可。
CodeWarrior还有很多丰富的功能,本教 程只讲了最常用的一部分。其他功能同学 们可以查相关资料自学。用好该软件将会 使调车事半功倍。
下载时电脑一端没插BDM会弹出如下窗口。请插好 BDM然后关闭此窗口后重新点击DEBUG下载
下载时电脑一端插了,而另一端没有正确插单片机 就会报错如下,请点击多次报错窗口直到没有弹出 报错,然后插好重新下载
最好在断电状态下插拔BDM和单 片机的连接线
插线都连接好一般会出现如 下提示,点确定即可给单片 机下载程序
Reset Target(用来 停止程序,BDM和 单片机断开连接时 请先用该功能程序 停止)
监测栏:所有的全局变量和数组都可以在此实时监测变化,但是 无法在此更改。在空白处点击右键选择Add Expression输入你 定义的变量名称即可添加要监测的变量(如传感器,舵机,电机 等信号)。右键菜单里Format可改变显示数制,Mode可改监 测周期。请注意一定要先运行程序,否则变量保持初值不会改变 的。
使用界面
特别注意选择所用芯片型号 MC9S12XS128
选择C语言作为编译环境
PAGE4~7看选项说明即可,一般 可以按默认选择
选择TBDML模式用于下载调试
向导完毕,生成工程。可见左边出现白色一栏,双击即可打 开相应文件。在此处右键功能添加GROUP和FILE

CodeWarrior for ColdFire简明使用方法

CodeWarrior for ColdFire简明使用方法(V1.0/2009年1月) 苏州大学飞思卡尔嵌入式系统研究与开发中心1.硬件连接PC和实验板通过与实验板配套的USB口BDM for ColdFire 连接PC 和实验板。

一端连接PC机并行接口,另一端连接实验板上的BDM接口。

2.打开工程在CodeWarrior下打开一个现有的工程的方法是:菜单File>Open…,选择要打开的工程中后缀名为mcp的文件即可。

也可以通过File>Open Recent打开一个最近访问的工程。

3.创建一个ColdFire工程1.启动CodeWarrior IDE。

2.从主菜单选择File> New…,弹出新建窗口。

3.创建工程,创建一个MCF52233DEMO的工程。

(需要将本书提供的…\第04章阅读材料\MCF52233DEMO文件夹放到Freescale安装目录中的…\Stationery\ColdFire目录下)。

4.编辑源代码a.单击Sources夹旁边的+标志。

双击main.c编辑窗口将会打开main.c文件。

b.可以按需要改变main.c的内容。

选择File > Save保存改变。

5.如果需要可以添加文件右键Sources 夹Add Files打开对话框。

选择想要加入的文件单击open。

被添加的文件出现在Sources夹下。

4.编译并链接源文件1.选择工具栏上的Make“”,IDE将会编译并链接工程;Error & Warnings窗口将会打开显示被检测到的错误和警告信息。

5.下载程序1.选择File>Flash Programmer,弹出Flash Programmer对话框。

2.选择Target configuration,单击Load Settings按钮,在打开的对话框中选择CFM_MCF52233_25MHz.xml打开,在connection中选择PEMICRO_PARALLEL(并口)或PEMICRO_USB(USB接口)或tblcf,在这里我们选择tblcf。

我的整理CodeWarrior生成lib文件一

写给CodeWarrior初学者1.运行CodeWarrior IDE,打开软件界面;2.点击“File”菜单下的“New”选项,然后在“Project”选项卡中选择“HC(S)12 New Project Wizard”,也就是新建工程向导,在右侧输入你要键入的工程名和你要放在哪个文件夹下面;3.点击“确定”后下面选择你采用的单片机型号,比如你选择“MC9S12D64”或者(其中如果选择MC9S12NE64,则必须安装光盘上的NE64补丁插件)“MC9S12NE64”;4.点击“下一步”后,选择你采用哪种编程语言,尽量不要选第三个“C++”,因为好像我试的有问题,如果你单纯的C,则选择第二个,如果你是C和汇编混合编程,则前两个都要选的;5.选择是否采用“处理器专家”,该项功能可以方便程序的寄存器设置,但我用过感觉比较糊涂,所以我一般选择“No”;6.下面就是选择是否采用“PC-lint”,选择“No”;7.选择是不是支持浮点数,如果你的工程采用浮点数则选择下面的两个中一个,否则选择“No”;8.选择采用哪种内存定位模式,一般选择第一个“Small”模式9.最后一步,选择前面两项,如果仅选择第一项,则仅可以软件调试,前两项都选择可以支持软件和硬件调试。

10.完成后,软件会自动创建一个工程,如下图所示,,其中左侧的sources 文件夹下面的main.c就是你的主程序文件,你可以在里面添加代码,同时在左侧按鼠标右键,会弹出菜单,里面有“Add Files”或“Create Group”等,可以根据你的需要往新创建的工程里添加你自己的头文件或者C文件。

11.你可以在main.c里面编辑你的代码,如果需要加入中断,则在左侧找到Prm文件夹下面打开“P&E_ICD_Linker.prm”,然后在右侧该文件里你可以加入你自己的中断函数和中断向量入口地址,记住:你在这个Prm里定义的自己的中断函数名,要和主函数里面的中断函数名对应起来;比如我在Prm文件里定义了串口接收中断:VECTOR ADDRESS 0XFFD6 SCI0Recive_ISR则在主函数(main.c)里面这样引用该中断函数:interrupt void SCI0Recive_ISR(void){里面是你自己的代码}12.现在一个简单的工程基本创建完成,点击下面的编译按钮进行或者调试按钮就进入调试环境13.如果您点击调试(绿色类似箭头按钮)的时候没反应,那可能是您设置的Debug路径有问题,如果您采用我的方法,比如CW3.0仅安装了Compiler,然后安装了CW4的Debugger,这样的话就要设置一下Debug的路径。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档