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.

TMS570LC4357: CCS/TMS570LC4357: compile with ARM compiler 9.3.1

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi everyone,

I'm trying to use  arm compiler 9.3.1 for TMS570LC43 board but the compiling doesn't successful since the arm compiler 9.3.1 libraries are compiled in LE.

If anyone can help me out it would be so appreciated.

Below the error logs:

C:/ti/ccs1011/ccs/tools/compiler/gcc-arm-none-eabi-9-2020-q2-update-win32/bin/arm-none-eabi-gcc-9.3.1.exe" -mfpu=vfpv3-d16 -O2 -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -mbig-endian -mcpu=cortex-r5 -Wl,-Map,"TMS570LC4357_GCC_Example.map" -mcpu=cortex-r5 -mfpu=vfpv3-d16 -mfloat-abi=hard -mbig-endian -o"TMS570LC4357_GCC_Example.out" ...............ect.

makefile:164: recipe for target 'TMS570LC4357_GCC_Example.out' failed
c:/ti/ccs1011/ccs/tools/compiler/gcc-arm-none-eabi-9-2020-q2-update-win32/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: c:/ti/ccs1011/ccs/tools/compiler/gcc-arm-none-eabi-9-2020-q2-update-win32/bin/../lib/gcc/arm-none-eabi/9.3.1/thumb/v7+fp/hard/crti.o: compiled for a little endian system and target is big endian

...

etc.

BR

Andrea

  • Hello,

    Please find the patch Jiri post in the following thread. I am not sure whether the latest GCC supports big endianness device or not.

    e2e.ti.com/.../1506406

  • Hello,

    Thanks for the answer. The issue is the same treated in that post but the patch provided is for GCC 5.2 compiler version and not for  ARM compiler 9.3.1.

    I would need the same patch for ARM compiler 9.3.1 (for windows OS). 

    BR

    Andrea

  • I would need the same patch for ARM compiler 9.3.1 (for windows OS). 

    CCS/TMS570LC4357: HalCoGen code cannot be compiled with GCC has a more recent patch for GCC ARM 7.2.1. I haven't yet checked if the same patch could be applied to GCC ARM 9.3.1

  • Hello Chester,

    thanks for the answer. I saw your solution about GCC ARM 7.2.1 that works in my project but I would need the same solution for  GCC ARM 9.3.1.

    Thanks for the support.

    BR

    Andrea

  • I saw your solution about GCC ARM 7.2.1 that works in my project but I would need the same solution for  GCC ARM 9.3.1.

    OK, have downloaded the source for GCC ARM 9.3.1 and will look at applying the patch for big-endian support to that version. Probably won't be able to do that until the weekend.

  • I saw your solution about GCC ARM 7.2.1 that works in my project but I would need the same solution for  GCC ARM 9.3.1.

    OK, I have applied a patch to GCC ARM 9.3.1 to add big-endian support.

    The output from generating the patched compiler is on my google drive gcc-arm-none-eabi-7-2020-q2-update

    This includes the updated source, along with Windows and Linux executables.

    I changed the version number to 9.3.1p1 to make it clear it is a modified version, rather than the standard version installed by CCS. If you install it in the CCS ccs/tools/compiler directory it should be discovered by CCS and be able to selected in a project as Compiler Version "GNU v9.3.1p1":

    Attached is a CCS 10 example project for a TMS570LC4357 which uses HALCoGen 04.07.01 and the patched compiler, which is set to use hardware floating point.

    As well as the selection of the patched compiler version, the important project selections to get big-endian BE32 support in v9.3.1p1 are:

    Under Build -> GNU -> Compiler -> Runtime set:

    • Target CPU (-mcpu) : cortex-r5
    • Use floating point hardware (-mfloat-abi) : hard
    • Target floating point hardware/format (-mfpu) : vfpv3-d16

    Under Build -> GNU -> Compiler -> Miscellaneous add the following to Miscellaneous flags:

    • -mbig-endian

    Under Build -> GNU Linker -> Miscellaneous add the following to Miscellaneous flags:

    • -mbig-endian
    • -mfloat-abi=hard
    • -mbe32

    The -mbe32 option was found to be required to get the v9.3.1p1 compiler to get the correct endianness in the executable, since the newer compiler defaults to BE8. Whereas the previous v7.2.1p1 compiler didn't have the -mbe8 / -mbe32 options.

    TMS570LC4357_GCC_halcogen.zip 

  • And for reference the changes made to the gcc-arm-none-eabi-9-2020-q2-update source were:

    1. Change the version:

    $ git diff /mnt/gcc_arm_toolchain/gcc-arm-none-eabi-9-2020-q2-update/src/gcc/gcc/BASE-VER src/gcc/gcc/BASE-VER | cat
    diff --git a/mnt/gcc_arm_toolchain/gcc-arm-none-eabi-9-2020-q2-update/src/gcc/gcc/BASE-VER b/src/gcc/gcc/BASE-VER
    old mode 100755
    new mode 100644
    index 3b74042..94f8603
    --- a/mnt/gcc_arm_toolchain/gcc-arm-none-eabi-9-2020-q2-update/src/gcc/gcc/BASE-VER
    +++ b/src/gcc/gcc/BASE-VER
    @@ -1 +1 @@
    -9.3.1
    +9.3.1p1

    2. Modify the t-multilib Makefile fragment to add the building big-endian versions of the run-time libraries for Cortex-R:

    $ git diff /mnt/gcc_arm_toolchain/gcc-arm-none-eabi-9-2020-q2-update/src/gcc/gcc/config/arm/t-multilib src/gcc/gcc/config/arm/t-multilib | cat
    diff --git a/mnt/gcc_arm_toolchain/gcc-arm-none-eabi-9-2020-q2-update/src/gcc/gcc/config/arm/t-multilib b/src/gcc/gcc/config/arm/t-multilib
    old mode 100755
    new mode 100644
    index 87069f7..cfc809d
    --- a/mnt/gcc_arm_toolchain/gcc-arm-none-eabi-9-2020-q2-update/src/gcc/gcc/config/arm/t-multilib
    +++ b/src/gcc/gcc/config/arm/t-multilib
    @@ -100,12 +100,20 @@ MULTILIB_REQUIRED	+= mthumb/mfloat-abi=soft
     MULTILIB_REQUIRED	+= marm/march=armv5te+fp/mfloat-abi=softfp
     MULTILIB_REQUIRED	+= marm/march=armv5te+fp/mfloat-abi=hard
     
    +MULTILIB_OPTIONS	+= mbig-endian
    +MULTILIB_DIRNAMES	+= big-endian
    +
     MULTILIB_REQUIRED	+= mthumb/march=armv7/mfloat-abi=soft
     MULTILIB_REQUIRED	+= mthumb/march=armv7+fp/mfloat-abi=softfp
     MULTILIB_REQUIRED	+= mthumb/march=armv7+fp/mfloat-abi=hard
    +MULTILIB_REQUIRED	+= mthumb/march=armv7/mfloat-abi=soft/mbig-endian
    +MULTILIB_REQUIRED	+= mthumb/march=armv7+fp/mfloat-abi=softfp/mbig-endian
    +MULTILIB_REQUIRED	+= mthumb/march=armv7+fp/mfloat-abi=hard/mbig-endian
     
     MULTILIB_REQUIRED	+= mthumb/march=armv7-r+fp.sp/mfloat-abi=softfp
     MULTILIB_REQUIRED	+= mthumb/march=armv7-r+fp.sp/mfloat-abi=hard
    +MULTILIB_REQUIRED	+= mthumb/march=armv7-r+fp.sp/mfloat-abi=softfp/mbig-endian
    +MULTILIB_REQUIRED	+= mthumb/march=armv7-r+fp.sp/mfloat-abi=hard/mbig-endian
     
     # Map v7-r with double precision down onto common v7 code.
     MULTILIB_MATCHES	+= march?armv7=march?armv7-r
    @@ -199,13 +207,20 @@ endif		# Not APROFILE.
     # Use Thumb libraries for everything.
     
     MULTILIB_REUSE		+= mthumb/march.armv7/mfloat-abi.soft=marm/march.armv7/mfloat-abi.soft
    +MULTILIB_REUSE		+= mthumb/march.armv7/mfloat-abi.soft/mbig-endian=marm/march.armv7/mfloat-abi.soft/mbig-endian
     
     MULTILIB_REUSE		+= $(foreach ABI, hard softfp, \
     			     $(foreach ARCH, armv7+fp armv7-r+fp\.sp, \
     			       mthumb/march.$(ARCH)/mfloat-abi.$(ABI)=marm/march.$(ARCH)/mfloat-abi.$(ABI)))
    +MULTILIB_REUSE		+= $(foreach ABI, hard softfp, \
    +			     $(foreach ARCH, armv7+fp armv7-r+fp\.sp, \
    +			       mthumb/march.$(ARCH)/mfloat-abi.$(ABI)/mbig-endian=marm/march.$(ARCH)/mfloat-abi.$(ABI)/mbig-endian))
     
     # Softfp but no FP, use the soft-float libraries.
     MULTILIB_REUSE		+= $(foreach MODE, arm thumb, \
     			     $(foreach ARCH, armv7, \
     			       mthumb/march.$(ARCH)/mfloat-abi.soft=m$(MODE)/march.$(ARCH)/mfloat-abi.softfp))
    +MULTILIB_REUSE		+= $(foreach MODE, arm thumb, \
    +			     $(foreach ARCH, armv7, \
    +			       mthumb/march.$(ARCH)/mfloat-abi.soft/mbig-endian=m$(MODE)/march.$(ARCH)/mfloat-abi.softfp/mbig-endian))

    The complete multi-lib variants for the patched compiler are:

    C:\ti\ccs1020\ccs\tools\compiler\gcc-arm-none-eabi-9-2021-q2-update-win32\bin>arm-none-eabi-gcc --print-multi-lib
    .;
    arm/v5te/softfp;@marm@march=armv5te+fp@mfloat-abi=softfp
    arm/v5te/hard;@marm@march=armv5te+fp@mfloat-abi=hard
    thumb/nofp;@mthumb@mfloat-abi=soft
    thumb/v7/nofp;@mthumb@march=armv7@mfloat-abi=soft
    thumb/v7/nofp/big-endian;@mthumb@march=armv7@mfloat-abi=soft@mbig-endian
    thumb/v7+fp/softfp;@mthumb@march=armv7+fp@mfloat-abi=softfp
    thumb/v7+fp/hard;@mthumb@march=armv7+fp@mfloat-abi=hard
    thumb/v7+fp/softfp/big-endian;@mthumb@march=armv7+fp@mfloat-abi=softfp@mbig-endian
    thumb/v7+fp/hard/big-endian;@mthumb@march=armv7+fp@mfloat-abi=hard@mbig-endian
    thumb/v7-r+fp.sp/softfp;@mthumb@march=armv7-r+fp.sp@mfloat-abi=softfp
    thumb/v7-r+fp.sp/hard;@mthumb@march=armv7-r+fp.sp@mfloat-abi=hard
    thumb/v7-r+fp.sp/softfp/big-endian;@mthumb@march=armv7-r+fp.sp@mfloat-abi=softfp@mbig-endian
    thumb/v7-r+fp.sp/hard/big-endian;@mthumb@march=armv7-r+fp.sp@mfloat-abi=hard@mbig-endian
    thumb/v6-m/nofp;@mthumb@march=armv6s-m@mfloat-abi=soft
    thumb/v7-m/nofp;@mthumb@march=armv7-m@mfloat-abi=soft
    thumb/v7e-m/nofp;@mthumb@march=armv7e-m@mfloat-abi=soft
    thumb/v7e-m+fp/softfp;@mthumb@march=armv7e-m+fp@mfloat-abi=softfp
    thumb/v7e-m+fp/hard;@mthumb@march=armv7e-m+fp@mfloat-abi=hard
    thumb/v7e-m+dp/softfp;@mthumb@march=armv7e-m+fp.dp@mfloat-abi=softfp
    thumb/v7e-m+dp/hard;@mthumb@march=armv7e-m+fp.dp@mfloat-abi=hard
    thumb/v8-m.base/nofp;@mthumb@march=armv8-m.base@mfloat-abi=soft
    thumb/v8-m.main/nofp;@mthumb@march=armv8-m.main@mfloat-abi=soft
    thumb/v8-m.main+fp/softfp;@mthumb@march=armv8-m.main+fp@mfloat-abi=softfp
    thumb/v8-m.main+fp/hard;@mthumb@march=armv8-m.main+fp@mfloat-abi=hard
    thumb/v8-m.main+dp/softfp;@mthumb@march=armv8-m.main+fp.dp@mfloat-abi=softfp
    thumb/v8-m.main+dp/hard;@mthumb@march=armv8-m.main+fp.dp@mfloat-abi=hard

    Where the library variants for @mbig-endian have been added by the patch. All of the new variants of the big-endian libraries were built for thumb mode only, in line with the existing run-time libraries. MULTILIB_REUSE was used to map arm mode executables to use the thumb mode run-time libraries.

  • Amaing, It works!

    Thank you very much Chester!

    BR

    Andrea