Parasite ATtiny Resets Your ESP32 For You

Embedded development can be a tough process. Between weird electrical gremlins, obscure bugs and our own mistakes, it can be a real struggle at times. To keep cognitive loads to a minimum, it’s best to make sure your tools are as simple and easy to use as possible. [tech] got tired of having to push a button to prepare the ESP32 for programming, and decided to solve the problem.

The solution comes via another microcontroller, in this case an ATtiny9. The small device listens in on the ESP32’s serial receiving pin. When it detects the Arduino IDE’s boot sequence on the line, it switches the BOOT0 and RESET lines on the ESP32, emulating the button presses to force it into programming mode.

Once you’ve become accustomed to one-click programming your ESP boards, you’re not going to want to go back. We could imagine this hack being replicated in a tidy piggyback format so it could be moved from board to board as workflow dictates.

If you’ve got an ESP32 lying around and don’t know what to do with it, you could always consider getting into game development.


28 thoughts on “Parasite ATtiny Resets Your ESP32 For You

    1. Was thinking the same… Even the ESP-IDF uses the RTS and DTR pins, so i don’t get why would you need something like this on a development board
      But I think it is a neat idea, but not for that… Maybe for an external Watchdog or a power supply guard

          1. I’ve seen schematics for simpler versions of this setup that used an RC network with a transistor to hold the correct pins low if the serial line spends too long low. (this is what the break key did on old terminals and signaled the mainframe to change baudrates)vI think it was provided by one of the developers of the arduino port to the esp8266.

    1. Not all boards that have an esp will come with enough free flash to transfer the image ota. I can name quite a few times where I wish this was possible but had to use the manual flashing mode.

    1. I have a visually identical board, and the automatic RTS/DTR rebooting works very erratically – it reboots the board, but most of the time it boots up in the normal (non-bootloader) mode. I guess that the author’s board behaves in a similar way, giving the impression that there are no provisions for automatically entering the bootloader mode.

      1. The inspiration was actually from an old co-worker talking about doing just that same thing years with one of those analog timers on an old closed server that would just fill with garbage every few days and had to be reset :P

        1. “have you tried turning it off and then on again? ” shouldn’t be a often employed solution, but it’s the only one that’s gotten a consistent and reliable track record.

  1. Why not just do a basic flip flop? Think Forrest Mims.

    Otherwise use a pair of NPN transistors and trigger the GPIO 0 and RST lines via the USB serial adapter you have on hand? DTR and RTS pins… Should be selectable as to which programming method you are using in either PlatformIO or in Arduino IDE.

  2. the earlier esp32 boards all seemed to do it automatically, but recently (last few months) many seem to have settled on a design that you HAVE to hit the button…

    I think it is because they want to maximize the usable pins broken out..

    It’s very annoying

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.