-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add CH341 emulation class driver #1507
Open
TravisRo
wants to merge
22
commits into
hathach:master
Choose a base branch
from
TravisRo:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add CH341 class driver. This is not really a class but rather CH341 emulation firmware. It allows any supported general purpose microcontroller to appear to the host as a CH341 device (IC)
Add CH341 to built-in driver list (CFG_TUD_CH341)
Add CH341 example
Add ch441_device.c to rp2040/family.cmake. Add ch341_device.h include to tusb.h
unused parameters const static / static const TUSB_OPT_DEVICE_ENABLED / CFG_TUD_ENABLED CFG_TUD_MAX_SPEED=TUSB_SPEED_FULL
Added high speed descriptors though I'm not sure if the CH341 driver will work as a high speed device. Changed "buffer size" define names in tusb_config to clarify whether we are specifying fifo buffer sizes or endpoint max packet sizes
Remove floating point math Remove multi-interface support Remove un-needed logging Add missing comments Reduce memory footprint
I have build_arm and build_aarch64 workflows fully green lit. Hopefully the others will go through too. I had to setup my own self-hosted runner to get through your workflow maze. You can't even have a printf in the example code. yikes! |
tud_ch341_read_char tud_ch341_write_char tud_ch341_write_str
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the PR
Adds CH341 USB to serial emulation class.
Additional context
The CDC driver (for windows at-least) is problematic which is probably why all of the USB to serial IC manufacturers use their own proprietary driver. In my case, I was trying to implement an ESP32 programmer with a CDC interface only to discover that the windows CDC driver (usbser.sys) doesn't handle the RTS signal properly so there was no way to get it to work without modifying the esp scripts.
This CH341 emulation class supports all of the signals. DTR RTS CTS DSR RI DCD as well as BREAK.
Everything is working as of now with the latest master branch and an RP2040. I didn't look at the other bsp's so there may be a small amount of additional work to do.
Regards,
Travis Robinson
libusbdotnet@gmail.com (libusb-win32, libusbK, LibUsbDotNet)