Davy Wouters wrote:
> Hi,
>
> I'm currently working on a port for the Analog Devices Blackfin BF537
> Processor.
> The Architecture/Variant/Platform HAL are operational to a level where
> i can use it for testing.
> Now i am writing a device driver for the ethernet MAC which is built
> in the BF537 Processor.
>
> I don't understand where the driver is actually started (start routine
> of the eth_drv instance).
> The init routine gets called during 'cyg_hal_invoke_constructors()'.
> What i tried is to call the 'init_all_network_interfaces()' function
> in a simple test application before
> actually tryin to send/receive something through a 'socket'.
> This project doesn't build because of the linker error "undefined
> reference to 'init_all_network_interfaces'".
> As far as i know this function is present in libtarget.a ...
How did you configure eCos for this target? The simplest way to build
a system with network support is like this:
% ecosconfig new <target> net
% ecosconfig tree
% make
Then build an application. I'd suggest trying to get the supplied test
programs running first.
>
> Can anyone help me with this? Or at least explain where or how the mac
> device driver gets started?
Most of the initialization happens during device initialization which
is "under the covers" and long before application code starts.
Make sure that your driver is being built/installed into libextras.a
The 'init' function will be called during system startup. Diagnostic
I/O is already running by this point, so it's safe to call 'diag_printf()'
in your init code. What I like to do is pepper my code with lines like
these:
diag_printf("%s: %d\n", __FUNCTION__, __LINE__);
You can use this to see something of the flow - what got called, etc,
then home in on what might not be working.
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------