Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iceprog leaves FTDI device in odd mode #194

Open
osresearch opened this issue Dec 15, 2018 · 1 comment
Open

iceprog leaves FTDI device in odd mode #194

osresearch opened this issue Dec 15, 2018 · 1 comment

Comments

@osresearch
Copy link
Contributor

On the upduino v2 with ice40 up5k and an FTDI 232H chip, the device enumerates as a serial device and creates /dev/ttyUSB0. I can send/receive data from the board fine:

[1455866.817013] usb 1-1: new high-speed USB device number 90 using xhci_hcd
[1455866.957203] usb 1-1: New USB device found, idVendor=0403, idProduct=6014
[1455866.957211] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[1455866.957216] usb 1-1: Product: Single RS232-HS
[1455866.957220] usb 1-1: Manufacturer: FTDI
[1455866.958328] ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
[1455866.958487] usb 1-1: Detected FT232H
[1455866.958846] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0

When the board is reprogrammed with iceprog, however, it disconnects from /dev/ttyUSB0:

[1455919.013105] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[1455919.013132] ftdi_sio 1-1:1.0: device disconnected

In order to have it re-enumerate and see the serial output from the FPGA, I have to unplug/re-plug the cable. Is there a way to have iceprog switch the FTDI back into serial mode after programming?

@osresearch
Copy link
Contributor Author

As a workaround, I'm able to add this to my Makefile for forcing a reset, flashing the device, and then re-attaching the /dev/ttyUSB0 port to the FTDI SIO kernel driver:

%.flash: %.bin
        iceprog -e 128 # Force a reset to stop any serial output
        iceprog $<
        echo 1-1:1.0 > /sys/bus/usb/drivers/ftdi_sio/bind  # re-attach serial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant