PSoC 5 Endian vs PSoC 3

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ScEn_283436
Level 5
Level 5
5 sign-ins First solution authored 100 replies posted

Hi,

   

My program has hard coded default values that are uint32. In trying to reuse code from PSoC 3 programs we've done in the past, I noticed in debug that the bytes of the values are the reverse of the those in the PSoC 3. For instance if I store a value of 0x1E000000, and I view it in Debug mode, it is stored as 0x0000001E. The values are retrieved correctly but in my case, I store different items in bytes of the uint32. Is there a flag or option that can flip the Endian byte order or do I have to live with this?

   

Thank you,

   

Nick

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You will have to live with that. The endianess of PSoC3 and 5 is different. Although the ARM core allows for changing the endianess by an assembly instruction, but the compiler (GCC) will not work with that correctly.

   

 

   

Bob

View solution in original post

0 Likes
2 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You will have to live with that. The endianess of PSoC3 and 5 is different. Although the ARM core allows for changing the endianess by an assembly instruction, but the compiler (GCC) will not work with that correctly.

   

 

   

Bob

0 Likes
ScEn_283436
Level 5
Level 5
5 sign-ins First solution authored 100 replies posted

Thanks, Bob. I have these low level routines that make use of single bytes in int32s and in the most used case I was able to just reverse the order of an array index.

0 Likes