Hi,
i use the C2000-target blocksets in order to produce firmware for my C2812-board. Everything is working fine.
I can use the blocksets to test them in a simulink-simulation. And after compiling and buildung the Code is working fine on my ezdspC2812-Board.
Now I want to write some handwritten-code in c an include it in my existing projekt. I use the legacy_code tool in such a way, that I write an m-File in oder to build a s-function:
Furthermore I want to use IQmath.lib in oder to have access to the build-in functions in my c-routines. My code is working fine when no build-in function of the IQmath.lib is used. I can use the s-function in simulation and I can use it for code generation.
Bat if I use one of the Biuld-In-Functions like _IQ15sin(A) my simulation crashes. Any ideas?
Chris
Here is my script to produce n s-function "pid_regler" which can be used in a simulink-file and which can be used for code generation.
clear, clc;
def=legacy_code('initialize');
def.HeaderFiles={'dmctype.h','IQmathLib.h','pid_reg3.h'};
def.SourceFiles={'pid_reg3.c'};
def.HostLibFiles={'IQmath.lib'};
def.SFunctionName ='pid_regler';
def.OutputFcnSpec ='int32 y1 = legacy_pid(int32 u1[2], int32 p1[6], int32 work1[4])';
legacy_code('sfcn_cmex_generate',def);
legacy_code('compile', def);
legacy_code('slblock_generate', def);