Flashing the Firmware - KL-Psychological-Methodology/TWatch-2020-ESM GitHub Wiki

If you have a new T-Wach 2020 (favorably V2) the first thing you need to do to get started with the firmware is to get it flashed onto the watch. If you later want to update the watch with a newer version of the firmware, the process will be the same.

Here we want to present two ways to flash the firmware on the watch: The Espressif Flash Download Tool (only available on Windows) and using PlatformIO on Visual Studio Code.

Espressif Flash Download Tool

Download the Flash Download Tools from https://www.espressif.com/en/support/download/other-tools You'll also need the compiled firmware, so download firmware.bin from our releases: https://github.com/KL-Psychological-Methodology/ESM-Firmware-for-T-Watch-2020-V2/releases/tag/v1.0.0

Start the Flash Download Tools and select ESP32 as chip Type, then click OK.

First Screen of Downoad Tool

On the next screen you can leave most of the settings as they are. Click the three dots at one of the list entries and navigate to the firmware.bin you downloaded. Enter 0x10000 in the field to the right, after the @. With the device not connected to the computer klick on the COM dropdown menu in the bottom right. Most likely the list will be empty. Connect the device to the computer via a USB-cable, and click that dropdown menu again. You should see a new option, select it. Click start on the bottom right, and wait for the status indicator to say FINISH.

Second Screen of Downoad Tool

After that you may need to disconnect the watch and remove then reinsert its battery. If everything went right the watch should display some text complaining about a missing SD card. The next step is then to configure the watch.

PlatformIO

Download and install Visual Studio Code from its website: https://code.visualstudio.com/ (please note that Visual Studio Code and Visual Studio are two different programs).

Once you have it installed open it and select the extensions tab on the left (the last symbol, which looks like four rectangles). Search for "PlatformIO", and click on install once you found it. Restart Visual Studio Code once the installation is complete.

Next, download or clone this repository, then open it in Visual Studio Code. Note: There is a limitation when compiling with PlatformIO on Windows, which can cause the compilation to fail for too long file names. As far as I am aware, this includes the whole path, so the process might fail if you put the project folder in too many subdirectories. For me, the path C:Users<user>\Documents\Github\TWatch-2020-ESM (with a 12 letter username) worked. You can recognize the issue when PlatformIO gives you an error message that some font files do not exist (which is not true).

Once you have opened the folder in Visual Studio Code, and everything is loaded, you can click on the checkmark in the blue bar at the bottom to compile the project. A terminal should open at the bottom of the window, indicating the progress. This might take a while, but when it's done there should be a line with "[SUCCESS]" written in green.

Now that you made sure that the firmware compiles correctly, connect the watch to the computer via a USB cable. Next, click the right facing arrow in the blue bar at the bottom. A new terminal should pop up, informing you on the progress of the upload process (at this point you will sometimes get a message that the device does not respond. This can be the case when multiple devices are connected via USB, e.g., a cellphone. Make sure to remove any devices that might cause this conflict, then try again).

Once PlatformIO is done it will reset the watch, which should then most likely show a message indicating that it can't find an SD card or config file. This is a message by the firmware, so if you see this, the process has worked, and you can move on to configuring the watch.

⚠️ **GitHub.com Fallback** ⚠️