[GUIDE] Fix GPS in custom ROMs

Search This thread

blu2lz

Senior Member
Nov 21, 2012
59
52
Scenario

See the bold text under "Guide". This scenario isn't valid anymore, it should now work for all GPS problems in custom ROMs without data loss.

You get your new phone and don't use the stock ROM, at least not GPS. Instead, you directly install a custom ROM. At least ROMs based or somehow depending on CM11 won't give you a GPS fix then. This is easily fixed by flashing stock again, getting a GPS fix and flash the custom ROM again. If you restore a backup you will still get no fix. You need to clean flash a custom ROM. My problem was that I already set up everything and didn't want to start from scratch. For everyone in the same situation, I share the things I've done to make it work again.


Disclaimer

I'm not responsible for data loss or anything you're doing wrong with your phone because of this guide.

Guide

@==vj== wrote that it is enough to just flash the NON-HLOS.bin, which makes sense, so you could try that first. Be sure to take the NON-HLOS.bin from a suitable image (GSM/CDMA) and check md5sum! If it works don't forget to thank ==vj==!

You can of course still follow the guide, it just takes more time though.

  1. Boot to recovery, make a nandroid backup
  2. (optional) Backup /sdcard, it will be deleted when you restore stock ROM!
  3. Pull the nandroid backup, remember, /sdcard will be wiped!
  4. Boot to fastboot (pressing Vol- while turning on the phone or type "adb reboot-bootloader"), restore stock ROM following this guide
  5. Install a GPS test tool like GPS Status & Toolbox, wait for GPS fix
  6. Reboot to fastboot again, flash a recovery, for example PhilZ recovery, by typing "fastboot flash recovery path_to_recovery.img"
  7. Boot to recovery and wipe data
  8. Install your custom ROM/GApps
  9. Boot into custom ROM and test GPS again, wait for the GPS fix
  10. Push backup back to phone
  11. Reboot to recovery, select custom restore and choose only data
  12. Wipe cache/dalvik
  13. Reboot
  14. Test GPS again, you should now get a fix

Hope this helps, ask me if you have questions.
 
Last edited:

RiCON

New member
Oct 19, 2014
1
2
Had CM11 nightlies installed, tried unofficial snapshots and build with Aerokernel and GPS didn't work. Wifi with DHCP didn't work either.

Ran your instructions more or less (didn't pull backups, just flashed clean stock and clean custom) and they both now work, at least with Aerokernel CM11.

Also, note that I used [ROM][FLASHABLE ZIP] Stock Motorola ROM Collection (Untouched + Optimized Versions) and flashed an optimized version without having to full wipe the /sdcard. Wiped /data, /system, /cache and dalvik and it still worked.
 

blu2lz

Senior Member
Nov 21, 2012
59
52
A much easier way now.

Just flash NON-HLOS.bin file of Stock ROM and GPS will be active on any Custom AOSP ROMs.

Code:
mfastboot.exe flash modem NON-HLOS.bin
mfastboot.exe erase modemst1 
mfastboot.exe erase modemst2 
pause
mfastboot.exe reboot
That makes sense, thanks for the input. Can't test though because now everything works. Would save a lot of hassle indeed.
@everyone who try this:
Be sure to take the NON-HLOS.bin from a suitable image (GSM/CDMA) and check md5sum!
 

blu2lz

Senior Member
Nov 21, 2012
59
52
Why type mfastboot.exe instead of just mfastboot?

It's the same, you can use both.

BTW, there are tools for linux and mac, too. You'll find linux-fastboot and osx-fastboot in the archives. Just be sure to "chmod u+x linux-fastboot", then you can use it with "./linux-fastboot" instead of "mfastboot". I'd recommend using sudo, on most distributions it won't work as user.
 
  • Like
Reactions: ==vj== and lyall29

jochy2525

Member
Jan 15, 2012
31
1
Buenos Aires
Hi there, where I can find NON-HLOS.bin for Claro AR 4.4.4?

I try to flash it but it says reported max download sife of xxxx bytes. Cannot load "NOH-HLOSbin"
 

hottu_doggu

Senior Member
Jul 16, 2014
60
24
I'm using xperience 9.0.0 Lollipop ROM. Flashing NON-HLOS.bin didn't enable GPS. Is it supposed to work on Lollipop ROMs? I will try fixing it the other way tomorrow.

Update: It works now.
 
Last edited:

Emarian

Member
Nov 22, 2014
37
9
Had CM11 nightlies installed, tried unofficial snapshots and build with Aerokernel and GPS didn't work. Wifi with DHCP didn't work either.

Ran your instructions more or less (didn't pull backups, just flashed clean stock and clean custom) and they both now work, at least with Aerokernel CM11.

Also, note that I used [ROM][FLASHABLE ZIP] Stock Motorola ROM Collection (Untouched + Optimized Versions) and flashed an optimized version without having to full wipe the /sdcard. Wiped /data, /system, /cache and dalvik and it still worked.

Big thanks to both the OP and RiCON's post for this! For any other XT1031 (Boost) users flashed to PagePlus, this method by the OP does indeed work perfectly with the optimized XT1028 rom.
 

kiden

Senior Member
Feb 3, 2010
170
88
Chicago
A much easier way now.

Just flash NON-HLOS.bin file of Stock ROM and GPS will be active on any Custom AOSP ROMs.

Code:
mfastboot.exe flash modem NON-HLOS.bin
mfastboot.exe erase modemst1 
mfastboot.exe erase modemst2 
pause
mfastboot.exe reboot

So question, my phone started as stock 4.4.4. I rooted and installed a custom rom. Now, the GPS will not work correctly. Will this method work if I flash a NON-HLOS.bin from the stock 4.4.3, since the stock 4.4.4 files are not available?
 

==vj==

Senior Member
Jan 19, 2013
1,077
1,033
Goa
So question, my phone started as stock 4.4.4. I rooted and installed a custom rom. Now, the GPS will not work correctly. Will this method work if I flash a NON-HLOS.bin from the stock 4.4.3, since the stock 4.4.4 files are not available?
Try your 4.4.4 Non-Hlos.bin initially. If no success then you need to get 4.4.2 Non-Hlos.

4.4.3 and 4.4.4 are the same with minor change.
 
  • Like
Reactions: diogomendes

diogomendes

Member
Nov 14, 2014
21
10
I can't find a guide to extract the non-hlos.bin from the 4.4.4 retail images.
Can someone shed some light on how to do it? (or post the file if you have it handy)
 

kiden

Senior Member
Feb 3, 2010
170
88
Chicago
I don't have the 4.4.4 one. Are you saying I can flash the 4.4.3 one, or that I should flash the 4.4.2 one?

And yeah, if anyone can get the file from the newest 4.4.4 for the Moto G 4G from their phone, that would be great, lol.
 

t4n017

Senior Member
Jan 17, 2012
916
1,761
No need to reflash the NON-HLOS.bin. Just erase modemst1 and modemst2, they're the cache partitions for the phone's radios/baseband. Just tried this on my XT1033 running unofficial CM11-M9, and I could get a GPS fix with 60ft accuracy in 4s.
Probably true, just flashing NON-HLOS didn't fix the GPS problem, I needed to erase modem.
 
  • Like
Reactions: ==vj==

==vj==

Senior Member
Jan 19, 2013
1,077
1,033
Goa
Wow..! The solution came simpler from flashing stock ROM to flashing Nhlos with radio cache wipe. And now easy as just wipe radio cache :) good going guys.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 27
    A much easier way now.

    Just flash NON-HLOS.bin file of Stock ROM and GPS will be active on any Custom AOSP ROMs.

    Code:
    mfastboot.exe flash modem NON-HLOS.bin
    mfastboot.exe erase modemst1 
    mfastboot.exe erase modemst2 
    pause
    mfastboot.exe reboot
    19
    Scenario

    See the bold text under "Guide". This scenario isn't valid anymore, it should now work for all GPS problems in custom ROMs without data loss.

    You get your new phone and don't use the stock ROM, at least not GPS. Instead, you directly install a custom ROM. At least ROMs based or somehow depending on CM11 won't give you a GPS fix then. This is easily fixed by flashing stock again, getting a GPS fix and flash the custom ROM again. If you restore a backup you will still get no fix. You need to clean flash a custom ROM. My problem was that I already set up everything and didn't want to start from scratch. For everyone in the same situation, I share the things I've done to make it work again.


    Disclaimer

    I'm not responsible for data loss or anything you're doing wrong with your phone because of this guide.

    Guide

    @==vj== wrote that it is enough to just flash the NON-HLOS.bin, which makes sense, so you could try that first. Be sure to take the NON-HLOS.bin from a suitable image (GSM/CDMA) and check md5sum! If it works don't forget to thank ==vj==!

    You can of course still follow the guide, it just takes more time though.

    1. Boot to recovery, make a nandroid backup
    2. (optional) Backup /sdcard, it will be deleted when you restore stock ROM!
    3. Pull the nandroid backup, remember, /sdcard will be wiped!
    4. Boot to fastboot (pressing Vol- while turning on the phone or type "adb reboot-bootloader"), restore stock ROM following this guide
    5. Install a GPS test tool like GPS Status & Toolbox, wait for GPS fix
    6. Reboot to fastboot again, flash a recovery, for example PhilZ recovery, by typing "fastboot flash recovery path_to_recovery.img"
    7. Boot to recovery and wipe data
    8. Install your custom ROM/GApps
    9. Boot into custom ROM and test GPS again, wait for the GPS fix
    10. Push backup back to phone
    11. Reboot to recovery, select custom restore and choose only data
    12. Wipe cache/dalvik
    13. Reboot
    14. Test GPS again, you should now get a fix

    Hope this helps, ask me if you have questions.
    10
    No need to reflash the NON-HLOS.bin. Just erase modemst1 and modemst2, they're the cache partitions for the phone's radios/baseband. Just tried this on my XT1033 running unofficial CM11-M9, and I could get a GPS fix with 60ft accuracy in 4s.
    5
    You're right. That does the trick! Thank you very much for that valuable information :)

    CM11-M9?

    That's officially an antique. Very old.

    Time to try something newer perhaps?

    ---------- Post added at 01:14 AM ---------- Previous post was at 01:03 AM ----------

    What commands did you use to erase those? mfastboot rease [partition name] ?

    http://xdaforums.com/showpost.php?p=56146279&postcount=3

    Just this:
    Code:
    fastboot erase modemst1 
    fastboot erase modemst2
    4
    Here is the NON-HLOS.bin for the Boost Mobile Moto G
    I wish someone posted this file for me before i had to go looking for it. Would have sped up the process for me but the above steps with flashing the modem only worked great!

    Boost Mobile Moto G 4.4 Modem