matlab 与ccsv5连接总结.doc

上传人:sk****8 文档编号:4317113 上传时间:2019-10-21 格式:DOC 页数:15 大小:2.56MB
下载 相关 举报
matlab 与ccsv5连接总结.doc_第1页
第1页 / 共15页
matlab 与ccsv5连接总结.doc_第2页
第2页 / 共15页
matlab 与ccsv5连接总结.doc_第3页
第3页 / 共15页
matlab 与ccsv5连接总结.doc_第4页
第4页 / 共15页
matlab 与ccsv5连接总结.doc_第5页
第5页 / 共15页
点击查看更多>>
资源描述

1、需要软件:前期是要安装VS2010或者VS2008或者VC6、CCS5.5或者CCS6、Matlab2012以上版本。并配置好Maltab的编译器路径(mex -setup)前提假设CCS5安装路径如下:CCS Installation: D:TIccsv5 CCSV5安装路径Code geeneration Tools: D:TIccsv5toolscompilerc2000 ,编译器的路径如果其它路径,则需要在下边的应用中相应的路径中更改路径。 【1】 Matlab VS CCSV5【1】 在matlab 中键入xmakefilesetup ,并设置如下图图1 gmake设置【2】 首先将

2、display operational configuration only的勾选去掉,然后在configuration的下拉中选择ticcs_c2000_ccsv5,如果没有,则点击右上角的New,然后分别在Make Utiliy、Complier、Linker、Archiver、Prebuild、Postbuild、Execute填入一下内容 Make Utiliy: Make Utility : D:PROGRA1MATLABR2013abinwin32gmake (这个路径是Matlab的编译路径)Arguments : -f |MW_XMK_GENERATED_FILE_NAMER|

3、 |MW_XMK_ACTIVE_BUILD_ACTION_REF|Complier :Complier: D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000Arguments :-ID:/ti/ccsv5/tools/compiler/c2000_6.2.0/include -fr|MW_XMK_DERIVED_PATH_REF|Linker Linker: D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000Arguments : -o |MW_XMK_GENERATED_TARGET_REF|Ar

4、chiver Archievr: D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/ar2000Arguments: -r |MW_XMK_GENERATED_TARGET_REF|Prebuild : 不填,空着Postbuild 不填,空着Execute 执行编译Execute Tool: D:ticcsv5ccs_basescriptingbindss.batArguments :D:PROGRA1MATLABR2013atoolboxidelinkextensionsticcsccsdemosrunProgram.js D:tiXDS100v2.cc

5、xml |MW_XMK_GENERATED_TARGET_REFE|接着点击保存即可。,这时将会在C:Documents and SettingsAdministrator我的文档MATLAB 路径下产生这样一个文件名字 ticcs_c2000_ccsv5_clone.m此文件的内容如下:(如果不想按上边一步一步配置xmakefiletool,可以将ticcs_c2000_ccsv5_clone.m这个文件拷贝到,(C:Documents and SettingsAdministrator我的文档MATLAB )路径下,然后根据自己一些软件的安装位置,修改其中的路径,下面我用绿色标出有可能需要

6、更改的地方。% NOTE: DO NOT REMOVE THIS LINE XMAKEFILE_TOOL_CHAIN_CONFIGURATIONfunction toolChainConfiguration = ticcs_c2000_ccsv5_clone()%TICCS_C2000_CCSV5_CLONE Defines a tool chain configuration.% Copyright 2015 The MathWorks, Inc.% GeneraltoolChainConfiguration.Configuration = ticcs_c2000_ccsv5_clone;t

7、oolChainConfiguration.Version = 2.0;toolChainConfiguration.Description = TI CCS v5 C2000 Tool Chain Configuration;toolChainConfiguration.Operational = true;toolChainConfiguration.InstallPath = D:ticcsv5; % ccsv5安装路径toolChainConfiguration.CustomValidator = ;toolChainConfiguration.Decorator = linkfoun

8、dation.xmakefile.decorator.c2000CCEv5Decorator;% MaketoolChainConfiguration.MakePath = D:PROGRA1MATLABR2013abinwin32gmake; %matlab 的gmake安装路径toolChainConfiguration.MakeFlags = -f |MW_XMK_GENERATED_FILE_NAMER| |MW_XMK_ACTIVE_BUILD_ACTION_REF|;toolChainConfiguration.MakeInclude = ;% CompilertoolChainC

9、onfiguration.CompilerPath = D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000; ccsv5编译器安装路径toolChainConfiguration.CompilerFlags = -ID:/ti/ccsv5/tools/compiler/c2000_6.2.0/include -fr|MW_XMK_DERIVED_PATH_REF|;toolChainConfiguration.SourceExtensions = .c,.asm,.abs,.sa;toolChainConfiguration.HeaderExte

10、nsions = .h;toolChainConfiguration.ObjectExtension = .obj;% LinkertoolChainConfiguration.LinkerPath = D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000;toolChainConfiguration.LinkerFlags = -o |MW_XMK_GENERATED_TARGET_REF|;toolChainConfiguration.LibraryExtensions = .lib,.cmd;toolChainConfiguration.Ta

11、rgetExtension = .out;toolChainConfiguration.TargetNamePrefix = ;toolChainConfiguration.TargetNamePostfix = ;% ArchivertoolChainConfiguration.ArchiverPath = D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/ar2000;toolChainConfiguration.ArchiverFlags = -r |MW_XMK_GENERATED_TARGET_REF|;toolChainConfiguration

12、.ArchiveExtension = .lib;toolChainConfiguration.ArchiveNamePrefix = ;toolChainConfiguration.ArchiveNamePostfix= ;% Pre-buildtoolChainConfiguration.PrebuildEnable = false;toolChainConfiguration.PrebuildToolPath = ;toolChainConfiguration.PrebuildFlags = ;% Post-buildtoolChainConfiguration.PostbuildEna

13、ble = false;toolChainConfiguration.PostbuildToolPath = ;toolChainConfiguration.PostbuildFlags = ;% ExecutetoolChainConfiguration.ExecuteDefault = false;toolChainConfiguration.ExecuteToolPath = D:ticcsv5ccs_basescriptingbindss.bat;toolChainConfiguration.ExecuteFlags = D:PROGRA1MATLABR2013atoolboxidel

14、inkextensionsticcsccsdemosrunProgram.js D:tiXDS100v2.ccxml |MW_XMK_GENERATED_TARGET_REFE|; %matlab ,XDS100V2等文件的放置路径。% DirectoriestoolChainConfiguration.DerivedPath = ;toolChainConfiguration.OutputPath = ;% CustomtoolChainConfiguration.Custom1 = ;toolChainConfiguration.Custom2 = ;toolChainConfigurat

15、ion.Custom3 = ;toolChainConfiguration.Custom4 = ;toolChainConfiguration.Custom5 = ;end【3】 然后打开模型,并进行设置,如果是2013A已经去掉 target preferences模块,在configuration中的 code generation 中选择idelink_ert_tlc,这时下边会出现code 图2 TLC文件选择Target ,点击它,在target hardware resources中IDE/Tool Chain,选择Texas Instruments Code Composer S

16、tudio v5 (makefile generation only).注意:首先备份配置,因为这会覆盖已有的配置。然后设置board为C2000,processor为 F28335 图3 configuration parameters/Code generation设置【4】 检查是否配置成功,在workspace键入checkEnvSetup(ccsv5,F28335 eZdsp, setup),这时如果没有配置成功,系统会自动弹出如下图对话框,提示选择安装路径等,此过程和xmakefilesetup的设置相似,只不过此处是设置系统环境变量,这样才能让软件通过系统变量找到相关软件的路径,

17、如果配置成功显示如下图,checkEnvSetup(ccsv5,f28335, check),检查配置checkEnvSetup(ccsv5,f28335, setup),设置环境变量图4 环境变量检查以及设置checkEnvSetup(ccsv5,F28335 eZdsp, setup)1. Checking CCSv5 (Code Composer Studio) version Required version: 5.0 or later Required for : Code Generation Your Version : 5.5.0 # Setting environment v

18、ariable TI_DIR to D:ticcsv52. Checking CGT (Texas Instruments C2000 Code Generation Tools) version Required version: 5.2.1 to 6.0.2 Required for : Code generation Your Version : 6.2.0 # Setting environment variable C2000_CGT_INSTALLDIR to D:ticcsv5toolscompilerc2000_6.2.0 The version found for CGT d

19、iffers from the one used for our software validation. Use it at your own risk.3. Checking DSP/BIOS (Real Time Operating System) version Required version: 5.33.05 to 5.41.11.38 Required for : Code generation Your Version : 5.42.01.09 # Setting environment variable CCSV5_DSPBIOS_INSTALLDIR to D:tibios

20、_5_42_01_09 The version found for DSP/BIOS differs from the one used for our software validation. Use it at your own risk.4. Checking XDC Tools (eXpress DSP Components) version Required version: 3.16.02.32 or later Required for : Code generation Your Version : 3.24.05.485. Checking Flash Tools (TMS3

21、20C28335 Flash APIs) version Required version: 2.10 Required for : Flash Programming Your Version : 2.10 # Setting environment variable FLASH_28335_API_INSTALLDIR to D:titidcsc28Flash28_APIFlash28335_API_V210【5】 此时在键入或者键入ccsboardinfo,进行配置查看过程调试总结:(1) 此配置确实比较麻烦,不同的版本情况不一样,2010a更复杂一些,不过用ccs3.3没有问题。一定要

22、设置好ticcs_c2000_ccsv5_clone文件的路径否则不能打开(而且一定要放在gmakefile指定的User template路径下面 ,当然可以更改这个路径,只要放在与路径相符的下面即可)。(2) Matlab2013A已经包含有xmakefile文件。D:Program FilesMATLABR2013atoolboxidelinkextensionsticcsregistryxmakefilecfgc2000_cce_v5.m,但是这里需要根据自己软件安装位置进行配置,可以通过修改cceV5.m文件修改,也可以通过xmakefilesetup工具修改,建议使用后者。(3)

23、问题3:按照网上方法配置后,可以编译out文件,但是无法实现自动下载,原因有可能是路径问题,比如D:PROGRA1MATLABR2013atoolboxidelinkextensionsticcsccsdemosrunProgram.js D:tiXDS100v2.ccxml |MW_XMK_GENERATED_TARGET_REFE|,这里本来是指定运行程序和调用仿真器配置文件下载的,对于D:Program FilesMATLABR2013a,由于路径存在空格,此处是无法识别,需要改成简写格式D:PROGRA1,或者重新装matlab这个不现实,对于仿真器配置文件ccxml比较小,可以将其放

24、在其它无空格的路径下,然后将xmakefile 工具execute 的arguments路径进行修改。对于有空格的路径可以改写为前(6个字母)+(1)图4 编译成功,但是无法自动下载。图5 自动连接下载的路径配置,arguments的路径要求无空格。到此实现了将matlab程序自动编译并下载到处理器中,无需打开CCS。 Hello,I have successfully import the files( .c and .h generated by simulink/ccs4/5 ) into a project (build a new project by yourself ),at t

25、he same time ,we need copy some other .c and .h files that in the matlab toolbox,Last the new project generated .out file ,and can download to the DSP.This is some pictures during building the project:In the document folder(generated by simulink and CCS),exist some .c .h and .asm, just like the pict

26、ure of the third answer. 需要新建一个CCS工程,将点c和点asm放入SRC中,将.h放入INCLUDE,同时,需要将必要的matlab中的c和h文件放入src和include文件中,In the document folder(generated by simulink and CCS),exist some .c .h and .asm, just like the picture of the third answer. U need build a new ccs project , then take the .c .asm into the SRC, tak

27、e the .h into the INCLUDE, at the same time ,U need take the necessary .c and .h that exist in the matlab files just like the piceure of the 4th and 5th answer into the SRC and INCLUDE . the SRC and INCLUDE are built by yourself in the CCS project,then what U need do is just detection of error when

28、compile the project。 懂了么?【2】 Matlab与CCSV5的交互命令clc 清屏clear(all) 或者 clear all clear(mypjt)ccsboardinfoboardNum,procNum=boardprocsel mypjt=ticcs 或者mypjt=ticcs(boardnum,1,procnum,0) 表示选择的软件仿真,如果把1改成0则是硬件仿真,从下图中可以看出projfile=fullfile(matlabroot,myprojects,Lab0301-LED,LED.pjt); projpath=fileparts(projfile)

29、;open(mypjt,projfile)visible(mypjt,1) 或者mypjt.visible(1) build(mypjt,all)cd(mypjt,projpath)cd(mypjt, Debug)load(mypjt,LED.out)run(mypjt,run) 运行ccsIDE中的程序halt(mypjt) 停止运行ccsIDE中的程序cd(mypjt,projpath) 返回到工程文件close(mypjt,LED.pjt) 关闭工程文件insert(mypjt,LED.c,20,break) 在工程文件第20行插入断点mypjt.new(mypjt,project) 新建一个名字为mypjt的ccs工程文件TI ControlSuite【3】 DSP驱动集成有些时候,评估板的驱动,并不能满足自己开发的板子,这时需要使用legacy code tool或者custom code来集成自己开发的驱动。D:matlabR2009btoolboxtargetextensionsprocessortic6000blkslctspecsc6455dsk_dip_led_LCT.m【4】 DSP PIL MatlabMatlab 2013或者2014可以在线获取target support package

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 重点行业资料库 > 自然科学

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。