# BIGTREETECH-TouchScreenFirmware
**Repository Path**: ccstl/BIGTREETECH-TouchScreenFirmware
## Basic Information
- **Project Name**: BIGTREETECH-TouchScreenFirmware
- **Description**: No description available
- **Primary Language**: C
- **License**: GPL-3.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 2
- **Created**: 2023-12-12
- **Last Updated**: 2023-12-12
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# BigTreeTech TFT Touchscreen
[](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/graphs/contributors)
[](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/actions/workflows/buildBinary.yml)
Important information related to BigTreeTech's TFT touchscreen 3D printer controllers

## Table of Contents
- [Supported Screens](#supported-screens)
- [Software Repository](#software-repository)
- [Marlin Dependencies](#marlin-dependencies)
- [Connecting the TFT to the Mainboard](#connecting-the-tft-to-the-mainboard)
- [Touch Mode Setup](#touch-mode-setup)
- [Setting the Baudrate on the TFT Firmware](#setting-the-baudrate-on-the-TFT-firmware)
- [Marlin Mode Setup](#marlin-mode-setup)
- [Menus and Themes](#menus)
- [Firmware Update](#firmware-update)
- [Deployment Files](#deployment-files)
- [Firmware Binary](#firmware-binary)
- [Fonts and Icons](#fonts-and-icons)
- [Configuration File](#configuration-file)
- [Optional - Language Files](#optional---language-files)
- [Configuration](#configuration)
- [Editing the Configuration File](#editing-the-configuration-file)
- [Installation](#installation)
- [Post Installation](#post-installation)
- [Configuration Update](#configuration-update)
- [Touch Screen Calibration](#touch-screen-calibration)
- [Forcing the Touch Screen Calibration](#forcing-the-touch-screen-calibration)
- [Hard Reset](#hard-reset)
- [Resetting to Default Settings](#resetting-to-default-settings)
- [Customization](#customization)
- [Bootscreen and Icons](#bootscreen-and-icons)
- [Firmware](#firmware)
- [Vertical Screen Orientation - Portrait Mode](#vertical-screen-orientation---portrait-mode)
- [Troubleshooting](#troubleshooting)
- [Firmware Update Failed](#firmware-update-failed)
- [Worst Case Scenario](#worst-case-scenario)
- [Version History](#version-history)
- [Appendix](#appendix)
- [Printing from Host](#printing-from-host)
- [Printing from Remote Host](#printing-from-remote-host)
- [Adding Gcode Thumbnails](#adding-gcode-thumbnails)
- [TFT Screen Configuration and Support for RRF](#tft-screen-configuration-and-support-for-rrf)
- [Overview](#overview)
- [Loading the Firmware](#loading-the-firmware)
- [Configuration Changes](#configuration-changes)
- [Implemented Features](#implemented-features)
- [Menu System for Macros](#menu-system-for-macros)
- [Setup of BTT TFT35 E3 V3 with MKS SGEN L Mainboards](#setup-of-btt-tft35-e3-v3-with-mks-sgen-l-mainboards)
- [Connections](#connections)
- [Firmware](#firmware)
- [Show more statistics at the end of the print](#show-more-statistics-at-the-end-of-the-print)
## Supported Screens
Only the TFTs listed below are currently supported. Trying to install the firmware on a TFT which is not supported can harm the hardware.
**BTT TFT**
BTT_TFT24_V1.1
BTT_TFT28_V1.0 and V3.0
BTT_TFT35_V1.0, V1.1, V1.2, V2.0, V3.0, E3_V3.0 and B1_V3.0
BTT_TFT43_V3.0
BTT_TFT50_V3.0
BTT_TFT70_V3.0
**BTT GD TFT**
BTT_GD_TFT24_V1.1
BTT_GD_TFT35_V2.0, V3.0, E3_V3.0 and B1_V3.0
BTT_GD_TFT43_V3.0
BTT_GD_TFT50_V3.0
BTT_GD_TFT70_V3.0
**MKS TFT**
MKS_TFT28_V3.0 and V4.0
MKS_TFT32_V1.3 and V1.4
MKS_TFT32L_V3_0
MKS_TFT35_V1_0
**WARNING:** BTT does not officially provide MKS TFT hardware support. MKS TFT is maintained by open source contributors and BTT does not bear any risk of MKS TFT hardware using this firmware.
## Software Repository
Firmware source: https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware
Main branch: **Master**
In the **Master** branch you will find:
- The most recent source code updates
- The most recent resources such as precompiled firmwares, themes, configuration and language files
**IMPORTANT NOTE:** The **Master** branch is currently the **ONLY** branch in the project to be used. The other currently existing branches **develop** and **release-xx.27** are outdated and **MUST NOT** be used.
## Marlin Dependencies
Minimum Marlin firmware version: **2.1.1**
Distribution date: **2022-09-22**
Firmware source: https://github.com/MarlinFirmware/Marlin/releases
To use all the features and functionalities supported by the TFT,
the following options must be enabled in Marlin firmware.
**General options which MUST be always activated:**
`EEPROM_SETTINGS` (in Configuration.h)
`BABYSTEPPING` (in Configuration_adv.h)
`AUTO_REPORT_TEMPERATURES` (in Configuration_adv.h)
`AUTO_REPORT_POSITION` (in Configuration_adv.h)
`EXTENDED_CAPABILITIES_REPORT` (in Configuration_adv.h)
`M115_GEOMETRY_REPORT` (in Configuration_adv.h)
`M114_DETAIL` (in Configuration_adv.h)
`REPORT_FAN_CHANGE` (in Configuration_adv.h)
**Options to support printing from onboard media:**
`SDSUPPORT` (in Configuration.h)
`LONG_FILENAME_HOST_SUPPORT` (in Configuration_adv.h)
`AUTO_REPORT_SD_STATUS` (in Configuration_adv.h)
`SDCARD_CONNECTION ONBOARD` (in Configuration_adv.h)
**Options to support dialog with host:**
`EMERGENCY_PARSER` (in Configuration_adv.h)
`SERIAL_FLOAT_PRECISION 4` (in Configuration_adv.h)
`HOST_ACTION_COMMANDS` (in Configuration_adv.h)
`HOST_PROMPT_SUPPORT` (in Configuration_adv.h)
`HOST_STATUS_NOTIFICATIONS` (in Configuration_adv.h)
**Options to support M73 with host:**
`Options to support dialog with host` (as pre requisite)
`SET_PROGRESS_MANUALLY` (in Configuration_adv.h)
`M73_REPORT` (in Configuration_adv.h)
**Options to support ADVANCED_OK with host:**
`ADVANCED_OK` (in Configuration_adv.h)
**Options to support M600 with host & (Un)Load menu:**
`Options to support dialog with host` (as pre requisite)
`NOZZLE_PARK_FEATURE` (in Configuration.h)
`ADVANCED_PAUSE_FEATURE` (in Configuration_adv.h)
`PARK_HEAD_ON_PAUSE` (in Configuration_adv.h)
`FILAMENT_LOAD_UNLOAD_GCODES` (in Configuration_adv.h)
**Options to fully support Bed Leveling menu:**
`Z_MIN_PROBE_REPEATABILITY_TEST` (in Configuration.h)
`G26_MESH_VALIDATION` (in Configuration.h)
`Z_STEPPER_AUTO_ALIGN` (in Configuration_adv.h)
## Connecting the TFT to the Mainboard
### Touch Mode Setup
In order to use the Touch Mode on your screen:
1. Connect the 5pin serial cable according to the manual of your mainboard
2. Define a serial port in Marlin, to activate the port used by the TFT
3. Make sure the same BAUDRATE is defined on both the Marlin and TFT firmwares
In case one of the three points above is not properly done, the message:
No printer attached!
will be shown at the top of the screen. This is because the TFT can not "see" the mainboard through the serial cable.
#### Setting the Baudrate on the TFT Firmware
On TFT firmware, the baudrate can be changed in two ways:
- by menu: After the firmware is installed, the baudrate can be changed from **Menu->Settings->Connection->S. Ports** menu
- by configuration file: Set the parameter `serial_port` in `config.ini` file with the proper baudrate (e.g. `serial_port:P1:6` for baudrate 115200). Please, see [Configuration](#configuration) section for configuring `config.ini` file
### Marlin Mode Setup
In order to use the Marlin Mode (emulation mode) on your screen:
1. In case your TFT does **not** have an EXP connector at all (TFT28 v1 for example), you can not use the Marlin emulator mode.
2. In case your mainboard provides **EXP1 and EXP2**, you have to connect 2 ribbon cables connecting EXP1 and EXP2 of the mainboard to EXP1 and EXP2 of the TFT. In the Marlin firmware of your mainboard, make sure that **ONLY** `REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER` is activated in `Configuration.h` and that all other controllers are **De**activated (especially `CR10_STOCKDISPLAY`).
3. In case you have an **"E3" mainboard** which provides a **single EXP connector**, you have to connect 1 ribbon cable connecting EXP of the mainboard to **EXP3** of the TFT. In case your TFT does **not** provide an EXP3 connector but only two 10pin connectors (TFT24 v1.1 for example) you will need a "Y-split" cable with one 10pin connector on one side (for the mainboard) and two 10pin connectors on the other side (for the TFT). In the Marlin firmware of your mainboard, make sure that **ONLY** `CR10_STOCKDISPLAY` is activated in `Configuration.h` and that all other controllers are **De**activated (especially `REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER`).



## Menus
| Status Screen DISABLED | Status Screen ENABLED |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
|  |  |
| If **status_screen:0** is not defined in **config.ini**, define:
# UI Settings
# Status Screen
# Select the Main Screen flavour
# Options: [disable: 0, enable: 1]
**status_screen:0** | If **status_screen:1** is not defined in **config.ini**, define:
# UI Settings
# Status Screen
# Select the Main Screen flavour
# Options: [disable: 0, enable: 1]
**status_screen:1** |
## Themes
| Unified Menu Theme | The Round Miracle Theme by **[Acenotass](https://github.com/Acenotass)** |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
|  |  |
| Use firmware, icons, and fonts from the [`Copy to SD Card root directory to update - Unified Menu Material theme`](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/tree/master/Copy%20to%20SD%20Card%20root%20directory%20to%20update/THEME_Unified%20Menu%20Material%20theme) folder | Use firmware, icons, and fonts from the [`Copy to SD Card root directory to update - The Round Miracle theme`](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/tree/master/Copy%20to%20SD%20Card%20root%20directory%20to%20update/THEME_The%20Round%20Miracle%20Menu%20Material%20theme) folder |
| Hybrid Red Material Theme by **[AntoszHUN](https://github.com/AntoszHUN)** | Hybrid Mono Material Theme by **[bepstein111](https://github.com/bepstein111)** |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
|  |  |
| Use firmware, icons, and fonts from the [`Copy to SD Card root directory to update - Hybrid Red Menu Material theme`](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/tree/master/Copy%20to%20SD%20Card%20root%20directory%20to%20update/THEME_Hybrid%20Red%20Menu%20Material%20theme) folder | Use firmware, icons, and fonts from the [`Copy to SD Card root directory to update - Hybrid Mono Menu Material theme`](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/tree/master/Copy%20to%20SD%20Card%20root%20directory%20to%20update/THEME_Hybrid%20Mono%20Menu%20Material%20theme) folder |
| Rep Rap Firmware Dark Theme by **[xPew](https://github.com/xPew)** | |
| :----------------------------------------------------------: | ------------------------------------------------------------ |
|  |  |
| Use firmware, icons, and fonts from the [`Copy to SD Card root directory to update - Rep Rap Firmware Dark theme`](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/tree/master/Copy%20to%20SD%20Card%20root%20directory%20to%20update/THEME_Rep%20Rap%20Firmware%20Dark%20theme) folder | |
## Firmware Update
The TFT firmware update process is based on the following stages:
1. [Deployment Files](#deployment-files): All the resources needed for the firmware update (up to four kinds of resources)
2. [Configuration](#configuration): All the changes needed on configuration file before the firmware installation
3. [Installation](#installation): All the steps needed in order to install the firmware
4. [Post Installation](#post-installation): Post installation process in case of major changes applied by the installed firmware
### Deployment Files
The following sections provide all the resources needed for the firmware update (up to four kinds of resources).
#### Firmware Binary
Precompiled firmwares are available on [`Copy to SD Card root directory to update`](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/tree/master/Copy%20to%20SD%20Card%20root%20directory%20to%20update) folder.
For **BTT TFTs**, the firmwares use the naming convention `BIGTREE_TFT*_V*.*.*.x.bin`.
For **BTT GD TFTs**, the firmwares use the naming convention `BIGTREE_GD_TFT*_V*.*.*.x.bin`

For **MKS TFTs**:
1. The firmwares use the naming convention `MKS_TFT*_V*.*.*.x.bin`
2. Any binary file for an MKS firmware (e.g. `MKS_TFT28_V4.0.27.x.bin`) **MUST** be renamed to `MKSTFT*.bin` (e.g. `MKSTFT28.bin`, `MKSTFT35.bin` etc.) in order it can be recognized and installed by the TFT
For example, for BTT TFT35 V3 select:
`BIGTREE_TFT35_V3.0.27.x.bin`
where:
- `BIGTREE_TFT35`: Model
- `V3.0`: Hardware version
- `27.x`: Software version
**NOTE:**
For BTT TFT35, there are currently three different kinds of firmware available:
- V3.0
- E3_V3.0
- B1_V3.0
So, make sure to use the firmware matching your TFT screen.
#### Fonts and Icons
Themes are available on [`Copy to SD Card root directory to update`](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/tree/master/Copy%20to%20SD%20Card%20root%20directory%20to%20update) folder.
The root folder for fonts and icons is `TFT*`, where `*` is the size of the TFT (e.g. `TFT24`, `TFT35`, `TFT50` etc). Fonts and icons folder structure:
- `TFT*/font`: Includes the fonts in .fon format and a readme.md
- `TFT*/bmp`: Includes the icons in .bmp format and a readme.md
For **MKS TFT32**, the `TFT28` folder has to be used and **MUST** be renamed to `TFT32` in order it can be recognized and installed by the TFT.
#### Configuration File
Templates for configuration file are available on [`Copy to SD Card root directory to update`](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/tree/master/Copy%20to%20SD%20Card%20root%20directory%20to%20update) folder.
The configuration file is named `config.ini`.
**NOTE:** RepRap firmware users have to make their changes using the `config_rrf.ini` template file and renaming it to `config.ini`.
#### Optional - Language Files
Optional language files are available on [`Copy to SD Card root directory to update/Language Packs`](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/tree/master/Copy%20to%20SD%20Card%20root%20directory%20to%20update/Language%20Packs) folder.
Language files use the naming convention `language_*.ini` (e.g. `language_it.ini`).
### Configuration
The firmware configuration can be modified by changing the `config.ini` (or the renamed `config_rrf.ini`) file using a simple text editor (make sure to use UTF encoding).
A configuration can be uploaded without the need to upload the firmware or the TFT folder again, as long as the firmware and the configuration file are from the same version (see [Configuration Update](#configuration-update)).
#### Editing the Configuration File
**NOTE:** RepRap firmware users have to make their changes using the `config_rrf.ini` template file and renaming it to `config.ini`.
To edit the `config.ini` file, follow the instructions here: [Detailed Instructions](config_instructions.md).
### Installation
**NOTE:** For devices with USB flash drive support, it is possible to update the **icons**, **fonts**, **config** and the **language** files from a USB flash drive in the same way it is done through an SD card. However, the firmware can only be updated using an SD card.
The following steps are needed in order to install the firmware:
1. Copy the precompiled `BIGTREE_TFT*_V*.*.*.bin` or your self compiled **firmware**, plus the `TFT*` folder of your preferred theme along with `config.ini` to the root of a blank SD card not greater than 8GB and formatted as FAT32:

2. Optionally, copy one or more `language_*.ini` file(s) onto the SD card. Doing so, it will allow you to switch between English and the uploaded language(s) from the **Language** menu present in the TFT firmware. We recommend to upload the minimum amount of languages to keep the memory usage low. The `language_*.ini` file can be edited to change the text shown on the TFT:

3. Place the SD card with `BIGTREE_TFT*_V*.*.*.bin`, the `TFT*` folder, `config.ini` and the optional `language_*.ini` file(s) into the TFT's SD card reader and reset your TFT (or optionally - power cycle your printer) to start the update process:
⚠️ Failing to update your icons & fonts will result in missing icons and/or unreadable text ⚠️
**Update process shown on TFT screen:** A successful update looks like this on the screen:  ... and the name of the elements on the SD card changes to this:  In case one or several parts of the update failed, an error will be shown. Follow the information on the screen to update the missing or outdated elements: ⚠️ Errors during the update can not be ignored and must be solved before using the TFT ⚠️
After the update is done and the files are renamed, it is possible to reuse them again. To do so, change the name of the element(s) to the pre-update name and start the update process again. 4. After a successful update, the TFT will switch to one of the following menus: - **Main** menu: The update is completed and you can use the TFT - **Touch Screen Calibration** menu: A post installation process is needed before switching to Main menu. Please, see [Post Installation](#post-installation) section for completing the post installation process **TIP:** Format the SD card after the firmware update in case you would like to print from it. ### Post Installation In case major changes have been applied by the installed firmware, a post installation process consisting on touch screen calibration is automatically started. Please, see [Touch Screen Calibration](#touch-screen-calibration) section for completing the process. ## Configuration Update Please, see [Configuration](#configuration) section for configuring `config.ini` file. **NOTES:** - For devices with USB flash drive support, it is possible to update the **icons**, **fonts**, **config** and the **language** files from a USB flash drive in the same way it is done through an SD card. However, the firmware can only be updated using an SD card - The following procedure can be also applied to any combination of resources (e.g. only **icons**, **icons** + **fonts**, **config** + **language** files etc.) In order to update the firmware configuration: 1. Copy your edited `config.ini` file to the root of the SD card. The SD card capacity should be less than or equal to 8GB and formatted as FAT32 2. Insert the SD card into the TFT's SD card slot and press the reset button of the TFT (or power cycle your printer) 3. The TFT's configuration will update from the configuration file on reboot 4. The `config.ini` file will be renamed to `config.ini.CUR` after updating the configuration ## Touch Screen Calibration The touch screen calibration process begins showing a white screen with a red dot in the upper right corner and the following text: Touch Screen Calibration - Please click on the red dot Once the process is started, to calibrate the touch screen press (with your finger or a stylus): 1. the red dot in the upper left corner 2. then the red dot in the upper right corner 3. then the red dot in the lower right corner 4. and finally, the black dot in the middle of the screen to finish the calibration Repeat the process in case the following message is shown: Adjustment failed, please try again. ### Forcing the Touch Screen Calibration The touch screen calibration process can be forced in two ways: - by menu: The calibration can be started from **Menu->Settings->Screen->TSC Adjust** menu - by hard reset: The calibration is started at the end of the hard reset process (see [Hard Reset](#hard-reset)) ## Hard Reset **NOTES:** - The hard reset process is typically used as the last chance when the firmware is not properly working (e.g. in case of freezes, errors on screen etc.) - Unless the default hard coded settings have been properly configured (e.g. a self compiled firmware was installed), after an hard reset the TFT typically needs to be reconfigured with the proper `config.ini` file (see [Configuration Update](#configuration-update)) The hard reset process consists in: 1. resetting the TFT's configuration to the TFT's default hard coded settings 2. starting the touch screen calibration process (see [Touch Screen Calibration](#touch-screen-calibration)) at startup before moving to **Main** menu In order to hard reset the firmware: 1. Create a blank file named `reset.txt` 2. Copy the `reset.txt` file to the root of the SD card. The SD card capacity should be less than or equal to 8GB and formatted as FAT32 3. Insert the SD card into the TFT's SD card slot and press the reset button of the TFT (or power cycle your printer) 4. The TFT's configuration will be reset to the TFT's default hard coded settings and the touch screen calibration process will start on reboot 5. The `reset.txt` file will be renamed to `reset.txt.DONE` after the touch screen calibration process is completed ### Resetting to Default Settings When the default hard coded settings are properly configured for a TFT and the TFT's basic function such as surfing on the menus is working, in case of issues the user can opt to apply only a configuration reset (soft reset) instead of an hard reset. In order to reset to default settings: - Enter on **Menu->Settings->Feature** menu - Select and press on **Reset default settings** item - Press on **Ok** button to confirm the reset - Leave the menu ## Customization ### Bootscreen and Icons Please, see [Customization Guides](https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/tree/master/readme/) section for detailed information. ### Firmwareplatformio.ini
and change the default_envs
to one that matches your TFT model and version:
;BIGTREE_TFT35_V1_0 ;BIGTREE_TFT35_V1_1 ;BIGTREE_TFT35_V1_2 ;BIGTREE_TFT35_V2_0 ;BIGTREE_TFT35_V3_0 ;BIGTREE_TFT35_E3_V3_0 ;BIGTREE_TFT28_V1_0 ;BIGTREE_TFT28_V3_0 ;BIGTREE_TFT24_V1_1 ;MKS_TFT32_V1_3 ;MKS_TFT32_V1_4 ;MKS_TFT32_V1_4_NOBL ;MKS_TFT28_V3_0 ;MKS_TFT28_V4_0 ;MKS_TFT28_NEW_GENIUS ;MKS_TFT35_V1_0 [platformio] src_dir = TFT boards_dir = buildroot/boards default_envs = BIGTREE_TFT35_V3_0
Ctrl
+Alt
+B
(Windows) / Ctrl
+Option
+B
(macOS) to compile:
BIGTREE_TFT*_V*.*.*.bin
file will be generated in the hidden .pio\build\BIGTREE_TFT*_V*_*
folder. Follow the update process outlined in the Firmware Update section above to update your TFT to the latest version