From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29334 invoked by alias); 6 May 2005 18:51:22 -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 29242 invoked from network); 6 May 2005 18:51:16 -0000 Received: from unknown (HELO mout.alturo.net) (212.227.15.21) by sourceware.org with SMTP; 6 May 2005 18:51:16 -0000 Received: from [212.227.15.30] (helo=mrelay.alturo.net) by mout.alturo.net with esmtp (Exim 3.35 #1) id 1DU7uu-0007FC-00; Fri, 06 May 2005 20:51:16 +0200 Received: from [84.56.154.117] (helo=[192.168.2.103]) by mrelay.alturo.net with asmtp (Exim 3.35 #1) id 1DU7uu-0007G4-00; Fri, 06 May 2005 20:51:16 +0200 Message-ID: <427BBCA5.3000203@ovidius-ib.de> Date: Fri, 06 May 2005 18:51:00 -0000 From: Marcel Ovidiu Achim User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org, ecos-discuss@sources.redhat.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [ECOS] unaligned half-word flash memory access on a EB55/AT91 X-SW-Source: 2005-05/txt/msg00088.txt.bz2 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); An osciloscope shows that the write seqence did start from A0 instead of A1 which should be implicated for a half-word access. The header file hal_io.h defines HAL_WRITE_UNIT16 to be of type "short". However, for my compiled code short is 32bit (word) wide. I expected "short" to be 16 bit. I compiled my code with gcc without any flags. I wonder why gcc compiles "short" into a "word" type. Do I need to set a flag for gcc while compiling my code or do I even need to recompile gcc itself? Is there any other register for the AT91 that influence the MAS[0:1] bus for the ARM7TDMI to force the core to do a half-word reading or writing? Thanks for your advice and greetings from Stuttgart/Germany Marcel Achim -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29470 invoked by alias); 6 May 2005 18:51:23 -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 29242 invoked from network); 6 May 2005 18:51:16 -0000 Received: from unknown (HELO mout.alturo.net) (212.227.15.21) by sourceware.org with SMTP; 6 May 2005 18:51:16 -0000 Received: from [212.227.15.30] (helo=mrelay.alturo.net) by mout.alturo.net with esmtp (Exim 3.35 #1) id 1DU7uu-0007FC-00; Fri, 06 May 2005 20:51:16 +0200 Received: from [84.56.154.117] (helo=[192.168.2.103]) by mrelay.alturo.net with asmtp (Exim 3.35 #1) id 1DU7uu-0007G4-00; Fri, 06 May 2005 20:51:16 +0200 Message-ID: <427BBCA5.3000203@ovidius-ib.de> Date: Fri, 06 May 2005 19:31:00 -0000 From: Marcel Ovidiu Achim User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org, ecos-discuss@sources.redhat.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [ECOS] unaligned half-word flash memory access on a EB55/AT91 X-SW-Source: 2005-05/txt/msg00089.txt.bz2 Message-ID: <20050506193100.MDonVRmKK_FGqY0-nsVWkLgrRYEqoxo_HO3cSqXi_O0@z> 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); An osciloscope shows that the write seqence did start from A0 instead of A1 which should be implicated for a half-word access. The header file hal_io.h defines HAL_WRITE_UNIT16 to be of type "short". However, for my compiled code short is 32bit (word) wide. I expected "short" to be 16 bit. I compiled my code with gcc without any flags. I wonder why gcc compiles "short" into a "word" type. Do I need to set a flag for gcc while compiling my code or do I even need to recompile gcc itself? Is there any other register for the AT91 that influence the MAS[0:1] bus for the ARM7TDMI to force the core to do a half-word reading or writing? Thanks for your advice and greetings from Stuttgart/Germany Marcel Achim -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss