> For example, you write this code in some ".c" file: > > __externC cyg_spi_at91_device_t spi_dataflash_dev0; > > CYG_DATAFLASH_FLASH_DRIVER( cyg_eb55_dataflash, > &spi_dataflash_dev0, > 0x08000000, > 0, > 16 ); > > this file contains only definitions of variables, > no code. For some reasons linker will remove > such kind of object file in the resulting binary, and also all the stuff like > dataflash module, because > without this file there are no links to dataflash module functions. > > I suppose, this is bug either in build system of ecos, or in arm-eabi > toolchain. > > The workaround for this issue, that I used, is simple. I add after > CYG_DATAFLASH_FLASH_DRIVER the dummy function: > > CYG_DATAFLASH_FLASH_DRIVER( cyg_eb55_dataflash, > 0, > 16 ); > > +void cyg_eb55_dataflash_func(int p) > +{ > +} > +
If something is not referenced, the linker will throw it away. It is unwanted bloat. To stop this, you need to let the build system know. eg for a serial driver in the CDL: compile -library=libextras.a at91_serial.c Andrew