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: Serial Port Configuration


Hello

the problem described below is now resolved.I had to create a new eCos configuration only with the Posix package and after that include the following, in order to avoid conflicts.With this, there is no error. But I had succefuly compiled my application but the program hangs up, do nothing.I have a breakpoint in main and open functions but the application doesn't enter on it. I am using Redboot and Insight.
Any ideas?

Thanks in advance

My code:
main()
{
struct termios newser1;
fd1=open("/dev/ser1", O_RDWR | IO_NOCTTY | O_NONBLOCK)
.....
while(1)
read(fd1,&data,1);
.......
}
My eCos configuration:
Posix, serial driver package
CYGPK_IO_SERIAL_TERMIOS0_DEV=/dev/ser0
CYGPK_IO_SERIAL_TERMIOS1_DEV=/dev/ser1

CYGPG_IO_SERIAL_ARM_AT91_SERIAL0=enable
CYGPG_IO_SERIAL_ARM_AT91_SERIAL1=enable



"Ali Rodgo" <alirodgo@web.de> schrieb am 14.02.04 19:19:02:
> 
> Hello,
> With building i mean to create the ecos library(build-->library) and with compling i mean a program(gcc)
> See please my comments bleow
> 
> > > Now it seems to fail another thing. I have added File IO and Posix compatibility layer to use the POSIX functions to use the open, read, write etc...functions and i have made the configuration  described below(in previously mails). but when compiling the following errors appear:
> > > 
> > > undefined reference:cyg_selinit
> > > undefined reference:cyg_selwakeup
> > > undefined reference:cyg_selrecord
> > > 
> > > If I enable CYGFUN_IO_FILEIO_SELECT=enable, there is an error when building eCos, when disable it, no errors when building but do when compiling(see above).Which configuration should i make?
> > 
> > There's something seriously wrong with your configuration. 
> > CYGFUN_IO_FILEIO_SELECT should have been enabled to start off with. Try 
> > starting over with a new configuration. I also don't understand what you 
> > mean about building and compiling... building and compiling mean the same 
> > to me.
> 
> Yes it is enabled when starting, but when building the library, there is an error.
> 
> > 
> > > In the package ISO C and POSIX infrastructure should i enable the following too in oreder to use termios and POSIX functions?
> > > 
> > > CYGBLD_ISO_OPEN_HEADER=enable
> > > CYGBLD_ISO_TERMIOS_HEADER=enable
> > > CYGBLD_ISO_SELECT_HEADER=enable
> > 
> > Those should already be enabled. If not, then I wonder, are you using eCos 
> > 2.0 or recent CVS? Or 1.3.1? If 1.3.1, then upgrade.
> > 
> I am using eCos 2.0.
> 
> Ok I will try to find out what is wrong,if i dont find the solution :-( i will show you my small code and my configuration. I would be gratefull if you could help me with this.The only what i want to do is to read/write from/to the "/dev/ser1" EB40A serial port( which is connected to a host pc) and make an application with threads, signals handlers, semaphores, all of this using the Posix functions implemented on eCos.
> 
> Thank you very much, Jonathan
> 
> 
> 
> 
> > Jifl
> > 
> > > Thanks in advance
> > > 
> > > Jonathan Larmour <jifl@eCosCentric.com> schrieb am 12.02.04 21:10:30:
> > > 
> > >>Ali Rodgo wrote:
> > >>
> > >>>Jonathan, what do you mean with "configuration is consistent"?I have checked the libraries and all of those are created, fcntl.h, termios.h etc.I have programmed: 
> > >>
> > >>Something like "ecosconfig check" on the command line, or checking there 
> > >>are no conflicts if using the graphical eCos configuration tool 
> > >>(View->Conflicts I think).
> > >>
> > >>
> > >>>fd=open("/dev/termios1", O_RDWR | O_NOCTTY) /* suppose to open the termios1  driver associate to the harrware serial driver /dev/ser1.
> > >>>read(fd,buf,1)
> > >>>
> > >>>I am really confused
> > >>
> > >>open() comes from the fileio package. If it says it can't find open(), then 
> > >>something is wrong with the way the fileio package was added, or eCos was 
> > >>rebuilt.
> > >>
> > >>Jifl
> > >>
> > >>
> > >>>Thanks in advance
> > >>>
> > >>>Jonathan Larmour <jifl@eCosCentric.com> schrieb am 12.02.04 15:26:24:
> > >>>
> > >>>
> > >>>>Ali Rodgo wrote:
> > >>>>
> > >>>>
> > >>>>>Thank you very much, i have made the following configuration:
> > >>>>>
> > >>>>>CYGPKG_IO_SERIAL_TERMIOS=enable CYGPKG_IO_SERIAL_TERMIOS_TERMIOS0=enable
> > >>>>>CYGPKG_IO_SERIAL_TERMIOS_TERMIOS1=enable 
> > >>>>>GYGDAT_IO_SERIAL_TERMIOS_TERMIOS1_DEV="/dev/ser1" 
> > >>>>>GYGDAT_IO_SERIAL_TERMIOS_TERMIOS0_DEV="/dev/ser0"
> > >>>>>
> > >>>>>
> > >>>>>CYGPKG_IO_SERIAL_DEVICE=enable 
> > >>>>>CYGPKG_IO_SERIAL_ARM_AT91_SERIAL1_NAME="/dev/ser1" 
> > >>>>>CYGPKG_IO_SERIAL_ARM_AT91_SERIAL0_NAME="/dev/ser0"
> > >>>>>
> > >>>>>and the code you can see in the file serial.c. When compiling i receive
> > >>>>>two errors in the open function:undefined reference to "open".
> > >>>>
> > >>>>open() should come from the FILEIO package which CYGPKG_IO_SERIAL_TERMIOS 
> > >>>>requires. Are you sure your configuration is consistent?
> > >>>>
> > >>>>
> > >>>>
> > >>>>>I f i want to make a printf should now open the device(SERIAL A)
> > >>>>>"/dev/termios0" and call the write function or call easy the printf
> > >>>>>function as before(/dev/ttydiag)
> > >>>>
> > >>>>Assuming you aren't running GDB on the same port, it's probably best to use 
> > >>>>/dev/termios0, or /dev/tty0 should work too.
> > >>>>
> > >>>>You can't use /dev/ttydiag on the same port as you're running the "full" 
> > >>>>serial driver on.
> > >>>>
> > >>>>Jifl
> > 
> > 
> > -- 
> > eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
> > Visit us at Embedded World 2004, Nürnberg, Germany, 17-19 Feb, Stand 12-449
> > --["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine
> > 
> > 
> > -- 
> > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
> > 
> 
> 
> ______________________________________________________________________________
> Nachrichten, Musik und Spiele schnell und einfach per Quickstart im 
> WEB.DE Screensaver - Gratis downloaden: http://screensaver.web.de/?mc=021110
> 
> 
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
> 


______________________________________________________________________________
Nachrichten, Musik und Spiele schnell und einfach per Quickstart im 
WEB.DE Screensaver - Gratis downloaden: http://screensaver.web.de/?mc=021110


--
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]