> ## Documentation Index
> Fetch the complete documentation index at: https://rambros3d.com/llms.txt
> Use this file to discover all available pages before exploring further.

> Guide to flash Bluetooth Control Firmware for Locomotive control boards such as Tracklinks and G-Tracks

# Firmware flashing

<img src="https://mintcdn.com/risetwynfishcom/jFyLYYUHumCUJL-C/images/train-control-remotexy.gif?s=ad39dbf5d08019eba9a82cd8ffaf261a" alt="Train Control Remotexy" width="600" height="450" data-path="images/train-control-remotexy.gif" />

## Prerequisites:

* **VS Code** - [**DOWNLOAD**](https://code.visualstudio.com/Download)
* **Pioarduino** - install it from VS code extension manager

<img src="https://mintcdn.com/risetwynfishcom/7JONMSbi_wrMN5gE/images/install-pioarduino.jpg?fit=max&auto=format&n=7JONMSbi_wrMN5gE&q=85&s=e6caab88a50af5286fd5a9d1662eaa50" alt="Install Pioarduino" width="1381" height="420" data-path="images/install-pioarduino.jpg" />

## 1) Clone repository

Go to **Source Control** (Ctrl+Shift+G) and clone this repository

<Check>
  ###### Repo URL - Locomotive BLE control: [https://github.com/DragonRailway/TrainControl\_BLE](https://github.com/DragonRailway/TrainControl_BLE)
</Check>

<img src="https://mintcdn.com/risetwynfishcom/SXIfefygD4DuaOEE/images/cloning-repository.png?fit=max&auto=format&n=SXIfefygD4DuaOEE&q=85&s=17523cbde9550b8fab9a7ca72c7fc8e5" alt="Cloning Repository" className="mr-auto" width="661" height="173" data-path="images/cloning-repository.png" />

Click `"Yes, I trust the authors"`

<img src="https://mintcdn.com/risetwynfishcom/SXIfefygD4DuaOEE/images/confirm-trust-authors.png?fit=max&auto=format&n=SXIfefygD4DuaOEE&q=85&s=f5c4d9da52f8653a54a928f07ee45b82" alt="Confirm Trust Authors" width="1307" height="471" data-path="images/confirm-trust-authors.png" />

Once the Cloning is complete, **Open** the repository

<img src="https://mintcdn.com/risetwynfishcom/SXIfefygD4DuaOEE/images/open-cloned-repository.png?fit=max&auto=format&n=SXIfefygD4DuaOEE&q=85&s=a634a8d08fc308f01b8265c81544bb7e" alt="Open Cloned Repository" width="807" height="325" data-path="images/open-cloned-repository.png" />

## 2) Select your Control Board

Leave it as Default if you're using `TRACKLINK-V3`

<img src="https://mintcdn.com/risetwynfishcom/4eltUBuc9VMD-d4K/images/select-train-board.jpg?fit=max&auto=format&n=4eltUBuc9VMD-d4K&q=85&s=8ae1b37c19420cef61da06daf5d02e5a" alt="Select Train Board" width="1920" height="1080" data-path="images/select-train-board.jpg" />

## 3) Connect and Upload

<Warning>
  While uploading code for the first time, you might have to manually enter boot mode by clicking **RST** button while holding **BOOT** button.
</Warning>

<img src="https://mintcdn.com/risetwynfishcom/7JONMSbi_wrMN5gE/images/upload-code.jpg?fit=max&auto=format&n=7JONMSbi_wrMN5gE&q=85&s=68b91f28a27e8e2eedca56024c3d48d6" alt="Upload Code" width="1482" height="491" data-path="images/upload-code.jpg" />

<Note>
  After uploading code, the RemoteXY app will need to authenticate for connection. Use password: **1234**
</Note>
