This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Big endian ARM HAL_WRITE_UINT8 problem (ecos 1.3.1)
- From: Gary Thomas <gary at chez-thomas dot org>
- To: Dirk Sigurdson <dsigurds at pacbell dot net>
- Cc: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: 10 Jul 2002 15:50:29 -0600
- Subject: Re: [ECOS] Big endian ARM HAL_WRITE_UINT8 problem (ecos 1.3.1)
- References: <B951F8A2.2898%dsigurds@pacbell.net>
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