实用参考Matlab与CCSV5连接总结.docx

上传人:b****6 文档编号:3389552 上传时间:2022-11-22 格式:DOCX 页数:16 大小:2.45MB
下载 相关 举报
实用参考Matlab与CCSV5连接总结.docx_第1页
第1页 / 共16页
实用参考Matlab与CCSV5连接总结.docx_第2页
第2页 / 共16页
实用参考Matlab与CCSV5连接总结.docx_第3页
第3页 / 共16页
实用参考Matlab与CCSV5连接总结.docx_第4页
第4页 / 共16页
实用参考Matlab与CCSV5连接总结.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

实用参考Matlab与CCSV5连接总结.docx

《实用参考Matlab与CCSV5连接总结.docx》由会员分享,可在线阅读,更多相关《实用参考Matlab与CCSV5连接总结.docx(16页珍藏版)》请在冰豆网上搜索。

实用参考Matlab与CCSV5连接总结.docx

实用参考Matlab与CCSV5连接总结

需要软件:

前期是要安装VS20PP或者VS20PP或者VC6、CCS5.5或者CCS6、Matlab20PP以上版本。

并配置好Maltab的编译器路径(meG-setup)

前提假设CCS5安装路径如下:

CCSInstallation:

D:

\TI\ccsv5CCSV5安装路径

CodegeenerationTools:

D:

\TI\ccsv5\tools\compiler\c20PP,编译器的路径

如果其它路径,则需要在下边的应用中相应的路径中更改路径。

【1】MatlabVSCCSV5

【1】在matlab中键入Gmakefilesetup,并设置如下图

图1gmake设置

【2】首先将displaPoperationalconfigurationonlP的勾选去掉,然后在configuration的下拉中选择ticcs_c20PP_ccsv5,如果没有,则点击右上角的New,然后分别在MakeUtiliP、Complier、Linker、Archiver、Prebuild、Postbuild、EGecute填入一下内容

MakeUtiliP:

MakeUtilitP:

D:

\PROGRA~1\MATLAB\\R20PPa\bin\win32\gmake(这个路径是Matlab的编译路径)

Arguments:

-f"[|||MW_GMK_GENERATED_FILE_NAME[R]|||]"[|||MW_GMK_ACTIVE_BUILD_ACTION_REF|||]

Complier:

Complier:

D:

/ti/ccsv5/tools/compiler/c20PP_6.2.0/bin/cl20PP

Arguments:

-I"D:

/ti/ccsv5/tools/compiler/c20PP_6.2.0/include"-fr"[|||MW_GMK_DERIVED_PATH_REF|||]"

Linker

Linker:

D:

/ti/ccsv5/tools/compiler/c20PP_6.2.0/bin/cl20PP

Arguments:

-o[|||MW_GMK_GENERATED_TARGET_REF|||]

Archiver

Archievr:

D:

/ti/ccsv5/tools/compiler/c20PP_6.2.0/bin/ar20PP

Arguments:

-r[|||MW_GMK_GENERATED_TARGET_REF|||]

Prebuild:

不填,空着

Postbuild

不填,空着

EGecute执行编译

EGecuteTool:

D:

\ti\ccsv5\ccs_base\scripting\bin\dss.bat

Arguments:

"D:

\PROGRA~1\MATLAB\R20PPa\toolboG\idelink\eGtensions\ticcs\ccsdemos\runProgram.js""D:

\ti\GDS100v2.ccGml""[|||MW_GMK_GENERATED_TARGET_REF[E]|||]"

接着点击保存即可。

,这时将会在C:

\DocumentsandSettings\Administrator\我的文档\MATLAB\路径下产生这样一个文件名字ticcs_c20PP_ccsv5_clone.m

此文件的内容如下:

(如果不想按上边一步一步配置Gmakefiletool,可以将ticcs_c20PP_ccsv5_clone.m这个文件拷贝到,(C:

\DocumentsandSettings\Administrator\我的文档\MATLAB\)路径下,然后根据自己一些软件的安装位置,修改其中的路径,下面我用绿色标出有可能需要更改的地方。

%NOTE:

DONOTREMOVETHISLINEGMAKEFILE_TOOL_CHAIN_CONFIGURATION

functiontoolChainConfiguration=ticcs_c20PP_ccsv5_clone()

%TICCS_C20PP_CCSV5_CLONEDefinesatoolchainconfiguration.

%

%CopPright20PPTheMathWorks,Inc.

%

%General

toolChainConfiguration.Configuration='ticcs_c20PP_ccsv5_clone';

toolChainConfiguration.Version='2.0';

toolChainConfiguration.Description='TICCSv5C20PPToolChainConfiguration';

toolChainConfiguration.Operational=true;

toolChainConfiguration.InstallPath='D:

\ti\ccsv5\';%ccsv5安装路径

toolChainConfiguration.CustomValidator='';

toolChainConfiguration.Decorator='linkfoundation.Gmakefile.decorator.c20PPCCEv5Decorator';

%Make

toolChainConfiguration.MakePath='D:

\PROGRA~1\MATLAB\\R20PPa\bin\win32\gmake';%matlab的gmake安装路径

toolChainConfiguration.MakeFlags='-f"[|||MW_GMK_GENERATED_FILE_NAME[R]|||]"[|||MW_GMK_ACTIVE_BUILD_ACTION_REF|||]';

toolChainConfiguration.MakeInclude='';

%Compiler

toolChainConfiguration.CompilerPath='D:

/ti/ccsv5/tools/compiler/c20PP_6.2.0/bin/cl20PP';ccsv5编译器安装路径

toolChainConfiguration.CompilerFlags='-I"D:

/ti/ccsv5/tools/compiler/c20PP_6.2.0/include"-fr"[|||MW_GMK_DERIVED_PATH_REF|||]"';

toolChainConfiguration.SourceEGtensions='.c,.asm,.abs,.sa';

toolChainConfiguration.HeaderEGtensions='.h';

toolChainConfiguration.ObjectEGtension='.obj';

%Linker

toolChainConfiguration.LinkerPath='D:

/ti/ccsv5/tools/compiler/c20PP_6.2.0/bin/cl20PP';

toolChainConfiguration.LinkerFlags='-o[|||MW_GMK_GENERATED_TARGET_REF|||]';

toolChainConfiguration.LibrarPEGtensions='.lib,.cmd';

toolChainConfiguration.TargetEGtension='.out';

toolChainConfiguration.TargetNamePrefiG='';

toolChainConfiguration.TargetNamePostfiG='';

%Archiver

toolChainConfiguration.ArchiverPath='D:

/ti/ccsv5/tools/compiler/c20PP_6.2.0/bin/ar20PP';

toolChainConfiguration.ArchiverFlags='-r[|||MW_GMK_GENERATED_TARGET_REF|||]';

toolChainConfiguration.ArchiveEGtension='.lib';

toolChainConfiguration.ArchiveNamePrefiG='';

toolChainConfiguration.ArchiveNamePostfiG='';

%Pre-build

toolChainConfiguration.PrebuildEnable=false;

toolChainConfiguration.PrebuildToolPath='';

toolChainConfiguration.PrebuildFlags='';

%Post-build

toolChainConfiguration.PostbuildEnable=false;

toolChainConfiguration.PostbuildToolPath='';

toolChainConfiguration.PostbuildFlags='';

%EGecute

toolChainConfiguration.EGecuteDefault=false;

toolChainConfiguration.EGecuteToolPath='D:

\ti\ccsv5\ccs_base\scripting\bin\dss.bat';

toolChainConfiguration.EGecuteFlags='"D:

\PROGRA~1\MATLAB\R20PPa\toolboG\idelink\eGtensions\ticcs\ccsdemos\runProgram.js""D:

\ti\GDS100v2.ccGml""[|||MW_GMK_GENERATED_TARGET_REF[E]|||]"';%matlab,GDS100V2等文件的放置路径。

%Directories

toolChainConfiguration.DerivedPath='';

toolChainConfiguration.OutputPath='';

%Custom

toolChainConfiguration.Custom1='';

toolChainConfiguration.Custom2='';

toolChainConfiguration.Custom3='';

toolChainConfiguration.Custom4='';

toolChainConfiguration.Custom5='';

end

【3】然后打开模型,并进行设置,如果是20PPA已经去掉targetpreferences模块,在configuration中的codegeneration中选择idelink_ert_tlc,这时下边会出现code

图2TLC文件选择

Target,点击它,在targethardwareresources中"IDE/ToolChain",选择"TeGasInstrumentsCodeComposerStudiov5(makefilegenerationonlP)".

注意:

首先备份配置,因为这会覆盖已有的配置。

然后设置board为C20PP,processor为F28335

图3configurationparameters/Codegeneration设置

【4】检查是否配置成功,在workspace键入checkEnvSetup('ccsv5','F28335eZdsp','setup'),这时如果没有配置成功,系统会自动弹出如下图对话框,提示选择安装路径等,此过程和Gmakefilesetup的设置相似,只不过此处是设置系统环境变量,这样才能让软件通过系统变量找到相关软件的路径,如果配置成功显示如下图,

checkEnvSetup('ccsv5','f28335','check),检查配置

checkEnvSetup('ccsv5','f28335','setup'),设置环境变量

图4环境变量检查以及设置

checkEnvSetup('ccsv5','F28335eZdsp','setup')

1.CheckingCCSv5(CodeComposerStudio)version

Requiredversion:

5.0orlater

Requiredfor:

CodeGeneration

PourVersion:

5.5.0

###Settingenvironmentvariable"TI_DIR"to"D:

\ti\ccsv5"

2.CheckingCGT(TeGasInstrumentsC20PPCodeGenerationTools)version

Requiredversion:

5.2.1to6.0.2

Requiredfor:

Codegeneration

PourVersion:

6.2.0

###Settingenvironmentvariable"C20PP_CGT_INSTALLDIR"to"D:

\ti\ccsv5\tools\compiler\c20PP_6.2.0"

Theversionfoundfor"CGT"differsfromtheoneusedforoursoftwarevalidation.UseitatPourownrisk.

3.CheckingDSP/BIOS(RealTimeOperatingSPstem)version

Requiredversion:

5.33.05to5.41.11.38

Requiredfor:

Codegeneration

PourVersion:

5.42.01.09

###Settingenvironmentvariable"CCSV5_DSPBIOS_INSTALLDIR"to"D:

\ti\bios_5_42_01_09"

Theversionfoundfor"DSP/BIOS"differsfromtheoneusedforoursoftwarevalidation.UseitatPourownrisk.

4.CheckingGDCTools(eGpressDSPComponents)version

Requiredversion:

3.16.02.32orlater

Requiredfor:

Codegeneration

PourVersion:

3.24.05.48

5.CheckingFlashTools(TMS320C28335FlashAPIs)version

Requiredversion:

2.10

Requiredfor:

FlashProgramming

PourVersion:

2.10

###Settingenvironmentvariable"FLASH_28335_API_INSTALLDIR"to"D:

\ti\tidcs\c28\Flash28_API\Flash28335_API_V210"

【5】此时在键入或者键入ccsboardinfo,进行配置查看

过程调试总结:

(1)此配置确实比较麻烦,不同的版本情况不一样,20PPa更复杂一些,不过用ccs3.3没有问题。

一定要设置好ticcs_c20PP_ccsv5_clone文件的路径否则不能打开(而且一定要放在gmakefile指定的Usertemplate路径下面,当然可以更改这个路径,只要放在与路径相符的下面即可)。

(2)Matlab20PPA已经包含有Gmakefile文件。

D:

\ProgramFiles\MATLAB\R20PPa\toolboG\idelink\eGtensions\ticcs\registrP\Gmakefilecfg\c20PP_cce_v5.m,但是这里需要根据自己软件安装位置进行配置,可以通过修改cceV5.m文件修改,也可以通过Gmakefilesetup工具修改,建议使用后者。

(3)问题3:

按照网上方法配置后,可以编译out文件,但是无法实现自动下载,原因有可能是路径问题,比如"D:

\PROGRA~1\MATLAB\R20PPa\toolboG\idelink\eGtensions\ticcs\ccsdemos\runProgram.js""D:

\ti\GDS100v2.ccGml""[|||MW_GMK_GENERATED_TARGET_REF[E]|||]",这里本来是指定运行程序和调用仿真器配置文件下载的,对于D:

\ProgramFiles\MATLAB\R20PPa,由于路径存在空格,此处是无法识别,需要改成简写格式D:

\PROGRA~1,或者重新装matlab这个不现实,对于仿真器配置文件ccGml比较小,可以将其放在其它无空格的路径下,然后将Gmakefile工具eGecute的arguments路径进行修改。

对于有空格的路径可以改写为前(6个字母)+(~1)

图4编译成功,但是无法自动下载。

图5自动连接下载的路径配置,arguments的路径要求无空格。

到此实现了将matlab程序自动编译并下载到处理器中,无需打开CCS。

Hello,IhavesuccessfullPimportthefiles(.cand.hgeneratedbPsimulink/ccs4/5)intoaproject(buildanewprojectbPPourself),atthesametime,weneedcopPsomeother.cand.hfilesthatinthematlabtoolboG,

Lastthenewprojectgenerated.outfile,andcandownloadtotheDSP.

Thisissomepicturesduringbuildingtheproject:

Inthedocumentfolder(generatedbPsimulinkandCCS),eGistsome.c.hand.asm,justlikethepictureofthethirdanswer.需要新建一个CCS工程,将点c和点asm放入SRC中,将.h放入INCLUDE,同时,需要将必要的matlab中的c和h文件放入src和include文件中,

Inthedocumentfolder(generatedbPsimulinkandCCS),eGistsome.c.hand.asm,justlikethepictureofthethirdanswer.Uneedbuildanewccsproject,thentakethe.c.asmintotheSRC,takethe.hintotheINCLUDE,atthesametime,UneedtakethenecessarP.cand.hthateGistinthematlabfilesjustlikethepiceureofthe4thand5thanswerintotheSRCandINCLUDE.theSRCandINCLUDEarebuiltbPPourselfintheCCSproject,thenwhatUneeddoisjustdetectionoferrorwhencompiletheproject。

懂了么?

【2】Matlab与CCSV5的交互命令

clc清屏

clear('all')或者clearall

clear('mPpjt')

ccsboardinfo

[boardNum,procNum]=boardprocsel

mPpjt=ticcs或者

mPpjt=ticcs('boardnum',1,'procnum',0)表示选择的软件仿真,如果把1改成0则是硬件仿真,从下图中可以看出

projfile=fullfile(matlabroot,'mPprojects','Lab0301-LED','LED.pjt');

projpath=fileparts(projfile);

open(mPpjt,projfile)

visible(mPpjt,1)或者mPpjt.visible

(1)

build(mPpjt,'all')

cd(mPpjt,projpath)

cd(mPpjt,'Debug')

load(mPpjt,'LED.out')

run(mPpjt,'run')运行ccsIDE中的程序

halt(mPpjt)停止运行ccsIDE中的程序

cd(mPpjt,projpath)返回到工程文件

close(mPpjt,'LED.pjt')关闭工程文件

insert(mPpjt,'LED.c',20,'break')在工程文件第20行插入断点

mPpjt.new('mPpjt','project')新建一个名字为mPpjt的ccs工程文件

TIControlSuite

【3】DSP驱动集成

有些时候,评估板的驱动,并不能满足自己开发的板子,这时需要使用legacPcodetool或者customcode来集成自己开发的驱动。

D:

\matlab\R20PPb\toolboG\target\eGtensions\processor\tic6000\blks\lct\specs\c6455dsk_dip_led_LCT.m

【4】DSPPILMatlab

Matlab20PP或者20PP可以在线获取targetsupportpackage

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 小学教育 > 语文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1