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

USB CDC for reading and writing to host computer #577

Open
thealienthing opened this issue Apr 4, 2023 · 1 comment
Open

USB CDC for reading and writing to host computer #577

thealienthing opened this issue Apr 4, 2023 · 1 comment

Comments

@thealienthing
Copy link

I apologize if my question is too broad or if I'm simply asking the wrong question: but how do I use the USBHandle to write and read serial messages between the host and Daisy seed? I can see the ability to write to the USBHandle and handle it with a callback and my host PC can receive these messages too, but how can I create a true two way connection over the USB line? I'd like to write a serial interface application to be able to control my Daisy without the hardware peripheral and even facilitate unit testing.

The best I've been able to do is hack the Receive callback to write some kind of arbitrary response and then check in buffer on the next callback and ignore it if the input buffer matches what I just wrote, thus avoiding a feedback loop. But there's got to be a better way! Maybe there is a different class I'm overlooking but it feels reasonable that I should be able to have an arbitrary conversation over usb between my computer and Daisy! I appreciate any help and advice. Also, I'm trying to avoid adding a usb serial device to a Usart input as im trying to not add any more hardware and also have fewer usb jacks.

@takumi-ogata
Copy link

Hey thealienthing,

I'm really sorry for the delay in response.

What you're trying to do is possible.
We do it on the seed tester program all the time. We can type "RAM" from the PC, and it'll run a ram test and send back the results. So a 2-way communication totally works.

Unfortunately, we don't have any docs for serial in that direction nor a two-way example demonstrating what you're trying to do at the moment.
When we get a chance, we can either put together a quick example to share or at least paste relevant snippets from our tester firmware for you to see.

We would greatly appreciate your patience.

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

No branches or pull requests

2 participants