MTK Flash is a command-line utility for flashing raw images to MediaTek devices, supporting MediaTek Boot ROM communication, Download Agent upload, and Fastboot flashing with image splitting.
-
Install dependencies:
sudo apt install -y rustc cargo build-essential
-
Build the project:
cargo build --release
The compiled binary will be located in the
target/releasedirectory:./target/release/mtk-flash --help
Alternatively, a precompiled binary is available on the Releases page.
-
Add your user to the
dialoutgroup:sudo usermod -aG dialout $USER -
If you want to use the automatic boot into download mode functionality, you also need to set up udev rules for the GPIO chip:
sudo cp data/90-mtk-flash.rules /etc/udev/rules.d/ sudo udevadm control --reload && sudo udevadm trigger -
Log out and log back in to apply the group membership. Alternatively, you can run
newgrp dialoutin the terminal to apply the changes immediately. -
Use the tool with the correct serial device path:
mtk-flash \ --da lk.bin \ --fip fip.img \ --img emmc_sparse.img \ --dev /dev/ttyACM0
mtk-flash --da <PATH> [--fip <PATH>] [--img <PATH>] --dev <DEVICE> [--gpio <CHIP>]--da <PATH>: Path to the Download Agent image.--fip <PATH>(optional): Path to the Firmware Image Package image.--img <PATH>(optional): Path to the system image.--dev <DEVICE>: Serial device path.--gpio <CHIP>(optional): Path to the GPIO chip device for controlling power, reset and download mode.
If you encounter issues, ensure that:
- The device is connected and recognized by the system.
- You have the necessary permissions to access the serial device.
- The specified paths to the images are correct.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.