I am trying to implement GPS code in the nrf9160 but I cant find the function nrf_modem_gnss_init(); to initialize GNSS inside the modem in , is it being initialised within nrf_modem_gnss_start() function internally ? please help on this.


I am trying to implement GPS code in the nrf9160 but I cant find the function nrf_modem_gnss_init(); to initialize GNSS inside the modem in , is it being initialised within nrf_modem_gnss_start() function internally ? please help on this.


You should check if the LNA gets properly enabled. Since you are using a regular GPIO pin instead of COEX0, there can potentially be issues.
GNSS gets started and is receiving PVT notifications once a second, so it does not look like a GNSS API issue.
You should check if the LNA gets properly enabled. Since you are using a regular GPIO pin instead of COEX0, there can potentially be issues.
GNSS gets started and is receiving PVT notifications once a second, so it does not look like a GNSS API issue.
This is an internal GPS setup and has external on-board antenna attached to it.
I can see voltages around D1(2.489 at cathode ) , D2 (2.673 at cathode ) which further goes to c1(2.48), c2(2.49) and c3(2.67), c4(2.67) which are sufficient to power up LNA.
Is there anything else I am missing in the code ?
Also coex is used for coexistence of LTE along with GNSS. Here I am using GNSS mode only in the code.

Can you confirm whether you are using COEX or not?
Modem team; All COEX and MAGPIO pins seem to be NC, so I don’t think the %XCOEX0 configuration matters. I checked the code snippet and it looks like the LNA should get enabled using the GPIO pin (as long as the pin configuration in DT is correct).
From SW point of view, I can’t think of anything else that would be missing.
Hi Hakon As shown in the schematic all COEX and MAGPIO are NC only.
And it's correct that we are trying to enable LNA via GPS_EN GPIO pin and I am already getting the volatge around D1(2.489 at cathode ) , D2 (2.673 at cathode ) which further goes to c1(2.48), c2(2.49) and c3(2.67), c4(2.67) which are sufficient to power up LNA.
Also just for clarification we have separate antennas for LTE and GPS. And here all I am doing is in GNSS mode only.
Hi Hakon I have tried implementing the GPS functionality on nrf9160DK board on this it is working fine and I am able to get the coordinates. but I have not written any code line explicitly to enable the LNA in it.
Can you please confirn how this is being taken care internally ? Is it enabled by COEX or MAGPIO and why it's not needed to enable COEX / MAGPIO explicitly for nrf9160DK board?
Gunjan Yadav said:Can you please confirn how this is being taken care internally ? Is it enabled by COEX or MAGPIO and why it's not needed to enable COEX / MAGPIO explicitly for nrf9160DK board?
When building for the nRF9160 DK, the Modem antenna library (CONFIG_MODEM_ANTENNA) gets enabled by default. The Modem antenna library configures COEX0 correctly for the DK based on whether CONFIG_MODEM_ANTENNA_GNSS_ONBOARD or CONFIG_MODEM_ANTENNA_GNSS_EXTERNAL is enabled. LNA is enabled when using the onboard antenna, and disabled when using an external antenna.