Part Number:PROCESSOR-SDK-AM335X
Tool/software: Linux
Hi,
We use USB to connect Beaglebone Black and a CC26XX based device. On the BBB side, we have a C program that opens /dev/ttyUSB1 interface and sets up UART communication.
During our test, we see Babble error as it is shown below. I understand there are many E2E discussions about this issue, but my question is how I can restore the UART communication after the Babble error occurs. In our program, the UART read will return error status when the Babble interrupt happens and ttyUSB1 is disconnected. After enumeration, /dev/ttyUSB1 becomes /dev/ttyUSB2, and our program tries to close the original file descriptor and open the new file descriptor with /dev/ttyUSB2. Though all the close(), open() and UART setup return successful status, nothing is return from read() afterwards. However, if we kill the program and open /dev/ttyUSB2 with the exact same code, the UART communication is back successfully, and we don't have to reboot the BBB. This is the part I don't understand. Do I need to do anything beside close() in the program to completely release the USB? Does anyone has suggestions?
[771881.001017] musb-hdrc musb-hdrc.1.auto: Babble
[771881.005688] musb-hdrc musb-hdrc.1.auto: Babble
[771881.010269] musb-hdrc: setup fifo_mode 4
[771881.010296] musb-hdrc: 28/31 max ep, 16384/16384 memory
[771881.010787] usb 1-1: USB disconnect, device number 9
[771881.021280] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[771881.021486] ftdi_sio 1-1:1.0: device disconnected
[771881.022706] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
[771881.022777] ftdi_sio 1-1:1.1: device disconnected
[771881.424364] usb 1-1: new full-speed USB device number 10 using musb-hdrc
[771881.553715] usb 1-1: New USB device found, idVendor=0403, idProduct=6010
[771881.553748] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[771881.553763] usb 1-1: Product: Dual RS232
[771881.553778] usb 1-1: Manufacturer: FTDI
[771881.562408] ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
[771881.562765] usb 1-1: Detected FT2232C
[771881.565684] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
[771881.570606] ftdi_sio 1-1:1.1: FTDI USB Serial Device converter detected
[771881.570965] usb 1-1: Detected FT2232C
[771881.577045] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB2
Regards,
Jianwei