From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10415 invoked by alias); 7 May 2005 08:27:07 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 10032 invoked from network); 7 May 2005 08:26:57 -0000 Received: from unknown (HELO mout.alturo.net) (212.227.15.21) by sourceware.org with SMTP; 7 May 2005 08:26:57 -0000 Received: from [212.227.15.30] (helo=mrelay.alturo.net) by mout.alturo.net with esmtp (Exim 3.35 #1) id 1DUKeG-00074p-00; Sat, 07 May 2005 10:26:56 +0200 Received: from [84.56.151.14] (helo=[192.168.2.103]) by mrelay.alturo.net with asmtp (Exim 3.35 #1) id 1DUKeG-0000xi-00; Sat, 07 May 2005 10:26:56 +0200 Message-ID: <427C7BD1.9020605@ovidius-ib.de> Date: Sat, 07 May 2005 09:21:00 -0000 From: Marcel Ovidiu Achim User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org CC: ecos-discuss@sources.redhat.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [ECOS] Re: unaligned half-word flash memory access on a EB55/AT91 X-SW-Source: 2005-05/txt/msg00103.txt.bz2 Message-ID: <20050507092100.sQ744M-2g5mQlML9CfcHH7WvxbUZ399HYlFOF6TqfnQ@z> Andrew Lunn schrieb: > 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 > > > Your sugestion drives the NCS0 line twice and again the access is not alligned (both read and write of the AT91 starts from A0 instead of A1). Since the memory cells of the flash device are 16 bit long, while writing 0x556 means also writng to another cell instead of 0x555. Please give more advice. Marcel -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss