* [ECOS] Re: unaligned half-word flash memory access on a EB55/AT91
@ 2005-05-07 9:16 Marcel Ovidiu Achim
2005-05-07 9:21 ` Marcel Ovidiu Achim
2005-05-08 9:36 ` Andrew Lunn
0 siblings, 2 replies; 6+ messages in thread
From: Marcel Ovidiu Achim @ 2005-05-07 9:16 UTC (permalink / raw)
To: ecos-discuss; +Cc: ecos-discuss
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ECOS] Re: unaligned half-word flash memory access on a EB55/AT91
2005-05-07 9:16 [ECOS] Re: unaligned half-word flash memory access on a EB55/AT91 Marcel Ovidiu Achim
@ 2005-05-07 9:21 ` Marcel Ovidiu Achim
2005-05-08 9:36 ` Andrew Lunn
1 sibling, 0 replies; 6+ messages in thread
From: Marcel Ovidiu Achim @ 2005-05-07 9:21 UTC (permalink / raw)
To: ecos-discuss; +Cc: ecos-discuss
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ECOS] Re: unaligned half-word flash memory access on a EB55/AT91
2005-05-07 9:16 [ECOS] Re: unaligned half-word flash memory access on a EB55/AT91 Marcel Ovidiu Achim
2005-05-07 9:21 ` Marcel Ovidiu Achim
@ 2005-05-08 9:36 ` Andrew Lunn
2005-05-09 3:58 ` Andrew Lunn
2005-05-09 4:02 ` Marcel Ovidiu Achim
1 sibling, 2 replies; 6+ messages in thread
From: Andrew Lunn @ 2005-05-08 9:36 UTC (permalink / raw)
To: Marcel Ovidiu Achim; +Cc: ecos-discuss, ecos-discuss
On Sat, May 07, 2005 at 10:26:57AM +0200, Marcel Ovidiu Achim wrote:
> 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.
How do you have the MMU setup for that area of memory?
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ECOS] Re: unaligned half-word flash memory access on a EB55/AT91
2005-05-08 9:36 ` Andrew Lunn
@ 2005-05-09 3:58 ` Andrew Lunn
2005-05-09 4:02 ` Marcel Ovidiu Achim
1 sibling, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2005-05-09 3:58 UTC (permalink / raw)
To: Marcel Ovidiu Achim; +Cc: ecos-discuss, ecos-discuss
On Sat, May 07, 2005 at 10:26:57AM +0200, Marcel Ovidiu Achim wrote:
> 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.
How do you have the MMU setup for that area of memory?
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ECOS] Re: unaligned half-word flash memory access on a EB55/AT91
2005-05-08 9:36 ` Andrew Lunn
2005-05-09 3:58 ` Andrew Lunn
@ 2005-05-09 4:02 ` Marcel Ovidiu Achim
2005-05-09 7:45 ` Marcel Ovidiu Achim
1 sibling, 1 reply; 6+ messages in thread
From: Marcel Ovidiu Achim @ 2005-05-09 4:02 UTC (permalink / raw)
To: Andrew Lunn; +Cc: ecos-discuss, ecos-discuss
Andrew Lunn schrieb:
>On Sat, May 07, 2005 at 10:26:57AM +0200, Marcel Ovidiu Achim wrote:
>
>
>>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.
>>
>>
>
>How do you have the MMU setup for that area of memory?
>
> Andrew
>
>
>
Well, the only way to set the memory behaviour that I konw is to
configure the EBI_CSR0 register.
I set it up as follows.
// Set the EBI_CSR0 register for 16 bit access etc.
HAL_WRITE_UINT32(0xFFE00000, BA_0x010 | CSEN | EBI_BAT_BYTE_SELECT | EBI_TDF_0 | 4MB_PAGE | WSE | EBI_NWS_1 | EBI_DBW_16);
--
Mit freundlichen Grüssen / Best regards
Marcel Ovidiu Achim
OVIDIUS Ingenieurbüro
Vogelsangstr. 76
70197 Stuttgart/Germany
Tel.: +49 (0)711 62 03 600
Mobil: +49 (0)177 69 070 59
email: marcel.achim@ovidius-ib.de
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ECOS] Re: unaligned half-word flash memory access on a EB55/AT91
2005-05-09 4:02 ` Marcel Ovidiu Achim
@ 2005-05-09 7:45 ` Marcel Ovidiu Achim
0 siblings, 0 replies; 6+ messages in thread
From: Marcel Ovidiu Achim @ 2005-05-09 7:45 UTC (permalink / raw)
To: Andrew Lunn; +Cc: ecos-discuss, ecos-discuss
Andrew Lunn schrieb:
>On Sat, May 07, 2005 at 10:26:57AM +0200, Marcel Ovidiu Achim wrote:
>
>
>>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.
>>
>>
>
>How do you have the MMU setup for that area of memory?
>
> Andrew
>
>
>
Well, the only way to set the memory behaviour that I konw is to
configure the EBI_CSR0 register.
I set it up as follows.
// Set the EBI_CSR0 register for 16 bit access etc.
HAL_WRITE_UINT32(0xFFE00000, BA_0x010 | CSEN | EBI_BAT_BYTE_SELECT | EBI_TDF_0 | 4MB_PAGE | WSE | EBI_NWS_1 | EBI_DBW_16);
--
Mit freundlichen Grüssen / Best regards
Marcel Ovidiu Achim
OVIDIUS Ingenieurbüro
Vogelsangstr. 76
70197 Stuttgart/Germany
Tel.: +49 (0)711 62 03 600
Mobil: +49 (0)177 69 070 59
email: marcel.achim@ovidius-ib.de
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-05-08 0:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-07 9:16 [ECOS] Re: unaligned half-word flash memory access on a EB55/AT91 Marcel Ovidiu Achim
2005-05-07 9:21 ` Marcel Ovidiu Achim
2005-05-08 9:36 ` Andrew Lunn
2005-05-09 3:58 ` Andrew Lunn
2005-05-09 4:02 ` Marcel Ovidiu Achim
2005-05-09 7:45 ` Marcel Ovidiu Achim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).