Peter Stuge wrote: > Stacey Sheldon wrote: >> This commit adds the 'ft2232_bus_addr' configuration >> command which allows the user to specify the fully >> qualified bus address of the ft2232 device. > > I think this is a good addition, but.. > > >> The format of the address is the same as for the >> equivalent -s option in lsusb for selecting the device: >> <bus>:<devnum> >> >> For example, if lsusb reports something like this: >> Bus 002 Device 084: ID 0403:6010 Future Technology Devices >> International, Ltd FT2232C >> Dual USB-UART/FIFO IC >> >> Then this configuration command will select this device in >> openocd: >> ft2232_bus_addr 002:084 > > ..unfortunately this documentation does not agree with the code.
> For the above device lsusb would also accept -s 2:84 without padding. Yeah, lsusb is quite accommodating in how you specify the device. I considered allowing those features in my patch as well but dropped them to better support this on all platforms (see below). > IMO this is highly desirable also in openocd, but it may not be > completely unproblematic since I am not convinced that this way of > specifying a bus address is actually consistent across all platforms > supported by libusb. In particular I think Windows may provide > another type of bus address. I have to check this. I agree, the specification of bus address is very likely to be different across platforms. I wasn't able to check other platforms for myself so I tried to code this as generically as possible. The reason that I'm doing only a simple strncmp() on the user-specified config string and the ":" concatenated literal values contained in the ->dirname and ->filename members is so that the code could automatically support different notation on different platforms. It makes no assumptions about the contents (ie. safe to drop leading zeros) of the dirname and filename members. This way, if windows puts ->dirname="the dirname" and ->filename="the filename" then the windows config file would need to be: ft2232_bus_addr "the dirname:the filename" I don't have any idea how to find out the contents of these fields on windows other than having openocd dump it out. The patch provides this if you turn on -d. Look for "Considering ftdi device at bus addr" in the output. If you'd like, I can resubmit the patch after adding the clarification about requiring all leading zeros in the bus:devnum for now. Was the leading zeros requirement the only discrepancy between docs/code or were there others? Once the contents of dirname and filename are known on other platforms, it may be possible to make the config spec more user friendly. That could be enhanced in a future commit. Thanks for the comments. Stacey. _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
