From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cc65ab136f46904d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: GNAT.Serial_Communications Date: Tue, 19 Apr 2011 13:32:34 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <9af0087d-9637-40d9-8c30-2e06c2d1e4f4@o26g2000vby.googlegroups.com> <31dd80b2-3fd3-4078-8774-c396a52c94a0@r6g2000vbz.googlegroups.com> <0d509f1c-4ca7-4595-a026-65c108558d76@bl1g2000vbb.googlegroups.com> <35515c03-f565-4fc4-ac1c-e9b7268123b3@dn9g2000vbb.googlegroups.com> <1144e8e4-4193-4ffd-a8d2-145c38993eb2@p16g2000vbi.googlegroups.com> <6301289c-f450-4d7f-8391-01e17d2555b9@z27g2000prz.googlegroups.com> Injection-Date: Tue, 19 Apr 2011 13:32:34 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="4pjzwDT2MPp9AkNxUo/C4Q"; logging-data="13102"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18laOj7lWzuXGk4N5sY5/26fzHOzj1Xsrw=" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:p9n8nt3amTRuqshWGrbBj6C2zow= Xref: g2news2.google.com comp.lang.ada:19866 Date: 2011-04-19T13:32:34+00:00 List-Id: On 2011-04-19, tonyg wrote: > > Just to let you all know ( I'm sure the world was waiting with baited > breath!) that thanks to the help received, its now all working. I'll > document what the problem was with some additional stuff to let future > people know. > > It was the flow control setting and it can be fixed by opening another > terminal window and using the command > > stty --file=/dev/ttyUSB0 -crtscts > > However - any ada program compiled with the gnat serial communications > package if run again will reset the port to add flow control so this > needs it will need to be done again. Which is unfortunate for me and Interesting. I would not expect that; there may be something resetting the port (maybe in the GNAT library or the version of the Linux kernel you are using) without you realising it as I don't recall seeing that while working with Linux serial ports (which, for the set of applications in question, I do in C and not Ada). > anyone with non flow control electronics. I expect this will occur > everytime the port is opened. Out of interest do all you serial port > tinkerers out there use flow control? Yes. It's a hardware based RTS/CTS flow control setup and it's a integral part of my microcontroller UART library (at least for the hardware UART; I also created a Tx only software UART for my library and I don't support flow control on that as it's just used for debugging). This is for microcontroller to microcontroller communications however. When I connect the devices to the Linux PC, I use the standard MAX232 setup and since it's been a number of months since I last did this, I cannot remember if my library supports inverting the RTS/CTS lines to allow the signals to pass through the MAX232 or if I just disable the flow control on both sides as I am generally just debugging. Given that I need to transmit 8 bit data on these ports, I have not bothered creating a software flow control Xon/Xoff implementation. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world