ampy icon indicating copy to clipboard operation
ampy copied to clipboard

The reason why ampy is unreliable for a large number of boards, like ESP32CAM etc...

Open gitcnd opened this issue 1 year ago • 2 comments

Many boards use the serial RTS and DTR pins to control the MCU reset and GPIO0 lines - to enable "hardware reset" and firmware uploads for your board.

For example - here's a simple, working, perl terminal-emulator for all boards which do this:

https://github.com/gitcnd/mcu_serial

Unfortunately, ampy doesn't control either of those lines, so you're at the random mercy of whatever your host device decides to do with them... and if either of those 2 are held in the wrong state, this "locks up" your MCU, preventing ampy from talking to it.

See my above perl code for examples of how to properly control those lines. I don't know enough python to work out how to do the equivalent to fix this bug...

gitcnd avatar Jan 16 '24 02:01 gitcnd

update: turns out this is a python deficiency, but it can be worked-around:

https://github.com/pyserial/pyserial/issues/729

See https://github.com/micropython/micropython/commit/f27593e960ff19e2b8374606658cda66765ffbcb

gitcnd avatar Jan 16 '24 22:01 gitcnd

fixed: https://github.com/scientifichackers/ampy/pull/126

gitcnd avatar Jan 16 '24 22:01 gitcnd