This guide walks you through installing SP Flash Tool (Smart Phone Flash Tool) on Ubuntu so you can flash firmware, recover a bricked MediaTek device, or install custom ROMs. You will download the Linux version of the tool, set up the required udev rules, and run the tool with proper permissions. Before starting, ensure you have a MediaTek-based Android device, a USB data cable, and the firmware files you intend to flash.
What You’ll Need
- Ubuntu (20.04 or newer recommended; 64-bit)
- MediaTek Android device (e.g., phones, tablets, or development boards)
- USB data cable (preferably the original one)
- Firmware files for your specific device (scatter file, boot, system, etc.)
- Internet connection to download the tool and drivers
Step-by-Step
- Download SP Flash Tool for Linux. Visit the official MediaTek or a trusted source (like the manufacturer’s support page) and download the Linux version of SP Flash Tool. It is usually distributed as a
.tar.gzor.ziparchive. Look for a version like v5.1924 or newer. - Install required 32-bit libraries (if needed). SP Flash Tool is a 32-bit application. On 64-bit Ubuntu, you need to enable multiarch and install the 32-bit libraries. Open a terminal and run:
sudo dpkg --add-architecture i386 sudo apt update sudo apt install lib32gcc-s1 lib32stdc++6 lib32z1 lib32ncurses6If you are on Ubuntu 22.04 or newer, you may also need
lib32ncurses6orlib32ncurses5depending on the tool version. - Extract the downloaded archive. Navigate to your Downloads folder (or wherever you saved the file) and extract it:
cd ~/Downloads tar -xzf SP_Flash_Tool_Linux_*.tar.gzReplace the filename with the actual one. This creates a folder like
SP_Flash_Tool_Linux. - Make the tool executable. Inside the extracted folder, find the executable (usually named
flash_tool). Set execute permissions:chmod +x flash_tool - Add udev rules for MediaTek devices. To allow the tool to communicate with your device without root, create a udev rule. Run:
sudo nano /etc/udev/rules.d/51-mediatek.rulesPaste the following lines (adjust if your device has a different vendor ID, but 0e8d is standard for MediaTek):
SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", MODE="0666", GROUP="plugdev"Save (Ctrl+O, Enter) and exit (Ctrl+X). Then reload udev:
sudo udevadm control --reload-rules sudo udevadm trigger - Run SP Flash Tool. Navigate to the extracted folder and launch the tool:
cd ~/Downloads/SP_Flash_Tool_Linux ./flash_toolThe GUI should open. If you get a missing library error, install the specific library mentioned in the error message (e.g.,
libusb-0.1-4). - Configure the tool for flashing. In the SP Flash Tool window:
- Go to the Download tab.
- Click Scatter-loading and select the scatter file (usually named
MTxxxx_Android_scatter.txt) from your firmware folder. - Check the partitions you want to flash (usually all are checked by default).
- Click Download (or Firmware Upgrade if you want a full wipe).
- Connect your device. Power off your phone. Then, while holding the volume down or volume up (depending on the device), connect the USB cable to the computer. The tool should detect the device and start flashing. Wait for the progress bar to reach 100%.
- Disconnect and reboot. Once the green checkmark appears, disconnect the device and power it on. The first boot may take longer than usual.
Common Mistakes
- Using the Windows version of SP Flash Tool. The Windows executable (
.exe) will not run on Ubuntu without Wine, which is not recommended. Always download the Linux version. - Missing 32-bit libraries. The tool is 32-bit, and without the libraries, it will fail to start with errors like
No such file or directoryorlibX11.so.6missing. - Incorrect scatter file. Using a scatter file from a different device or firmware version can cause flashing errors or brick your device. Always use the scatter file that comes with the exact firmware you intend to flash.
- Not disabling USB debugging or not powering off the device. For MediaTek devices, you usually need to power off completely and connect with the right key combination. Having USB debugging enabled can interfere.
- Running the tool with sudo. Running
sudo ./flash_toolcan cause permission issues with udev rules and may not work. Use normal user permissions after setting up the udev rules.
Tips
- Backup your data. Flashing can erase all data. Always back up important files before starting.
- Use a USB 2.0 port. Some MediaTek devices have issues with USB 3.0 ports. If you encounter connection drops, try a USB 2.0 port.
- Keep the battery charged. Ensure your device has at least 50% battery to avoid power failure during flashing.
- Check the tool version. Some devices require a specific version of SP Flash Tool. If you get errors, try an older or newer version.
- Use a short, high-quality USB cable. Long or damaged cables can cause data transfer errors.
Troubleshooting
- Tool does not start. If you see an error like
error while loading shared libraries: libX11.so.6, install the missing 32-bit library. For example:sudo apt install lib32x11-6. Check the exact library name in the error and install the correspondinglib32package. - Device not detected. If the tool shows “Searching” forever, ensure your udev rules are correct and reloaded. Also try a different USB port or cable. Verify your device is in the correct mode (powered off, not charging).
- Flashing fails with error 4001 or similar. This often indicates a driver issue. Reinstall the udev rules and try again. Also, check that you are using the correct scatter file.
- Boot loop after flashing. This usually means the firmware is incompatible or the flash was incomplete. Redo the flash with the correct firmware, and consider doing a “Format All + Download” (if available) to clear old data.
- Permission denied when running the tool. Make sure the
flash_toolfile is executable (chmod +x) and you are not using sudo. If you still get permission errors, check the ownership of the folder.
Frequently Asked Questions
Do I need to install a driver on Ubuntu?
No, Ubuntu uses the in-kernel USB driver for MediaTek devices. The udev rules we set up are sufficient for SP Flash Tool to access the device.
Can I use SP Flash Tool on Ubuntu 24.04?
Yes, but you may need to install additional 32-bit libraries. The steps in this guide work on 24.04, but if you encounter missing library errors, install the corresponding lib32 packages.
What is a scatter file and why do I need it?
A scatter file is a text file that describes the memory layout of the firmware partitions. It tells SP Flash Tool where to write each image. It is essential for flashing correctly.
Will flashing void my warranty?
Yes, in most cases, flashing custom firmware or even stock firmware via SP Flash Tool can void your warranty. Check with your manufacturer.
Can I recover a bricked phone with SP Flash Tool?
Yes, if the bootloader is not completely corrupted, SP Flash Tool can often restore a bricked MediaTek device by flashing the stock firmware. This is one of its primary uses.
Is it safe to flash without a battery?
Some MediaTek devices can be flashed without a battery, but it is not recommended. Most devices require a battery to provide stable power during the flashing process.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- How to Turn Off Shutter Sound on iPhone
- VPN Setup on iPhone SE: Step-by-Step Guide
- Fix Internet Not Working on Windows 11
- Fix Right Click Not Working in Firefox
- Compare Two Columns with Comma Separated Values in Excel
- How to Limit Ad Tracking on iPhone Apps