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/TMS570LC4357: CCS 10 doesn't report an error loading a program for a Cortex-R5 in which the target endianess doesn't match that of the program

Part Number: TMS570LC4357
Other Parts Discussed in Thread: LAUNCHXL2-570LC43

Tool/software: Code Composer Studio

In the related thread a program was created for the big-endian TMS570LC4357, but with gcc set to create a little endian program as reported by readelf:

$ readelf -h ~/workspace_v10/TMS570LC4357_GCC_halcogen/Debug/TMS570LC4357_GCC_halcogen.out 
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0xac94
  Start of program headers:          52 (bytes into file)
  Start of section headers:          362228 (bytes into file)
  Flags:                             0x5000400, Version5 EABI, hard-float ABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         3
  Size of section headers:           40 (bytes)
  Number of section headers:         22
  Section header string table index: 21

When I went to load this program with the wrong endianess using CCS 10 I expected to get an error that the target endianess didn't match that of the program. However, no such error was reported by CCS 10 which flashed the program, which then promptly generated an Undefined Instruction Exception when attempted to execute the first instruction.

When I tried the same program with CCS 9.0.1.00004 and TI Emulators 8.2.0.00004 I got the expected error on attempting to load the program:

Is it a bug that CCS 10.0.0.00010 with TI Emulators 9.1.0.00001 doesn't report an error on attempting to load a program for a Cortex-R5 with a target endianess which doesn't match the program?

  • Hello Chester,

    This certainly sounds like a bug. I'll need to confirm this on one of my Hercules targets. I am working from home so I will need to request access to my office to pick up a Hercules target there. I may take a few days.

    I'll keep you posted.

    Thanks

    ki

  • Ki said:
    This certainly sounds like a bug.

    If it helps, attached is the GNU ARM v7.2.1 built program, as little-endian, which shows the issue.

    TMS570LC4357_GCC_halcogen.zip

    Ki said:
    I am working from home so I will need to request access to my office to pick up a Hercules target there.

    I was only considering this a minor regression, and so not urgent (don't want you to get into trouble with your local lockdown restrictions).

    I was using a LAUNCHXL2-570LC43.

  • Chester Gillon said:
    I was only considering this a minor regression, and so not urgent (don't want you to get into trouble with your local lockdown restrictions).

    Thanks Chester. I appreciate your understanding regarding this. I did have other things I've been meaning to grab from the office so I was able to get authorization and made the trip anyway. I was able to reproduce the issue on one of my Hercules board. It seems to be an issue introduced with CCS 10.0. With CCS 9.3.0. I get the expected error regarding the endianess. Both CCS versions have the same EMU pack version installed (9.1.0.00001), hence the issue seems to be a regression with the CCS debugger itself.

    I've filed a bug for this. The tracking link is below:

    https://sir.ext.ti.com/jira/browse/EXT_EP-9827

    Thanks

    ki