public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] I2C Driver not initializing
@ 2007-09-11 14:06 Alexandre
  2007-09-11 14:15 ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Alexandre @ 2007-09-11 14:06 UTC (permalink / raw)
  To: ecos-discuss

Hello all,

Would anyone happend to know what i'd have to do for a driver to init ?
I've linked my i2c init function to the generic i2c interface but my
specific function is never called. I don't think the I2C interface
init function is called anyway, i supposed it would happen
automatically after configuring I2C in the ecos config tool but this
isn't the case.

Do I have to call the init function myself in cyg_user_start() ?

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] I2C Driver not initializing
  2007-09-11 14:06 [ECOS] I2C Driver not initializing Alexandre
@ 2007-09-11 14:15 ` Andrew Lunn
  2007-09-11 14:26   ` Alexandre
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2007-09-11 14:15 UTC (permalink / raw)
  To: Alexandre; +Cc: ecos-discuss

On Tue, Sep 11, 2007 at 04:06:30PM +0200, Alexandre wrote:
> Hello all,
> 
> Would anyone happend to know what i'd have to do for a driver to init ?
> I've linked my i2c init function to the generic i2c interface but my
> specific function is never called. I don't think the I2C interface
> init function is called anyway, i supposed it would happen
> automatically after configuring I2C in the ecos config tool but this
> isn't the case.

Is this a I2C device driver you have written yourself? Or is it one of
the existing device drivers?

What do you have in the cdl file for the driver?

compile       -library=libextras.a my_i2c.c

Im wondering if the linker has throw the driver out because it is not
being used. By adding the -library=libextras.a the linker cannot throw
it away.

   Andrew

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] I2C Driver not initializing
  2007-09-11 14:15 ` Andrew Lunn
@ 2007-09-11 14:26   ` Alexandre
  2007-09-11 15:25     ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Alexandre @ 2007-09-11 14:26 UTC (permalink / raw)
  To: Alexandre, ecos-discuss

> Is this a I2C device driver you have written yourself? Or is it one of
> the existing device drivers?

Well it's one I've written myself as i didn't found any driver for the
LPC2XXX port.

> What do you have in the cdl file for the driver?

Actually, nothing, the driver part is style in my user code as I
wanted to test it before even trying to include it in eCos.
I added the package "I2C Support" to my package build and tried to
link my functions to it. Everything compiles just fine and i can
access the generic I2C functions as the headers are added to my
source.

> compile       -library=libextras.a my_i2c.c

libextras.a already exists in my config and contains my serial devices
configuration. It does not contain anything about i2c however, should
it ?

> Im wondering if the linker has throw the driver out because it is not
> being used. By adding the -library=libextras.a the linker cannot throw
> it away.

Well even the generic I2C driver code is not initialized so I think I
made a mistake by forgetting something or misunderstanding the whole
concept ^^

Alex

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] I2C Driver not initializing
  2007-09-11 14:26   ` Alexandre
@ 2007-09-11 15:25     ` Andrew Lunn
  2007-09-11 16:04       ` Alexandre
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2007-09-11 15:25 UTC (permalink / raw)
  To: Alexandre; +Cc: ecos-discuss

> Well even the generic I2C driver code is not initialized so I think I
> made a mistake by forgetting something or misunderstanding the whole
> concept ^^

Do you call any I2C function? If nothing is using I2C it will all get
throw out by the linker.

Take a look at the functions which are actually in your
image. 

arm-elf-objdump --syms myprog

Is the i2c code there?

   Andrew

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] I2C Driver not initializing
  2007-09-11 15:25     ` Andrew Lunn
@ 2007-09-11 16:04       ` Alexandre
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre @ 2007-09-11 16:04 UTC (permalink / raw)
  To: Alexandre, ecos-discuss

Ok that was the problem, the i2c file was rejected by the linker and
not included in the code since considered unused, it works now ...

I feel shame ^^

Thanks a lot Andrew, as usual :)

On 9/11/07, Andrew Lunn <andrew@lunn.ch> wrote:
> > Well even the generic I2C driver code is not initialized so I think I
> > made a mistake by forgetting something or misunderstanding the whole
> > concept ^^
>
> Do you call any I2C function? If nothing is using I2C it will all get
> throw out by the linker.
>
> Take a look at the functions which are actually in your
> image.
>
> arm-elf-objdump --syms myprog
>
> Is the i2c code there?
>
>    Andrew
>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-11 16:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-11 14:06 [ECOS] I2C Driver not initializing Alexandre
2007-09-11 14:15 ` Andrew Lunn
2007-09-11 14:26   ` Alexandre
2007-09-11 15:25     ` Andrew Lunn
2007-09-11 16:04       ` Alexandre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).