Fix Broken Android drivers: How to Fix Firmware Drivers

Fix Broken Android Drivers

In the past, I bricked my tablet during some experiments on firmware. After a long and deep search on the internet, I found the manufacturer’s site and then I downloaded the firmware to reflash. You can read here how I unbricked Allwinner tablet AD701. Everything was working except for the WiFi. The WiFi button on settings would just show “Turning On” and then turn off automatically.  This means a problem in the driver or firmware. After a lot of searches, I also found a way to solve such driver issues. So here is my guide to help you solve driver issues in Android.

Many people face similar problems with their devices. Some face issues with G-sensors, Bluetooth, NFC, while some with the camera. There can be many issues due to such problematic firmware. Basically, we are trying to fix issues that are in the firmware. The drivers in the firmware of the device can sometimes be faulty. They are easy to fix if we know the right code and steps.

Sometimes we can fix some issues with just small patch files. All we may need to do is copy the patch file into the SD card and flash them. However most of the time, solving may require reflashing the firmware. This means we have to edit the software, repack and reflash. This is advanced level work but with correct guidance, it can be easy. I have read many sources and successfully done this. This is why I have made this guide to help.

Starting the Unbrick Work

My guide works on how I fixed the issues. This means the process I used to solve the driver issues of the old Allwinner Tablet. I tried many things to solve the problem. This includes trying various apps, fixing via “Terminal Emulator“, and patching. It turns out the main problem was drivers not loading properly. In order to fix this, we needed to edit the core system files. I tried to solve this without root but it turns out it couldn’t be done without rooting.

I would advise all of you to root your devices if you need to fix your drivers. Rooting gives deeper and unrestricted access. Magisk provides a great way of gaining root access nowadays. Some manufacturers may not provide the kernel source code, firmware, and even option to unlock the bootloader. These things can be an issue. However, if you have found a way around these, follow the below-given steps. This is a temporary fix.

1) Root the device

Advertisement

2) Install Terminal Emulator App

3) Use the following codes:

su(Enter)

insmod /vendor/modules/8188eu.ko(Enter)

Advertisement

4) Now go to settings and turn on WiFi. Sometime it may get stuck but a restart will do the trick.

Note: (8188eu.ko) is the driver module for the Android device.

Finding the Correct Driver

I used the above-given process for around 7 months, and it was frustrating. So I found the final solution, and that was to edit the kernel files. This process can be used to fix broken drivers for any Android device. First of all, you must have a good idea about drivers and their names. See the below list to confirm and find which drivers you need. This is a shortlist and there are many out there.

WiFi drivers
8818eu, bcm4330
Audio driver
sndi2s
Camera drivers
gt2005, hi253, hi704, mt9d112, mt9m112, mt9m113, ov2643, ov2655, ov5640
ov7670, sp0838
G-sensor drivers
dmard06, bma250, mxc622x
Ts drivers
ft5x_ts, mma7660, goodix_touch, gt818_ts, zt8031, goodix811, gt2005

After figuring out the needed driver, we can proceed further. In our case, we need 8188eu.ko for WiFi. The main and basic problem is with the script that orders the device to load drivers is not working. The device is not getting the command to load the required driver. Therefore, all we need to do is add that code. And push the updated image.

Advertisement

Permanently Fix Broken Android Drivers

I tried pushing the script using file explorer and editors but it doesn’t work. It can only be edited by pulling the file out. Then the only way of installing is flashing. If you can edit the firmware file given by the manufacturer then the pulling process won’t be necessary. Otherwise please follow the below-given steps.

  1. Install the Android SDK and run the ADB shell. Also, enable USB Debugging on Android device before connecting it to the computer. Make sure you are charged above 50%.
Android Debug Bridge (adb) Installation Directory
Android Debug Bridge (adb) Installation Directory

Install ADB and run ADB shell:

1) Download from Android Studio and install it in an easier location like shown above. You can also extract zip files available online. They are light and have all the necessary files. Our step uses location as shown in our installation directory image.

2) To make it easy copy the folder into root C:

Advertisement

3) Run adb shell from command.

4) Find the folder named “platform-tools”.

Suppose that the folder containing folder “platform-tools” is “sdk” and it is in “adb” which is in C:\.

5) Run Command (CMD) in your Windows OS while your device is connected.

Advertisement

Type “cd..” as many times required to get to root directory such as “C:”

Follow these commands to start the shell.

cd..

cd..

cd adb

cd sdk

Advertisement

cd platform-tools

adb

adb shell

su(If required for super user permission)

Advertisement

Now let us pull the boot.img file by using new commands.

adb shell

cat /dev/block/nandc > /sdcard/dump/boot.img

(Control+C)

adb pull /sdcard/dump/boot.img *Local Directory*

3) Copy the boot.img to your computer

Extracting and Editing

4) Install Boot Repacker in your PC.

5) Extract the contents of boot.img

6) Edit “init.sun5i.rc” or “init.sun4i.rc” or “init.sun.rc” whichever you have. These files will include instructions such as “insmod /system/vendor/modules/8188eu.ko” under network.

7) Edit the file using Notepad++ and add the new line “insmod /system/vendor/modules/8188eu.ko” and save it. This is for fixing the issue with WiFi. Other issues require loading command for different files.

8) Repack the boot.img and copy it to SD Card root directory.

9) Reflash the boot.img file using below given command.

cat /sdcard/boot.img > /dev/block/nandc

Finishing and Starting Again

This method should do the work. It should fix the driver issues permanently. Do a restart after the whole process and check if everything is working or not. Also, make a full backup of your data before doing any of the work. Do a full hard reset and clean the cache to start clean again. It is always smart to do a clean start to make sure everything is working fine. This process helped me to fix my tablet. I hope it does work for you as well. If you have any suggestions to improve this then do share with us.

Recommended For You

About the Author: Abhishek Chand

Structural Engineer by profession. Computer and smartphone enthusiast. Tech-savvy blogger and former Gadget reviewer of AP1 HD TV and TechnoNepal.

Leave a Reply

Your email address will not be published. Required fields are marked *