This is the mail archive of the ecos-discuss@sources.redhat.com 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: Correction on serial driver hooks


Hi Gary,
   Non I did not compile my driver into libextras.a. This driver far
from being official so I just compile it as a piece of my application.
That does not seem to be a problem. My init function and my lookup
functions get called properly. If I step through my lookup function I
see my device "/dev/ttyS0".

   To be completely honest, I initialize the driver manually myself.
Therefore the init function called by the driver does not do anything.
All that my putc function do is sending one character to the serial port
once again completely done manually. My problem is that my scc1_putc
function doesn't get called at all.

   On thing I noticed however, the cyg_io_lookup function has three
arguments. When I call cyg_io_lookup, I pass two arguments.

One more detail, am using the sim template with all options. If it
matters.

Turning CYGDGB_INIT_IO won't be of much help since the scc1 is my only
serial driver port available.


In resume, I configure the port myselft at this point in time. Init and
lookup do get called. However scc1_putc does not get called and I loose
contact with my probe.

Do you see anything wrong with my definitions ? By the way, the
structure SERIAL_CHANNEL is filled up with junk which I don't use
anywhere since I do all initialization myself. The only relevant
parameter is the scc1_funs.

Thanks for having a peek at this.

Pascal

-----Original Message-----
From: Gary Thomas [mailto:gthomas@ecoscentric.com]
Sent: Thursday, October 17, 2002 5:23 PM
To: Cusson, Pascal
Cc: eCos Discussion
Subject: Re: [ECOS] Correction on serial driver hooks


On Thu, 2002-10-17 at 15:05, Cusson, Pascal wrote:
> Here are my definition corrected on my serial driver hooks:
> 
> SERIAL_FUNS(scc1_funs, scc1_putc, scc1_getc, scc1_set_config,
scc1_start_xmit, scc1_stop_xmit);
> 
> SERIAL_CHANNEL(serial_channel0, scc1_funs, scc1_info1,
>                 CYGNUM_SERIAL_BAUD_57600,
>                 CYG_SERIAL_STOP_DEFAULT,
>                 CYG_SERIAL_PARITY_DEFAULT,
>                 CYG_SERIAL_WORD_LENGTH_DEFAULT,
>                 CYG_SERIAL_FLAGS_DEFAULT);
> 
> DEVTAB_ENTRY(serial_scc1,"/dev/ttyS0",0,&cyg_io_serial_devio,init,
scc1_lookup,&serial_channel0);
> 
> When calling cyg_io_lookup, nothing happens. It looks like teh driver
does not get attached. Subsequently, my function scc1_putc does not get
called either when using cyg_io_write.
> 
> What do I need to put in the cyg__io_lookput to attach my functions
???

Did you remember to put your driver into libextras.a?

Is the driver initialization being called (this will happen
at boot time)?  You can turn on CYGDBG_IO_INIT to get messages
about the initialization.
-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------

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


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