• XDA Forums have been migrated to XenForo. We are aware of several issues including missing threads, logins not working, and more. To discuss, use this thread.
  • If you are experiencing issues logging in, we migrated and software and made it more secure. We recommend trying to reset your password.

[GUIDE] Fix GPS in custom ROMs

blu2lz

New member
Nov 21, 2012
59
52
0
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
0
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

New member
Nov 21, 2012
59
52
0
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

New member
Nov 21, 2012
59
52
0
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

hottu_doggu

New member
Jul 16, 2014
60
24
0
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

New member
Nov 22, 2014
37
9
0
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

New member
Feb 3, 2010
170
88
0
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==

New member
Jan 19, 2013
1,078
1,033
0
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

New member
Nov 14, 2014
20
10
0
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

New member
Feb 3, 2010
170
88
0
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

New member
Jan 17, 2012
916
1,761
0
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==

New member
Jan 19, 2013
1,078
1,033
0
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.
 
Our Apps
Get our official app! (coming soon)
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone