Hi Adriano,
> I'm having some problems with arm endianess of floating types.
>
> For example, the "double" value 10.0:
> my PC writes it to a file:
> 0x00.00.00.00.00.00.24.40
> while the TS-arm writes:
> 0x00.00.24.40.00.00.00.00
>
> So, when arm reads a binary file written by a PC it interprets a wrong value,
> and vice-versa. This causes a lot of problems when using third part libraries
> and standards.
>
> If anyone wants to check, I attached a program to illustrate it. Running it
> on PC and on ARM will show the numbers above.
This is a standard problem with machine-to-machine
communications of data types. The general solution is
to use a machine-independent specification of the binary
type, and communicate using that, eg.
1) XDR External Data Representation
- basically everything is big-endian
2) CORBA Common Data Representation (CDR)
- endian flag indicates whether data is big
or little endian, and the 'reader makes right',
i.e., if the reader is different it has to
convert the data
MATLAB data files are also defined to be machine independent.
So you haven't stumbled on something new, you just have to
decide what solution will work for you.
Personally most of my development uses the ACE C++ library,
and I use its C++ CDR encode/decode functions to transport data
between big-endian PowerPc processors and little-endian x86
processors.
Cheers,
Dave
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|