How to reference C code drivers in Simulink Project

조회 수: 2 (최근 30일)
DKalale
DKalale 2017년 4월 21일
댓글: Sudarshan Kolar 2017년 4월 27일
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
Sudarshan Kolar
Sudarshan Kolar 2017년 4월 27일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by