This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Big endian ARM HAL_WRITE_UINT8 problem (ecos 1.3.1)


On 7/10/02 3:18 PM, "Grant Edwards" <grante@visi.com> wrote:

> On Wed, Jul 10, 2002 at 03:50:29PM -0600, Gary Thomas wrote:
> 
> 
>> The macros are designed so that the same addresses should work for
>> both big and little endian systems.  We've used this successfully on
>> a number of ARM platforms which can operate in either endian mode.
>> 
>> Instead of using 0x0400c71f, try using the address as it would be in
>> little endian form 0x0400c71c.
> 
> If you want to write to address 0x71f, you specify address
> 0x71c?  Doesn't anybody else thing that sounds a bit wierd? I
> guess I understand what's going on, but it seems a bit silly to
> make users of big-endian hardware munge up their register
> addresses.
> 
> If I need to write to the byte at address 0x71f, then I want to
> write 0x71f in my source code: that's why I don't use those
> macros -- they don't work with pre-existing include files
> containing my register definitions.

I'm in the same boat.  I've already got pre-existing headers that I'm using.
Sounds like I should by-pass using the macros.

I've always worked with big endian chips so I might be a bit confused.  But
shouldn't an address of a single byte in memory be the same no matter if
your big endian or little endian?

Further, I pass data back and forth between my big endian device and a
little endian pc.  On one or the other sides I have to do an endian
conversion.  So if I had a 32 bit word on the device of 0x0000071f (1823d),
passed it to the little endian host, did an endian conversion, the value
would be 0x0000c71f (1823d) and not 0x0400c71c (1820d).

Please help me with my confusion.


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]