Is a floating point variable in big or little endian format (PSoC5 in PSoC creator 4.2)?

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

cross mob
GaSh_293351
Level 1
Level 1
5 replies posted Welcome! 5 questions asked

It looks that the format is in little endian.

Is there a way to configure it to big endian?

0 Likes
1 Solution

Yes, the PSoC 5 uses the GCC compiler and it is in little endian format. To change the endianess just add the custom flag "-mbig-endian" in the command line section provided in the compiler options of the build settings as shown below:

endian.PNG

You can find the list of custom flags available here: https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

However, please note that our architecture supports only little endian format and changing it might prove disastrous for your project.

Regards,

Dheeraj

View solution in original post

0 Likes
4 Replies
Anonymous
Not applicable

i dont thinks is there any way to placed the data in the next three bytes in memory.

0 Likes

There is an ARM machine instruction to set/change the endianess. But I am sure that neither C-compiler nor the components will work after a change. What is the reason for your question, what do you need to perform?

Bob

Thanks Bob.

I am using this data in the communication with other device.

Just wanted to know if there is a standard way to cahnge, befoe I make the conversion myself.

0 Likes

Yes, the PSoC 5 uses the GCC compiler and it is in little endian format. To change the endianess just add the custom flag "-mbig-endian" in the command line section provided in the compiler options of the build settings as shown below:

endian.PNG

You can find the list of custom flags available here: https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

However, please note that our architecture supports only little endian format and changing it might prove disastrous for your project.

Regards,

Dheeraj

0 Likes