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.

TMS570LS1224: How to build and link workable code for a big-endian system such as a Hercules TMS570 MCU using a GCC toolchain

Part Number: TMS570LS1224

I am posting this mostly for the benefit of others.  There are plenty of threads all over the place on the issue, but I was unable to find a good answer anywhere else and ultimately found a solution on my own.

In my project we wish use the ARM compiler for release builds, but due to the cost, we would like to avoid using it for development work.  We are using the GCC compiler as an alternative for development since the code and assembly are more compatible to the ARM compiler than the between the ARM compiler and the TI LTS compiler.

When using the GNU tools available in TI Code Composer Studio or using the ARM-provided GCC compiler, I found that you could build your source code as big endian, but the program would not build since all of the built-in libraries support only little-endian systems.

I did a lot of searching online without much help.  I also tried to build a cross-compiler from several versions of GCC source.  I was able to build a native GCC compiler, but make always crashed when trying to build a cross-compiler for ARM.

Ultimately, I found that Linaro provides the binaries needed for building code for a big-endian system on their website here:

https://releases.linaro.org/components/toolchain/binaries/

You will find the toolchain supporting ARM big endian as armeb-eabi.  At the time of this post, I was able to find a compiler for GCC 7.5.0, which supports C11, C99 and C89 in case you are programming in C.  This can be easily added to TI CCS by unzipping the files and adding the folder as a compiler search path in preferences.

I hope that someone can save some time by reading this.

  • I was able to build a native GCC compiler, but make always crashed when trying to build a cross-compiler for ARM.

    In case it helps if you do need to build a cross-compiler for ARM, TMS570LC4357: CCS/TMS570LC4357: compile with ARM compiler 9.3.1 has notes on the last time did that.

    Ultimately, I found that Linaro provides the binaries needed for building code for a big-endian system on their website here

    From memory the AdaCore gnat-2021-20210519-arm-elf compiler also comes with big-endian libraries, and was able to get CCS to use gnat-2021-20210519-arm-elf 

    Since gnat-2021-20210519-arm-elf is intended for Ada, rather than C, development using GCC it does have some limitations compared to the Linaro distribution installed with CCS:

    1. There is no C++ compiler, and no C++ runtime libraries.
    2. There are no *.specs files in the runtime libraries, so have to delete the -specs options in any CCS projects.
    3. There is no crt0 start-up code in the runtime libraries, so have to link with the -nostartfiles option.
  • Hello,

    Thank you for sharing this with the community. 

    Regards,
    Sahin