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/CC2640R2F: [E0004] invalid immediate operand

Part Number: CC2640R2F
Other Parts Discussed in Thread: CCSTUDIO

Tool/software: Code Composer Studio

Dear TI-Service team,

I unfortunately ran into a problem with the CC2640R2F Assembler or Compiler.

It constantly issues the error [E0004] invalid immediate operand with no obvious reason to me.

I use Code Composer V 8.3.0.00009

Compiler TI v18.1.4.LTS

>>> ERROR text in console :

1 Assembly Error, No Assembly Warnings
 
>> Compilation failure
Application/quuppa/subdir_rules.mk:9: recipe for target 'Application/quuppa/quuppa.obj' failed
"C:\Users\andy\AppData\Local\Temp\{4EB32958-7C33-4C86-A48F-2650AE8328CB}", ERROR!   at line 231: [E0004] Invalid Immediate operand
 
            MOV       A2, #-13818           ; [DPU_V7M3_PIPE] |53|
 
 
Errors in Source - Assembler Aborted
gmake: *** [Application/quuppa/quuppa.obj] Error 1
gmake: Target 'all' not remade because of errors.

 >>> ERROR text in console  END

>>> Code line where it is issued

StdError ExampleClass::clear(Type type)
{
    StdError ret = E_GENERAL_ERROR;    <<<< here it is issued! E_GENERAL_ERROR is an enum type with value -1

    return ret;
}

>>> Code line where it is issued - END

It seems to be issued on the last line of code in this file where an enum value is used.

If this error is once seen in a project it constantly stays (will be issued again) on the same line of the C-file. Irrespective of changements in the C file or any other stepps I tried.

I tired already:

1. cleaning and rebuilding

2. creating a new workspace and import the project again.

3. clone a new GIT repository

4. delete all build configuration folders and build again

It seems to be connected with a certain build configuration where a debug predefine is activated in the project (in the release build configuration it is never issued!).

As well I maybe should mention that there is very little flash memory available in this project (suppose 0h880 (2176) bytes) but this should result in a different error.

please help I'm really stuck here and we are in need of publishing a feature release this week!

kind regards

Andreas

  • Unfortunately, I am unable to reproduce this problem.  For the source file being built when this occurs ...

    Andreas U said:
    ERROR!   at line 231: [E0004] Invalid Immediate operand

    ... please follow the directions in the article How to Submit a Compiler Test Case.

    Thanks and regards,

    -George

  • ok thanks I will have a look on that.

    in the mean time the error occured as well in the other build configuration. It happened when I set special optimization level for a specific file.
    Here is the data from ".cproject" file.

    Before the change:

    <fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Default.666495467.914643983.5051229" name="quuppa_direction_finding.cpp" rcbsApplicability="disable" resourcePath="Application/quuppa/quuppa_direction_finding.cpp" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.2031932104.673022777">
    <tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.2031932104.673022777" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.2031932104">
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.2049669212" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.0" valueType="enumerated"/>
    <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1089071645" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
    <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.1960120806" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
    <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.890903944" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
    <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.99361471" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
    </tool>
    </fileInfo>


    After the change:
    <fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Default.666495467.814622409" name="quuppa_direction_finding.cpp" rcbsApplicability="disable" resourcePath="Application/quuppa/quuppa_direction_finding.cpp" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.1595349987.870169386">
    <tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.1595349987.870169386" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.1595349987">
    <option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.523300283" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.off" valueType="enumerated"/>
    <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1028304359" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
    <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.330061170" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
    <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.759448457" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
    <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.789489776" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
    </tool>
    </fileInfo>

    I don't know if this helps reproduce the error because reverting the file settings does not revert the error.
    kind regards
    Andreas
  • George I just sent you a private message with the preprocessed code.

    best regards
    Andreas
  • Thank you for sending in a test case by private message.  I can reproduce the behavior.  I filed the entry CODEGEN-5924 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    The source line which causes the problem is ...

    uint64_t blemacaddr = 0xca0600006274;

    A workaround to consider is changing this line to ...

    volatile uint64_t vt64 = 0x6274;
    vt64 |= 0xca06LL << 32;
    uint64_t blemacaddr = vt64;

    Thanks and regards,

    -George