5

reading output from cat /dev/ttyACM0 results in beagle board freezing. It unfreezes when i unplug the usb serial.

So essentially my setup is a beagle board connected via a usb to my laptop, which is communicating with it via COM6. We also have it connected to the web via web sharing. I also have another usb connected to it from a Arduino Teensy++ controller. This controller is sending data via usb serial to the beagle board. The point of this exercise is to read the data from the usb serial.

The process of reading i use is cat /dev/ttyACM0. This results in the print of the first 2 lines of data, then the entire beagle board freezes. When u unplug the teensy++, it prints out like 10-20 lines (assuming whatever the buffer contains). Not sure why this is happening.

Can anyone help ? Thanks

Nick
  • 4,302
  • 2
  • 24
  • 38
  • Does it use some extra control lines like CTS? Maybe that's what the beagleboard is waiting for. – Evert Nov 01 '12 at 15:23
  • Not sure. Im going to check that out. But once the beagle board gets locked up, I unplug the USB and it spits out whats on the buffer (essentially everything thats been sent since the lockup. I sometimes get the following error when i unplug the USB: " [ 1757.210482] cdc_acm 1-1:1.1: acm_start_wb - usb_submit_urb(write bulk) failed: -19" – Jaspreet Singh Lidder Nov 02 '12 at 16:30
  • Also, check if the teensy++ is successfully sending the serial data all the time by checking it with a standard windows based application for reading serial data, for example bray's terminal or terraterm. Besides this, I think it has got something to do with the way your embedded linux is handling the usb serial device. Don't know what yet though. EDIT: I think it has something to with the way the serial port is being read. I think it's waiting for newline characters (and maybe minimum bytes read) from teensy++. Try setting the serial port to raw mode with stty: `stty raw -F /dev/ttyACM0` – Evert Nov 02 '12 at 22:04
  • I tried 'stty raw -F /dev/ttyACM0' and it freezes. When i unplug the teensy++, i get the following error: 'stty: /dev/ttyACM0: Input/output error' – Jaspreet Singh Lidder Nov 07 '12 at 19:47
  • What exactly do you mean by "freezing" ? Just that the program/terminal you are working with stops accepting input? What about other tasks on the system? If you have another terminal open over ssh/telnet does that also freeze? Also you may want to check serial port settings such as line mode and buffering, and consider testing with something more aware of serial ports than 'cat' is. – Chris Stratton Nov 11 '12 at 16:16

1 Answers1

2

Check the speed at which you are sending data, I have found if you send data too quickly to arduino you can fill the arduino buffer and it seems to lock up. Try adding delay to the output data, or make sure the arduino is emptying the buffer fast enough.

Wilsonator
  • 407
  • 1
  • 5
  • 14