Generating C code from a Matlab-Simulink model for DSP C6748

Juanma picture Juanma · Jun 20, 2011 · Viewed 7k times · Source

I'm trying to generate C code from a Matlab-Simulink simple model (eg.: sine wave generator with a DAC at the output). This code must be executed with Code Composer Studio for TMS320C6748 DSP (Texas Instrument C6748). Specifically, for the development board OMAP-L138 ZOOM ™EVM DEVELOPMENT KIT.

For this, I am using the following versions: Simulink (Version 7.7 - R2011a) Embedded Coder (Version 6.0 - R2011a) Code Composer Studio v3.3

I tried several options (with generic modules in Simulink and programming the C6748 timers, configuring a module "Target Preferences" with "OMAP_L138/C6748 EVM"...) but it isn't working.

Is it possible to implement this idea? Is there an example working?

Thanks

Answer

Murat Belge picture Murat Belge · Jun 27, 2011

Code generation for OMAP-L138 EVM / C6748EVM is supported in Simulink in R2011a. Before opening the Target Preferences block, import the processor definitions from DSP/BIOS. On the MATLAB command line, type the following:

getDspBiosFolder % This returns which DSP/BIOS MATLAB is seeing. If the value returned matches your installation of MATLAB, then you are OK. Otherwise, you need to use setDspBiosFolder to set the installation folder for DSP/BIOS (i.e. setDspbiosFolder('C:\CCStudio_v3.3\bios_5_33_06') on MATLAB command line). importDspbiosConfig('proc', 'all') importDspbiosConfig('board', 'all')

After these steps, you should be able to open the Target Preferences block and examine the settings. Before proceeding with code generation, run checkEnvSetup() utility to make sure that you installed all TI software required for code generation:

checkEnvSetup('ccs', 'omapl138evm', 'list')

The command above gives you a list of what you need to install. After making sure you have all of the software installed above with correct version numbers, execute the following:

checkEnvSetup('ccs', 'omapl138evm')

This sets all environment variables needed for code generation. MATLAB sees the location of the tools through environment variables created this way.

After these steps you should be able to generate code.