# Flashing the ESP8266 with the Arduino IDE

Flashing the ESP8266 with the newest version of the ESP8266/Arduino can be tedious with the off brand FTDI programmers.

* * *

## Problems with knockoff FTDI programmers

The new version of ESP8266/Arduino offers different flashing methods than the previous versions, which are the CK and NodeMCU methods. These new methods allow the flashing tool to automatically reset the ESP8266 into boot loader mode. This is convenient if you have a NodeMCU or the right FTDI programmer. I have a cheap knock off FTDI programmer in which the CK flashing method does not work with.

The table below shows the correct connections for using the esptool-ck method of flashing. The FTDI programmer that I use does not have the "RTS" pin. Alternatively it has a "CTS" pin. I figured the FTDI programmers were the exact same, but after attempting to flash with this method I was convinced otherwise.

[The current version of ESP8266/Arduino uses the esptool-ck flashing method](https://github.com/igrr/esptool-ck)

<table class="table-bordered">

<thead>

<tr>

<th>Name</th>

<th>Description</th>

</tr>

</thead>

<tbody>

<tr>

<td>none</td>

<td>No DTR/RTS manipulation</td>

</tr>

<tr>

<td>ck</td>

<td>RTS controls RESET or CH_PD, DTR controls GPIO0</td>

</tr>

<tr>

<td>wifio</td>

<td>TXD controls GPIO0 via PNP transistor and DTR controls RESET via a capacitor</td>

</tr>

<tr>

<td>nodemcu</td>

<td>GPIO0 and RESET controlled using two NPN transistors as in [NodeMCU devkit](https://raw.githubusercontent.com/nodemcu/nodemcu-devkit/master/Documents/NODEMCU_DEVKIT_SCH.png).</td>

</tr>

</tbody>

</table>

</div>

## The Solution

Unfortunately the current version of ESP8266/Arduino does not offer alternative methods of flashing. After hours of frustration I finally figured out a solution to the problem.

The methods to flash the ESP8266 within the Arduino IDE can be adjusted. I first thought I needed to download another method to flash with such as the [esptool.py](https://github.com/themadinventor/esptool), but I found a much easier solution. The "boards.txt" file can be edited, which allowed more customization to the flashing settings within the Arduino IDE. This is the path on my system.

/Users/$USER/Library/Arduino15/packages/esp8266/hardware/esp8266/2.1.0/boards.txt

The reset method needs to be changed from "ck" to "none" in order for this to work properly.

```bash
generic.upload.resetmethod=ck
```

to

```bash
generic.upload.resetmethod=none
```

Because we are not using the CK flashing method, we need to boot up the ESP8266 into boot loader mode manually.

```bash
	GPIO0 -> gnd
	VCC   -> 3.3v
	CH_PD -> 3.3v
	GND   -> gnd
	TX    -> RX
	RX    -> TX
```

The ESP8266 must be powered by an external 3.3v power supply, because the FTDI programmer cannot supply enough current. Also keep in mind that the ground of the FTDI programmer MUST be connected to the same ground that the ESP8266 is connected to. If this is not done it will not flash.

This should solve any problems flashing with a knockoff FTDI programmer.
