This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: unaligned half-word flash memory access on a EB55/AT91
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Marcel Ovidiu Achim <marcel dot achim at ovidius-ib dot de>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Fri, 6 May 2005 22:04:36 +0200
- Subject: Re: [ECOS] unaligned half-word flash memory access on a EB55/AT91
- References: <427BBCA5.3000203@ovidius-ib.de>
On Fri, May 06, 2005 at 08:51:17PM +0200, Marcel Ovidiu Achim wrote:
> Hi all,
>
> I am using eCos on an Atmel EB55 board. For an application I need to
> store data into the on board flash device. My compiled code seams to
> do an unaligned access to the on board flash which is enabled by the
> NCS0 line.
>
> This is a very simple code for a better understanding.
>
> // Set the EBI_CSR0 register for 16 bit access etc.
> HAL_WRITE_UINT32(0xFFE00000, 0x010030A1);
>
> // Write 0xAA to address 0x555 of into the flash device.
> // Note: this is not the whole prog. seq.
> HAL_WRITE_UINT16(0x01000000 + 0x555, 0xAA);
I don't think this is allowed. You have to do 16 bit accesses on 16
bit aligned addresses. Maybe you want to do:
HAL_WRITE_UINT8(0x01000000 + 0x555, 0xAA);
HAL_WRITE_UINT8(0x01000000 + 0x556, 0x00);
which will acheive the same but will do it in a legal way.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss