Skip to content

Add support for Digilent probes#2793

Merged
bugadani merged 3 commits into
probe-rs:masterfrom
craigjb:digilent-probes
Sep 2, 2024
Merged

Add support for Digilent probes#2793
bugadani merged 3 commits into
probe-rs:masterfrom
craigjb:digilent-probes

Conversation

@craigjb
Copy link
Copy Markdown
Contributor

@craigjb craigjb commented Sep 2, 2024

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, and product_string. The product description is required because the USB vendor_id and product_id are 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 requires output: 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 ChipType in probe/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?

Copy link
Copy Markdown
Contributor

@bugadani bugadani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@bugadani bugadani added this pull request to the merge queue Sep 2, 2024
Merged via the queue into probe-rs:master with commit c84ad1b Sep 2, 2024
Comment on lines +95 to +96
// Digilent HS2
(0x0403, 0x6014, "Digilent Adept USB Device") => (0x00e8, 0x60eb),
Copy link
Copy Markdown

@darsor darsor Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

tracing::debug!("Opened FTDI device: {:?}", chip_type);

Copy link
Copy Markdown
Contributor Author

@craigjb craigjb Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably the Adept SDK has a robust way to detect which device it is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darsor If you don't mind, an upvote on this question may help: https://forum.digilent.com/topic/33686-detect-hs2-vs-hs3-hardware/

Copy link
Copy Markdown
Contributor Author

@craigjb craigjb Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
                },
            ],
        },
    ],
}

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

Successfully merging this pull request may close these issues.

3 participants