It seems to be a bug in there. From spi_at91_init.cxx, the following
definition is not visible : CYGBLD_ATTRIB_C_INIT_PRI
Possibly because of the compiler switch (__cplusplus) ?
----------- cyg_type.h -------------
#if defined(__GNUC__) && !defined(__cplusplus) && (__GNUC_VERSION__ >=
40300)
// Equivalents of the above for C functions, available from gcc 4.3
onwards.
# define CYGBLD_ATTRIB_C_INIT_PRI( _pri_)
__attribute__((constructor (_pri_)))
# define CYGBLD_ATTRIB_C_INIT_BEFORE( _pri_ )
__attribute__((constructor (_pri_-100)))
# define CYGBLD_ATTRIB_C_INIT_AFTER( _pri_ )
__attribute__((constructor (_pri_+100)))
#endif
An easy work around is to keep the C++ constructor only:
#1 In spi_at91_init.cxx -> remove #ifndef CYGBLD_ATTRIB_C_INIT_PRI /
#endif
#2 In spi_at91.c -> replace
#ifndef CYGBLD_ATTRIB_C_INIT_PRI
# define CYGBLD_ATTRIB_C_INIT_PRI(x)
#endif
void CYGBLD_ATTRIB_C_INIT_PRI(CYG_INIT_BUS_SPI)
cyg_spi_at91_bus_init(void)
{
with:
void
cyg_spi_at91_bus_init(void)
{
Then you should get the SPI bus initialized only once.
Christophe