Hi All,
I think I have got to the bottom of a compilation issue with Keil, for the TMS470M. I haven't found the way to fix it, but I must be getting close!
When generating code with the core as little endian (its an M3, so I believe they are all little....) and the compiler setting as big endian, (so that the code should be mapped to the bg endian memory of the micro) It looks like the output hex is not correctly alligned....
e.g the contents at the reset address (which holds the stack pointer) appears correct.... so, at addres 0x00, the data is 0x08002000 with the msb in the lowest address, lsb in the highest address. Thats fine! it works, and the stack pointer is loaded OK.
BUT
looking at the first actual instruction (B __main) which is a simple branch to main, it looks like the byte order is swapped over! so, looking at the 4 bytes at the reset vector you see 0x00f00a38, wheras the code that should be there is 0xf000b80a. The most significant 16bits are in the most significant 16bits of the location, but they are swapped, with the msb in byte 1 not byte 0! manually swap these, and the code branches to main (don't swap them and it is an immediate trip to see the usage fault handler.)
I am still looking for the fix for this, there doesn't seem to be many options to adjust which could affect this arrangement in memory.
Comments? Roll on September 2012 for full support!!