[ECOS] Dual Init of SPI on at91sam7x-based system

Bob Brusa bob.brusa@gmail.com
Fri Dec 3 09:48:00 GMT 2010


Hi
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?

I should add:
a) My little program does not use any spi-related stuff - only serial i/o  
and the net-interface.
b) My library was generated with spi-bus0 only. I had disabled spi-bus1 of  
the at91sam7x512 in configtool (CYGINT_DEVS_SPI_ARM_AT91_HAS_BUS1 = 0).

Thanks for advice - Robert	

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list