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.

C6670 memcpy swap the endianness

Expert 2985 points

Hi TI experts,

My situation: CCSV5.3, MCSDK2.01.02.06, Complierv7.4.1, SYS/BIOSv6.33.6.50

Project is built under litter endianness.

I meet a problem.

When I use memcpy to copy data from MSMCSRAM to MSMCSRAM, everything is OK.

But when I use memcpy to copy data from L2SRAM to MSMCSRAM, the data changes from little endianness to big endianness. Or I can describe as the high byte and low byte are swapped!

I also think it make no sense. But before I debug further, I just can assume like above.

Can anyone tell me whether it really can be a problem sometimes or just make no sense?

Regards,

Feng

  • That is quite strange. Can you confirm that you are booting your device in little endian mode. In your application are you switching endian or the code is built to operate in  little endian only. Can you confirm that all the libraries that you are linking into are also built in little endian? Is it possible for you to try the same code on a different board and see if you have the same behavior.

    Regards,

    Rahul