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.

rfefd r13! - build crash (target board HDK - TMS570LS3137; CCS v4.2)

Dear all,

I am working with following configuration:

Code Composer Studio 4.2.4.00033

Hercules Devices 4.2.4.0002

TMS470 Code Generation Tools 4.9.0

Unfortunately the build crashes (a compiler error occurs) at line with an instruction "rfefd r13!". If this instruction is replaced by  "rfeia r13!", then the error disappears.

Error message: ERROR!   at line 1250: [E0002] Illegal mnemonic specified

Could anybody advise why this happends? Is a root cause of that within incorrect setting of the compiler?

BTW: this piece of code is properly compiled and linked by IAR EWAR:

IAR Assembler for ARM
  6.40.1.53790 (6.40.1.53790)

IAR C/C++ Compiler for ARM
  6.40.1.23790 (6.40.1.23790)

IAR ELF Linker for ARM
  6.40.1.53790 (6.40.1.53790)

Thanks for your hints in advance!

Cheers, Jiri

  • Are you building with -mt compiler option? I can reproduce the error with this option enabled (Thumb-2 mode) but there is no error when compiled for ARM mode.

    It looks like a bug as I found documentation on the ARM site that says this is a valid Thumb-2 instruction. Please confirm your build options and I will file a bug report as well.

     

  • Actually on reading the documentation closer, it looks like the RFEFD is not valid in Thumb-2. (IA, IB, DA, DB are the only ones valid for Thumb-2). Please see this document. So this does not appear to be a bug. If you are compiling with -mt, the error is expected.

  • AartiG,

    regardless of chosen instruction set (ARM vs. Thumb) the reported error occurs. Please see my compiler setting/options:


    "${CG_TOOL_ROOT}/bin/cl470"

    ------------------------------------------
    Thumb instruction set:
    ------------------------------------------
    checked item "Enable 16bit code"

    -mv7R4 -mt -g --include_path="C:/Program Files (x86)/Texas Instruments/ccsv4/tools/compiler/tms470/include" --include_path=<+anotherProjectSpecificDirectories> --diag_warning=225 --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 --asm_listing

    ------------------------------------------
    ARM instruction set
    ------------------------------------------
    unchecked item "Enable 16bit code"

    -mv7R4 -g --include_path="C:/Program Files (x86)/Texas Instruments/ccsv4/tools/compiler/tms470/include" --include_path=<+anotherProjectSpecificDirectories> --diag_warning=225 --enum_type=packed --abi=eabi --code_state=32 --float_support=VFPv3D16 --asm_listing

    BTW:

    In previously mentioned  IAR EWARM environment,  compilation and linking of code are working properly with both instruction sets (ARM and Thumb). On the other side, I have not checked source code whether Thumb instruction set is active when the instruction RFEFD is being executed.

  • Citing the aforementioned document:
    Architectures
    This ARM instruction is available in ARMv6 and above.
    This 32-bit Thumb-2 instruction is available in T2 variants of ARMv6 and above.
    There is no 16-bit version of this instruction.
    And according ARM DDI 0100I, FD is a valid alternative to IA.
    So my conclusion: It is a bug (as well as forcing the operand for it to be upper case).
  • Jiri Janacek said:
    regardless of chosen instruction set (ARM vs. Thumb) the reported error occurs.

    I can't reproduce the error with your set of command line options. Could you please attach your assembly source file?

  • My command line
    cl470 -mv 7r4 --asm_listing --float_support=VFPv3D16 --abi=eabi t.asm

    My source:
     .text
     .thumb
     rfefd r13!
     rfeia r13!
    => error.
    It compiles fine after replacing .thumb by .arm .
  • I can confirm 42Bastian´s results:

    1251 00000060            .arm
    1252 00000060 F8BD0A00   rfefd r13!
    1253                     ;;rfeia r13!

    1251 00000060            .arm
    1252                     ;;rfefd r13!
    1253 00000060 F8BD0A00   rfeia r13!



    1251 0000005e            .thumb
    1252                     ;;rfefd r13!
    1253 0000005e E9BDC000   rfeia r13! ; [KEEP 32-BIT INS]

    1251 0000005e            .thumb
    1252                     rfefd r13!
    "../example.asm", ERROR!   at line 1252: [E0002] Illegal mnemonic specified
    1253                     ;;rfeia r13!

    As I mentioned previously - "On the other side, I have not checked source code whether Thumb instruction set is active when the instruction RFEFD is being executed." Based on code walk-through that is obviously the reason why my results did not match with AartiG´s ones.

    Thanks for your help!

    JJ

  • Ok, so the consensus is that the error only appears when compiling for Thumb-2, either with the .thumb directive in the assembly code, or by adding the -mt compile option (in absence of .thumb directive).

    I am still not certain if this is a bug as it is not clear to me from the documentation. So I have filed bug # SDSCM00044817 so it can be analyzed and confirmed by the compiler team. Thank you for reporting the issue.

  • This is a bug.  RFEFD is just a pseudo-instruction for RFEIA.

    -Mack