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.

CCSTUDIO-THEIA: TI clang and BE32

Part Number: CCSTUDIO-THEIA
Other Parts Discussed in Thread: AM263P4

Hello,

we are evaluating TI ARM Clang 4.0.3 LTS for possible future use with Sitara (AM263P4) devices.
As a test, we tried rebuilding existing firmware for TMS570 (Cortex-R4F).

The build almost succeeds, but the generated HEX uses BE-8 encoding (instructions byte-swapped), while TMS570 requires BE-32.
Data endianness is correct - only instruction bytes are reversed.

Upstream LLVM/Clang (tested v20.1) supports the -mbe32 option, which produces correct BE-32 output.
TI ARM Clang seems to not support this option.

We are not using CCS, only a Makefile build, so we are interested in a direct compiler option for tiarmclang to enable BE-32 mode.

Question:
How to configure TI ARM Clang to generate BE-32 output for Cortex-R4F?
Is there a compiler or linker option for this mode?

Thanks,
Jiri

PS: Product selection "CCSTUDIO-THEIA" is invalid, this form don't allow me to ask to TI Clang compiller directly

  • I’ve solved the issue.
    In tiarmclang, the compiler itself doesn’t take -mbe32, but you can pass the corresponding option to the linker:

    -Wl,--be32

    This works as the equivalent of -mbe32 (non-TI compillers)

  • Please understand the only options related to endianness that are tested and documented are described here.  BE-32 is not listed.  Therefore, you are using the compiler in an untested mode.  

    As a test, we tried rebuilding existing firmware for TMS570 (Cortex-R4F).

    It is up to you to decide whether, for the purposes of a test like this, using the compiler in an untested mode is okay.

    Thanks and regards,

    -George