Import code generated by simulink to CCS v6

7 次查看(过去 30 天)
I'm using R2015a and CCS v6. I have successfully gotten the c28069blink_cla.mdl to build and run on the F28069 controlCARD. Now I want to be able to take the code generated by Simulink and make a CCS project from which I can build, run code, and debug.
I created a new project in CCS and copied over the files, except the .obj, from the c28069blink_cla_ert_rtm folder that was generated in my Matlab. Then I changed the Include Options in the Properties section of the CCS project to set the include paths for various Matlab and TI include files needed (see pic).
When I try to build in CCS I get a bunch of "unresolved symbol" errors and "function declared implicitly" warnings. CCS cannot find the include files that are in the Matlab paths I set so it is not seeing all of the declarations of the functions (like c2000_flash_init()) and all the #defines in these include files. I know the include files cannot be found because if I find a #include statement in the source code that is referencing a file in the Matlab paths and I right click the statement and choose "Open Declaration" CCS tells me "could not find include file" in red text at the bottom of the screen (see pic). CCS is able to find the include files that are in the TI paths.
How can I get the CCS project working correctly?

回答(2 个)

Shruti Sapre
Shruti Sapre 2015-12-18
Hi,
Could you try the makefile approach given at the below link?
Hope this helps!
-Shruti
  2 个评论
rs
rs 2015-12-21
编辑:rs 2015-12-21
Thanks for replying. I tried the directions. I get the following output after doing the makefile setup and then I get some errors when I try to build.
>> xmakefilesetup User makefile tool chain configuration location not set, using default C:\Users\J3\Documents\MATLAB\ instead. User makefile template location not set, using default C:\\Users\\J3\\Documents\\MATLAB\\ instead.
Error when I try to build:
Linking
undefined first referenced
symbol in file
--------- ----------------
_Cla1Prog_Start ./derived/c28069blink_cla.obj
_Cla1Task1 ./derived/c28069blink_cla.obj
error: unresolved symbols remain error: errors encountered during linking; "./CustomMW/c28069blink_cla.out" not built
I see these symbols in c28069blink_cla_private.h which matlab made:
extern Uint16 Cla1Prog_Start; __interrupt void Cla1Task1();
And they get used in c28069blink_cla.c which matlab made:
Cla1Regs.MVECT1 = (Uint16)((Uint32)&Cla1Task1 - (Uint32)&Cla1Prog_Start);
There's a #include c28069blink_cla_private.h in the c28069blink_cla.c but it seems like it can't see what's in the .h file?
There's some mention of a similar problem in CCS in this post but it's not useful for matlab code generation: https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/296911
Sourabh
Sourabh 2016-8-24
Are you able to resolve the above issue? I am facing a similar issue.

请先登录,再进行评论。


Srijith Vijay
Srijith Vijay 2017-1-9
As of now, there is no direct way to do this. You can manually create a project in CCS and then manually link/add the source files and other linker and compiler dependencies in the linker and compiler options section of this CCS project, respectively.
This information is available in the .mk (makefile) generated along with the code. This will create a project file which you can later use.
The 'Import from Makefile' option in CCS may have a lot of dependency errors.
Our developers are aware of this and will be incorporating this feature to directly import a CCS project in one of the future releases of MATLAB.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by