Code Composer Studio v4 DSPBIOS Project.docx
- 文档编号:11358283
- 上传时间:2023-05-31
- 格式:DOCX
- 页数:19
- 大小:729.97KB
Code Composer Studio v4 DSPBIOS Project.docx
《Code Composer Studio v4 DSPBIOS Project.docx》由会员分享,可在线阅读,更多相关《Code Composer Studio v4 DSPBIOS Project.docx(19页珍藏版)》请在冰点文库上搜索。
CodeComposerStudiov4DSPBIOSProject
http:
//cnx.org/content/mIntroduction
ThismoduledescribeshowtocreateaCodeComposerStudio(CCS)projectthatexecutesasimpleDSP/BIOSbasedprogram.ThetargetwillbetheTIsimulatorandtheprocessorusedistheTMS320C67xx.
CreateaDSP/BIOSCCSproject
TocreateaCCSprojectselectFile->New->CCSProject.
Figure1:
ScreenshotofCCSProjectmenu
Thiswillbringupawindowwhereyoucanenterthenameoftheproject.Thelocationselectedisthedefaultlocationforprojectfiles.PressNext.
Figure2:
CCSProjectnameandlocation
SincetheexampleusestheTMS320C67xxprocessortheprojecttypeselectedisC6000.TheprojectconfigurationsareDebugandRelease.SelecttheNextbutton.
Figure3:
TypeofCCSproject
Ifthereareanyprojectdependenciestheyareselectedonthenextscreen.SelecttheNextbutton.
Figure4:
CCSProjectdependencies
OntheProjectSettingsScreen,selecttheitemsthatpertaintothetypeofprojecttobecreated.SincetheprojectwillbeexecutedselectOutputType:
Executable.TheprocessortypeisTMS320C67xxsotheDeviceVariantisGenericC67xxDevice.ThisprojectwilluseLittleEndian.Thecodegenerationtoolsarethelatestversion(inthiscaseTIv7.0.3).Theruntimesupportlibraryisselectedtomatchthedevicevariantandtheendiannessselected.Thelibrarycanbeselectedautomatically.PressNext.
Figure5:
Projectsettingswindow
SincetheprojectwillbebasedonDSP/BIOSanemptyDSP/BIOSexampleproject.ThiswillsetupprojectparametersforDSP/BIOS.
Figure6:
Aftertheprojectssettingshavebeenset,selectFinishandtheprojectwillshowupintheC/C++Projectsview.
Figure7:
C/C++projectsview
AddaDSP/BIOSconfigurationfile
TheeasiestwaytosetupDSP/BIOSinaCCSprojectistousetheDSP/BIOSconfigurationtool.Thisgeneratesafilewitha.tcfextensionthatisincludedintheproject.ThisfilewillgeneratecodethatgetsincludedintheprojectforsettingupDSP/BIOS.ItalsogeneratesaheaderfilethatcanbeincludedinotherC/C++files.Forthefilenamedspbiosproject.tcftheheaderfilenamewillbedspbiosprojectcfg.h.
TocreateaDSP/BIOSconfigurationfile,selectFile->New->DSP/BIOSv5.xxConfigurationFile(youmayneedtoselectFile->New->Otherfirst,thenselectDSP/BIOSv5.xxConfigurationFile).Thiswillbringupadialogwherethenameofthefileisentered.
Figure8:
DSP/BIOSConfigurationfilename
Therearedefaultconfigurationfilesfordifferentdevices.ForthisexampletheC67xxsimulatorisused.Theconfigurationwillhave16MbytesofSDRAMinthememorysection.SelectNextandadialogfortheDSP/BIOSfeatureswillcomeup.
Figure9:
DSP/BIOSplatformfordefaultsettings
Figure10:
DSP/BIOSfeaturesselection
SelectFinishandanewfileiscreatedwiththedefaultconfigurationandisaddedtotheprojectandtheconfigurationtoolisopened.
Figure11:
DSP/BIOSconfigurationtool
IntheconfigurationtooliswheretheDSP/BIOSobjectsaresetup.Inthisexamplethereareonlytwoobjectsthatwillbesetup.ThefirstisatracelogthatiscommontomanyDSP/BIOSprojects.Thesecondisataskobjectthatwillbeusedtoprinttothelog.
TosetuptheLOGobject,expandtheInstrumentationitemandrightclickontheLOGitem.SelectInsertLOGandgivetheLOGobjectthenametrace.
Figure12:
InsertLOGmenuitem
Figure13:
Figure14:
DSP/BIOSconfigurationtoolshowingthetraceLOGobject
Nextinsertatask(TSK)objectandgiveitthenameTSK0.
Figure15:
InsertingaTSKobject
Figure16:
TSKobject
InorderfortheTSKobjecttobeassociatedwithafunctiontheTaskfunctionnamemustbechanged.RightclickontheTSK0objectandselectProperties.UndertheFunctiontab,type_funTSK0.Besuretoincludetheunderscoreatthebeginningofthename.TheCprogramfunctionnamewillbefunTSK0buttheassemblycodenamewillhaveanunderscoreatthebeginning.Besuretonotethatthenameofthetaskobjectandthenameofthefunctionthatitusescannotbethesamename.InthisexampletheobjectnameisTSK0andthefunctionnameiffunTSK0.
Aftertheobjectshavebeensetup,saveandclosetheconfigurationfile.
Whenyourprojectgetsbuilt,theconfigurationfileautomaticallygeneratesfiles.Oneofthesefilesisaheaderfilethatcanbeusedinyourprograms.Ifyourconfigurationfileisnamedfile.tcfthentheheaderfilethatgetsmadewillbecalledfilecfg.h.InthesourcefilesthatusetheDSP/BIOSobjectthisheaderfilecanbeincluded.Useastatementlike:
#include"filecfg.h"
Addcodefiles
WhenusingDSP/BIOSinaproject,verylittlecodeisinthemainfunction.Otherobjectsareusedliketasksandinterrupts.InthisexampleasimpletaskwillbemadethatprintstoaLOGbuffer.CreateanewCprogramfile.SelectFile->New->SourceFile.
Figure17:
Newsourcefile
TheNewSourceFiledialogopensandyoucanenterthesourcefilename.Adda.cextensionforaCprogramfile.Thesourcefoldershouldbethefolderofyourproject.SelectFinishandanewfileisopened.
Figure18:
Newsourcefiledialog
EntertheCcode.Thefilemustcontainamainfunction.Afterenteringthecode,savethefile.
#include
#include
#include
#include"dspbiosprojectcfg.h"//headergeneratedbydspbiosproject.tcf
voidmain(void){
LOG_printf(&trace,"Inmainfunction");
return;
}
voidfunTSK0(void){
LOG_printf(&trace,"InTSK0");
return;
}
Inthecodeabove,notethattheheaderfiledspbiosprojectcfg.hisincluded.ThisistheheaderfilegeneratedbytheDSP/BIOSconfigurationfile.Also,thefunctionfunTSK0isthefunctionthatwillbeexecutedwhenTSK0getsscheduledtorun.
Createatargetconfiguration
Inordertobuildandrunyourprojectyouneedtohaveatargetconfiguration.Thisfilewillcontaininformationabouttheemulatorthatwillbeusedandthetargetprocessor.InthismodulethetargetconfigurationwillbetheTIsimulatorfortheC6713processor.
FirstselectFile->New->TargetConfigurationFile.
Figure19:
Opennewtargetconfigurationfile
IntheNewTargetConfigurationdialogentertheconfigurationfilenameendinginthe.ccxmlfileextension.Putthefileintheprojectdirectory.SelectFinishandanewtargetconfigurationfileopens.
Figure20:
Targetconfigurationdialog
Inthetargetconfiguration,selecttheconnectionneeded(simulatororsometypeofemulator,etc.)andthetypeofdevice.InthisexampletheTIsimulatorisusedwiththeC6713littleendiansimulatordevice.SelectSavewhendone.
Figure21:
Targetconfigurationsetup
Nowthetargetconfigurationisintheproject.
Figure22:
Projectfiles
Debugtheproject
TostartadebugsessioneitherselectTarget->DebugActiveProjectorpressthedebugiconinthemenubar.
Figure23:
Debugicon
Whenthedebugsessionstartsthecodefilesarecompiledandlinkedintoanexecutablefileandthefileisloadedontothetarget.Theinitializationcodeisexecutedandtheprogramishaltedatthebeginningofthemainfunction.
Figure24:
Debuggingsession
InordertobeabletoseetheLOGprinttexttherealtimeanalysis(RTA)datastreammustbeturnedon.SelectTools->RTA->PrintLogswhichwillopenuptheLOGprintwindow.SelecttheStreamRTAdatabuttonontherightpartofthemenubar.Theiconisdepressedinthefigure.
Figure25:
TurnontheRTAdatastream
Iconsonthedebugwindowcanbeusedtoruntheprogramandotherdebuggingtools.
Figure26:
Debuggingtools
Pressthegreenarrowtoruntheprogram.Themainfunctionwillbeexecutedandtheprogramwillleavethemainfunction.AfterthemainfunctionexecutestheTSK0objectisscheduleandthetsk0functionisexecuted.BothfunctionsprinttothetraceLOGobject.TheoutputcanbeviewedinthePrintfLogswindow.
Figure27:
PrintfLogsoutputwindow
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Code Composer Studio v4 DSPBIOS Project
![提示](https://static.bingdoc.com/images/bang_tan.gif)