This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to make code generation with OMAP-L138 Experimenter Kit, CCSv5.5 and MATLAB SIMULINK

Other Parts Discussed in Thread: OMAPL138, OMAP-L138, AM1808, TMS320C6748
Hello, ladies and gentlemen!

I am using CCSv5.5 with matlab (x64) R2014b (simulink) running on windows 7 (x64), when I try to build a simple Model (just with Audio of Multimedia File, C6748EVM DAC, C6748EVM ADC, Audio Device and C6000 Reset Block ), I get the following error without getting an out. file created for loading in CCS. So I can't bild a communication between Matlab and the board.


### Creating makefile: C:\Users\bisp\Documents\MATLAB\c6748evmwithreset_ticcs\c6748evmwithreset.mk ### Makefile creation done. ### Building makefile...

The call to idelink_ert_make_rtw_hook, during the exit hook generated the following error: Error while building the project.

The build process will terminate as a result.
Error while building the project.
The build failed with the following message: "C:/ti/ccsv5/tools/compiler/c6000_7.4.8/bin/cl6x" -I"C:/Program Files/MATLAB/R2014b/toolbox/idelink/extensions/ticcs/inc" -I"C:/Program Files/MATLAB/R2014b/toolbox/shared/dspblks/extern/include" -I"C:/Program Files/MATLAB/R2014b/extern/include/multimedia" -I"C:/Program Files/MATLAB/R2014b/toolbox/shared/dsp/vision/matlab/include" -I"C:/Users/bisp/Documents/MATLAB/c6748evmwithreset_ticcs" -I"C:/Users/bisp/Documents/MATLAB" -I"C:/Program Files/MATLAB/R2014b/extern/include" -I"C:/Program Files/MATLAB/R2014b/simulink/include" -I"C:/Program Files/MATLAB/R2014b/rtw/c/src" -I"C:/Program Files/MATLAB/R2014b/rtw/c/src/ext_mode/common" -I"C:/Program Files/MATLAB/R2014b/rtw/c/ert" -I"C:/Program Files/MATLAB/R2014b/toolbox/dsp/include" -I"C:/Program Files/MATLAB/R2014b/toolbox/dsp/extern/src/export/include/src" -I"C:/Program Files/MATLAB/R2014b/toolbox/dsp/extern/src/export/include" -I"C:/Program Files/MATLAB/R2014b/toolbox/target/extensions/processor/tic6000/blks/lct/include" -I"C:/ti/pspdrivers_01_30_01/packages" -I"C:/ti/pspdrivers_01_30_01/packages/ti/pspiom/cslr" -I"C:/ti/pspdrivers_01_30_01/packages/ti/pspiom/platforms/evm6748" -I"C:/ti/pspdrivers_01_30_01/packages/ti/pspiom/platforms/evm6748/audio" -I"C:/ti/pspdrivers_01_30_01/packages/ti/pspiom/mcasp" -I"C:/ti/pspdrivers_01_30_01/packages/ti/pspiom/i2c" -I"C:/ti/pspdrivers_01_30_01/packages/ti/pspiom/platforms/codec" -I"C:/ti/pspdrivers_01_30_01/packages/ti/pspiom/psc" -I"C:/ti/edma3_lld_01_11_03_01/packages" -I"C:/ti/edma3_lld_01_11_03_01/packages/ti/sdo/edma3/drv" -D"CHIP_OMAPL138" -D"__TICCSC__" -D"RT" -D"USE_RTMODEL" -mv6400+ -D"MODEL=c6748evmwithreset" -D"NUMST=3" -D"NCSTATES=0" -D"HAVESTDIO=" -D"ONESTEPFCN=1" -D"TERMFCN=1" -D"MAT_FILE=0" -D"MULTI_INSTANCE_CODE=0" -D"INTEGER_CODE=0" -D"MT=1" -D"CLASSIC_INTERFACE=0" -D"ALLOCATIONFCN=0" -D"TID01EQ=0" -I"C:/ti/ccsv5/tools/compiler/c6000_7.4.8/include" -I"C:/ti/OMAPL138_CSL/include" -fr"./derived/" ./HostLib_Audio.c ./HostLib_MMFile.c ./HostLib_Multimedia.c ./HostLib_rtw.c ./c6748evm_aic31.c ./c6748evm_i2c.c ./MW_c6xxx_csl.c ./c6748evmwithreset.c ./c6748evmwithreset_data.c ./c6748evmwithreset_main.c [HostLib_Audio.c] "C:/Program Files/MATLAB/R2014b/toolbox/shared/dspblks/extern/include/HostLib_rtw.h", line 15: fatal error: could not open source file "dlfcn.h" 1 fatal error detected in the compilation of "./HostLib_Audio.c". Compilation terminated. >> Compilation failure gmake: *** [derived/HostLib_Audio.obj] Error 1

Component: Simulink | Category: Block error



Before I ran the model at Simulink, I have already crossed through the checkEnvSetup and xmakefilesetup on the Matlab Command window just similar as the video Simulink code generation from MATLAB for TI C2000 processors- Hello World using CCS v4/v5 on youtube tells. Only a few parameters would be changed because of the OMAP-L138 processor and its different location.

Here it ist on the Matlab Command Window:

>> checkEnvSetup('ccsv5', 'omapl138evm')

1. Checking CCSv5 (Code Composer Studio) version
   Required version: 5.0 or later
   Required for    : Code Generation
   Your Version    : 5.5.0
   ### Setting environment variable "TI_DIR" to "C:\ti\ccsv5"

2. Checking C6000 CSL (TMS320C6000 Chip Support Library) version
   Required version: 2.31.00.10 or later
   Required for    : Code generation
   Your Version    : 2.31.00.15
   ### Setting environment variable "CSL_C6000_INSTALLDIR" to "C:\ti\C6xCSL"
   ### Setting environment variable "CSL_C6000_INSTALLDIR" to "C:\ti\C6xCSL"

3. Checking XDC Tools (eXpress DSP Components) version
   Required version: 3.16.02.32 or later
   Required for    : Code generation
   Your Version    : 3.24.03.33

4. Checking CGT (Code Generation Tools) version
   Required version: 6.1.18 to 7.3.1
   Required for    : Code generation
   Your Version    : 6.1.23
   ### Setting environment variable "C6000_CGT_INSTALLDIR" to "C:\ti\CGT_6_1_23"
   ### Setting environment variable "C6000_CGT_INSTALLDIR" to "C:\ti\CGT_6_1_23"

5. Checking DSP/BIOS (Real Time Operating System) version
   Required version: 5.33.05 to 5.41.11.38
   Required for    : Code generation
   Your Version    : 5.42.01.09
   ### Setting environment variable "CCSV5_DSPBIOS_INSTALLDIR" to "C:\ti\bios_5_42_01_09"
   ### Setting environment variable "CCSV5_DSPBIOS_INSTALLDIR" to "C:\ti\bios_5_42_01_09"
   The version found for "DSP/BIOS" differs from the one used for our software validation. Use it at your own risk.

6. Checking Texas Instruments IMGLIB (C64x+ Image Library) version
   Required version: 2.0.1 or later
   Required for    : CRL block replacement
   Your Version    : 2.1.0.0
   ### Setting environment variable "C64XP_IMGLIB_INSTALLDIR" to "C:\ti\c64plus-imglib_2_02_00_00"

7. Checking NDK (NDK 2.00) version
   Required version: 2.00.00 or later
   Required for    : External mode and Ethernet blocks
   Your Version    : NOT FOUND
   The required version of NDK is not found in C:\ti\ndk_2_20_00_19
   Following environment variable(s) required for code generation could not be set:
   ### "NDK_EVMC6748_INSTALLDIR"

8. Checking C674x DSP/BIOS PSP Drivers (BIOS PSP Release version 01.30.00.05) version
   Required version: 1.30.00.05
   Required for    : Code generation / device drivers
   Your Version    : 1.30.01
   ### Setting environment variable "PSP_EVMC6748_INSTALLDIR" to "C:\ti\pspdrivers_01_30_01"
   The version found for "C674x DSP/BIOS PSP Drivers" differs from the one used for our software validation. Use it at your own risk.

9. Checking EDMA3 Low Level Driver (EDMA3 LLD 01.10) version
   Required version: 1.10.00 or later
   Required for    : Device drivers
   Your Version    : 01.11.03
   ### Setting environment variable "EDMA3LLD_BIOS5_INSTALLDIR" to "C:\ti\edma3_lld_01_11_03_01"

10. Checking OMAP-L138/C6747EVM BSL (OMAP-L138 / TMS320C6748 / AM1808 SOM-M1 Gel, CCS Setup, & BSL Files (CCS v4.2.4)) version
   Required version: 2.0.0 or later
   Required for    : Device drivers
   Your Version    : 2.3.2
   ### Setting environment variable "BSL_EVMC6748_INSTALLDIR" to "C:\ti\CCSv4-2-4_with_SOM-M1_BSL_WS"


Here it is for the XMakefile User Configuration at Matlab Command Window :

Template: gmake
Configuration: ticcs_c6000_ccsv5_clone
User Templates: C:\Users\bisp\Documents\MATLAB\CodeGeneration02\
User Configurations: C:\Users\bisp\Documents\MATLAB\CodeGeneration02\

Under Make Utility:
Make utility: C:\Program Files\MATLAB\R2014b\bin\win64\gmake
Arguments:-f "[|||MW_XMK_GENERATED_FILE_NAME[R]|||]" [|||MW_XMK_ACTIVE_BUILD_ACTION_REF|||]

Under Compiler:
Compiler: C:/ti/ccsv5/tools/compiler/c6000_7.4.8/bin/cl6x
Arguments: -I"C:/ti/ccsv5/tools/compiler/c6000_7.4.8/include" -I"C:/ti/OMAPL138_CSL/include" -fr"[|||MW_XMK_DERIVED_PATH_REF|||]"

Under Linker:
Linker: C:/ti/ccsv5/tools/compiler/c6000_7.4.8/bin/cl6x
Arguments:-o [|||MW_XMK_GENERATED_TARGET_REF|||] -I"C:/ti/bios_5_42_01_09/packages/ti/pmi/lib/pmi.a674" -I"C:/ti/bios_5_42_01_09/packages/ti/pmi/lib/pmi_ctl_null.a674" -I"C:/ti/bios_5_42_01_09/packages/ti/bios/lib/pwrm.a674" -I"C:/ti/bios_5_42_01_09/packages/ti/pscl/lib/pscl.a674" -I"C:/ti/bios_5_42_01_09/packages/ti/pscl/lib/pscl_cfg_null.a674"

Under Archiver:
Archiver: C:/ti/ccsv5/tools/compiler/c6000_7.4.8/bin/ar6x
Arguments: -r [|||MW_XMK_GENERATED_TARGET_REF|||]


Here it is for the Simulink Model Configuration Parameters:
Target selection
System target file: idelink_ert.tlc
Language: C

Coder Target
Tool Chain Automation
Bild format: Makefile
Bild action: Bild_and_execute
Overrun notification: None

Target Hardware Resources
IDE/Tool Chain: Texas Instruments CCS v5(makefile generation only)

Board: OMAP-L138/C6748 EVM
Processor: OMAP-L138
CPU Clock: 300 MHz


Please help me solve the problem or tell me how to make a code generation between them successfully.
Thank you very much!



Zhirong Liang

  • Hi,

    Thanks for your post.

    In general, TI would not support MATLAB simulink model code generation but after seeing your compilation errors, I have few suggestions below:

    1. Could you please locate the path of the inclue file "dlfcn.h" which is defined in the source file "./HostLib_Audio.c" and kindly check whether the corresponding include path is added in the project properties. Also ensure whether the same include file "dlfcn.h" is physically available in the specified path, so that, you could resolve this undefined include file error and fix the compilation of source "./HostLib_Audio.c"

    2. One more observation, when you cross through the checkEnvSetup('ccsv5', 'omapl138evm'), there are conflicts thrown and it is better to fix the same as below:

    A. DSPBIOS version differs from the one used for software validation, so, kindly use the required version below:

      Required version: 5.33.05 to 5.41.11.38

      Required for    : Code generation

      Your Version    : 5.42.01.09

    B.  Please set the below environment variable which is required for code generation

      ### "NDK_EVMC6748_INSTALLDIR"

    C The version found for "C674x DSP/BIOS PSP Drivers" differs from the one used for our software validation. Kindly use the required version below:

      Required version: 1.30.00.05

      Required for    : Code generation / device drivers

      Your Version    : 1.30.01

    Kindly use the above recommendation and try to compile the source file "./HostLib_Audio.c"

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------

  • Thank you very much, Sivaraj!


    At first, I have fixed all the settings in the Matlab Command window so as the program required.

    >> checkEnvSetup('ccsv5', 'c6748evm', 'check')

    1. CCSv5 (Code Composer Studio)
       Your version    : 5.5.0
       Required version: 5.0 or later
       Required for    : Code Generation
       TI_DIR="C:\ti\ccsv5"

    2. C6000 CSL (TMS320C6000 Chip Support Library)
       Your version    : 2.31.00.15
       Required version: 2.31.00.10 or later
       Required for    : Code generation
       CSL_C6000_INSTALLDIR="C:\ti\C6xCSL"
       CSL_C6000_INSTALLDIR="C:\ti\C6xCSL"

    3. XDC Tools (eXpress DSP Components)
       Your version    : 3.24.03.33
       Required version: 3.16.02.32 or later
       Required for    : Code generation

    4. CGT (Code Generation Tools)
       Your version    : 6.1.23
       Required version: 6.1.18 to 7.3.1
       Required for    : Code generation
       C6000_CGT_INSTALLDIR="C:\ti\CGT_6_1_23"
       C6000_CGT_INSTALLDIR="C:\ti\CGT_6_1_23"

    5. DSP/BIOS (Real Time Operating System)
       Your version    : 5.41.11.38
       Required version: 5.33.05 to 5.41.11.38
       Required for    : Code generation
       CCSV5_DSPBIOS_INSTALLDIR="C:\ti\bios_5_41_11_38"
       CCSV5_DSPBIOS_INSTALLDIR="C:\ti\bios_5_41_11_38"

    6. Texas Instruments IMGLIB (C64x+ Image Library)
       Your version    : 2.1.0.0
       Required version: 2.0.1 or later
       Required for    : CRL block replacement
       C64XP_IMGLIB_INSTALLDIR="C:\ti\c64plus-imglib_2_02_00_00"

    7. NDK (NDK 2.00)
       Your version    : 2.00.00
       Required version: 2.00.00 or later
       Required for    : External mode and Ethernet blocks
       NDK_EVMC6748_INSTALLDIR="C:\ti\ndk_2_0_0"

    8. C674x DSP/BIOS PSP Drivers (BIOS PSP Release version 01.30.00.05)
       Your version    : 1.30.00.05
       Required version: 1.30.00.05
       Required for    : Code generation / device drivers
       PSP_EVMC6748_INSTALLDIR="C:\ti\pspdrivers_01_30_00_05"

    9. EDMA3 Low Level Driver (EDMA3 LLD 01.10)
       Your version    : 01.11.03
       Required version: 1.10.00 or later
       Required for    : Device drivers
       EDMA3LLD_BIOS5_INSTALLDIR="C:\ti\edma3_lld_01_11_03_01"

    10. OMAP-L138/C6747EVM BSL (OMAP-L138 / TMS320C6748 / AM1808 SOM-M1 Gel, CCS Setup, & BSL Files (CCS v4.2.4))
       Your version    : 2.3.2
       Required version: 2.0.0 or later
       Required for    : Device drivers
       BSL_EVMC6748_INSTALLDIR="C:\ti\CCSv4-2-4_with_SOM-M1_BSL_WS"

    Secondly, I checked again, whether the file "dlfcn.h" is anywhere to find. But I can't find it, wether in the by Matlab created folder, nor in any projects of the PC. This file would be needed as an include file for the source file "./HostLib_Audio.c". I think, Matlab should make this file by himself und use it later at code generation with CCS.

    Have you any idea, Sivaraj? Or anyone else can kindly tell me, how to solve it?

  • Thank you very much, Titus! The links you told me are very useful. But some informations make conflicts together. Someone said, it can work. But another one said no. I have read a few threads in this forum and other. There are really some successful experiments by combining OMAP L138 and Matlab SIMULINK through the wag of code generation. The difference between them and me ist that they used CCSv3.3 or CCSv4.x in the earlier time and many people talked about Matlab 2012.

    I can't understand, why it doesn't work when a newer version of Matlab and CCS will be used.
  • It seems CCSv5 doesn't support MATLAB

    e2e.ti.com/.../646995

    You can use CCv4 or CCSv3 right ?
  • Thank you, Titus! Thanks for every different opinion!  I found my problem after I read the documentations from Matlab help again and again. I have solved it.

    As long as I replaced ticcs_c6000_ccsv5_clone at XMAkefile Configurations with ticcs_c6000_dspbios_ccsv5_clone, and canceled the wave device blocks, the microphone device and the loudspeaker device from the Simulink Model, the error is gone,  the code building finished, and the .out file arrived.

    Now I make a brief summary for everyone, who faces the same problem and wants to solve it.

    Firstly I fix all the settings at the Matlab Command window with the command checkEnvSetup('ccsv5', 'c6748evm') so as the programm requires. A series prompt windows ask, which folder would be selected. Just choose the one which is prepared at the beginning. 

    With this command checkEnvSetup('ccsv5', 'c6748evm', 'check'), man can also check whether every option is OK.

    >> checkEnvSetup('ccsv5', 'c6748evm', 'check')

    1. CCSv5 (Code Composer Studio)
       Your version    : 5.5.0
       Required version: 5.0 or later
       Required for    : Code Generation
       TI_DIR="C:\ti\ccsv5"

    2. C6000 CSL (TMS320C6000 Chip Support Library)
       Your version    : 2.31.00.15
       Required version: 2.31.00.10 or later
       Required for    : Code generation
       CSL_C6000_INSTALLDIR="C:\ti\C6xCSL"
       CSL_C6000_INSTALLDIR="C:\ti\C6xCSL"

    3. XDC Tools (eXpress DSP Components)
       Your version    : 3.24.03.33
       Required version: 3.16.02.32 or later
       Required for    : Code generation

    4. CGT (Code Generation Tools)
       Your version    : 6.1.23
       Required version: 6.1.18 to 7.3.1
       Required for    : Code generation
       C6000_CGT_INSTALLDIR="C:\ti\CGT_6_1_23"
       C6000_CGT_INSTALLDIR="C:\ti\CGT_6_1_23"

    5. DSP/BIOS (Real Time Operating System)
       Your version    : 5.41.11.38
       Required version: 5.33.05 to 5.41.11.38
       Required for    : Code generation
       CCSV5_DSPBIOS_INSTALLDIR="C:\ti\bios_5_41_11_38"
       CCSV5_DSPBIOS_INSTALLDIR="C:\ti\bios_5_41_11_38"

    6. Texas Instruments IMGLIB (C64x+ Image Library)
       Your version    : 2.1.0.0
       Required version: 2.0.1 or later
       Required for    : CRL block replacement
       C64XP_IMGLIB_INSTALLDIR="C:\ti\c64plus-imglib_2_02_00_00"

    7. NDK (NDK 2.00)
       Your version    : 2.00.00
       Required version: 2.00.00 or later
       Required for    : External mode and Ethernet blocks
       NDK_EVMC6748_INSTALLDIR="C:\ti\ndk_2_0_0"

    8. C674x DSP/BIOS PSP Drivers (BIOS PSP Release version 01.30.00.05)
       Your version    : 1.30.00.05
       Required version: 1.30.00.05
       Required for    : Code generation / device drivers
       PSP_EVMC6748_INSTALLDIR="C:\ti\pspdrivers_01_30_00_05"

    9. EDMA3 Low Level Driver (EDMA3 LLD 01.10)
       Your version    : 01.11.03
       Required version: 1.10.00 or later
       Required for    : Device drivers
       EDMA3LLD_BIOS5_INSTALLDIR="C:\ti\edma3_lld_01_11_03_01"

    10. OMAP-L138/C6747EVM BSL (OMAP-L138 / TMS320C6748 / AM1808 SOM-M1 Gel, CCS Setup, & BSL Files (CCS v4.2.4))
       Your version    : 2.3.2
       Required version: 2.0.0 or later
       Required for    : Device drivers
       BSL_EVMC6748_INSTALLDIR="C:\ti\CCSv4-2-4_with_SOM-M1_BSL_WS"

    Secondly I type command xmakefilesetup at the Matlab Command window and get the XMakefile User Configuration Pane:

    >> xmakefilesetup

    Details, please watch the two videos on youtube:

    Simulink code generation from MATLAB for TI C2000 processors - Hello World using CCS v4/v5   by Antonio

    Matlab-C2000 LaunchPad     by Lokman Gokdere

  • 2nd.  Settings for XMakefile User Configuration at Matlab Command Window :

    Template: gmake
    Configuration: ticcs_c6000_dspbios_ccsv5_clone
    User Templates: C:\Users\bisp\Documents\MATLAB\CodeGeneration02\
    User Configurations: C:\Users\bisp\Documents\MATLAB\CodeGeneration02\

    Under Tool Directories:
    CCS Installation: C:\ti\ccsv5\
    Code Generation Tools: C:\ti\ccsv5\tools\compiler\c6000_7.4.8\
    Chip Support Library(CSL): C:\ti\C6xCSL\
    DSP/BIOS Installation: C:\ti\bios_5_41_11_38\
    XDC Tools Installation: C:\ti\xdctools_3_24_03_33\
    Under Make Utility:
    Make utility: C:\Program Files\MATLAB\R2014b\bin\win64\gmake
    Arguments:-f "[|||MW_XMK_GENERATED_FILE_NAME[R]|||]" [|||MW_XMK_ACTIVE_BUILD_ACTION_REF|||]

    Under Compiler:
    Compiler: C:/ti/ccsv5/tools/compiler/c6000_7.4.8/bin/cl6x
    Arguments: -I"C:/ti/ccsv5/tools/compiler/c6000_7.4.8/include" -I"C:/ti/OMAPL138_CSL/include" -fr"[|||MW_XMK_DERIVED_PATH_REF|||]"

    Under Linker:
    Linker: C:/ti/ccsv5/tools/compiler/c6000_7.4.8/bin/cl6x
    Arguments:-o [|||MW_XMK_GENERATED_TARGET_REF|||] -I"C:/ti/bios_5_42_01_09/packages/ti/pmi/lib/pmi.a674" -I"C:/ti/bios_5_42_01_09/packages/ti/pmi/lib/pmi_ctl_null.a674" -I"C:/ti/bios_5_42_01_09/packages/ti/bios/lib/pwrm.a674" -I"C:/ti/bios_5_42_01_09/packages/ti/pscl/lib/pscl.a674" -I"C:/ti/bios_5_42_01_09/packages/ti/pscl/lib/pscl_cfg_null.a674"

    Under Archiver:
    Archiver: C:/ti/ccsv5/tools/compiler/c6000_7.4.8/bin/ar6x
    Arguments: -r [|||MW_XMK_GENERATED_TARGET_REF|||]
    Under Execute:
    Execute tool: C:\ti\ccsv5\ccs_base\scripting\bin\dss.bat
    Arguments: "C:\Program Files\MATLAB\R2014b\toolbox\idelink\extensions\ticcs\ccsdemos\runProgram.js""C:\Users\bisp\ti\CCSTargetConfigurations\L138_Simulink_TargetConfiguration.ccxml""[|||MW_XMK_GENERATED_TARGET_REF[E]|||]"
     
     
     

    3rd
    . Simulink Model Setup. Here is some documentation from Matlab Help for Model Setup
     
    Avoid using blocks that do not generate code, including the following blocks:

    1. Scope

    2. To Workspace

    3. From Workspace

    4. Spectrum Scope

    5. To File

    6. From File

    7. Triggered to Workspace

    8. Signal To Workspace

    9. Signal From Workspace

    10. Triggered Signal From Workspace

    11. To Wave device

    12. From Wave device

    4th.Configuration Parameters. Here is also documentation from Matlab Help for Model Setup

    To configure your Simulink model for a specific tool chain and target hardware:

    1. In a Simulink model, open the model Configuration Parameters by:
    Pressing Ctrl+E on your keyboard
    Selecting the Simulation > Model Configuration Parameters menu items

    2. In the Configuration Parameters dialog, click Code Generation, and then click "+" next to Code Generation. This action displays the sub-panes under Code Generation.

    3. On the Code Generation pane, change System target file to idelink_ert.tlc or idelink_grt.tlc.
    The dialog displays a Coder Target pane under the Code Generation pane.

    4. Select the Coder Target pane.

    5. Select the Target Hardware Resources tab.

    6.Set the following parameters to match the tool chain and target hardware you are using:
    IDE/Tool Chain: Texas Instruments Code Composer Studio v5 (makefile generation only)
    Board: OMAP-L138/C6748 EVM
    Processor: OMAPL138

    CPU Clock: 300Hz

    7. Review the other parameters under the Target Hardware Resources tab.

    8. Select Tool Chain Automation tab.

    Under Run-Time

    Build format: Makefile

    Build action: Build_and_execute

    Overrun notification: None

    9. Click Apply, and save the changes to your model.

     
     
     
    5th. Build Model
    After clicking the icon Build Model, two windows  (Diagnostic Viewer and dos-window) come up showing the running model. And the .out file ist created for code generation in the folder CustomMW under the Simulink Model-folder.
     
    At the Diagnostic Viewer window it displays:
     
    Build 
     2
    ClearSave
    2:35:12 PM Feb 20, 2015 Elapsed: 12 sec
    Code Generation 
     1
    ClearSave
    Elapsed: 10 sec
    ### Creating makefile: C:\Users\bisp\Documents\MATLAB\c6748evmwithreset02_ticcs\c6748evmwithreset02.mk ### Makefile creation done. ### Building makefile... ### Build done. Generated program: C:\Users\bisp\Documents\MATLAB\c6748evmwithreset02_ticcs\CustomMW\c6748evmwithreset02.out. Invoking the Execute Tool specified by the Execute tab in the XMakefile User Configuration dialog. To open the XMakefile User Configuration dialog, enter xmakefilesetup in a MATLAB Command Window. For more information on how to configure the parameters, click the Help button in the dialog.
    Build process completed successfully
     
     
    At the dos-window namens C:\Windows\system32\cmd.exe it displays:
    dos-window for codegeneration
     
     
     
    6.th Create Target Configuration File in CCSv5
    ------Documentation from Matlab Help "Using Makefiles with Code Composer Studio 4/5", Matlab Command:
    >> helpview(fullfile(docroot,'toolbox','ecoder','helptargets.map'),'loadruninccsv4')
     
    Before loading and running your target software, use the CCSv4/5 IDE to create a "target configuration file". The TI Debug Server uses this file while it works with CCSv4/5 to load and run your target software. The XML-based target configuration file describes the target board and processor. The file name ends with a *.ccxml extension.

    Create a target configuration file:

    In the CCSv4/5, select File > New > Target Configuration File to display a New Target Configuration dialog:
    For File name, update the file name that ends with .ccxml to describe your project and hardware.
    Click Finish. This action displays a utility in the CCSv5/5 editor pane for customizing the target configuration file.
    Use the utility to select the Connection and Device type. Typing a partial string next to Device filters the list of devices.
    Click Save.
     
     
     
    7.th Load the .out file and Run the board OMAP L138
    Details, please watch the last part of the two videos at youtube. It's simple to do this.

    Simulink code generation from MATLAB for TI C2000 processors - Hello World using CCS v4/v5   by Antonio

    Matlab-C2000 LaunchPad     by Lokman Gokdere
     
     
  • Hi Zhirong,
    Sounds good.
    Thanks for your effort and helping others here.
    Surely I would be useful to others.
    I really appreciate you for this.
    Thanks again.
  • Hi Zhirong, hi Titus,

    thank you for providing a detailed description of the steps that you have taken.

    Is it really need to perform both steps 1 and 2, i.e. first call checkEnvSetup(..., 'setup') and then also the xmakefilesetup tool? Doesn't it do the same?

    I have the problem that checkEnvSetup skips "XDC Tools (eXpress DSP Components)" and so it does not recognize my version. However there is a folder C:\ti\xdctools_3_25_03_72. Is there a method to set it manually?

    xmakefilesetup does list the correct folder for XDC Tools Installation correctly.

    I tried two (modified/cloned) configurations for OMAP-L138 EVM "ticcs_c6000_dspbios_ccsv5" and  "ticcs_c6000_ccsv5". As I am using the OMAP I guess it needs DSP/BIOS because there is no choice under "Target Hardware Resources" to select "None" for OS (the dropdown menu is grayed out, red box in the screenshot):

    A) When using "ticcs_c6000_dspbios_ccsv5":

    When performing the build I get the following error messages:

    ### Building makefile...
    The call to idelink_ert_make_rtw_hook, during the exit hook generated the following error:
        Error while building the project.

    The build process will terminate as a result.
    Caused by:
    Error while building the project.
    The build failed with the following message: "Evaluating prebuild target..."
    "C:/ti/xdctools_3_25_03_72/tconf" -b -Dconfig.importPath="C:/ti/bios_5_42_01_09/packages" ./mysumdiff.tcf
    The command ""C:/ti/xdctools_3_25_03_72/tconf"" is entered incorrectly or could not be found. [free translation to English on my own]
    gmake: *** [prebuild] Error 1

    So I think again that this is related to the settings done before.

    Edit: What I really think is strange: the tconf.exe tool indeed cannot be found in the XDCtools directory (C:/ti/xdctools_3_25_03_72) but in the XDCtools subdirectory of DSP/BIOS folder (C:\ti\bios_5_42_01_09\xdctools).

    Edit 2: When I manually try to execute the tconf tool from the subfolder in the DSP/BIOS folder I get the following error message(s):

    C:\ti\bios_5_42_01_09\xdctools\tconf -b -Dconfig.importPath="C:/ti/bios_5_42_01_09/packages" ./mysumdiff.tcf

    C:\ti\bios_5_42_01_09\xdctools\tconf: can't create session manager: create of JVM failed

    Additionally an error message pop-up opens which tells me that MSVCR71.dll is missing.

    B) When using "ticcs_c6000_ccsv5" (w/o DSP/BIOS):

    ### Building makefile...
    The call to idelink_ert_make_rtw_hook, during the exit hook generated the following error:
        Error while building the project.

    The build process will terminate as a result.
    Caused by:
    Error while building the project.
    The build failed with the following message: "C:/ti/ccsv5/tools/compiler/c6000_7.4.4/bin/cl6x" -I"C:/Program Files/MATLAB/R2015b/toolbox/idelink/extensions/ticcs/inc" -I"C:/foobar/sumdiff/mysumdiff_ticcs" -I"C:/foobar/sumdiff" -I"C:/Program Files/MATLAB/R2015b/extern/include" -I"C:/Program Files/MATLAB/R2015b/simulink/include" -I"C:/Program Files/MATLAB/R2015b/rtw/c/src" -I"C:/Program Files/MATLAB/R2015b/rtw/c/src/ext_mode/common" -I"C:/Program Files/MATLAB/R2015b/rtw/c/ert" -D"CHIP_OMAPL138" -D"__TICCSC__" -D"RT" -D"USE_RTMODEL" -mv6400+ -D"MODEL=mysumdiff" -D"NUMST=1" -D"NCSTATES=0" -D"HAVESTDIO=" -D"ONESTEPFCN=1" -D"TERMFCN=1" -D"MAT_FILE=0" -D"MULTI_INSTANCE_CODE=0" -D"INTEGER_CODE=0" -D"MT=0" -D"CLASSIC_INTERFACE=0" -D"ALLOCATIONFCN=0" -D"TID01EQ=0" -I"C:/ti/ccsv5/tools/compiler/c6000_7.4.4/include" -I"C:/Program Files/C6xCSL/include" -fr"./derived/" ./MW_c6xxx_csl.c ./mysumdiff.c ./mysumdiff_main.c
    [MW_c6xxx_csl.c]
    ".\MW_c6xxx_csl.h", line 19: fatal error: could not open source file "mysumdiffcfg.h"
    1 fatal error detected in the compilation of "./MW_c6xxx_csl.c".
    Compilation terminated.

    I guess it is missing the <modelname>cfg.h file as this is required by DSP/BIOS or created by the DSP/BIOS Tconf tool as I have read elsewhere (here: http://de.mathworks.com/matlabcentral/newsreader/view_thread/277160#767237.

    Any help will be appreciated.

    Thanks,
    Matthias

  • Hello, Matthias!

    To your question 1: Yes, you must do the step 1 and step 2. They are not the same. Step1 is for the system environment of the computer. Step 2 is for Matlab itself.

    To your question 2: Yes, you should set the path of xdctools manually. In the Environment Variables of the Advanced system settings:  

    1) Add a new Variable XDCROOT and his new Value C:/ti/xdctools_3_24_03_33 to the System variables.   

    2) Add a new Value to the PATH: %XDCROOT%.

    Otherwise you could reinstall the XDC Tools.

    To your question 3: I had also tried the two configurations before. But only the mode ticcs_c6000_dspbios_ccsv5 did work.

    At the end an advise for you: fix all the settings and installations as same as I wrote above, the process should work and you get less strange errors at least.

     

    Best Regards,

    Zhirong

  • Hello Zhirong,

    thank you for your help! I took the same version of XDCTools as you and it seems to work.

    Another important step was indeed to set the correct Execute Tool & arguments to load the executable directly on the board without having to do it from the CCS IDE. But this is where I got stuck.

    Note: Did you get your Execute Tool really running with "C:\Program Files\MATLAB\R2014b\...". I could not manage to do it with file paths that include spaces. Even double quotes did not help and so I had to work around using shortnames (DOS paths limited to 8 caracters for each level), e.g. ""C:\Progra~1\MATLAB\R2...". I had another space in the path of the ccxml file.

    May I ask which ccxml file you are using? I think that I am using the same board as you. Mine references two GEL files, one for the ARM core, one for the DSP core.

    Did you have difficulties with waking up the DSP from within the ARM code? Are the GEL files also executed when using the DSS approach?

    I get the following error message again [ https://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/p/72371/1823780#1823780 ] - from the command line:

    *** Connecting to target...

    SEVERE: C674X_0: Error connecting to the target: (Error -1180 @ 0x0) Device is held in reset. Take the device out of reset, and retry the operation. (Emulation package 5.1.232.0)

    This might be related to the relative path to the GEL file instead of absolute path, but I'll have to double check it.

    Edit: I wonder how this is done... in the CCS IDE if I click on ARM9_0 or C674x_0 I can see the initialization script paths (GEL file paths) in the Advanced View. But when I have a look at the source code, no .gel file extension can be found. So how can I tell DSS to use them? Or how is it done in CCS IDE?

    Edit 2: I will also try to figure out what the differences and similarities between TI's loadti DSS example is and Mathworks' runProgram.js. But if somebody can already tell I'd be happy to see a summary on that.

    Edit 3 [related to Edit 2]: I have modified Matlab's runProgram.js DSS script to work with OMAP-L138 SoC. It requires some understanding but is then straight forward to be done, there is also a helpful section in the TI wiki: http://processors.wiki.ti.com/index.php/Debug_Server_Scripting#Multiple_Debug_Sessions_for_Multi-core_Debug . Both TI's loadti DSS example nd Mathworks' runProgram.js (of course) use the same commands but Mathworks' version is smaller (probably less complex) and allows a better and fast overview.

    Thank you for your help again!

    Matthias

  • To your question 1:
    No, I had ran the the Execute Tool with the following path and arguments :
    Execute tool:
    C:\ti\ccsv5\ccs_base\scripting\bin\dss.bat

    Arguments: C:\Programme\MATLAB\R2014b\toolbox\idelink\extensions\ticcs\ccsdemos\runProgram.js C:\Users\bisp\ti\CCSTargetConfigurations\L138_Simulink_TargetConfiguration.ccxml
    [|||MW_XMK_GENERATED_TARGET_REF[E]|||]

    To your question 2:
    You can create a new ccxml file everytime. The settings of which are more important.
    I had made the settings in each ccxml file like that:
    Under Basic:
    Connection: Texas Instruments XDS100v1 USB Emulator
    Board or Device: EVMC6748
    Save Configuration: Save

    Under Advanced:
    Texas Instruments XDS100v1 USB Emulator_0
    > EVMC6748_0
    > TMS320C6748_0
    > ICEPICK_C
    > Subpath_0
    > C674X_0

    The Gel file for the DSP names C6748.gel should be chosen.
    References:
    Reay, D. S., Digital signal processing and applications with the OMAP-L138 eXperimenter, Wiley, Hoboken, NJ 2012.

    To your question 3:
    I hadn’t tried to wake up the DSP from within the ARM code.

    To your question 4:
    You need to reflash the board. It’s the first step of all, before you do any further research work on it.
    About how to do this, please read the document:
    ‘’Reflashing the OMAPL138 for winDSK8’’
    References:
    Welch, T. B., Real-time digital signal processing from MATLAB to C with the TMS320C6x DSPs, 2nd Ed., CRC Press, Boca Raton, FL. 2012.

    To your question 5:
    You can read the texts about loadti and runProgram.js twenty times, until you get the point. Just follow the examples.

    Best Regards,
    Zhirong