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 Wed, 2002-07-10 at 15:43, Dirk Sigurdson wrote:
> I'm working with a big endian arm chip and am having problems with the
> HAL_WRITE_UINT8 macro.
> 
> If I do something like:
> 
> #define HW_REG_ADDRESS \
>     ((volatile cyg_uint8*) (0x0400c71f))
> 
> 
> HAL_WRITE_UINT8(HW_REG_ADDRESS, 0xff);
> 
> 
> It ends up writing to address 0x0400c71c and not 0x0400c71f.  I could just
> take the ^3 out of the macro, but am concerned that it might cause problems.
> Does anyone have any suggestions?

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.



-- 
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]