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

Create guide for using an ESP devboard with USB_UART bridge chip as serial adapter #4483

Merged
merged 17 commits into from
Dec 7, 2024
Merged
50 changes: 50 additions & 0 deletions guides/devboard_as_flasher.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Using an ESP devboard as a USB-UART bridge
==========================================

.. _devboard-as-flasher:

ESP development boards usually have an onboard USB interface, either built into the chip (e.g. ESP32-S3) or via an onboard USB-UART bridge chip.
However some ESP based devices not designed for development work don't bother with this,
and only expose the UART0 pins (TX and RX) for flashing purposes.

Normally you would use a dedicated USB-UART interface board for this but what if you don't have one?
In this "emergency" situation it is possible to use a development board that does have a USB-UART bridge chip to flash another device.
This is achieved by holding the ESP chip in reset so that it doesn't interfere with the bridge chip operation.

It does NOT require any firmware to be flashed onto the development board
and will not change anything already flashed onto it - it's purely a way to use the serial interface chip.

We will refer to the devboard with functional USB_UART bridge chip as flasher board for this guide.

Make sure you've read the :doc:`/guides/physical_device_connection` for properly understanding the functionality of your flasher devboard.

.. figure:: /guides/images/devboard-as-flasher.png
:align: center
:width: 75.0%

Connection diagram for an ESP flash target

You need to make the following electrical connections:

shvmm marked this conversation as resolved.
Show resolved Hide resolved
.. note::

- Most ESP32 S and C series boards do *not* have a separate USB-UART chip - they have it built into the ESP - so are not suitable for this application.
- The 5V connection on either board may be labelled either ``5V`` or ``VIN``. Some boards may not have a 5V connection and will require 3.3V only.
- Rather than powering the target board from the flasher board, it is also possible to use a separate power supply, just make sure all the ground pins are connected together.

- connect both ``EN`` and ``GND`` together in the flasher devboard
- ``+5.0V`` or ``3V3`` on the flasher devboard to ``VIN`` or ``3V3`` respectively of the target device
- ``GND``, or ground of flasher devboard to ``GND`` of the target device
- ``TX`` of flasher devboard to ``TX`` of the target device
- ``RX`` of flasher devboard to ``RX`` of the target device

Pulling down ``EN`` by connecting it to ``GND`` on the flasher board prevents
the ESP chip on flasher module from booting and polluting the serial lines.

.. note::

- If the board has not previously had ESPHome loaded, you may need to pull the ``IO0`` pin low (i.e. connected to ``GND``) to force the board into flash mode.
This must be done before power is applied.
- Do not connect 3V3 to VIN of the target devices with a 3V3 LDO as it may lead to brownouts.
shvmm marked this conversation as resolved.
Show resolved Hide resolved

Once the connections are made, plug the flasher board into your computer via USB and proceed with flashing the target board via whichever means you intend to use.
Binary file added guides/images/devboard-as-flasher-pi.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/images/devboard-as-flasher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions guides/physical_device_connection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Physically Connecting to your Device

The most difficult part of setting up a new ESPHome device is the initial
installation, which requires connecting your ESP device to a computer using a
cable.
data cable.

**You only need to do this once per device.** Once you've flashed ESPHome on a
device, you can use :doc:`/components/ota/index` to upload new
Expand Down Expand Up @@ -119,8 +119,9 @@ USB Port on Device

Development boards often come with a USB port built in. This USB port is
connected to a serial adapter, so you don't need a separate serial adapter. You
can use just a :ref:`USB cable <usb-cable>` to connect it to your computer to
program it.
can use just a :ref:`USB data cable <usb-cable>` to connect it to your computer to
program it. Additionally, a development board can also be used to flash other ESPs.
:doc:`Read more here. </guides/devboard_as_flasher>`

This isn't likely to be very useful without connecting additional sensors to it
by either soldering or using a breadboard, but you do not need anything else to
Expand Down Expand Up @@ -241,7 +242,8 @@ require different parts and tools.
.. _usb-cable:
* - :ref:`USB to micro-USB/mini-USB/USB-C <usb-cable>`
- If your target device has a USB port on it, you need the appropriate
cable to connect to it.
data cable to connect to it. A power only USB cable that usually
comes presupplied with powerbanks won't work.
- $3 to $10
- .. image:: /guides/images/usb-cable.jpg
:alt: From https://www.stockvault.net/photo/271754/usb-cable
Expand All @@ -259,6 +261,9 @@ require different parts and tools.

The `Tasmota website provides a good set of suggestions on what to buy
<https://tasmota.github.io/docs/Getting-Started/#needed-hardware>`_.

Any ESP development board with functioning USB_UART bridge chip can also be used instead.
:doc:`Read instructions here. </guides/devboard_as_flasher>`
- $3 to $10
- .. image:: /guides/images/usb-serial-adapter.jpg
:alt: From https://tasmota.github.io/docs/Getting-Started/
Expand Down
Loading