Using CCS v11.1, tiarmclang v1.3.0, and the compiler options listed below, little-endian code is generated when building my project. The project builds with no errors but a few warnings. When I flash the binary I can see that the instructions at the location that I expect the vector table to be are random, however the LSB of each instruction is 0xEA, which is the opcode for a unconditional branch in arm encoding. If I explicitly generate little-endian code, then CCS does not let me debug because it correctly recognises that the target is big-endian and therefore cannot run the little-endian binary. My assumption is that something is silently failing in tiarmclang and it is defaulting back to little-endian code generation.
Here are my compiler options, taken from the console log with include paths stripped:
"C:/ti/ccs1110/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -mbig-endian -marm -O0 -gdwarf-3 -Werror=ti-pragmas -Werror=ti-macros -Werror=ti-intrinsics -fno-short-wchar -fcommon --target=armv7reb-ti-none-eabi -march=armv7-r -MMD -MP -MF -std=gnu90 -o
Here are the only kind of warnings that the build is generating (I believe these are unrelated to my issue, but are included for completeness):
warning: call to function without interrupt attribute could clobber interruptee's VFP registers
I have also tried -march=armebv7-r as recommended in this documentation. This causes the compiler to give this error:
tiarmclang: error: architecture armebv7r not supported.
How can I get my compiler to output big-endian code?
Thanks,
Adam