Introduction / Why You Need This
Stock firmware is the official operating system version preinstalled by the device manufacturer. Reverting to it resolves numerous issues: removes unstable modifications, fixes errors following failed updates, restores banking app functionality after rooting, or prepares the smartphone for resale. The process requires attention, but by following the instructions precisely, you will get a fully functional device with factory settings.
Requirements / Preparation
Before starting, ensure you meet several mandatory conditions. Mistakes at this stage often lead to a completely bricked device.
- Full backup. The formatting process will erase all personal data, apps, and settings.
- Battery charge of at least 70%. Sudden power loss during partition writing will corrupt the file system.
- Computer running Windows/macOS/Linux and a high-quality USB cable. Cheap or damaged cables frequently cause connection drops at critical moments.
- Exact model name. Check the device code in
Settings → About phone → Model number. Firmware from a different variant may damage the modem or camera.
⚠️ Important: Unlocking the bootloader voids the official warranty on most devices. If your phone is still under warranty, contact an authorized service center.
Step 1: Finding and Downloading Official Files
Download firmware only from trusted sources or the manufacturer's official portals. Different platforms require specific archive formats:
- Xiaomi/Poco/Redmi: Use Mi Flash Tool and Fastboot ROM archives from the official website.
- Samsung: Look for files with the
.tar.md5extension for the Odin utility. - Google Pixel/Motorola/OnePlus: Use images flashed via
fastboot.
Extract the archive to a folder with a short path containing only Latin characters, e.g., C:\android_rom\. Ensure the path contains no Cyrillic characters or spaces—this is a common cause of command-line utility failures.
Step 2: Setting Up Your Computer and Entering Flash Mode
Install ADB and Fastboot drivers. On Windows, you can install them via the official Android SDK Platform-Tools package. On macOS and Linux, use the terminal: brew install android-platform-tools or sudo apt install adb fastboot.
Turn off the phone. To enter Fastboot mode, hold Volume Down + Power for 5–7 seconds. On Samsung devices, use Volume Down + Volume Up + Power to enter Download Mode. Connect the cable to your PC. Verify the connection with the command:
fastboot devices
If the output displays a serial number followed by fastboot, the connection is established. If the line is empty, check your drivers.
Step 3: Flashing the Firmware to Memory
The method depends on the chipset and brand. Let's cover the universal approach for Fastboot-compatible devices. Open a terminal or command prompt in the folder with the extracted files.
To completely wipe the partitions and install the firmware, run:
fastboot erase userdata
fastboot erase cache
fastboot flashall -w
This command automatically flashes the kernel, system, modem, and recovery partitions. Do not disconnect the cable or press any buttons until the finished. total time: ... message appears. The process takes 3 to 15 minutes.
💡 Tip: For Samsung devices, use Odin. Load the
AP,BL,CP, andCSCfiles into their respective fields, keep theAuto Rebootcheckbox selected, and clickStart. For MediaTek devices, you will need SP Flash Tool with a pre-loaded scatter file.
Step 4: First Boot and Setup
After successful flashing, the smartphone will reboot automatically. The first boot of the stock system takes 5–10 minutes as the device optimizes apps and initializes encrypted partitions. Wait for the welcome screen.
Complete the setup, connect to Wi-Fi, and check the software version in Settings → About phone. If everything went smoothly, you will see the current build with a Build Number matching the manufacturer's specifications.
Verifying the Results
Verify that the firmware was installed correctly by running the following basic tests:
- Check cellular connectivity and data transfer. Call another number or open a test website over mobile data.
- Ensure that the sensors, microphone, speaker, and camera function correctly in standard apps without crashing.
- In
Settings → About phone, verify that the build number matches the one listed on the manufacturer's website for your model.
Troubleshooting / Common Issues
unknown commandorpartition not founderror: The firmware files do not match your device model, or the Fastboot utility is outdated. Download the latestplatform-toolsand double-check your device code.- Stuck on the manufacturer logo: Usually indicates a partition conflict. Re-enter Recovery (
Volume Up+Power) and selectWipe Data/Factory Reset, followed byReboot system now. - Utility does not detect the device: Install universal drivers, replace the USB cable, or try a different port. Sometimes restarting the ADB service via
adb kill-server && adb start-serverresolves the issue. FAILED (remote: Device is locked)error: The bootloader is locked and prevents flashing. Unlock it officially through the manufacturer's website, or use service tools if the device is already bricked.