Add support for Digilent probes#2793
Conversation
| // Digilent HS2 | ||
| (0x0403, 0x6014, "Digilent Adept USB Device") => (0x00e8, 0x60eb), |
There was a problem hiding this comment.
I just got a few new Digilent HS2 probes (Rev. A) and the product string is "Digilent USB Device", so probe-rs configured them like an HS3 and they didn't work. Is there a more robust way to detect this?
There was a problem hiding this comment.
I think it may be possible by also using chip_type to distinguish. I think the HS3 uses a FT2232 and HS2 is FT232H. I don’t have a HS2 on hand to try though.
Could you run with tracing and see what chip type this reports?
There was a problem hiding this comment.
@darsor I finally have a Digilent HS2 on-hand as well. It and the Digilent HS3 present the exact same VID, PID, description string, and chip type. 🙁
HS3: (1027, 24596, Some("Digilent USB Device"), Some(FT232H))
HS2: (1027, 24596, Some("Digilent USB Device"), Some(FT232H))
The only difference I've found so far in the descriptors is max_power.
HS3: max_power: 0x32
HS3: max_power: 0xfa
It's kind of strange to differentiate devices off of details like that, but I don't see another good option yet. I may also reach out to Digilent to ask if there's a better way.
There was a problem hiding this comment.
Presumably the Adept SDK has a robust way to detect which device it is.
There was a problem hiding this comment.
@darsor If you don't mind, an upvote on this question may help: https://forum.digilent.com/topic/33686-detect-hs2-vs-hs3-hardware/
There was a problem hiding this comment.
@darsor Digilent responded saying there’s basically no way except their proprietary user flash data.
From my testing, at least for the dongle version of the HS2, the USB descriptor is different enough to detect. The max power is even enough for these two. I’ll verify with some other Digilent boards I have.
If you have a chance, could you verify that you see the same max power value in the HS2 USB descriptor? It should be dumped if you run with tracing.
There was a problem hiding this comment.
That's unfortunate. I just checked one of the HS2's we recently bought and it has max_power: 0xfa, so that looks like it may be the best method for now.
Full HS2 configuration descriptor
Configuration {
configuration_value: 0x1,
num_interfaces: 0x1,
attributes: 0x80,
max_power: 0xfa,
string_index: None,
interface_alt_settings: [
InterfaceAltSetting {
interface_number: 0x0,
alternate_setting: 0x0,
num_endpoints: 0x2,
class: 0xff,
subclass: 0xff,
protocol: 0xff,
string_index: Some(
0x2,
),
endpoints: [
Endpoint {
address: 0x81,
direction: In,
transfer_type: Bulk,
max_packet_size: 0x200,
packets_per_microframe: 0x1,
interval: 0x0,
},
Endpoint {
address: 0x02,
direction: Out,
transfer_type: Bulk,
max_packet_size: 0x200,
packets_per_microframe: 0x1,
interval: 0x0,
},
],
},
],
}
Change
This change sets different FTDI pin layouts depending on which probe is detected, which is required to support Digilent HS* JTAG probes.
The layout is determined by the
vendor_id,product_id, andproduct_string. The product description is required because the USBvendor_idandproduct_idare not enough to identify Digilent probes (e.g. Digilent HS2 & HS3 are the same).Background
I have several Digilent JTAG probes that are based on FTDI chips, but they did not work as expected when tested with probe-rs. After digging into the FTDI module, I found that probe-rs defaults the pin configurations to
output: 0x0008, direction: 0x000b. However, the Diligent probes require different values. For example, the Digilent HS3 requiresoutput: 0x2088, direction: 0x308b, otherwise it will not function. I found these values in the OpenOCD interface script: digilent_jtag_hs3.cfg.Question
I've hard-coded values for Digilent probes, just like
ChipTypeinprobe/ftdi/ftdaye/mod.rs. These values are needed to auto-detect the probe, so I don't think they should be run-time configuration or CLI parameters. However, should these be in some YAML that's compiled in like targets? Or, is it ok for now since there are so few?