Freescale CodeWarrior 集成开发环境 IDE 使用手册
- 格式:pdf
- 大小:2.60 MB
- 文档页数:56
CodeWarrior™ Development Studiofor Microcontrollers V6.x Quick StartSYSTEM REQUIREMENTSHardware PC with 1 GHz Intel® Pentium® compatibleprocessor512 MB of RAM (1 GB recommended)CD-ROM driveDepending on host-target connection: ParallelPort, 9-pin Serial Port, or USB PortOperating System Microsoft® Windows® XP orMicrosoft Windows Vista® Operating Systems32-bit (Home Premium Edition and BusinessEdition)Disk Space 2 GB total400MB on Windows system diskThis Quick Start explains how to install the CodeWarrior Development Studio for Microcontrollers V6.x software, and how to use the IDE to create, build, and debug a project.NOTE You must install the CodeWarrior software on the equipment on which you intend to use the software.1.Insert CodeWarrior Development Studio CD into CD-ROM drive —CW Auto Install beginsNOTE If Auto Install does not start, run launch.exe, which is located in the root directory of the CD.The CodeWarrior software may be part of a DVD included withyour kit. In this case, click Install CodeWarrior DevelopmentStudio for Microcontrollers, follow the on-screen instructions,and skip to step "Check for updates".2.Follow setup program's on-screen instructionsNOTE 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 and up to 64KB of C code for ColdFire V1derivatives.NOTE Evaluation Edition: The Evaluation license is automatically installed with your product and you do not need to register it.This license allows you to develop projects as ProfessionalEdition within the 30-day evaluation period. After 30 days, thelicense works as Special Edition license (free permanent, butfeature limited) which supports unlimited assembly code, up to32KB of C code for HC(S)08/RS08 derivatives and up to 64KBof C code for ColdFire V1 derivatives.1.Create a projecta.Select Start > Programs > Freescale CodeWarrior >CW forMicrocontrollers V6.x > CodeWarrior IDE — IDE starts and displaysstartup dialog box.Startup Dialog Boxb.Select Create New Project — the Microcontrollers New Project Deviceand Connection dialog box appears.NOTE This section of the quick start demonstrates using the New Project Wizard. We use an MC68HC908GZ60target as anexample.c.Expand HC08 and GZ Family and select MC68HC908GZ60 derivative. NOTE If your MCU is missing from the list, download a service pack for that device at /codewarrior/downloads.Device and Connection Dialog Boxd.Select Full Chip Simulation as your default connection.e.Click Next — the Project Parameters dialog box appears.Project Parameters Dialog Boxf.In Project name text box, the IDE supplies a default project name. Entera project name of your choice.NOTE The IDE automatically creates a folder with the same name in specified location. The IDE automatically adds .mcp extensionwhen it creates project.g.In Location text box enter location to store project, click Set to browse tofolder locationh.Select C as language to be supported by project.NOTE You can click Finish to accept defaults for remaining options.i.Click Next — the Add Additional Files dialog box appears.This dialog box lets you browse folders and add or remove files to or fromthe project.Add Additional Files Dialog Boxj.Click Next — the Processor Expert dialog box appears.This dialog box let you specify whether you want your project configuredto use Device Initialization or Processor Expert.Processor Expert Dialog Boxk.Select the None option button.l.Click Next — the C/C++ Options dialog box appears.This dialog box allows you to specify C/C++ Options.C/C++ Options Dialog Boxm.Select ANSI startup code as code, the New Project Wizard will place in your project as startup code.n.Select Small as memory model to use.o.Select None for floating point format to support.p.Click Finish — the IDE creates your project according to your specifications; Project window appears, docked at left side of mainwindow.Project WindowNOTE To undock project window, double-click the double gray lines.To re-dock window, right click in title tab and select Docked.2.Select connectionFor this example, we specified Full Chip Simulation (FCS).a.To change MCU and connection, select Project >Change MCUConnection.b.Make sure Full Chip Simulation is selected in drop-down list.3.Edit source codea.Double click main.c in Sources folder — the Editor window opensdisplaying contents of file.main.c in Editor Windowb.Make changes to contents of main.c file, if desired.c.From the IDE main menu bar, select File > Save — the IDE saveschanges.4.Add files if appropriatea.In the project window, select a folder.b.From IDE main menu bar, select Project > Add Files.The Select files to add dialog box appears.c.Navigate to the directory that contains file you want to add.d.Select the filename of file you want to add to project.e.Click Open — the Project Messages window appear indicating accesspath has been added to target, if the path is new to the project.f.In the project window, filename of the added file appears under theselected folder.5.Build projecta.From IDE main menu bar, select Project > Make — the IDE builds(assembles, compiles, and links) project; Error & Warnings windowopens showing any error messages and warning messages1.Start debuggera.Click on project window title bar to ensures that window is active projectb.From main menu bar, select Project > Make.c.From main menu bar, select Project > Debug — the True-TimeSimulator & Real-Time Debugger window opens.True-Time Simulator & Real-Time Debugger WindowNOTE The Source and Assembly panes display the main.c program and code.2.Set breakpointa.Point at a C statement in Source window and right-click — the Sourcecontext menu appears.b.Select Set Breakpoint — a permanent breakpoint mark is set.3.Run applicationa.From the True-Time Simulator & Real-Time Debugger window, selectRun — the Run menu appears.b.Select Start/Continue or click on Start/Continue icon — theProgram executes till the first breakpoint; Command pane displaysprogram statusDebugger Simulator Command Pane4.Click the Start/Continu e icon — the simulator resumes programexecution.5.Click the Halt icon — the Simulator stops program execution.6.From the True-Time Simulator & Real-Time Debugger windowtoolbar, select File > Exit to exit the debugger.7.From IDE main Window toolbar, select File > Exit to exit theCodeWarrior IDE.Congratulations!You have successfully created, built, and run an HC08 application with the CodeWarrior for Microcontrollers V6.xsoftware!Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. CodeWarrior is a trademark or registered trademark of Freescale Semiconductor, Inc. in the United States and/or other countries. PROCESSOR EXPERT and EMBEDDED BEANS are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners.Copyright © 2009 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: 24 September 2009。
《Freescale8位单片机入门与实践》第五章_codewarrior应用综述第五章CodeWarrior应用综述(在线调试、VisualTools的使用、专家系统可选学)修改图形编号5.1 在线编程注意:实验电路板电源开关断开。
JP2的3、4两个端子短接。
1、确立目标在“True-Time Simulator & Real-Time Debug”工具界面,点击:Component->Set Target 在Processor栏,选择HC08,在Target栏,选择P&E Target Interface,然后点击OK,如图5-1所示图5-1 确立目标最后关闭“True-Time Simulator & Real-Time Debug”工具界面,在主界面中重新按下“Debug”,进入“True-Time Simulator & Real-Time Debug”调试。
2、在线调试重新进入后,PEDebug->Mode:Full Chip Simulation->In-Circuit ……如图5-2所示。
图5-2 调试界面系统将自动弹出如下的界面,如图5-3所示。
图5-3 连接界面点击Close Port。
出现界面如图5-4。
图5-4 关闭串口界面闭合目标板电源开关,给目标板供电,最后点击Contact target with these settings…。
出现图5-5界面,最后点击YES,程序就下载到实验板上了。
注:如果此时不出现图5-19,断开目标板电源,再次点击图5-18中Refresh List,然后再给目标板供电。
图5-5 查询是否擦除、下载程序然后在DEBUG界面上进行调试,如图5-6所示。
图5-6 DEBUG界面点击上图所示:运行(run)程序;单步运行(single step)程序;单步运行(step into)程序;跳出运行(step out)函数;跟踪(trace)程序;程序停止(halt)运行;目标板复位(reset target)。
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 for HCS12使用入门及嵌入式编程2009-04-17 20:051.商用软件开发工具“CodeWarrior for HCS12”为Motorrola(freescale)单片机提供商用开发软件的公司有许多,著名的有以下一些:Metrowerks Cosmic Software IAR Systems Isystem 这些公司不但提供C交叉编译器,还提供集成开发环境IDE。
其中Metrowerks是Motorola于1999年收购的、独立运作的子公司,CodeWarrior是Metrowerks公司研发的专门面向Motorola(freesacle)所有MCU与DSP嵌入式应用开发的软件工具,是motorola(freescale)向用户推荐的产品。
如同多数软件开发商一样,Metrowerk提供CodeWarrior有效期为30天的试用版本,还有专门提供面向教学的,免费的特别版(Special Edition )。
这个特别版本对生成的代码量有一定限制,C代码不得超过12KB,对工程包含的文件数目限制在30个以内。
虽然有些限制,但用于教学和研究生的一些简单的研究题目已经足够了。
付一定的费用也可以达到代码量32KB、64KB的升级版本,直至全商用版本。
用CodeWarrior开发产品应使用正版商业软件。
试用版、教学用特别版本都可以从Metrowerks的网站上下载,也可以向分销商申请免费的光盘。
以下简单介绍CodeWarrior的使用方法。
为的是读者快速入门,更多的功能和用法请阅读该软件包中包含的大量文档,在实践中不断熟悉和掌握。
“CODEWARRIOR FOR S12”是面向以HC12或S12 CPU的单片机嵌入式应用开发软件包。
包括集成开发环境IDE、处理器专家库、全芯片仿真、可视化参数显示工具、项目工程管理器、C交叉编译器、汇编器、链接器以及调试器。
2.安装CodeWaarior安装CodeWarrior软件包没有什么特别之处,在window操作系统上,只要按照安装向导单击鼠标就可以自动完成。
CodeWarrior使⽤说明第⼀章: 认识CodeWarrior第⼆章: ⼯程和⽬标⽂件的显⽰和定制第三章: 编译第四章: 链接第五章: 调试第六章: 定制第七章: 库函数和Microsoft Foundation Classes (MFC)1). CodeWarrior 能做些什么?A).使⽤C/C++ 进⾏编程B).也⽀持Java 开发本课程仅限于应⽤C/C++ 语⾔在Windows 平台上使⽤CodeWarrior 进⾏的开发.2). CodeWarrior 优点是什么?CodeWarrior 能够⾃动地检查代码中的明显错误,它通过⼀个集成的调试器和编辑器来扫描你的代码,以找到并减少明显的错误,然后编译并链接程序以便计算机能够理解并执⾏你的程序.3).常⽤编程类型说明:A).应⽤程序(如:⽂本编辑器WordPad )B). 庞⼤的商业软(如:⽐如象Adobe Photoshop,MicrosoftWord,CodeWarrior…)C). 控制⾯板(control panels)<实际上是设置系统功能的⼀个简单界⾯,⽐如可以在控制⾯板中完成.如:设置⾳量和⿏标移动速度这样⼀些参数.>D). 动态链接库(dynamic linked libraries,DLLs)<提供⼀些很有⽤的被系统和应⽤程序共享的函数.通常它们没有⽤户界⾯.>E). 插件(plug-ins)<类似于DLLs,插件也是可供其它软件使⽤的⼩程序,但插件只能被特定的软件使⽤.>4).CodeWarrior⼯具条介绍: 4.1).⽂件菜单: 4.2).编辑菜单4.3).查看菜单4.4).查找菜单4.5).⼯程菜单4.6).调试菜单4.8).窗⼝菜单4.9).帮助菜单4.7).VCS 菜单5).CodeWarrior 集成开发环境的设置5.1).通⽤设置5.5.1).编译设置(Build Settings): 选择是否在执⾏编译之前保存已打开的源⽂件,以及有多少内存被⽤于编译⼯作;5.5.2).IDE 之外(IDE Extras): ⼏个独⽴的设置.⽐如指定CodeWarrior 是否使⽤⼀个第三⽅的⽂本编辑器——因为集成的编辑器并不是很完美,这可以通过指定⼀个你惯⽤的编辑器来替代它;5.5.3).插件设置(Plug-In Settings): 供插件开发商调试他们的插件;5.5.4).隐藏⽂件夹(Shielded Folders): 在这⾥指定的⽂件夹在⼯程设计期间,或执⾏查找和⽐较操作期间,将要被忽略掉.如果在你的⼯程级有⼀个巨⼤的“数据”⽂件⽬录,⽽你⼜不想让这些⽂件降低CodeWarrior 的操作速度时,这个设置就很管⽤了;5.5.5).资料树(Source Trees): ⽤于指定CodeWarrior 在编译程序时⽤不着的⽬录.5.2).编辑器设置5.2.1).编辑器设置(Editor Settings): ⼏个⽤于定制编辑器显⽰、管理⽂本和窗⼝的设置项;5.2.2).字体和制表符(Fonts and Tabs): 设置编辑器中的⽂本⼤⼩、字体、制表符和其它显⽰设置;5.2.3).⽂本颜⾊(Text Colors): ⽤于指定特定语⾔元素(⽐如程序的注释)在编辑窗⼝中的显⽰的颜⾊。
CodeWarrior 使用教程第一课认识 CodeWarriorTranslated from CodeWarrior 能做些什么?当你知道自己能写更好的程序时,你一定不会再使用别人开发的应用程序。
但是常常会发生这种情况,就是当你写了无数行代码后,却找不到使得整个程序出错的那一行代码,导致根本没法编译和链接整个程序。
这可能更令人灰心丧气。
本文将告诉你如何使用CodeWarrior 这一工具解决上述问题。
从现在开始,我们将集中精力学习如何在CodeWarrior 中使用C/C++ 进行编程。
为了学习本课程,你必须已经能够比较熟练地使用上述两种语言之一。
CodeWarrior 也可以支持Java 开发,但那是另一门课程的内容。
本课程仅限于在Windows 平台上使用CodeWarrior 进行的开发。
一旦你精通了CodeWarrior 编程后,你可以试试在其它平台上使用CodeWarrior。
本文中讨论过的大部分内容都可以应用到开发Mac 应用程序中。
CodeWarrior 能够自动地检查代码中的明显错误,它通过一个集成的调试器和编辑器来扫描你的代码,以找到并减少明显的错误,然后编译并链接程序以便计算机能够理解并执行你的程序。
你所使用过的每个应用程序都经过了使用象CodeWorrior 这样的开发工具进行编码、编译、编辑、链接和调试的过程。
现在你在我们的指导下,自己也可以去做这些工作了。
你可以使用CodeWarrior 来编写你能够想象得到的任何一种类型的程序。
如果你是一个初学者,你可以选择编写一个应用程序(比如一个可执行程序),比如象微软公司的文本编辑器WordPad 这样的应用程序。
应用程序可能是最容易编写的程序了,而那些庞大的商业软件,比如象Adobe Photoshop,Microsoft Word 以及CodeWarrior 软件都是极其复杂的。
其它类型的程序指的是控制面板(control panels),动态链接库(dynamic linked libraries,DLLs) 和插件(plug-ins)。