This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Dual Init of SPI on at91sam7x-based system
- From: Sergei Gavrikov <sergei dot gavrikov at gmail dot com>
- To: Bob Brusa <bob dot brusa at gmail dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Fri, 3 Dec 2010 13:56:18 +0200 (EET)
- Subject: Re: [ECOS] Dual Init of SPI on at91sam7x-based system
- References: <op.vm4ti8be8qukij@w27>
On Fri, 3 Dec 2010, Bob Brusa wrote:
> I have a small program to run tests with lwip. It worked. Then I
> updated from my ecos to the current version, built the library and
> built my program. When launching it, it produces the message:
>
> ASSERT FAIL: <1>intr.cxx[506]void Cyg_Interrupt::attach() Interrupt vector not
> free.
>
> When digging into this message, I find that the SPI-bus0 is
> initialized twice. The loop in hal_misc.c
>
>
> for (p = &CONSTRUCTORS_START; p != CONSTRUCTORS_END; NEXT_CONSTRUCTOR(p))
> (*p)();
>
> calls the spi-bus0-initialization twice (copied from the debugger):
>
> 2 cyg_spi_at91_bus_init() spi_at91.c:196 0x00104eb0
> 1 cyg_hal_invoke_constructors() hal_misc.c:213 0x00103f04
>
> The first time p is 0x2068e0, the second time 0x2068e4.
>
> And of course, this then produces the above assert fail-message. But
> why is this constructor-table set up this way? And how can I fix that?
>
My "discovery":
Look at arguments and points of view around this thread
http://sourceware.org/ml/ecos-patches/2009-02/msg00068.html
Perhaps, you will get a clue.
Also, may be it is bad idea I never try it, try to manage that with CDL
option CYGSEM_HAL_STOP_CONSTRUCTORS_ON_FLAG (read a description on the
option). Honestly speaking, I'm not sure that I correctly understood it.
Sergei
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss