Re: [Ftdi-usb-sio-devel] Raspberry Pi FDTI Driver issue
Brought to you by:
bryder
From: H M. <hmc...@ya...> - 2015-04-10 16:13:42
|
My suggestion is to approach it as a hardware problem, if you haven't already. Does the USB->Serial adapter function properly on another Linux box? (Perhaps you did that and I missed where you said it.) If possible, did you try a different USB->Serial adapter? (Serial UARTS do fail, I've dealt with hundreds.) Is the garbage character always the same? If your software simply "eats" the first character, does it work OK after that? (If so, could be line noise. You wouldn't be the only person this ever happened to. I've seen code for embedded devices (M68K series microprocessors) that routinely clear unexpected characters from the incoming buffer. These are just suggestions. Hope they help. Hugh On Thursday, April 9, 2015 8:52 PM, Bill Ryder <bil...@gm...> wrote: Nope - that is pretty strange. Can you strace your program on a Pi? We can start by looking at what the system calls are returning. Alternatively you can load the driver in debug mode and a LOT more detail will be dumped in the buffer dmesg uses. But ideally start with strace to at least make sure it's the kernel sending you that data. On Fri, Apr 10, 2015 at 2:22 AM, Brett Whittacre <wh...@ec...> wrote: Here is the Dmseg information about it. I looks to be the right driver to me. Any other ideas of what it might be? [ 3.822917] usbserial: USB Serial support registered for generic [ 3.842095] usbcore: registered new interface driver ftdi_sio [ 3.849420] usbserial: USB Serial support registered for FTDI USB Serial Device [ 3.855792] ftdi_sio 1-1.2:1.0: FTDI USB Serial Device converter detected [ 3.862030] usb 1-1.2: Detected FT232RL [ 3.868149] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0 [ 5.496995] random: nonblocking pool is initialized Kind Regards, Brett WhittacreVice Pre...@ec... ec2 Software Solutions3035 E. Patrick Ste. 1Las Vegas, Nevada, 89120P: 1.866.791.3673 ext 200 | F: 1.702.947.7357 www.ec2software.com Follow the rules. Exceed the standard. ----- On Apr 8, 2015, at 5:08 PM, Bill Ryder <bil...@gm...> wrote: At a guess the Pi isn't loading the right driver. Do you have the output from dmesg when the FTDI is plugged in? It should say something about a ftdi_sio device being attached. On Thu, Apr 9, 2015 at 9:40 AM, Brett Whittacre <wh...@ec...> wrote: I am having a very strange issue with serial communication through a fdti FT232 device. I have created a serial program that communicated with a device. It is set to blocking mode. When I run the program on a PC, it works just fine. However, when I run the same program on a Raspberry pi 2, it always returns at least one character, even though there is nothing on the line at that time. The code below works on Ubuntu 14.04 with no issues. I get full blocking using either a read of select call. I am just wondering if I am doing something wrong on the PI.... Here is how I am connecting to the port.' fd=open(sDev.c_str(), O_RDWR | O_NOCTTY ); struct termios options; tcgetattr(fd, &options); cfsetispeed(&options, B115200); cfsetospeed(&options, B115200);options.c_cflag |= (CLOCAL | CREAD ); options.c_cflag &= ~CSTOPB; //Set one stop bit options.c_cflag &= ~CRTSCTS; //options.c_cflag &= ~CSIZE; //Mask the character size bitsoptions.c_cflag |= (ICANON); options.c_cflag &= ~(IXON| IXOFF |IXANY); //No software flow control options.c_cc[VTIME]=0; options.c_cc[VMIN]=1; tcsetattr(fd, TCSANOW, &options); int flags; //clear DTR and RTS flags &= ~(TIOCM_DTR | TIOCM_RTS);ioctl(fd, TIOCMSET, &flags);usleep(200); //SET DTR flags |= TIOCM_DTR;ioctl(fd, TIOCMSET, &flags);usleep(200); //clear DTRflags &= ~(TIOCM_DTR);ioctl(fd, TIOCMSET, &flags);usleep(200); Kind Regards, Brett WhittacreVice Pre...@ec... ec2 Software Solutions3035 E. Patrick Ste. 1Las Vegas, Nevada, 89120P: 1.866.791.3673 ext 200 | F: 1.702.947.7357 www.ec2software.com Follow the rules. Exceed the standard. Kind Regards, Brett WhittacreVice Pre...@ec... ec2 Software Solutions3035 E. Patrick Ste. 1Las Vegas, Nevada, 89120P: 1.866.791.3673 ext 200 | F: 1.702.947.7357 www.ec2software.com Follow the rules. Exceed the standard. ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ Ftdi-usb-sio-devel mailing list Ftd...@li... https://lists.sourceforge.net/lists/listinfo/ftdi-usb-sio-devel ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ Ftdi-usb-sio-devel mailing list Ftd...@li... https://lists.sourceforge.net/lists/listinfo/ftdi-usb-sio-devel |