TMTransitionTitleCodewarrior使用指南田云锋汽车电子现场应用工程师2005年6月R63492@freescale.comTMFreescale™andtheFreescalelogoaretrademarksofFreescaleSemiconductor,Inc.Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.©FreescaleSemiconductor,Inc.2005.Slide2内容•codewarrior简介•利用向导创建一个新工程项目•在新项目中加入或删除文件•编译•调试•启动程序•PRM文件设置•如何对IO及寄存器进行操作•如何写中断程序•如何使用汇编和C语言混合编程•嵌入式编程注意事项•如何使用ProcessorExpertTMFreescale™andtheFreescalelogoaretrademarksofFreescaleSemiconductor,Inc.Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.©FreescaleSemiconductor,Inc.2005.Slide3项目创建•ProjectcreationImportantchoicesaremade(derivative,language,targetsusedforthedevelopment)Usuallydifficulttochangeanyoftheseoncetheprojectisstarted•CodeWarriorsolution:ProjectWizardIntuitivemenutoguidethedeveloperthroughtheselectionprocess,Choiceofthederivative,Choiceofthelanguage(Absoluteassembly,assembly,C,CwithProcessorExpert,C++)Choiceoftarget(simulator,varioushardwareconnections)Otheroptions(PC-Lint,Boardsupportpackages)Completeprojecttemplatepreparedwithfiles,developercanjust“insertthecodehere”ProjectCreationH/WSpecificCodegenerationApplicationSpecificCodeDevelopmentTest/Debug&ValidationH/W–S/WIntegrationProjectWizard-Derivative-Language-TargetsTMFreescale™andtheFreescalelogoaretrademarksofFreescaleSemiconductor,Inc.Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.©FreescaleSemiconductor,Inc.2005.Slide4Hardwarespecificcode•HardwarespecificcodegenerationDevelopershavetounderstandthedetailsofperipheralregisters,bitfields,setupandaccesssequencesTrendisformoreandcomplexperipherals,withmoreregisters,increasingtheeffortofwritingaccuratecodeforeachperipheralofthederivative.Butthereisnoaddedvaluefromaprojectstandpoint,allapplicationsneedsomefromofcodetoperformthefunctionProjectCreationH/WSpecificCodegenerationApplicationSpecificCodeDevelopmentTest/Debug&ValidationH/W–S/WIntegrationProcessorExpertDerivativesKnowledgeDatabaseCodeWarriorsolution:ProcessorExpert-Applicationdesigntoolusingknowledgedatabase,-Graphicalselectionofperipheralparameters,-Auto-generationoflow-leveldrivers,-High-level‘beans’available,-Makestheuser’smanualeasy.TMFreescale™andtheFreescalelogoaretrademarksofFreescaleSemiconductor,Inc.Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.©FreescaleSemiconductor,Inc.2005.Slide5Applicationspecificcode•ApplicationspecificcodedevelopmentNeedauser-friendlyeditor,beabletodevelopabsoluteassemblycode,needanefficientcompiler(codesize,speed)•CodeWarriorsolution:IDE,Editor,Assembler,Compiler,LinkerIDEwithutilitiessuchasfilecompare,projectsettings,targetsettingsMulti-panecolorcodededitor,‘goto’codedefinition,‘goto’proceduresdefinitionAbsoluteassemblerandreallocateableassemblerCompilerwith50+optimizationsLinkerwitheditableparametersprojectsthatchangeoftenorhavemultipledevelopers.ProjectCreationH/WSpecificCodegenerationApplicationSpecificCodeDevelopmentTest/Debug&ValidationH/W–S/WIntegrationEditorCompilerAssemblerLinkerTMFreescale™andtheFreescalelogoaretrademarksofFreescaleSemiconductor,Inc.Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.©FreescaleSemiconductor,Inc.2005.Slide6Test,debugandvalidation•Test,debugandvalidationWithoutsimulator,itisimpossibletotestsoftwareuntilhardwareisavailable,Developershavetomakeupfordelaysatthecriticalstage,reducingtesting,integrationandquality,Improvedcodevalidationwillreduceproductmaintenance,reduce“endofproject”costs.•CodeWarriorsolution:IDE,DebuggerandSimulator,DataVisualization,I/OStimulationProjectCreationH/WSpecificCodegenerationApplicationSpecificCodeDevelopmentTest/Debug&ValidationH/W–S/WIntegrationDebuggerMulti-TargetInterfaceSimulatorDataVisualizationI/OStimulationRTOSawarenessProjectmanagerallowingtargetspecificfilesselectionandsystemsettingsFullyconfigurabledebugger,Instructionsetaccuratesimulator,I/OsimulationDataVisualization(direct,commandfiles)I/OStimulation(direct,commandfiles)RTOSawareness(e.g.OSEK)TMFreescale™andtheFreescalelogoaretrademarksofFreescaleSemiconductor,Inc.Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.©FreescaleSemiconductor,Inc.2005.Slide7Hardwareandsoftwareintegration•HardwareandsoftwareintegrationWithoutsimulation,developersriskofgettingH/WandS/Wproblemsmixedup(nonehasbeenqualifiedyet),Developershavedifficultiestocompareaworkingcase(simulation)withanon-workingcase(hardwaretarget),•CodeWarriorsolution:Sameaspreviousslideplus:EasilyswitchbetweentargetsforcomparisonofresultsDataVisualizationandI/Ostimulation(simulationandtargets)FlashprogrammingsupportRTOSawareness(e.g.OSEK)ForeigntargetcapabilitythroughAPIProjectCreationH/WSpecificCodegenerationApplicationSpecificCodeDevelopmentTest/Debug&ValidationH/W–S/WIntegrationDebuggerMulti-TargetInterfaceSimulatorMultilinkDataVisualizationI/OStimulationRTOSawarenessUSB(e.g.inDart)APIFreescale™andtheFreescalelogoaretrademarksofFreescaleSemiconductor,Inc.Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.©FreescaleSemiconductor,Inc