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

Question: Luna as a USB-UART bridge #176

Closed
francis2tm opened this issue Sep 17, 2022 · 1 comment
Closed

Question: Luna as a USB-UART bridge #176

francis2tm opened this issue Sep 17, 2022 · 1 comment
Labels
question question from the community that is not technical support

Comments

@francis2tm
Copy link

Hello!
I was wondering if Luna can be used out of the box as USB-UART bridge with an example. Do you think it's possible to generate a DTR and a RTS signals? Essencially I want to use the ECP5 to act like a USB-UART bridge to interface a ESP32 with a computer. It'd be amazing if it'd be possible to flash firmware via the USB-UART bridge to the ESP32 too! And the ESP32 can use DTR and RTS signals to put itself it bootloader mode, like so:
image
Do you think it's possible?
Thanks a lot ;)

@martinling
Copy link
Member

It's definitely possible, but would take a little gateware work.

There is an example in the repository, in examples/usb/acm_serial.py, of creating a device that shows up as a USB serial port (with TX looped back to RX in the example). The example uses a partial implementation of the CDC ACM specification, that can be found in luna/gateware/usb/devices/acm.py.

To create a complete USB-serial adapter you would need to combine that with some further logic that implements the UART side of the adapter. There is a simple transmitter in luna/gateware/interface/uart.py but not a receiver. You would also need to implement further parts of the CDC ACM spec in order to make the DTR and RTS signals controllable by the host.

@straithe straithe added the question question from the community that is not technical support label Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question question from the community that is not technical support
Projects
None yet
Development

No branches or pull requests

3 participants