This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Redboot: No network interfaces found on olimex lpc-l2294 board
I see. The first two assignments in post_reset() are omitted by
optimizer. My plan for next step was study ARM assembly, so I can more
understand dissassembled code. Now I can put it off :-).
It's amazing how fast response I got. Thanks to all and especially to
Alexey! Yes I plan to use ecos also for further development, so your
warning regarding EINT2 is very usefull. I will consider Andrew's
recommendation, so code is consistent with ecos.
Thanks again.
Bronislav
On 11/14/07, Andrew Lunn <andrew@lunn.ch> wrote:
> > Sergei's code:
> >
> > static __inline__ void post_reset(cyg_addrword_t base)
> > {
> > // Toggle A0 connected to the SBHE# line
> > *(char *)0x82000000 = 1;
> > *(char *)0x82000001 = 2;
> > *(char *)0x82000000 = 3;
> > *(char *)0x82000001 = 0;
> > }
> >
> > Your code:
> >
> > static __inline__ void post_reset(cyg_addrword_t base)
> > {
> > // Toggle A0 connected to the SBHE# line
> > (*(volatile char *)0x82000001) = 0x00;
> > (*(volatile char *)0x82000000) = 0x00;
> > (*(volatile char *)0x82000001) = 0x00;
> > }
>
> The correct thing to do here is use the HAL MACROS
>
> HAL_WRITE_UINT8
> HAL_WRITE_UINT16
> HAL_WRITE_UINT32
>
> and
>
> HAL_READ_UINT8
> HAL_READ_UINT16
> HAL_READ_UINT32
>
> These will take care of the volatile etc.
>
> 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