pdf-icon

ESP-IDF Quick Start

1. ESP-IDF Setup

2. Devices & Examples

CoreS3

Tab5 ESP-IDF Factory Firmware Compilation

This tutorial will show you how to compile the default factory firmware for the Tab5, which you can use as a base for secondary development.

1. Preparation

  1. Environment Setup: This tutorial is based on Ubuntu for setting up the ESP-IDF development environment. For instructions on other platforms, please refer to ESP-IDF – Getting Started for ESP32-P4 (Linux & macOS).
ESP-IDF Version
This tutorial recommends using ESP-IDF version v5.4.1
  1. Clone the esp-idf repository using Git, switch to the specified branch, and run the scripts to install the toolchain.
Note
The space between the . and the script in the . ./export.sh command is required. This command is equivalent to source ./export.sh.
git clone --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
git checkout v5.4.1  # recommend
./install.sh
. ./export.sh
  1. All subsequent idf.py commands rely on ESP-IDF. Before running any commands, activate the environment variables by sourcing export.sh in your ESP-IDF directory. For details, see ESP-IDF – Getting Started for ESP32-P4 (Linux & macOS).

2. User Demo

  1. Clone the Tab5 factory firmware demo repository and place it alongside your esp-idf directory.
git clone https://github.com/m5stack/M5Tab5-UserDemo.git
  1. Enter the M5Tab5-UserDemo folder and fetch the dependent components using the provided Python script. Ensure you have a Python development environment installed on your PC before running this.
cd M5Tab5-UserDemo
python ./fetch_repos.py
  1. In the M5Tab5-UserDemo/platforms/tab5 directory, source the ESP-IDF export.sh script to activate the environment variables. The commands below assume M5Tab5-UserDemo and esp-idf are siblings; adjust paths if your layout differs.
cd platforms/tab5
. ../../../esp-idf/export.sh

3. Build and Flash

Connect the Tab5 to your computer via USB. Press and hold the Reset button until the green LED blinks rapidly, then release to enter download mode. Once in download mode, run the following command to compile and flash the firmware:

idf.py flash

4. Start Using

After flashing completes, tap different areas of the screen to test each functional module.

On This Page