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.

CCS/RM48L952: Code Composer Studio

Part Number: RM48L952

Tool/software: Code Composer Studio

Hello,

The error below appeared during building the code with CodeComposerStudio. Could you tell me the reason ? I would like resolve this issue. I checked the NassFcm.c line 22850 as compiler told. But I belive there is no wrong code. There just a code for variable declaration.

"C:\ti\ccsv7\tools\compiler\ti-cgt-arm_16.9.1.LTS\bin/armcl" -mv7R4 --code_state=32 --float_support=VFPv3D16 -me -g --diag_warning=225 --diag_suppress=824 --diag_wrap=off --display_error_number --enum_type=int --abi=eabi --"include_path=C:\ti\ccsv7\tools\compiler\ti-cgt-arm_16.9.1.LTS\lib\src" --define=PRODUCT_NAME=NassFCM --define=PROJECT_ID="('.')" --define=MAJOR_VER=0 --define=MINOR_VER=0 --define=PATCH_VER=0 --define=FIRMWARE_PROJECT_ID="('.')" -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DMODEL=NassFCM -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO --include_path=C:/Users/ANURAD~1.WIJ/DOCUME~1/Nass/FCCTR-~1/FCCTR-~1/V4SIMI~1/Main --include_path=C:/Users/ANURAD~1.WIJ/DOCUME~1/Nass/FCCTR-~1/FCCTR-~1/V4SIMI~1/Main/NassFCM_ert_rtw --include_path=C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include --include_path=C:/Users/ANURAD~1.WIJ/DOCUME~1/Nass/FCCTR-~1/FCCTR-~1/V4SIMI~1/Main/AppInterface/Nass --include_path=C:/Users/ANURAD~1.WIJ/DOCUME~1/Nass/FCCTR-~1/FCCTR-~1/V4SIMI~1/Main/AppInterface/Generic --include_path=C:/PROGRA~1/MATLAB/R2017a/extern/include --include_path=C:/PROGRA~1/MATLAB/R2017a/simulink/include --include_path=C:/PROGRA~1/MATLAB/R2017a/rtw/c/src --include_path=C:/PROGRA~1/MATLAB/R2017a/rtw/c/src/ext_mode/common --include_path=C:/PROGRA~1/MATLAB/R2017a/rtw/c/ert "NassFCM.c"
>> NassFCM.c, line 22850: INTERNAL ERROR: CONSTANT TABLE ERROR - CODEGEN ABORTED

This may be a serious problem. Please contact customer support with a
description of this problem and a sample of the source files that caused this
INTERNAL ERROR message to appear.

Cannot continue compilation - ABORTING!


>> Compilation failure
gmake: *** [NassFCM.obj] Error 1

  • Unfortunately, that diagnostic means you have found a bug in the compiler.  For the source file NassFCM.c, please follow the directions in the article How to Submit a Compiler Test Case.  Based on that test case, I will file a report against the compiler.  Often, a workaround can be found.

    Thanks and regards,

    -George

  • Dear George,

    I'd like to know the propre way to make the preprocessed source file. I call compiler from matlab. Could you tell me how I can make the preprocessed file in this case?

    I don't tell it is work or not, but I attach the .pp file which I import the NassFcm.c and made.

    NassFCM.pp.txt
    /*
     * File: NassFCM.c
     *
     * Code generated for Simulink model 'NassFCM'.
     *
     * Model version                  : 1.322
     * Simulink Coder version         : 8.12 (R2017a) 16-Feb-2017
     * C/C++ source code generated on : Wed Jul 17 14:31:40 2019
     *
     * Target selection: ert.tlc
     * Embedded hardware selection: ARM Compatible->ARM Cortex
     * Code generation objectives: Unspecified
     * Validation result: Not run
     */
    
    

    Best Regards,

    Sone

  • user4127213 said:
    I call compiler from matlab. Could you tell me how I can make the preprocessed file in this case?

    Unfortunately, no.  I'm confident the Matlab build interface has a way to add custom build options, and that is where you would add the options --preproc_with_comment --preproc_with_compile.  But I don't know the details.

    If you are unable to work it out ... Consider putting those options in the system environment variable TI_ARM_C_OPTION.  Then build the project.  This causes those options to be used every time the compiler runs.  That's more than you need.  But maybe it is the best way available.  For more detail, search the TI ARM compiler manual for the sub-chapter titled Setting Default Compiler Options.

    Thanks and regards,

    -George

  • Were you able to create the requested test case?

    Thanks and regards,

    -George

  • Hi, George,

    Not yet. I don't understand the way to make the file. 

    Best Regards,

    George

  • Hello George & George,

    I took a quick look. I don't quite understand the workflow or the error.

    1) Delete the build directory, it is usually called filename_ert_rtw. Next time you build, it will force a completely fresh build of your code (and write a fresh directory) - IF there is a corrupt file somewhere that is causing an issue, this might fix it.

    2) Contact MathWorks technical support. I'm not sure how much they will be able to help, but they may have ideas on the nature of the error in their database. MW TS likely wont have the TI compiler installed, so they probably cant replicate the error.

    Cheers,

    -Brian

  • Also, you may be able to configure your compiler in the Configuration Parameters -> Code Generation -> Build Process -> Toolchain Settings.  You need to click Specify in order to edit C Compiler flags. My example is for C2000, yours might be different.

    I'm far from an expert on these settings - in fact I've never edited these fields myself. There's tons of documentation on all the numerous settings, so you may want to browse the doc. If you get stuck, the best course of action is to contact MW Tech Support as previously mentioned; they can likely assist better then I can.

  • Dear Mr.Brian,

    Thank you for your suggestion. I have tried to add option --preproc_with_comment --preproc_with_compile. But the compiler didn't work. The Compiler still told me same 'INTERNAL ERROR : CONSTANT TABLE ERROR'

     Best Regards,

    Sone

  • Hi Sone,

    I don't have any other suggestions - this is beyond my technical depth. Probably best option to get help is for you to contact  MathWorks Tech Support, as they don't directly monitor the TI Forums.

    Cheers,

    -Brian

  • Hi, Mr.Brian,

    Thank you for your kindness. I have to do something.

    Best Regards,

    Sone

  • user4127213 said:
    I have tried to add option --preproc_with_comment --preproc_with_compile. But the compiler didn't work. The Compiler still told me same 'INTERNAL ERROR : CONSTANT TABLE ERROR'

    Adding those options to the C Compiler settings will not fix the error. What they will do is generate a preprocessed source file (.pp extension). The .pp file will contain the C source and all necessary header includes all within a single file so it makes it easier for us to reproduce and investigate the cause of the internal error. Check if there is a .pp file generated after the build and attach it here.

  • Dear George,

    Thank you for your suggestion. Could you tell me how the TI_ARM_C_OPTION works to solve my problem? I would like to know how I should utilize this variable?

    Best Regards,

    Sone

  • NassFCM.pp.txt.txtDear TI team,

    Thank you for your suggestion. I could make preprocessed file. I attach it here.

    Best Regards,

    Sone

  • user4127213 said:
    I have tried to add option --preproc_with_comment --preproc_with_compile. But the compiler didn't work. The Compiler still told me same 'INTERNAL ERROR : CONSTANT TABLE ERROR'

    Those options are not intended to fix the problem.  That is one step in creating a test case you submit here for us to analyze.  Those options create a preprocessed file with the file extension .pp.  It is located in the same directory as the source code.  Please follow the directions in the article How to Submit a Compiler Test Case to submit that file.

    Thanks and regards,

    -George

  • user4127213 said:
    Thank you for your suggestion. I could make preprocessed file. I attach it here.

    Thank you for the preprocessed file. With it I was able to reproduce the internal error. This is a bug in the compiler and I have filed a bug report to have it analyzed and fixed in a future release. The tracking ID is CODEGEN-6603. Feel free to track it using the SDOWP link in my signature.

    Adding optimization to the compiler options gets rid of the error, which you could use as a short-term workaround. In the same Compiler Flag Settings field where you previously added the options for preprocessing, add the -o0 or -o1 options.

  • Dear AartiG,

    Thank you for your comment and tell me the way to gets rid of the error. What is the main purpose of -o0 and -o1?

    I have added -o0 and -o1 after --preproc_with_compile like below. Is this correct way to add? I think I don't understand the correct way to add options.  I still find the same Internal Error.

     --preproc_with_compile -o0 -o1

    Best Regards,

    Sone  

  • It can also be worked around with --embedded_constants=off, which avoids the entire constant-table pass.

  • Thank you for your suggestion.

    What is the main task of --embedded_constans=0ff ?

    Best Regads,

    Sone

  • The -o option turns on optimization, the numbers set the level of optimization. You can read more about it in the ARM Compiler User's Guide

    You can add either -o0 or -o1 to the Compiler setting and anywhere on the command line should be fine. You can confirm if it was added properly by checking the compiler command line that gets printed out during build.