Forgive me if this is a noob question, but this is my first chip bringup from scratch. I'm trying to bring up an ARM7 (ADuC7021), and am having a problem with the endianness of data, and I'm not sure how to fix it.
My problem is this: if I call an internal function SD_OutputString("Bootloader.."), I get the following output on my serial port: "tooBdaol..re". In other words, it seems to be storing the string in reverse endian format.
The code in question is very simple:
void SD_OutputString(const char *pTxt) { while (*pTxt != 0) { SD_OutputChar(*pTxt); pTxt++; } }
main() { SD_OutputString("Bootloader.."); }
I'm using arm-elf-gcc / arm-elf-ld to compile and link the code. My Makefile has the following lines:
CPPFlags = -Wall -mcpu=arm7tdmi -mbig-endian LDFlags = -T ld_flash.cmd -nostartfiles -mbig-endian
Does anyone know why my data is being stored in reverse order?
John