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

Add parameter to specify BOOT and ENABLE pins on usbserial dongle #20

Open
Harvie opened this issue Aug 13, 2019 · 10 comments
Open

Add parameter to specify BOOT and ENABLE pins on usbserial dongle #20

Harvie opened this issue Aug 13, 2019 · 10 comments

Comments

@Harvie
Copy link

Harvie commented Aug 13, 2019

Hello,
i have ESP32 development board, which has ENABLE (RESET) pin connected to DTR of FTDI usb serial converter. This works very well when flashing ESP32 using Arduino IDE, but does not work when using mos flash, because mos tool seems to use RTS pin of FTDI rather than DTR.

Can you please add arguments, so i can specify this? Eg. something like:

mos flash --port /dev/ttyUSB1 --pin-reset=DTR --pin-bootloader=CTS

This would be super usefull for me.

@rojer
Copy link
Contributor

rojer commented Aug 13, 2019

CTS is an input pin, do you mean RTS?

@Harvie
Copy link
Author

Harvie commented Aug 14, 2019

CTS is an input pin, do you mean RTS?

Didn't knew that. I don't really care about bootloader pin, because i switch it manualy. But the reset pin is important for me. Still i guess other people might need to specify bootloader pin.

@pohy
Copy link

pohy commented Aug 21, 2019

Hello, I encountered the same problem. Solved it by swapping DTR and RTS.
It's quick and dirty: pohy@6e26973

@Harvie
Copy link
Author

Harvie commented Aug 26, 2019

@pohy cool! @rojer do you think we can have commandline option for this ^^^ ?

@Harvie
Copy link
Author

Harvie commented Aug 31, 2019

CTS is an input pin, do you mean RTS?

I've just realized that CTS pin of FTDI usb2serial is bidirectional. Hence my confusion. It would be great if MOS provided also support for reset using FTDI bitbang mode, it's quite common series of chips and the api is compatible across all FTDI products, so it should be easy to do.

Idealy support both like this:

--pin-reset=DTR --pin-bootloader=RTS

or

--ftdi --pin-reset=DTR --pin-bootloader=CTS

@rojer
Copy link
Contributor

rojer commented Aug 31, 2019

not as easy as it seems. we'd need ftdi-specific api to control it, since normally cts is input-only.

@Harvie
Copy link
Author

Harvie commented Aug 31, 2019

@rojer i am fully aware of this. hence i suggested the --ftdi flag to switch between the native serial and ftdi APIs...

@rojer
Copy link
Contributor

rojer commented Aug 31, 2019

i mean, before committing to tis, i'd like to know how common this is.
swapping dtr and rts - ok, sure. but using cts as output - why, when you have rts available?

@Harvie
Copy link
Author

Harvie commented Aug 31, 2019

Because FTDI is very often sold in device called "FTDI cable", which has following pinout:
image

They sell these FTDI cables everywhere. And they come in various forms, like actual cable:

image

or even PCB with same pinout as the cable:

image

(This one has additional pin header to work as arduino ISP, but unfortunately there is not RTS...)

To be honest i would be happy for dtr/rts swap, but having support for classic FTDI cable would certainly be usefull.

Currently we have hand soldered programming jigs involving pieces of wire and hot glue. It would be nice to be able to use something cheap and easily accesible.

@rojer
Copy link
Contributor

rojer commented Aug 31, 2019

ok, this makes sense.
i think this could be done in two steps:

  • add two string flags --esp-ctl-rst and --esp-ctl-boot, defaulting to RTS and DTR respectively
  • add support for CTS as a value, specifically fro FTDI chips.
    are you able to do one or both of these and send a PR?

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

3 participants