[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Kernel compile error with RS485



Depending on the timing requirement of the RS-485 device you
can probably do the RTS toggling in the user mode application.
Perhaps use tcdrain() and gettimeofday() to know when it's safe to
toggle teh RTS to set receive mode.
(get_lsr_status() in serial.c does not take the last char in the shift
register
into account, see elinux code for that.)

set_rts_to_tx_mode(fd);
write(fd,data, len)
tcdrain(fd);
gettimeofday(&t0,NULL);
do{
  gettimeofday(&t1,NULL);
}while(((t1.tv_sec-t0.tv_sec)*1000000+t1.tv_usec-t0.tv_usec)< char_time);
set_rts_to_rx_mode(fd);

/Johan


----- Original Message -----
From: Ujwal S. Sathyam <ujwal@xxxxxxx.com>
To: Jonas Holmberg <jonashg@xxxxxxx.com>
Cc: dev-etrax <dev-etrax@xxxxxxx.com>
Sent: Monday, July 02, 2001 5:29 PM
Subject: RE: Kernel compile error with RS485


> the port /dev/ttyS3 failed to open because I had not enabled it in the
> kernel config and recompiled the kernel. Now that I enabled it, it
> works. So I should be able to use 4-wire 485 on that port then without
> explicitly enabling 485 in the kernel? Can I also use 2-wire?
>
> Thanks,
>
> Ujwal
>
>
> On 02 Jul 2001 13:05:39 +0200, Jonas Holmberg wrote:
> > > So I figured out that I have to recompile the kernel with ser3
> > > (/dev/ttys3) enabled to use the port. I also turned on RS485 support.
> > > But now the kernel compile with "make kernel" fails. I
> > > thought I caught
> > > a bug in
> > >
> > > /usr/local/axis/devboard_lx/os/linux/arch/cris/drivers/serial.h
> > >
> > > where CONFIG_RS485 should probably be CONFIG_ETRAX_RS485.
> > >
> > > But it still would not compile. Here is the error after I
> > > made the above
> > > change. Is RS485 support complete on the devboard?
> >
> > The RS485-code comes from the 2.0.38 kernel and hasn't been ported yet.
But from what I've heard you should be able to use the port in four-wire
mode without enabling CONFIG_ETRAX_RS485. What went wrong when you tried to
open() the port?
> >
> > brdgs
> > /Jonas
> >
>
>