-
Notifications
You must be signed in to change notification settings - Fork 2
USB To Serial Adapter
A USB-to-serial adapter is needed to flash devices that must be flashed using a serial connection. See Flashing for more details on how and why to flash a device.
USB-to-serial adapters can also be used for debugging purposes, to view the log that devices write to their serial port, especially when booting.
While there are many USB-to-serial adapters available on the market, you should be looking for the ones that have certain characteristics when purchasing one.
Look for converters that are terminated with wires or connectors or that allow attaching or soldering your own wires. Stay away from those terminated with a DB9 connector; you don't need a classic RS-232 serial port.
The adapter should have the following pins/wires available: GND
, TX
, RX
and VCC
(with possibly different namings).
The logic levels of the RX and TX pins must be 3.3V
. Some converters allow switching between 5V and 3.3V using a jumper.
Aside from the serial connection, your USB-to-serial convertor will be used to power the ESP chip. For that reason, it must have a dedicated VCC wire that offers 3.3V.
It must supply enough current for the chip, which is at least 200mA. Many converters don't supply this much at 3.3V. The presence of a big round capacitor on the board usually indicates the capability of supplying larger currents:
On Windows and macOS you'll probably need to install drivers that are specific to your adapter. You'll have to look them up online. On Linux, the majority of USB-to-serial adapters are supported out-of-the-box, so you don't need to worry about drivers.
Following are just some recommendations.
On Amazon:
On AliExpress:
If your adapter is not terminated with pins that can be easily inserted into programming sockets, you'll need to connect or solder jumper wires to it:
Some devices require a secondary GND
wire to be temporarily connected to their GPIO0
pin during boot, so that they boot in bootloader/flashing mode. You'll need to manually connect another wire to the existing ground (black) wire:
Identify the 4 required connectors/headers/pads on your device: GND
, TX
, RX
and VCC
. Device-specific wiki pages will help you do that. For devices that require a manual GPIO0
ground connection, you'll also have to identify it on the board.
The GND
and VCC
adapter wires need to be connected to the corresponding GND
and VCC
device connectors. However, adapter TX
must be connected to board RX
; similarly, adapter RX
will be connected to board TX
. If you're not sure which is which, try both variants, as there's no danger in mixing them up. Be sure though not to mix up GND
and VCC
! Connect the secondary GND
wire to GPIO0
if the device-specific instructions indicate so.
With the wires connected, you can plug/unplug the USB adapter into/from your laptop, powering and unpowering the device board. Use this method to reboot the device if needed.
When the adapter is plugged in, serial programs on your laptop should see a serial port that can be used to flash firmware or inspect the serial log.