How to reference C code drivers in Simulink Project

1 view (last 30 days)
I am trying to compile code for the TI C2000 TMS320F28377S Processor. When everything is Simulink code, everything I've got compiles fine.
However, I want to use the Sigma Delta Filter Module which there is no mathworks support for, so I am trying to reference the Control Suite Drivers for this peripheral. The question is, how do I do this and get things to link properly.
First I added the location of the driver files to my paths in the matlab workspace.
Second, I set up the Custom Code options as follows in the Model Configuration Parameters as shown below
When I compile this, I see the following output in the MATLAB console. The Report Generator gives perfect output, but when it goes to be compiled by Code Composer Studio there is a linker error.
<Linking>
undefined first referenced
symbol in file
--------- ----------------
_SDFM F2837xS_sdfm_drivers.obj
error: unresolved symbols remain
error: errors encountered during linking;
It appears that I am not linking the C files correctly. I am just trying to reference the "F2837xS_sdfm_drivers.h" and "F2837xS_sdfm_drivers.c" files from control suite into my simulink project. I then want to call the "Sdfm_configureData_filter" from the C files.
Any ideas on where I need to put these files for them to be referenced correctly or how I need to reference them in the custom code window?
  1 Comment
Sudarshan Kolar
Sudarshan Kolar on 27 Apr 2017
Hello,
I would recommend creating an S-function with the device driver files. The following doc should be useful:
https://www.mathworks.com/matlabcentral/fileexchange/39354-device-drivers
Sudarshan

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!