public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] UART communication
@ 2000-09-05  6:16 Andreas.Karlsson
  2000-09-05  8:52 ` Dave Airlie
  2000-09-05  9:04 ` Jonathan Larmour
  0 siblings, 2 replies; 9+ messages in thread
From: Andreas.Karlsson @ 2000-09-05  6:16 UTC (permalink / raw)
  To: ecos-discuss, aeb

Hi,

While receiving several bytes on the UART0 port on my AEB-board the
eCos-serialdriver says it only received 1 byte with the value of 0.

The incoming data looks very nice on an oscilloscope. 

Just to be sure that I hadn't messed something up in my receiver-thread I
connected the TX and the RX pin and sent 4 bytes, the packet was received
just as it should.



I compiled the ser0 with a baud rate of 57600 since that's the only one I
can use. The other settings are 1 stop bit, no parity, wordsize=8 and
CTS/RTS enabled.

I noticed that the baudrate of 57600 wasn't supported in aeb_serial.h but
what happens when I make this selection in the configuration?

To be able to enable CTS/RTS I had to modify the select_baud-array in
aeb_serial.h. This because I should be able to set all fields in the
cyg_serial_info_t struct. I added the value of 26 on the bauddivisor for
57600, maybe this is the problem.

I really don't know what could be wrong so if anybody has a clue...

/Andreas

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

* Re: [ECOS] UART communication
  2000-09-05  6:16 [ECOS] UART communication Andreas.Karlsson
@ 2000-09-05  8:52 ` Dave Airlie
  2000-09-05  9:03   ` Gary Thomas
  2000-09-05  9:04 ` Jonathan Larmour
  1 sibling, 1 reply; 9+ messages in thread
From: Dave Airlie @ 2000-09-05  8:52 UTC (permalink / raw)
  To: Andreas.Karlsson; +Cc: ecos-discuss, aeb

With eCos on the ARM AEB you cannot choose 57600, I up came against
something similiar a while back.. check the return from
cyg_io_set_config I found it by tracing the code ...

I think you can use a different clock multiplier to get 57600 but it
involves changing eCos code...

Dave.


On Tue, 5 Sep 2000 Andreas.Karlsson@combitechsystems.com wrote:

> Hi,
> 
> While receiving several bytes on the UART0 port on my AEB-board the
> eCos-serialdriver says it only received 1 byte with the value of 0.
> 
> The incoming data looks very nice on an oscilloscope. 
> 
> Just to be sure that I hadn't messed something up in my receiver-thread I
> connected the TX and the RX pin and sent 4 bytes, the packet was received
> just as it should.
> 
> 
> 
> I compiled the ser0 with a baud rate of 57600 since that's the only one I
> can use. The other settings are 1 stop bit, no parity, wordsize=8 and
> CTS/RTS enabled.
> 
> I noticed that the baudrate of 57600 wasn't supported in aeb_serial.h but
> what happens when I make this selection in the configuration?
> 
> To be able to enable CTS/RTS I had to modify the select_baud-array in
> aeb_serial.h. This because I should be able to set all fields in the
> cyg_serial_info_t struct. I added the value of 26 on the bauddivisor for
> 57600, maybe this is the problem.
> 
> I really don't know what could be wrong so if anybody has a clue...
> 
> /Andreas
> 

-- 
      David Airlie, Software Engineer, Parthus Technologies plc.,
       Mary Rosse Centre, National Tech Park, Limerick, Ireland.
   t: +353-61-508116 / f: +353-61-508101 / David.Airlie@parthus.com

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

* Re: [ECOS] UART communication
  2000-09-05  8:52 ` Dave Airlie
@ 2000-09-05  9:03   ` Gary Thomas
  0 siblings, 0 replies; 9+ messages in thread
From: Gary Thomas @ 2000-09-05  9:03 UTC (permalink / raw)
  To: Dave Airlie; +Cc: aeb, ecos-discuss, Andreas.Karlsson

You might try the [untested] attached patch.  No guarantees, but it
will give you an idea of where to look and what to try.

Of course if you get it working, we'd appreciate any feedback/patches.

On 05-Sep-2000 Dave Airlie wrote:
> 
> With eCos on the ARM AEB you cannot choose 57600, I up came against
> something similiar a while back.. check the return from
> cyg_io_set_config I found it by tracing the code ...
> 
> I think you can use a different clock multiplier to get 57600 but it
> involves changing eCos code...
> 
> Dave.
> 
> 
> On Tue, 5 Sep 2000 Andreas.Karlsson@combitechsystems.com wrote:
> 
>> Hi,
>> 
>> While receiving several bytes on the UART0 port on my AEB-board the
>> eCos-serialdriver says it only received 1 byte with the value of 0.
>> 
>> The incoming data looks very nice on an oscilloscope. 
>> 
>> Just to be sure that I hadn't messed something up in my receiver-thread I
>> connected the TX and the RX pin and sent 4 bytes, the packet was received
>> just as it should.
>> 
>> 
>> 
>> I compiled the ser0 with a baud rate of 57600 since that's the only one I
>> can use. The other settings are 1 stop bit, no parity, wordsize=8 and
>> CTS/RTS enabled.
>> 
>> I noticed that the baudrate of 57600 wasn't supported in aeb_serial.h but
>> what happens when I make this selection in the configuration?
>> 
>> To be able to enable CTS/RTS I had to modify the select_baud-array in
>> aeb_serial.h. This because I should be able to set all fields in the
>> cyg_serial_info_t struct. I added the value of 26 on the bauddivisor for
>> 57600, maybe this is the problem.
>> 
>> I really don't know what could be wrong so if anybody has a clue...
>> 
>> /Andreas
>> 
> 
> -- 
>       David Airlie, Software Engineer, Parthus Technologies plc.,
>        Mary Rosse Centre, National Tech Park, Limerick, Ireland.
>    t: +353-61-508116 / f: +353-61-508101 / David.Airlie@parthus.com
> 

============= Patch to support 57600 and 115200 baud on AEB-1 ================
Index: devs/serial/arm/aeb/current/src/aeb_serial.h
===================================================================
RCS file: /local/cvsfiles/ecc/ecc/devs/serial/arm/aeb/current/src/aeb_serial.h,v
retrieving revision 1.1
diff -u -5 -p -r1.1 aeb_serial.h
--- devs/serial/arm/aeb/current/src/aeb_serial.h        2000/04/10 14:44:46     1.1
+++ devs/serial/arm/aeb/current/src/aeb_serial.h        2000/09/05 15:59:29
@@ -144,11 +144,11 @@ static unsigned short select_baud[] = {
         69*3,  // 7200
         52*3,  // 9600
     (69*3)/2,  // 14400
         26*3,  // 19200
         13*3,  // 38400
-           0,  // 57600
-           0,  // 115200
+          26,  // 57600
+          13,  // 115200
            0,  // 230400
 };
 
 #endif // CYGONCE_ARM_AEB_SERIAL_H


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

* Re: [ECOS] UART communication
  2000-09-05  6:16 [ECOS] UART communication Andreas.Karlsson
  2000-09-05  8:52 ` Dave Airlie
@ 2000-09-05  9:04 ` Jonathan Larmour
  1 sibling, 0 replies; 9+ messages in thread
From: Jonathan Larmour @ 2000-09-05  9:04 UTC (permalink / raw)
  To: Andreas.Karlsson; +Cc: ecos-discuss, aeb

Andreas.Karlsson@combitechsystems.com wrote:
> 
> While receiving several bytes on the UART0 port on my AEB-board the
> eCos-serialdriver says it only received 1 byte with the value of 0.
> 
> The incoming data looks very nice on an oscilloscope.
> 
> Just to be sure that I hadn't messed something up in my receiver-thread I
> connected the TX and the RX pin and sent 4 bytes, the packet was received
> just as it should.
> 
> I compiled the ser0 with a baud rate of 57600 since that's the only one I
> can use. The other settings are 1 stop bit, no parity, wordsize=8 and
> CTS/RTS enabled.

Can you clarify what you mean by CTS/RTS enabled? How did you enable this?
 
> I noticed that the baudrate of 57600 wasn't supported in aeb_serial.h but
> what happens when I make this selection in the configuration?
> 
> To be able to enable CTS/RTS I had to modify the select_baud-array in
> aeb_serial.h. This because I should be able to set all fields in the
> cyg_serial_info_t struct. I added the value of 26 on the bauddivisor for
> 57600, maybe this is the problem.

Does 57600 bps communication work normally?

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

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

* Re: [ECOS] UART communication
  2000-09-06 10:01 ` Jonathan Larmour
@ 2000-09-07  0:25   ` Jesper Skov
  0 siblings, 0 replies; 9+ messages in thread
From: Jesper Skov @ 2000-09-07  0:25 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: Andreas.Karlsson, ecos-discuss, aeb

>>>>> "Jonathan" == Jonathan Larmour <jlarmour@redhat.com> writes:

Jonathan> Andreas.Karlsson@combitechsystems.com wrote:
>> > Can you clarify what you mean by CTS/RTS enabled? How did you >
>> enable this?
>> 
>> I enabled it with the cyg_io_set_config-function like this:
>> 
Jonathan> [snip]
>> settings_buf.flags=CYG_SERIAL_FLAGS_RTSCTS; //enable CTS/RTS

Jonathan> I think you should find that setting this has no effect,
Jonathan> which is why you are seeing overruns. If you update to eCos
Jonathan> from CVS, you will find that "real" support for hardware
Jonathan> flow control has been added to the generic layer, although
Jonathan> the only device driver that uses it currently is the ARM PID
Jonathan> serial driver.

Jonathan> However, it would not be difficult to make the same changes
Jonathan> to the AEB serial driver. Perhaps you should consider that?

I'm plotting on restructuring the 16450/1655x serial drivers just as I
have just done with the SH SCI/SCIF serial drivers.

I haven't looked into all the details yet, but I believe I should be
able to make a generic 16450/1655x serial driver which is shared
between all the platforms that presently have a dedicated driver for
such a beast. This would affect at least PID, Cogent and AEB -
possibly other platforms as well.

I would base that reorg on the PID driver, thus extending the current
PID BREAK+CTS/RTS support to the other affected platforms.

By the looks of things, however, I wouldn't get around to that for
some weeks, so changing the AEB driver would probably be a good (and
necessary) short term fix.

Jesper

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

* Re: [ECOS] UART communication
  2000-09-06 10:21 Andreas.Karlsson
@ 2000-09-06 10:31 ` Jonathan Larmour
  0 siblings, 0 replies; 9+ messages in thread
From: Jonathan Larmour @ 2000-09-06 10:31 UTC (permalink / raw)
  To: Andreas.Karlsson; +Cc: ecos-discuss, aeb

Andreas.Karlsson@combitechsystems.com wrote:
> 
> I've been trying today to connect to a terminal on a Laptop just to check
> that the 57600kbps is working and it works very well. But maybe you are
> right that CTS/RTS doesn't work. I hope I don't have to rebuild any of the
> tools just eCos, right?

You shouldn't need a new toolchain, although you may need new versions of
ecosconfig/eCos configuration tool if you want to switch to the eCos CVS
sources (see http://sources.redhat.com/ecos/anoncvs.html )

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

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

* RE: [ECOS] UART communication
@ 2000-09-06 10:21 Andreas.Karlsson
  2000-09-06 10:31 ` Jonathan Larmour
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas.Karlsson @ 2000-09-06 10:21 UTC (permalink / raw)
  To: jlarmour; +Cc: ecos-discuss, aeb

Ok,

I've been trying today to connect to a terminal on a Laptop just to check
that the 57600kbps is working and it works very well. But maybe you are
right that CTS/RTS doesn't work. I hope I don't have to rebuild any of the
tools just eCos, right?

/Andreas

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

* Re: [ECOS] UART communication
  2000-09-05 22:32 Andreas.Karlsson
@ 2000-09-06 10:01 ` Jonathan Larmour
  2000-09-07  0:25   ` Jesper Skov
  0 siblings, 1 reply; 9+ messages in thread
From: Jonathan Larmour @ 2000-09-06 10:01 UTC (permalink / raw)
  To: Andreas.Karlsson; +Cc: ecos-discuss, aeb

Andreas.Karlsson@combitechsystems.com wrote:
> > Can you clarify what you mean by CTS/RTS enabled? How did you
> > enable this?
> 
> I enabled it with the cyg_io_set_config-function like this:
> 
[snip] 
> settings_buf.flags=CYG_SERIAL_FLAGS_RTSCTS; //enable CTS/RTS

I think you should find that setting this has no effect, which is why you
are seeing overruns. If you update to eCos from CVS, you will find that
"real" support for hardware flow control has been added to the generic
layer, although the only device driver that uses it currently is the ARM
PID serial driver.

However, it would not be difficult to make the same changes to the AEB
serial driver. Perhaps you should consider that?

Or if you update to CVS, you could try the software (XON/XOFF) flow control
which should "just work".

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

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

* RE: [ECOS] UART communication
@ 2000-09-05 22:32 Andreas.Karlsson
  2000-09-06 10:01 ` Jonathan Larmour
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas.Karlsson @ 2000-09-05 22:32 UTC (permalink / raw)
  To: jlarmour; +Cc: ecos-discuss, aeb

> 

> Can you clarify what you mean by CTS/RTS enabled? How did you 

> enable this?

> Jifl



I enabled it with the cyg_io_set_config-function like this:



cyg_serial_info_t settings_buf;



settings_buf.baud=CYGNUM_SERIAL_BAUD_57600; //had to modify the sources in
aeb_serial.h

settings_buf.stop=CYGNUM_SERIAL_STOP_1;

settings_buf.parity=CYGNUM_SERIAL_PARITY_NONE;

settings_buf.word_length=CYGNUM_SERIAL_WORD_LENGTH_8;

settings_buf.flags=CYG_SERIAL_FLAGS_RTSCTS; //enable CTS/RTS



err = cyg_io_lookup( "/dev/ser0", &ser0_hdl );

if(ENOERR != err)

{

	printf("Couldn't find /dev/ser0 !!\n");

}

len=sizeof(cyg_serial_info_t);

err=cyg_io_set_config(ser0_hdl, CYG_IO_SET_CONFIG_SERIAL_INFO,
&settings_buf, &len);



When checking the Line Status Register after receiving the zero-byte there
is an overrun error. 

The value of LSR is 0x62.

/Andreas

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

end of thread, other threads:[~2000-09-07  0:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-05  6:16 [ECOS] UART communication Andreas.Karlsson
2000-09-05  8:52 ` Dave Airlie
2000-09-05  9:03   ` Gary Thomas
2000-09-05  9:04 ` Jonathan Larmour
2000-09-05 22:32 Andreas.Karlsson
2000-09-06 10:01 ` Jonathan Larmour
2000-09-07  0:25   ` Jesper Skov
2000-09-06 10:21 Andreas.Karlsson
2000-09-06 10:31 ` Jonathan Larmour

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).