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

hal::FtHal::init_freq(device, 400_000)? expected Error, found TimeoutError #53

Open
circuit4u-medium opened this issue May 27, 2024 · 5 comments
Labels
question Further information is requested

Comments

@circuit4u-medium
Copy link

after
let device = libftd2xx::Ft232h::with_description("USB <-> Serial Converter")?;
then
let hal = hal::FtHal::init_freq(device, 400_000)?;

got this error message

image

@newAM
Copy link
Member

newAM commented May 27, 2024

Can you share the full code, and which version of this crate you are using?

This is similar to code that gets tested in lib.rs, it should work.

@circuit4u-medium
Copy link
Author

Thanks for the quick reply. Yes, cargo run the code in examples folder doesn't have any issue.

I was trying to run Rust code in a Jupyter notebook interactively. Here are the snippets:

image

@newAM
Copy link
Member

newAM commented May 27, 2024

Can you try :dep ftdi-embbeded-hal = { version = "0.22.0", features = ["libftd2xx", "libftd2xx-static"] }?

I'm not sure how the resolver works in jupyter, it might not have enabled those.

@circuit4u-medium
Copy link
Author

Thanks for the advice. I think the issue is resolved, but now there seems to be a new one:
image

@newAM
Copy link
Member

newAM commented May 28, 2024

That's from the underlying libftd2xx driver. Never seen that one before myself. libftd2xx is closed source; you can debug as far as the driver call, which is probably worthwhile to check the handle (pointer) is reasonable. There's also logging in the rust wrapper for the driver which will log the pointer.

If you're on Linux then the open source drivers are worth a try (requires different feature flags). The open source drivers are easier to debug.

@newAM newAM added the question Further information is requested label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants