This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: undefined reference to 'init_all_network_interfaces'


Please keep replies on the list so that all may benefit.

Davy Wouters wrote:
Hi Gary,

Tnx for a fast response,

I'm using the ecos configuration tool V2.11 on a windows XP/cygwin PC.
I think that the way i created my configuration there is the same as
what you suggest here?!

You can use 'ecosconfig' on any system, not just the config tool. Just make sure that if you use the config tool that you include the 'net' template. This causes all of the necessary items for networking to be included in your build.

I can get an application build and running. This is how i noticed that
the init of the driver does get called.
But when i try to call init_all_network_interfaces() the application
doesn't build anymore. Then again maybe i do not need to do this call
at all to get the start of my driver called ?
The driver functions are in the libextras.a as you suggested.

I also tried to build the same application for a i386 pc target.
This seems to have the same result that all functionality from
network_support.c in packages/net/common/current/src are 'thrown away'
somehow. Maybe when linking libtarget.a?

Start with getting the supplied tests to build. Then you'll know that you have a good base from which to add your application.


Davy


On 12/18/06, Gary Thomas <gary@mlbassoc.com> wrote:
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
------------------------------------------------------------

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]