问题
I'm trying to use libftdi to toggle some pins on an ft232rl, then use the regular Virtual Com Port (/dev/ttyUSB0). I've got a microcontroller (LPC1114) connected to an FT232RL for programming. To get it into ISP mode, it has to be reset with one line held low, and to execute code after programming, it has to be reset. I'm trying to automate this with the ft232. I've got libftdi working, and toggling pins correctly, but once the program finishes, the VCP has disappeared from /dev. Even using the libftdi example programs, I have to physically unplug and plug back in the USB cable, which completely defeats the purpose.
TL;DR: is there a way to get back /dev/ttyUSB0 after using libftdi in bitbang mode without unplugging the cable.
回答1:
LibFTDI seems to use LibUSB under the hood.
You clould try using libusb_attach_kernel_driver function from LibUSB to restore /dev/ttyUSBx
functionality.
来源:https://stackoverflow.com/questions/38404997/reinstate-virtual-com-port-after-using-libftdi-on-ft232rl