The c code is a simple user program with canonical reads in a for loop. Looking at console tty10 during an upload from device to computer, you get ttyS0: 1 input overrun(s) ttyS0: 2 input overrun(s) ttyS0: 1 input overrun(s)
In average, you get 3~4 overruns per upload, but it can drop to 1 or 0. One of the things you really need to do is to get a serial port analyzer. I have not used one in years, but the ones we used were breakout boxes. Not only do these have the capability to change pins, bit they also have leds. You really want to see if the hardware flow control is actually working or not. I have not done any serial port programming in a number of years, but you can really pull your hair out trying to debug this stuff.
It is also very time consuming to sort out, especially with intermitent problems . I have actually stumbled accross a solution by using a USB to serial converter instead of the onboard 16550A UART. See http://www.ftdichip.com/Products/FTEvaluationKits.htm The UART in the converter has 384 bytes of Rx buffer, a far cry from the mere 16 bytes of the 16550A. Now works very reliably at 115200 bauds! ------------------------------------------------------------------- This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. NPL Management Ltd cannot guarantee that the e-mail or any attachments are free from viruses. NPL Management Ltd. Registered in England and Wales. No: 2937881 Registered Office: Serco House, 16 Bartley Wood Business Park, Hook, Hampshire, United Kingdom RG27 9UY -------------------------------------------------------------------