[ECOS] raw output to serial port and dataflash + legacy API questions

Evgeniy Dushistov dushistov@mail.ru
Mon May 11 17:44:00 GMT 2009

On Thu, May 07, 2009 at 02:57:56PM +0400, Dave Milter wrote:
> 2)I have board with dataflash, it supported with package in directory
> packages/devs/flash/atmel/dataflash, but on my board
> as against eb55 there is only dataflash, there is no NOR flash.
> I build redboot, but
> arm-eabi-nm redboot.elf | grep dataflash is empty.
> while
> arm-eabi-nm libtarget.a | grep dataflash give all symbols
> that I expect to see.
> During my investigation I remove norflash from eb55 description
> and receive the same result for eb55 redboot.

I had the similar problem when adding support for dataflash 
for at91sam9263 cpu.

As far as I understand, the problem is following.

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,
                            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,
                             16 );
+void cyg_eb55_dataflash_func(int p)

and add reference to this function from the code that 100% will not be removed:

+typedef void flash_workaround_func(int);
+externC flash_workaround_func cyg_eb55_dataflash_func;
 int do_flash_init(void)
     int stat, i;
     cyg_flash_info_t info;
+    flash_workaround_func *f;
+    f = (flash_workaround_func *)cyg_flash_anonymizer(&cyg_eb55_dataflash_func);

Any ideas on that?


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