Import code generated by simulink to CCS v6

10 views (last 30 days)
rs
rs on 16 Dec 2015
Answered: Srijith Vijay on 9 Jan 2017
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?

Answers (2)

Shruti Sapre
Shruti Sapre on 18 Dec 2015
Hi,
Could you try the makefile approach given at the below link?
Hope this helps!
-Shruti
  2 Comments
rs
rs on 21 Dec 2015
Edited: rs on 21 Dec 2015
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 on 24 Aug 2016
Are you able to resolve the above issue? I am facing a similar issue.

Sign in to comment.


Srijith Vijay
Srijith Vijay on 9 Jan 2017
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.

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!