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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃挕 [FEATURE] Support for CP2104 serial devices #305

Closed
gritd opened this issue Nov 7, 2022 · 7 comments
Closed

馃挕 [FEATURE] Support for CP2104 serial devices #305

gritd opened this issue Nov 7, 2022 · 7 comments
Labels
enhancement missing-issue-template The user has removed the issue template or failed to complete it properly.

Comments

@gritd
Copy link

gritd commented Nov 7, 2022

The changelog states the mt32pi can handle CP1202 serial devices but I have a board which uses the CP1204 which is not recognised, is that correct? Does this serial chip variation gets ignored or is this a matter of initalization time increase?

@dwhinham
Copy link
Owner

dwhinham commented Nov 7, 2022

No idea, no-one's tried a CP1204 until now.

Please run a debug build and provide logs showing the result of plugging in this device.

If we're lucky we might just need to add a VID/PID.

@gritd
Copy link
Author

gritd commented Nov 7, 2022

should be compatible but I can try and make a debug mt32pi, meanwhile, the VID/PID is: PID: 0xEA60 / VID:0x10C4

@dwhinham dwhinham added the missing-issue-template The user has removed the issue template or failed to complete it properly. label Nov 9, 2022
@ajhuitsing
Copy link

Hi,

Here's a patch which enables support for CP2104 USB serial chip, as suggested by @gritd

The Circle library already supports CP2102 USB serial chip, but restricts it to CP2102 by detecting the chip variant during initialization. This is too restrictive: the CP2104 is compatible (has even the same VID/PID) So this patch simply removes the explicit CP2102 variant check, and then it works like a charm :-)

circle-support-cp2104.patch.zip

@dwhinham: thanx for making this inspiring project!

@gritd
Copy link
Author

gritd commented Nov 30, 2022

confirmed! - CP2104 is detected and works super, thanks - hope this can make it into the next rev.

@dwhinham
Copy link
Owner

dwhinham commented Nov 30, 2022

Thank you both for the patch and for testing.

I can certainly include this patch for the next release, but really we should be aiming to upstream a fix into Circle so that other projects can benefit too.

cc'ing @rsta2, @hinxx:
Removing a part number check in the CP2102 driver (relevant code) apparently gets it working for CP2104, and possibly other members of the CP210x family as they appear to be very similar.

This PDF (page 2) suggests that the differences are very minor (e.g. number of stop bits supported).

Searching for partnum within the Linux driver also reveals where behaviour varies depending on the part number.

Would it make sense to rename the driver to "CP210x" and lift the part number check?
Unfortunately I don't have any of these devices myself to test but maybe we should track this issue upstream and gather more feedback?

Thanks!

@dwhinham dwhinham changed the title 馃挕 [FEATURE] well maybe 馃挕 [FEATURE] Support for CP2104 serial devices Nov 30, 2022
@rsta2
Copy link

rsta2 commented Dec 1, 2022

@dwhinham Good idea and thank you for giving an info to us! Unfortunately this cannot be included in the next Circle release any more, which was already scheduled for today, but I think we can deal with this soon after the release. I will come back on it.

dwhinham added a commit that referenced this issue Dec 1, 2022
This should get CP2104 and potentially other similar devices working.

Closes #305.
@dwhinham
Copy link
Owner

dwhinham commented Dec 1, 2022

Thanks Rene, and no problem with missing the window for the new Circle release as we have a workaround for the time being and it's easy enough for me to maintain patches.

I've applied a patch to deal with this in mt32-pi for now in 772fb15, so I think we can close this here and follow on with this issue over at rsta2/circle#329.

Cheers!

@dwhinham dwhinham closed this as completed Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement missing-issue-template The user has removed the issue template or failed to complete it properly.
Projects
None yet
Development

No branches or pull requests

4 participants