<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124827/nrf9151-custom-board-gnss-sample-fails-with-failed-to-activate-gnss-functional-mode</link><description>Hi Nordic Team, 
 I have developed a custom board using the nRF9151 controller. I am testing the GNSS sample from nRF Connect SDK v3.0.0 . When I flash and run the firmware, I see the following output in RTT Viewer: 
 
 Hardware Details: 
 
 
 SoC: nRF9151</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Nov 2025 08:06:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124827/nrf9151-custom-board-gnss-sample-fails-with-failed-to-activate-gnss-functional-mode" /><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/554474?ContentTypeID=1</link><pubDate>Mon, 17 Nov 2025 08:06:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcb326ab-6aa2-48d5-a902-24a57fd432aa</guid><dc:creator>Nishant Gaurav</dc:creator><description>&lt;p&gt;Hi arun&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i have also faced this problem , i suggest you to go throgh&amp;nbsp;&lt;a id="" href="https://academy.nordicsemi.com/courses/cellular-iot-fundamentals/lessons/lesson-6-cellular-fundamentals/topic/lesson-6-exercise-2/"&gt;https://academy.nordicsemi.com/courses/cellular-iot-fundamentals/lessons/lesson-6-cellular-fundamentals/topic/lesson-6-exercise-2/&lt;/a&gt;&amp;nbsp;lesson 6 exercise 2 solution code, you can download code from github&amp;nbsp;&lt;a id="" href="https://github.com/NordicDeveloperAcademy/cell-fund"&gt;https://github.com/NordicDeveloperAcademy/cell-fund&lt;/a&gt;&amp;nbsp;in that try to run&amp;nbsp;&lt;code&gt;l6/l6_e2_sol. and in main.c comment this line&amp;nbsp;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;// if (server_resolve() != 0) {&lt;br /&gt; // LOG_INF(&amp;quot;Failed to resolve server name&amp;quot;);&lt;br /&gt; // return 0;&lt;br /&gt; // }&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;// if (server_connect() != 0) {&lt;br /&gt; // LOG_INF(&amp;quot;Failed to initialize client&amp;quot;);&lt;br /&gt; // return 0;&lt;br /&gt; // }&lt;/p&gt;
&lt;p&gt;configure the RTT logs by enabling this in prj.conf&lt;/p&gt;
&lt;p&gt;CONFIG_USE_SEGGER_RTT=y&lt;br /&gt;CONFIG_LOG_BACKEND_RTT=y&lt;br /&gt;CONFIG_LOG_BACKEND_UART=n&lt;br /&gt;CONFIG_LOG_PRINTK=n&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;built and run the code and wait , it will take some time to cold start&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/552338?ContentTypeID=1</link><pubDate>Fri, 24 Oct 2025 09:53:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7475bfa-b5f3-4ea7-b997-fd9886f9ead5</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/kevinfindmee"&gt;KevinFindmee&lt;/a&gt;&amp;nbsp;,&lt;br /&gt;&lt;br /&gt;Which specific error do you get?&amp;nbsp;&lt;br /&gt;Are hardware and software details in your case the same as mentioned initially by the creator of this ticket? If not, please open new ticket and provide details about the problem there.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/552301?ContentTypeID=1</link><pubDate>Thu, 23 Oct 2025 23:40:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb7d04d2-48fd-4456-93ac-5491e18ca898</guid><dc:creator>KevinFindmee</dc:creator><description>&lt;p&gt;Hi guys,&lt;br /&gt;&lt;br /&gt;I&amp;#39;m getting the same error with my board over here. NRF951 only GNSS on a costum board&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551577?ContentTypeID=1</link><pubDate>Wed, 15 Oct 2025 12:09:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d5dfbf3-ad52-4883-8293-277807d47b56</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Arun,&lt;br /&gt;&lt;br /&gt;You could try to recover your device using nrfutil as indicated in this&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/122929/nrf52-dk-flashing-issue-pca10040-3-0-4-2024-34"&gt;ticket&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;You could also try to double-check power supply and inspect SWD lines. Have a look at this&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/120718/nrf54l-dk-can-t-program-external-mcu-via-swd-j-link-error-unknown-error-in-dll"&gt;thread&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551554?ContentTypeID=1</link><pubDate>Wed, 15 Oct 2025 09:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdd36b04-533f-4027-9113-3c4afe09d973</guid><dc:creator>Arun538</dc:creator><description>&lt;p&gt;&lt;strong data-start="99" data-end="112"&gt;Hi Dejan,&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When I try to connect my custom board to the NRF52 DK, it connects and I am able to upload code.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;15:09:08.717	Using nrfutil device to communicate with target via JLink
15:09:08.717	JLink OB firmware version J-Link OB-nRF5340-NordicSemi compiled Jul 8 2025 10:15:34
15:09:08.717	Device family NRF52_FAMILY
15:09:08.717	Device version NRF9151_xxCA_REV3
15:09:08.717	Board version PCA10040
15:09:08.903	Reading readback protection status for Application core
15:09:08.904	Reading readback protection status for Application core 0%
15:09:08.905	Reading readback protection status for Application core 100%
15:09:08.905	Application core protection status &amp;#39;NRFDL_PROTECTION_STATUS_NONE&amp;#39;
15:09:08.906	Reading readback protection status for Application core completed
15:09:09.142	Loading core information for Application core
15:09:09.143	Loading core information for Application core 0%
15:09:09.143	Loading core information for Application core 100%
15:09:09.145	Loading core information for Application core completed
15:09:09.629	Reading readback protection status for Application core
15:09:09.629	Reading readback protection status for Application core 0%
15:09:09.631	Reading readback protection status for Application core 100%
15:09:09.631	Application core protection status &amp;#39;NRFDL_PROTECTION_STATUS_NONE&amp;#39;
15:09:09.631	Reading readback protection status for Application core completed
15:09:09.682	Device is loaded and ready for further operation&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;br data-start="146" data-end="149" /&gt; However, when I try to connect my custom board to the NRF9151 DK, it does not connect and shows this error.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;15:14:04.396	Initialising the bundled nrfutil device
15:14:04.555	Using the bundled core version for nrfutil device: 8.0.0
15:14:04.583	Using nrfutil-device version: 2.12.3
15:14:04.584	Using nrf-device-lib version: 0.17.81
15:14:04.584	Using nrf-probe version: 0.40.1
15:14:04.584	Using JLink version: JLink_V8.76
15:14:04.584	Your version of SEGGER J-Link (8.76) is newer than the one this app was tested with (8.18). The tested version is not required, and your J-Link version will most likely work fine. If you get issues related to J-Link with your devices, use the tested version.
15:14:04.601	Getting serial port options from the persistent store for 001051231268.pc-nrfconnect-programmer
15:14:04.602	Device connected with the serial number 001051231268
15:14:06.422	Selecting device with the serial number 001051231268
15:14:06.801	Error: Failed with exit code 1. One or more device info tasks failed: * 1051231268: Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown Error in J-Link DLL (error code =-1)). This might indicate that the debug port is unavailable. Please double-check device power supply and SWD lines, and that SWD isn&amp;#39;t disabled (Generic) Message: Operation device-info failed, Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown Error in J-Link DLL (error code =-1)). This might indicate that the debug port is unavailable. Please double-check device power supply and SWD lines, and that SWD isn&amp;#39;t disabled.
15:14:06.801	Selected device with the serial number 001051231268
15:14:06.802	Using nrfutil device to communicate with target via JLink
15:14:07.085	Reading readback protection status for Application core
15:14:07.086	Reading readback protection status for Application core 0%
15:14:07.211	Failed &amp;quot;reading readback protection status for application core&amp;quot;. Error: code: 1, description: Generic, message: Batch task protection-get failed, Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown Error in J-Link DLL (error code =-1)). This might indicate that the debug port is unavailable. Please double-check device power supply and SWD lines, and that SWD isn&amp;#39;t disabled
15:14:07.228	Error: Failed with exit code 1. One or more batch tasks failed: * 1051231268: Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown Error in J-Link DLL (error code =-1)). This might indicate that the debug port is unavailable. Please double-check device power supply and SWD lines, and that SWD isn&amp;#39;t disabled (Generic) Message: Batch task protection-get failed, Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown Error in J-Link DLL (error code =-1)). This might indicate that the debug port is unavailable. Please double-check device power supply and SWD lines, and that SWD isn&amp;#39;t disabled.
15:14:07.228	Error: Failed with exit code 1. One or more batch tasks failed: * 1051231268: Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown Error in J-Link DLL (error code =-1)). This might indicate that the debug port is unavailable. Please double-check device power supply and SWD lines, and that SWD isn&amp;#39;t disabled (Generic) Message: Batch task protection-get failed, Device error: Setting the debug port SELECT register failed while powering up sys and debug regions (Unknown Error in J-Link DLL (error code =-1)). This might indicate that the debug port is unavailable. Please double-check device power supply and SWD lines, and that SWD isn&amp;#39;t disabled.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;br data-start="353" data-end="356" /&gt;&lt;strong data-start="356" data-end="364"&gt;Arun&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551411?ContentTypeID=1</link><pubDate>Tue, 14 Oct 2025 11:30:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:352f5f34-0b8b-449d-8ade-8287c5f41683</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Arun,&lt;br /&gt;&lt;br /&gt;Maybe you have older version of nRF52-dk. Your nrf52-dk should have nrf5340 on it. You could try to program your board using either newer nrf52-dk or for example nrf9151-dk.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551357?ContentTypeID=1</link><pubDate>Tue, 14 Oct 2025 06:44:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e44f25ec-f9c9-43dc-ac3a-ef44ad5d5483</guid><dc:creator>Arun538</dc:creator><description>&lt;p data-start="99" data-end="112"&gt;&lt;strong data-start="99" data-end="112"&gt;Hi Dejan,&lt;/strong&gt;&lt;/p&gt;
&lt;p data-start="114" data-end="307"&gt;Can we please connect on a call? I&amp;rsquo;m running behind schedule and really need to complete this project.&lt;br data-start="216" data-end="219" /&gt; Please help me when you&amp;rsquo;re available &amp;mdash; I&amp;rsquo;ll be available until &lt;strong data-start="282" data-end="304"&gt;10 PM (India time)&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-start="309" data-end="338"&gt;Thank you for your support.&lt;/p&gt;
&lt;p data-start="340" data-end="364"&gt;Best regards,&lt;br data-start="353" data-end="356" /&gt; &lt;strong data-start="356" data-end="364"&gt;Arun&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551315?ContentTypeID=1</link><pubDate>Mon, 13 Oct 2025 17:22:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87c9cc22-0484-4ccd-a928-5aa587d0ddf4</guid><dc:creator>Arun538</dc:creator><description>&lt;p&gt;Hi Dejan,&lt;/p&gt;
&lt;p&gt;I tried connecting to all the available COM ports using different terminal programs (like PuTTY, serial terminal and Tera Term), but I&amp;rsquo;m still not getting any serial output from my custom nRF9151 board. That&amp;rsquo;s why I switched to RTT Viewer to check if any logs were available.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551287?ContentTypeID=1</link><pubDate>Mon, 13 Oct 2025 13:40:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6db028a-0d92-4562-8075-6c4c619bd8b1</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Arun,&lt;/p&gt;
[quote user="Arun538"]When I run the &lt;strong&gt;unmodified GNSS sample&lt;/strong&gt;, I don’t see any logs in the RTT Viewer.[/quote]
&lt;p&gt;If you do not modify the sample, you can use your terminal emulator program to connect to available COM port to see the output.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551270?ContentTypeID=1</link><pubDate>Mon, 13 Oct 2025 12:25:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a540070-4189-4fc6-84c5-cdfb8cd0b320</guid><dc:creator>Arun538</dc:creator><description>&lt;p data-start="115" data-end="128"&gt;&lt;strong data-start="115" data-end="128"&gt;Hi Dejan,&lt;/strong&gt;&lt;/p&gt;
&lt;p data-start="130" data-end="282"&gt;When I run the &lt;strong data-start="145" data-end="171"&gt;unmodified GNSS sample&lt;/strong&gt;, I don&amp;rsquo;t see any logs in the RTT Viewer.&lt;/p&gt;
&lt;p data-start="130" data-end="282"&gt;&lt;br data-start="212" data-end="215" /&gt; However, when I add the following lines to the &lt;strong data-start="262" data-end="274"&gt;prj.conf&lt;/strong&gt; file:&lt;/p&gt;
&lt;div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary"&gt;
&lt;div class="overflow-y-auto p-4" dir="ltr"&gt;&lt;code class="whitespace-pre!"&gt;&lt;span&gt;&lt;span class="hljs-attr"&gt;CONFIG_USE_SEGGER_RTT&lt;/span&gt;=y&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class="overflow-y-auto p-4" dir="ltr"&gt;&lt;code class="whitespace-pre!"&gt;&lt;span&gt;&lt;span class="hljs-attr"&gt;CONFIG_RTT_CONSOLE&lt;/span&gt;=y
&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class="overflow-y-auto p-4" dir="ltr"&gt;&lt;code class="whitespace-pre!"&gt;&lt;span&gt;&lt;span class="hljs-attr"&gt;CONFIG_LOG_BACKEND_RTT&lt;/span&gt;=y
&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p data-start="363" data-end="420"&gt;I can see the log output, but then I get error.&lt;/p&gt;
&lt;p data-start="422" data-end="578"&gt;I&amp;rsquo;m using the &lt;strong data-start="436" data-end="459"&gt;nRF52 DK (PCA10040)&lt;/strong&gt; &amp;mdash; the &lt;strong data-start="466" data-end="520"&gt;Development Kit for the nRF52810 and nRF52832 SoCs&lt;/strong&gt; &amp;mdash; as a programmer to flash my &lt;strong data-start="551" data-end="575"&gt;nRF9151 custom board&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-start="422" data-end="578"&gt;&lt;/p&gt;
&lt;p data-start="580" data-end="604"&gt;Best regards,&lt;br data-start="593" data-end="596" /&gt; &lt;strong data-start="596" data-end="604"&gt;Arun&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551260?ContentTypeID=1</link><pubDate>Mon, 13 Oct 2025 11:38:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b7da68c-cd10-47d3-ba93-a90054fd4ed3</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Arun,&lt;/p&gt;
[quote user=""]I am testing the &lt;strong&gt;GNSS sample&lt;/strong&gt; from &lt;strong&gt;nRF Connect SDK v3.0.0&lt;/strong&gt;.&lt;br /&gt; When I flash and run the firmware, I see the following output in RTT Viewer:[/quote][quote user="Arun538"]I’ve attached my &lt;code&gt;main.c&lt;/code&gt; and &lt;code&gt;prj.conf&lt;/code&gt; files — could you please check and let me know if anything is missing or needs to be modified?[/quote]
&lt;p&gt;&lt;span&gt;I have tested GNSS application with your main.c file in NCS v3.0.0. I got build error when using your main.c file but building worked fine when using main.c from GNSS sample. You could try to look for any changes between unmodified sample and your application.&lt;/span&gt;&lt;/p&gt;
[quote user="Arun538"]I uploaded the firmware to my custom board using the nRF9151 DK as a programmer.[/quote][quote user="Arun538"]I’m using the &lt;strong&gt;nRF52 DK as a programmer&lt;/strong&gt; to flash my &lt;strong&gt;nRF9151&lt;/strong&gt; board.[/quote]
&lt;p&gt;&lt;span&gt;Which device did you use for programming?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551091?ContentTypeID=1</link><pubDate>Fri, 10 Oct 2025 08:58:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8685077b-9db6-4df7-a836-52b4af0ca267</guid><dc:creator>Arun538</dc:creator><description>&lt;p data-start="72" data-end="85"&gt;&lt;strong data-start="72" data-end="85"&gt;Hi Dejan,&lt;/strong&gt;&lt;/p&gt;
&lt;p data-start="87" data-end="226"&gt;I removed all occurrences of &lt;code data-start="116" data-end="124"&gt;printk&lt;/code&gt; from both the project source files and the configuration file, but it&amp;rsquo;s still showing the same error.&lt;/p&gt;
&lt;p data-start="228" data-end="487"&gt;I&amp;rsquo;m using the &lt;strong data-start="242" data-end="270"&gt;nRF52 DK as a programmer&lt;/strong&gt; to flash my &lt;strong data-start="283" data-end="294"&gt;nRF9151&lt;/strong&gt; board.&lt;br data-start="301" data-end="304" /&gt; I upload the firmware using &lt;strong data-start="332" data-end="376"&gt;nRF Connect for Desktop (Programmer tab)&lt;/strong&gt;, and since I can&amp;rsquo;t see any output in the serial terminal, I&amp;rsquo;m using &lt;strong data-start="445" data-end="466"&gt;J-Link RTT Viewer&lt;/strong&gt; to monitor the logs.&lt;/p&gt;
&lt;p data-start="489" data-end="624"&gt;I&amp;rsquo;ve attached my &lt;code data-start="506" data-end="514"&gt;main.c&lt;/code&gt; and &lt;code data-start="519" data-end="529"&gt;prj.conf&lt;/code&gt; files &amp;mdash; could you please check and let me know if anything is missing or needs to be modified?&lt;/p&gt;
&lt;p data-start="489" data-end="624"&gt;&lt;/p&gt;
&lt;p data-start="489" data-end="624"&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2019 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;math.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;nrf_modem_at.h&amp;gt;
#include &amp;lt;nrf_modem_gnss.h&amp;gt;
#include &amp;lt;modem/lte_lc.h&amp;gt;
#include &amp;lt;modem/nrf_modem_lib.h&amp;gt;
#include &amp;lt;date_time.h&amp;gt;


LOG_MODULE_REGISTER(gnss_sample, CONFIG_GNSS_SAMPLE_LOG_LEVEL);

#define PI 3.14159265358979323846
#define EARTH_RADIUS_METERS (6371.0 * 1000.0)

#if !defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE) || defined(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST)
static struct k_work_q gnss_work_q;

#define GNSS_WORKQ_THREAD_STACK_SIZE 2304
#define GNSS_WORKQ_THREAD_PRIORITY   5

K_THREAD_STACK_DEFINE(gnss_workq_stack_area, GNSS_WORKQ_THREAD_STACK_SIZE);
#endif /* !CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE || CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST */

#if !defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE)
#include &amp;quot;assistance.h&amp;quot;

static struct nrf_modem_gnss_agnss_data_frame last_agnss;
static struct k_work agnss_data_get_work;
static volatile bool requesting_assistance;
#endif /* !CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE */

#if defined(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST)
static struct k_work_delayable ttff_test_got_fix_work;
static struct k_work_delayable ttff_test_prepare_work;
static struct k_work ttff_test_start_work;
static double time_to_fix;
#endif

static const char update_indicator[] = {&amp;#39;\\&amp;#39;, &amp;#39;|&amp;#39;, &amp;#39;/&amp;#39;, &amp;#39;-&amp;#39;};

static struct nrf_modem_gnss_pvt_data_frame last_pvt;
static uint64_t fix_timestamp;
static uint32_t time_blocked;

/* Reference position. */
static bool ref_used;
static double ref_latitude;
static double ref_longitude;

K_MSGQ_DEFINE(nmea_queue, sizeof(struct nrf_modem_gnss_nmea_data_frame *), 10, 4);
static K_SEM_DEFINE(pvt_data_sem, 0, 1);
static K_SEM_DEFINE(time_sem, 0, 1);

static struct k_poll_event events[2] = {
	K_POLL_EVENT_STATIC_INITIALIZER(K_POLL_TYPE_SEM_AVAILABLE,
					K_POLL_MODE_NOTIFY_ONLY,
					&amp;amp;pvt_data_sem, 0),
	K_POLL_EVENT_STATIC_INITIALIZER(K_POLL_TYPE_MSGQ_DATA_AVAILABLE,
					K_POLL_MODE_NOTIFY_ONLY,
					&amp;amp;nmea_queue, 0),
};

BUILD_ASSERT(IS_ENABLED(CONFIG_LTE_NETWORK_MODE_LTE_M_GPS) ||
	     IS_ENABLED(CONFIG_LTE_NETWORK_MODE_NBIOT_GPS) ||
	     IS_ENABLED(CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS),
	     &amp;quot;CONFIG_LTE_NETWORK_MODE_LTE_M_GPS, &amp;quot;
	     &amp;quot;CONFIG_LTE_NETWORK_MODE_NBIOT_GPS or &amp;quot;
	     &amp;quot;CONFIG_LTE_NETWORK_MODE_LTE_M_NBIOT_GPS must be enabled&amp;quot;);

BUILD_ASSERT((sizeof(CONFIG_GNSS_SAMPLE_REFERENCE_LATITUDE) == 1 &amp;amp;&amp;amp;
	      sizeof(CONFIG_GNSS_SAMPLE_REFERENCE_LONGITUDE) == 1) ||
	     (sizeof(CONFIG_GNSS_SAMPLE_REFERENCE_LATITUDE) &amp;gt; 1 &amp;amp;&amp;amp;
	      sizeof(CONFIG_GNSS_SAMPLE_REFERENCE_LONGITUDE) &amp;gt; 1),
	     &amp;quot;CONFIG_GNSS_SAMPLE_REFERENCE_LATITUDE and &amp;quot;
	     &amp;quot;CONFIG_GNSS_SAMPLE_REFERENCE_LONGITUDE must be both either set or empty&amp;quot;);

/* Returns the distance between two coordinates in meters. The distance is calculated using the
 * haversine formula.
 */
static double distance_calculate(double lat1, double lon1,
				 double lat2, double lon2)
{
	double d_lat_rad = (lat2 - lat1) * PI / 180.0;
	double d_lon_rad = (lon2 - lon1) * PI / 180.0;

	double lat1_rad = lat1 * PI / 180.0;
	double lat2_rad = lat2 * PI / 180.0;

	double a = pow(sin(d_lat_rad / 2), 2) +
		   pow(sin(d_lon_rad / 2), 2) *
		   cos(lat1_rad) * cos(lat2_rad);

	double c = 2 * asin(sqrt(a));

	return EARTH_RADIUS_METERS * c;
}

static void print_distance_from_reference(struct nrf_modem_gnss_pvt_data_frame *pvt_data)
{
	if (!ref_used) {
		return;
	}

	double distance = distance_calculate(pvt_data-&amp;gt;latitude, pvt_data-&amp;gt;longitude,
					     ref_latitude, ref_longitude);

	if (IS_ENABLED(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST)) {
		LOG_INF(&amp;quot;Distance from reference: %.01f&amp;quot;, distance);
	} else {
		printf(&amp;quot;\nDistance from reference: %.01f\n&amp;quot;, distance);
	}
}

static void gnss_event_handler(int event)
{
	int retval;
	struct nrf_modem_gnss_nmea_data_frame *nmea_data;

	switch (event) {
	case NRF_MODEM_GNSS_EVT_PVT:
		retval = nrf_modem_gnss_read(&amp;amp;last_pvt, sizeof(last_pvt), NRF_MODEM_GNSS_DATA_PVT);
		if (retval == 0) {
			k_sem_give(&amp;amp;pvt_data_sem);
		}
		break;

#if defined(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST)
	case NRF_MODEM_GNSS_EVT_FIX:
		/* Time to fix is calculated here, but it&amp;#39;s printed from a delayed work to avoid
		 * messing up the NMEA output.
		 */
		time_to_fix = (k_uptime_get() - fix_timestamp) / 1000.0;
		k_work_schedule_for_queue(&amp;amp;gnss_work_q, &amp;amp;ttff_test_got_fix_work, K_MSEC(100));
		k_work_schedule_for_queue(&amp;amp;gnss_work_q, &amp;amp;ttff_test_prepare_work,
					  K_SECONDS(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST_INTERVAL));
		break;
#endif /* CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST */

	case NRF_MODEM_GNSS_EVT_NMEA:
		nmea_data = k_malloc(sizeof(struct nrf_modem_gnss_nmea_data_frame));
		if (nmea_data == NULL) {
			LOG_ERR(&amp;quot;Failed to allocate memory for NMEA&amp;quot;);
			break;
		}

		retval = nrf_modem_gnss_read(nmea_data,
					     sizeof(struct nrf_modem_gnss_nmea_data_frame),
					     NRF_MODEM_GNSS_DATA_NMEA);
		if (retval == 0) {
			retval = k_msgq_put(&amp;amp;nmea_queue, &amp;amp;nmea_data, K_NO_WAIT);
		}

		if (retval != 0) {
			k_free(nmea_data);
		}
		break;

	case NRF_MODEM_GNSS_EVT_AGNSS_REQ:
#if !defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE)
		retval = nrf_modem_gnss_read(&amp;amp;last_agnss,
					     sizeof(last_agnss),
					     NRF_MODEM_GNSS_DATA_AGNSS_REQ);
		if (retval == 0) {
			k_work_submit_to_queue(&amp;amp;gnss_work_q, &amp;amp;agnss_data_get_work);
		}
#endif /* !CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE */
		break;

	default:
		break;
	}
}

#if !defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE)
#if defined(CONFIG_GNSS_SAMPLE_LTE_ON_DEMAND)
K_SEM_DEFINE(lte_ready, 0, 1);

static void lte_lc_event_handler(const struct lte_lc_evt *const evt)
{
	switch (evt-&amp;gt;type) {
	case LTE_LC_EVT_NW_REG_STATUS:
		if ((evt-&amp;gt;nw_reg_status == LTE_LC_NW_REG_REGISTERED_HOME) ||
		    (evt-&amp;gt;nw_reg_status == LTE_LC_NW_REG_REGISTERED_ROAMING)) {
			LOG_INF(&amp;quot;Connected to LTE network&amp;quot;);
			k_sem_give(&amp;amp;lte_ready);
		}
		break;

	default:
		break;
	}
}

void lte_connect(void)
{
	int err;

	LOG_INF(&amp;quot;Connecting to LTE network&amp;quot;);

	err = lte_lc_func_mode_set(LTE_LC_FUNC_MODE_ACTIVATE_LTE);
	if (err) {
		LOG_ERR(&amp;quot;Failed to activate LTE, error: %d&amp;quot;, err);
		return;
	}

	k_sem_take(&amp;amp;lte_ready, K_FOREVER);

	/* Wait for a while, because with IPv4v6 PDN the IPv6 activation takes a bit more time. */
	k_sleep(K_SECONDS(1));
}

void lte_disconnect(void)
{
	int err;

	err = lte_lc_func_mode_set(LTE_LC_FUNC_MODE_DEACTIVATE_LTE);
	if (err) {
		LOG_ERR(&amp;quot;Failed to deactivate LTE, error: %d&amp;quot;, err);
		return;
	}

	LOG_INF(&amp;quot;LTE disconnected&amp;quot;);
}
#endif /* CONFIG_GNSS_SAMPLE_LTE_ON_DEMAND */

static const char *get_system_string(uint8_t system_id)
{
	switch (system_id) {
	case NRF_MODEM_GNSS_SYSTEM_INVALID:
		return &amp;quot;invalid&amp;quot;;

	case NRF_MODEM_GNSS_SYSTEM_GPS:
		return &amp;quot;GPS&amp;quot;;

	case NRF_MODEM_GNSS_SYSTEM_QZSS:
		return &amp;quot;QZSS&amp;quot;;

	default:
		return &amp;quot;unknown&amp;quot;;
	}
}

static void agnss_data_get_work_fn(struct k_work *item)
{
	ARG_UNUSED(item);

	int err;

	/* GPS data need is always expected to be present and first in list. */
	__ASSERT(last_agnss.system_count &amp;gt; 0,
		 &amp;quot;GNSS system data need not found&amp;quot;);
	__ASSERT(last_agnss.system[0].system_id == NRF_MODEM_GNSS_SYSTEM_GPS,
		 &amp;quot;GPS data need not found&amp;quot;);

#if defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_SUPL)
	/* SUPL doesn&amp;#39;t usually provide NeQuick ionospheric corrections and satellite real time
	 * integrity information. If GNSS asks only for those, the request should be ignored.
	 */
	if (last_agnss.system[0].sv_mask_ephe == 0 &amp;amp;&amp;amp;
	    last_agnss.system[0].sv_mask_alm == 0 &amp;amp;&amp;amp;
	    (last_agnss.data_flags &amp;amp; ~(NRF_MODEM_GNSS_AGNSS_NEQUICK_REQUEST |
				       NRF_MODEM_GNSS_AGNSS_INTEGRITY_REQUEST)) == 0) {
		LOG_INF(&amp;quot;Ignoring assistance request for only NeQuick and/or integrity&amp;quot;);
		return;
	}
#endif /* CONFIG_GNSS_SAMPLE_ASSISTANCE_SUPL */

#if defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_MINIMAL)
	/* With minimal assistance, the request should be ignored if no GPS time or position
	 * is requested.
	 */
	if (!(last_agnss.data_flags &amp;amp; NRF_MODEM_GNSS_AGNSS_GPS_SYS_TIME_AND_SV_TOW_REQUEST) &amp;amp;&amp;amp;
	    !(last_agnss.data_flags &amp;amp; NRF_MODEM_GNSS_AGNSS_POSITION_REQUEST)) {
		LOG_INF(&amp;quot;Ignoring assistance request because no GPS time or position is requested&amp;quot;);
		return;
	}
#endif /* CONFIG_GNSS_SAMPLE_ASSISTANCE_MINIMAL */

	if (last_agnss.data_flags == 0 &amp;amp;&amp;amp;
	    last_agnss.system[0].sv_mask_ephe == 0 &amp;amp;&amp;amp;
	    last_agnss.system[0].sv_mask_alm == 0) {
		LOG_INF(&amp;quot;Ignoring assistance request because only QZSS data is requested&amp;quot;);
		return;
	}

	requesting_assistance = true;

	LOG_INF(&amp;quot;Assistance data needed: data_flags: 0x%02x&amp;quot;, last_agnss.data_flags);
	for (int i = 0; i &amp;lt; last_agnss.system_count; i++) {
		LOG_INF(&amp;quot;Assistance data needed: %s ephe: 0x%llx, alm: 0x%llx&amp;quot;,
			get_system_string(last_agnss.system[i].system_id),
			last_agnss.system[i].sv_mask_ephe,
			last_agnss.system[i].sv_mask_alm);
	}

#if defined(CONFIG_GNSS_SAMPLE_LTE_ON_DEMAND)
	lte_connect();
#endif /* CONFIG_GNSS_SAMPLE_LTE_ON_DEMAND */

	err = assistance_request(&amp;amp;last_agnss);
	if (err) {
		LOG_ERR(&amp;quot;Failed to request assistance data&amp;quot;);
	}

#if defined(CONFIG_GNSS_SAMPLE_LTE_ON_DEMAND)
	lte_disconnect();
#endif /* CONFIG_GNSS_SAMPLE_LTE_ON_DEMAND */

	requesting_assistance = false;
}
#endif /* !CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE */

#if defined(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST)
static void ttff_test_got_fix_work_fn(struct k_work *item)
{
	LOG_INF(&amp;quot;Time to fix: %.01f s&amp;quot;, time_to_fix);
	if (time_blocked &amp;gt; 0) {
		LOG_INF(&amp;quot;Time GNSS was blocked by LTE: %u s&amp;quot;, time_blocked);
	}
	print_distance_from_reference(&amp;amp;last_pvt);
	LOG_INF(&amp;quot;Sleeping for %u s&amp;quot;, CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST_INTERVAL);
}

static int ttff_test_force_cold_start(void)
{
	int err;
	uint32_t delete_mask;

	LOG_INF(&amp;quot;Deleting GNSS data&amp;quot;);

	/* Delete everything else except the TCXO offset. */
	delete_mask = NRF_MODEM_GNSS_DELETE_EPHEMERIDES |
		      NRF_MODEM_GNSS_DELETE_ALMANACS |
		      NRF_MODEM_GNSS_DELETE_IONO_CORRECTION_DATA |
		      NRF_MODEM_GNSS_DELETE_LAST_GOOD_FIX |
		      NRF_MODEM_GNSS_DELETE_GPS_TOW |
		      NRF_MODEM_GNSS_DELETE_GPS_WEEK |
		      NRF_MODEM_GNSS_DELETE_UTC_DATA |
		      NRF_MODEM_GNSS_DELETE_GPS_TOW_PRECISION;

	/* With minimal assistance, we want to keep the factory almanac. */
	if (IS_ENABLED(CONFIG_GNSS_SAMPLE_ASSISTANCE_MINIMAL)) {
		delete_mask &amp;amp;= ~NRF_MODEM_GNSS_DELETE_ALMANACS;
	}

	err = nrf_modem_gnss_nv_data_delete(delete_mask);
	if (err) {
		LOG_ERR(&amp;quot;Failed to delete GNSS data&amp;quot;);
		return -1;
	}

	return 0;
}

#if defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NRF_CLOUD)
static bool qzss_assistance_is_supported(void)
{
	char resp[32];

	if (nrf_modem_at_cmd(resp, sizeof(resp), &amp;quot;AT+CGMM&amp;quot;) == 0) {
		/* nRF9160 does not support QZSS assistance, while nRF91x1 do. */
		if (strstr(resp, &amp;quot;nRF9160&amp;quot;) != NULL) {
			return false;
		}
	}

	return true;
}
#endif /* CONFIG_GNSS_SAMPLE_ASSISTANCE_NRF_CLOUD */

static void ttff_test_prepare_work_fn(struct k_work *item)
{
	/* Make sure GNSS is stopped before next start. */
	nrf_modem_gnss_stop();

	if (IS_ENABLED(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST_COLD_START)) {
		if (ttff_test_force_cold_start() != 0) {
			return;
		}
	}

#if !defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE)
	if (IS_ENABLED(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST_COLD_START)) {
		/* All A-GNSS data is always requested before GNSS is started. */
		last_agnss.data_flags =
			NRF_MODEM_GNSS_AGNSS_GPS_UTC_REQUEST |
			NRF_MODEM_GNSS_AGNSS_KLOBUCHAR_REQUEST |
			NRF_MODEM_GNSS_AGNSS_NEQUICK_REQUEST |
			NRF_MODEM_GNSS_AGNSS_GPS_SYS_TIME_AND_SV_TOW_REQUEST |
			NRF_MODEM_GNSS_AGNSS_POSITION_REQUEST |
			NRF_MODEM_GNSS_AGNSS_INTEGRITY_REQUEST;
		last_agnss.system_count = 1;
		last_agnss.system[0].sv_mask_ephe = 0xffffffff;
		last_agnss.system[0].sv_mask_alm = 0xffffffff;
#if defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NRF_CLOUD)
		if (qzss_assistance_is_supported()) {
			last_agnss.system_count = 2;
			last_agnss.system[1].sv_mask_ephe = 0x3ff;
			last_agnss.system[1].sv_mask_alm = 0x3ff;
		}
#endif /* CONFIG_GNSS_SAMPLE_ASSISTANCE_NRF_CLOUD */

		k_work_submit_to_queue(&amp;amp;gnss_work_q, &amp;amp;agnss_data_get_work);
	} else {
		/* Start and stop GNSS to trigger possible A-GNSS data request. If new A-GNSS
		 * data is needed it is fetched before GNSS is started.
		 */
		nrf_modem_gnss_start();
		nrf_modem_gnss_stop();
	}
#endif /* !CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE */

	k_work_submit_to_queue(&amp;amp;gnss_work_q, &amp;amp;ttff_test_start_work);
}

static void ttff_test_start_work_fn(struct k_work *item)
{
	LOG_INF(&amp;quot;Starting GNSS&amp;quot;);
	if (nrf_modem_gnss_start() != 0) {
		LOG_ERR(&amp;quot;Failed to start GNSS&amp;quot;);
		return;
	}

	fix_timestamp = k_uptime_get();
	time_blocked = 0;
}
#endif /* CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST */

static void date_time_evt_handler(const struct date_time_evt *evt)
{
	k_sem_give(&amp;amp;time_sem);
}

static int modem_init(void)
{
	if (IS_ENABLED(CONFIG_DATE_TIME)) {
		date_time_register_handler(date_time_evt_handler);
	}

#if defined(CONFIG_GNSS_SAMPLE_LTE_ON_DEMAND)
	lte_lc_register_handler(lte_lc_event_handler);
#elif !defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE)
	lte_lc_psm_req(true);

	LOG_INF(&amp;quot;Connecting to LTE network&amp;quot;);

	if (lte_lc_connect() != 0) {
		LOG_ERR(&amp;quot;Failed to connect to LTE network&amp;quot;);
		return -1;
	}

	LOG_INF(&amp;quot;Connected to LTE network&amp;quot;);

	if (IS_ENABLED(CONFIG_DATE_TIME)) {
		LOG_INF(&amp;quot;Waiting for current time&amp;quot;);

		/* Wait for an event from the Date Time library. */
		k_sem_take(&amp;amp;time_sem, K_MINUTES(10));

		if (!date_time_is_valid()) {
			LOG_WRN(&amp;quot;Failed to get current time, continuing anyway&amp;quot;);
		}
	}
#endif

	return 0;
}

static int sample_init(void)
{
	int err = 0;

#if !defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE) || defined(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST)
	struct k_work_queue_config cfg = {
		.name = &amp;quot;gnss_work_q&amp;quot;,
		.no_yield = false
	};

	k_work_queue_start(
		&amp;amp;gnss_work_q,
		gnss_workq_stack_area,
		K_THREAD_STACK_SIZEOF(gnss_workq_stack_area),
		GNSS_WORKQ_THREAD_PRIORITY,
		&amp;amp;cfg);
#endif /* !CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE || CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST */

#if !defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE)
	k_work_init(&amp;amp;agnss_data_get_work, agnss_data_get_work_fn);

	err = assistance_init(&amp;amp;gnss_work_q);
#endif /* !CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE */

#if defined(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST)
	k_work_init_delayable(&amp;amp;ttff_test_got_fix_work, ttff_test_got_fix_work_fn);
	k_work_init_delayable(&amp;amp;ttff_test_prepare_work, ttff_test_prepare_work_fn);
	k_work_init(&amp;amp;ttff_test_start_work, ttff_test_start_work_fn);
#endif /* CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST */

	return err;
}

static int gnss_init_and_start(void)
{
#if defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE) || defined(CONFIG_GNSS_SAMPLE_LTE_ON_DEMAND)
	/* Enable GNSS. */
	if (lte_lc_func_mode_set(LTE_LC_FUNC_MODE_ACTIVATE_GNSS) != 0) {
		LOG_ERR(&amp;quot;Failed to activate GNSS functional mode&amp;quot;);
		return -1;
	}
#endif /* CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE || CONFIG_GNSS_SAMPLE_LTE_ON_DEMAND */

	/* Configure GNSS. */
	if (nrf_modem_gnss_event_handler_set(gnss_event_handler) != 0) {
		LOG_ERR(&amp;quot;Failed to set GNSS event handler&amp;quot;);
		return -1;
	}

	/* Enable all supported NMEA messages. */
	uint16_t nmea_mask = NRF_MODEM_GNSS_NMEA_RMC_MASK |
			     NRF_MODEM_GNSS_NMEA_GGA_MASK |
			     NRF_MODEM_GNSS_NMEA_GLL_MASK |
			     NRF_MODEM_GNSS_NMEA_GSA_MASK |
			     NRF_MODEM_GNSS_NMEA_GSV_MASK;

	if (nrf_modem_gnss_nmea_mask_set(nmea_mask) != 0) {
		LOG_ERR(&amp;quot;Failed to set GNSS NMEA mask&amp;quot;);
		return -1;
	}

	/* Make QZSS satellites visible in the NMEA output. */
	if (nrf_modem_gnss_qzss_nmea_mode_set(NRF_MODEM_GNSS_QZSS_NMEA_MODE_CUSTOM) != 0) {
		LOG_WRN(&amp;quot;Failed to enable custom QZSS NMEA mode&amp;quot;);
	}

	/* This use case flag should always be set. */
	uint8_t use_case = NRF_MODEM_GNSS_USE_CASE_MULTIPLE_HOT_START;

	if (IS_ENABLED(CONFIG_GNSS_SAMPLE_MODE_PERIODIC) &amp;amp;&amp;amp;
	    !IS_ENABLED(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE)) {
		/* Disable GNSS scheduled downloads when assistance is used. */
		use_case |= NRF_MODEM_GNSS_USE_CASE_SCHED_DOWNLOAD_DISABLE;
	}

	if (IS_ENABLED(CONFIG_GNSS_SAMPLE_LOW_ACCURACY)) {
		use_case |= NRF_MODEM_GNSS_USE_CASE_LOW_ACCURACY;
	}

	if (nrf_modem_gnss_use_case_set(use_case) != 0) {
		LOG_WRN(&amp;quot;Failed to set GNSS use case&amp;quot;);
	}

#if defined(CONFIG_NRF_CLOUD_AGNSS_ELEVATION_MASK)
	if (nrf_modem_gnss_elevation_threshold_set(CONFIG_NRF_CLOUD_AGNSS_ELEVATION_MASK) != 0) {
		LOG_ERR(&amp;quot;Failed to set elevation threshold&amp;quot;);
		return -1;
	}
	LOG_DBG(&amp;quot;Set elevation threshold to %u&amp;quot;, CONFIG_NRF_CLOUD_AGNSS_ELEVATION_MASK);
#endif

#if defined(CONFIG_GNSS_SAMPLE_MODE_CONTINUOUS)
	/* Default to no power saving. */
	uint8_t power_mode = NRF_MODEM_GNSS_PSM_DISABLED;

#if defined(CONFIG_GNSS_SAMPLE_POWER_SAVING_MODERATE)
	power_mode = NRF_MODEM_GNSS_PSM_DUTY_CYCLING_PERFORMANCE;
#elif defined(CONFIG_GNSS_SAMPLE_POWER_SAVING_HIGH)
	power_mode = NRF_MODEM_GNSS_PSM_DUTY_CYCLING_POWER;
#endif

	if (nrf_modem_gnss_power_mode_set(power_mode) != 0) {
		LOG_ERR(&amp;quot;Failed to set GNSS power saving mode&amp;quot;);
		return -1;
	}
#endif /* CONFIG_GNSS_SAMPLE_MODE_CONTINUOUS */

	/* Default to continuous tracking. */
	uint16_t fix_retry = 0;
	uint16_t fix_interval = 1;

#if defined(CONFIG_GNSS_SAMPLE_MODE_PERIODIC)
	fix_retry = CONFIG_GNSS_SAMPLE_PERIODIC_TIMEOUT;
	fix_interval = CONFIG_GNSS_SAMPLE_PERIODIC_INTERVAL;
#elif defined(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST)
	/* Single fix for TTFF test mode. */
	fix_retry = 0;
	fix_interval = 0;
#endif

	if (nrf_modem_gnss_fix_retry_set(fix_retry) != 0) {
		LOG_ERR(&amp;quot;Failed to set GNSS fix retry&amp;quot;);
		return -1;
	}

	if (nrf_modem_gnss_fix_interval_set(fix_interval) != 0) {
		LOG_ERR(&amp;quot;Failed to set GNSS fix interval&amp;quot;);
		return -1;
	}

#if defined(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST)
	k_work_schedule_for_queue(&amp;amp;gnss_work_q, &amp;amp;ttff_test_prepare_work, K_NO_WAIT);
#else /* !CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST */
	if (nrf_modem_gnss_start() != 0) {
		LOG_ERR(&amp;quot;Failed to start GNSS&amp;quot;);
		return -1;
	}
#endif

	return 0;
}

static bool output_paused(void)
{
#if defined(CONFIG_GNSS_SAMPLE_ASSISTANCE_NONE) || defined(CONFIG_GNSS_SAMPLE_LOG_LEVEL_OFF)
	return false;
#else
	return (requesting_assistance || assistance_is_active()) ? true : false;
#endif
}

static void print_satellite_stats(struct nrf_modem_gnss_pvt_data_frame *pvt_data)
{
	uint8_t tracked   = 0;
	uint8_t in_fix    = 0;
	uint8_t unhealthy = 0;

	for (int i = 0; i &amp;lt; NRF_MODEM_GNSS_MAX_SATELLITES; ++i) {
		if (pvt_data-&amp;gt;sv[i].sv &amp;gt; 0) {
			tracked++;

			if (pvt_data-&amp;gt;sv[i].flags &amp;amp; NRF_MODEM_GNSS_SV_FLAG_USED_IN_FIX) {
				in_fix++;
			}

			if (pvt_data-&amp;gt;sv[i].flags &amp;amp; NRF_MODEM_GNSS_SV_FLAG_UNHEALTHY) {
				unhealthy++;
			}
		}
	}

	printf(&amp;quot;Tracking: %2d Using: %2d Unhealthy: %d\n&amp;quot;, tracked, in_fix, unhealthy);
}

static void print_flags(struct nrf_modem_gnss_pvt_data_frame *pvt_data)
{
	if (pvt_data-&amp;gt;flags &amp;amp; NRF_MODEM_GNSS_PVT_FLAG_DEADLINE_MISSED) {
		printf(&amp;quot;GNSS operation blocked by LTE\n&amp;quot;);
	}
	if (pvt_data-&amp;gt;flags &amp;amp; NRF_MODEM_GNSS_PVT_FLAG_NOT_ENOUGH_WINDOW_TIME) {
		printf(&amp;quot;Insufficient GNSS time windows\n&amp;quot;);
	}
	if (pvt_data-&amp;gt;flags &amp;amp; NRF_MODEM_GNSS_PVT_FLAG_SLEEP_BETWEEN_PVT) {
		printf(&amp;quot;Sleep period(s) between PVT notifications\n&amp;quot;);
	}
	if (pvt_data-&amp;gt;flags &amp;amp; NRF_MODEM_GNSS_PVT_FLAG_SCHED_DOWNLOAD) {
		printf(&amp;quot;Scheduled navigation data download\n&amp;quot;);
	}
}

static void print_fix_data(struct nrf_modem_gnss_pvt_data_frame *pvt_data)
{
	printf(&amp;quot;Latitude:          %.06f\n&amp;quot;, pvt_data-&amp;gt;latitude);
	printf(&amp;quot;Longitude:         %.06f\n&amp;quot;, pvt_data-&amp;gt;longitude);
	printf(&amp;quot;Accuracy:          %.01f m\n&amp;quot;, (double)pvt_data-&amp;gt;accuracy);
	printf(&amp;quot;Altitude:          %.01f m\n&amp;quot;, (double)pvt_data-&amp;gt;altitude);
	printf(&amp;quot;Altitude accuracy: %.01f m\n&amp;quot;, (double)pvt_data-&amp;gt;altitude_accuracy);
	printf(&amp;quot;Speed:             %.01f m/s\n&amp;quot;, (double)pvt_data-&amp;gt;speed);
	printf(&amp;quot;Speed accuracy:    %.01f m/s\n&amp;quot;, (double)pvt_data-&amp;gt;speed_accuracy);
	printf(&amp;quot;V. speed:          %.01f m/s\n&amp;quot;, (double)pvt_data-&amp;gt;vertical_speed);
	printf(&amp;quot;V. speed accuracy: %.01f m/s\n&amp;quot;, (double)pvt_data-&amp;gt;vertical_speed_accuracy);
	printf(&amp;quot;Heading:           %.01f deg\n&amp;quot;, (double)pvt_data-&amp;gt;heading);
	printf(&amp;quot;Heading accuracy:  %.01f deg\n&amp;quot;, (double)pvt_data-&amp;gt;heading_accuracy);
	printf(&amp;quot;Date:              %04u-%02u-%02u\n&amp;quot;,
	       pvt_data-&amp;gt;datetime.year,
	       pvt_data-&amp;gt;datetime.month,
	       pvt_data-&amp;gt;datetime.day);
	printf(&amp;quot;Time (UTC):        %02u:%02u:%02u.%03u\n&amp;quot;,
	       pvt_data-&amp;gt;datetime.hour,
	       pvt_data-&amp;gt;datetime.minute,
	       pvt_data-&amp;gt;datetime.seconds,
	       pvt_data-&amp;gt;datetime.ms);
// 	printf(&amp;quot;PDOP:              %.01f\n&amp;quot;, (double)pvt_data-&amp;gt;pdop);
// 	printf(&amp;quot;HDOP:              %.01f\n&amp;quot;, (double)pvt_data-&amp;gt;hdop);
// 	printf(&amp;quot;VDOP:              %.01f\n&amp;quot;, (double)pvt_data-&amp;gt;vdop);
// 	printf(&amp;quot;TDOP:              %.01f\n&amp;quot;, (double)pvt_data-&amp;gt;tdop);
 }

int main(void)
{
	int err;
	uint8_t cnt = 0;
	struct nrf_modem_gnss_nmea_data_frame *nmea_data;

	LOG_INF(&amp;quot;Starting GNSS sample&amp;quot;);

	err = nrf_modem_lib_init();
	if (err) {
		LOG_ERR(&amp;quot;Modem library initialization failed, error: %d&amp;quot;, err);
		return err;
	}

	/* Initialize reference coordinates (if used). */
	if (sizeof(CONFIG_GNSS_SAMPLE_REFERENCE_LATITUDE) &amp;gt; 1 &amp;amp;&amp;amp;
	    sizeof(CONFIG_GNSS_SAMPLE_REFERENCE_LONGITUDE) &amp;gt; 1) {
		ref_used = true;
		ref_latitude = atof(CONFIG_GNSS_SAMPLE_REFERENCE_LATITUDE);
		ref_longitude = atof(CONFIG_GNSS_SAMPLE_REFERENCE_LONGITUDE);
	}

	if (modem_init() != 0) {
		LOG_ERR(&amp;quot;Failed to initialize modem&amp;quot;);
		return -1;
	}

	if (sample_init() != 0) {
		LOG_ERR(&amp;quot;Failed to initialize sample&amp;quot;);
		return -1;
	}

	if (gnss_init_and_start() != 0) {
		LOG_ERR(&amp;quot;Failed to initialize and start GNSS&amp;quot;);
		return -1;
	}

	fix_timestamp = k_uptime_get();

	for (;;) {
		(void)k_poll(events, 2, K_FOREVER);

		if (events[0].state == K_POLL_STATE_SEM_AVAILABLE &amp;amp;&amp;amp;
		    k_sem_take(events[0].sem, K_NO_WAIT) == 0) {
			/* New PVT data available */

			if (IS_ENABLED(CONFIG_GNSS_SAMPLE_MODE_TTFF_TEST)) {
				/* TTFF test mode. */

				/* Calculate the time GNSS has been blocked by LTE. */
				if (last_pvt.flags &amp;amp; NRF_MODEM_GNSS_PVT_FLAG_DEADLINE_MISSED) {
					time_blocked++;
				}
			} else if (IS_ENABLED(CONFIG_GNSS_SAMPLE_NMEA_ONLY)) {
				/* NMEA-only output mode. */

				if (output_paused()) {
					goto handle_nmea;
				}

				if (last_pvt.flags &amp;amp; NRF_MODEM_GNSS_PVT_FLAG_FIX_VALID) {
					print_distance_from_reference(&amp;amp;last_pvt);
				}
			} else {
				/* PVT and NMEA output mode. */

				if (output_paused()) {
					goto handle_nmea;
				}

				printf(&amp;quot;\033[1;1H&amp;quot;);
				printf(&amp;quot;\033[2J&amp;quot;);
				print_satellite_stats(&amp;amp;last_pvt);
				print_flags(&amp;amp;last_pvt);
				printf(&amp;quot;-----------------------------------\n&amp;quot;);

				if (last_pvt.flags &amp;amp; NRF_MODEM_GNSS_PVT_FLAG_FIX_VALID) {
					fix_timestamp = k_uptime_get();
					print_fix_data(&amp;amp;last_pvt);
					print_distance_from_reference(&amp;amp;last_pvt);
				} else {
					printf(&amp;quot;Seconds since last fix: %d\n&amp;quot;,
					       (uint32_t)((k_uptime_get() - fix_timestamp) / 1000));
					cnt++;
					printf(&amp;quot;Searching [%c]\n&amp;quot;, update_indicator[cnt%4]);
				}

				printf(&amp;quot;\nNMEA strings:\n\n&amp;quot;);
			}
		}

handle_nmea:
		if (events[1].state == K_POLL_STATE_MSGQ_DATA_AVAILABLE &amp;amp;&amp;amp;
		    k_msgq_get(events[1].msgq, &amp;amp;nmea_data, K_NO_WAIT) == 0) {
			/* New NMEA data available */

			if (!output_paused()) {
				printf(&amp;quot;%s&amp;quot;, nmea_data-&amp;gt;nmea_str);
			}
			k_free(nmea_data);
		}

		events[0].state = K_POLL_STATE_NOT_READY;
		events[1].state = K_POLL_STATE_NOT_READY;
	}

	return 0;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p data-start="489" data-end="624"&gt;&lt;/p&gt;
&lt;p data-start="489" data-end="624"&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Enable RTT Console and Logging
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n

# General
CONFIG_FPU=y
CONFIG_NRF_MODEM_LIB=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_PICOLIBC_IO_FLOAT=y
CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y

# GNSS sample
# Enable to use nRF Cloud A-GNSS
CONFIG_NRF_CLOUD=y
CONFIG_GNSS_SAMPLE_ASSISTANCE_NRF_CLOUD=n

# LTE Link Control
CONFIG_LTE_LINK_CONTROL=y
# Request eDRX from the network
CONFIG_LTE_LC_EDRX_MODULE=y
CONFIG_LTE_EDRX_REQ=y
# PSM requested periodic TAU 8 hours
CONFIG_LTE_LC_PSM_MODULE=y
CONFIG_LTE_PSM_REQ_RPTAU=&amp;quot;00101000&amp;quot;
# PSM requested active time 6 seconds
CONFIG_LTE_PSM_REQ_RAT=&amp;quot;00000011&amp;quot;

# AT Host library - Used to send AT commands directy from an UART terminal and to allow
#		    integration with nRF Connect for Desktop LTE Link monitor application.
CONFIG_AT_HOST_LIBRARY=y

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_POSIX_API=y
# Disable native network stack to save some memory
CONFIG_NET_NATIVE=n

# Memory and stack configuration
CONFIG_HEAP_MEM_POOL_SIZE=2048
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536
&lt;/pre&gt;&lt;/p&gt;
&lt;p data-start="489" data-end="624"&gt;&lt;/p&gt;
&lt;p data-start="489" data-end="624"&gt;&lt;/p&gt;
&lt;p data-start="626" data-end="648"&gt;Best regards,&lt;br data-start="639" data-end="642" /&gt; Arun&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551072?ContentTypeID=1</link><pubDate>Fri, 10 Oct 2025 05:49:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d834bc31-16ae-4e15-9ed2-818415930b43</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Arun,&lt;br /&gt;&lt;br /&gt;Can you try to remove occurrences of printk (from your code and configuration) and leave only logging enabled? What is the result?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551061?ContentTypeID=1</link><pubDate>Fri, 10 Oct 2025 03:56:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc756508-3512-4aaf-9446-0a5088478a01</guid><dc:creator>Arun538</dc:creator><description>&lt;p data-start="63" data-end="76"&gt;&lt;span&gt;Hi Dejan,&lt;/span&gt;&lt;/p&gt;
&lt;p data-start="78" data-end="168"&gt;Yes, I&amp;rsquo;ve added the following configurations in the &lt;code data-start="130" data-end="140"&gt;prj.conf&lt;/code&gt; file to enable RTT logging:&lt;/p&gt;
&lt;p data-start="78" data-end="168"&gt;CONFIG_USE_SEGGER_RTT=y&lt;br /&gt;CONFIG_RTT_CONSOLE=y&lt;br /&gt;CONFIG_LOG=y&lt;br /&gt;CONFIG_LOG_BACKEND_RTT=y&lt;br /&gt;CONFIG_LOG_BACKEND_UART=n&lt;br /&gt;CONFIG_LOG_MODE_IMMEDIATE=y&lt;br /&gt;CONFIG_PRINTK=y&lt;br /&gt;CONFIG_STDOUT_CONSOLE=y&lt;/p&gt;
&lt;p data-start="78" data-end="168"&gt;In the main file, I only added&lt;/p&gt;
&lt;p data-start="78" data-end="168"&gt;#include &amp;lt;zephyr/sys/printk.h&amp;gt;&lt;/p&gt;
&lt;p data-start="431" data-end="500"&gt;Other than that, I haven&amp;rsquo;t made any modifications to the GNSS sample.&lt;/p&gt;
&lt;p data-start="431" data-end="500"&gt;&lt;/p&gt;
&lt;p data-start="502" data-end="524"&gt;Best regards,&lt;br data-start="515" data-end="518" /&gt; Arun&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551003?ContentTypeID=1</link><pubDate>Thu, 09 Oct 2025 11:40:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e959109a-e1e9-4e3f-86d0-8dabf48fd838</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Arun,&lt;br /&gt;&lt;br /&gt;RTT logging is not enabled by default in the project configuration. Have you modified GNSS sample in any way?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/551000?ContentTypeID=1</link><pubDate>Thu, 09 Oct 2025 11:30:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53e5840b-e9b2-423c-9288-51f5b9055b95</guid><dc:creator>Arun538</dc:creator><description>&lt;p data-start="82" data-end="95"&gt;&lt;strong data-start="82" data-end="95"&gt;Hi Dejan,&lt;/strong&gt;&lt;/p&gt;
&lt;p data-start="97" data-end="168"&gt;I&amp;rsquo;m using &lt;strong data-start="107" data-end="139"&gt;modem firmware version 1.3.5&lt;/strong&gt; along with &lt;strong data-start="151" data-end="165"&gt;NCS v3.0.0&lt;/strong&gt;.&lt;/p&gt;
&lt;p data-start="170" data-end="194"&gt;Best regards,&lt;br data-start="183" data-end="186" /&gt; &lt;strong data-start="186" data-end="194"&gt;Arun&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/550939?ContentTypeID=1</link><pubDate>Wed, 08 Oct 2025 16:45:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62be0d3e-996c-49e1-8600-bb94462cae79</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Arun,&lt;br /&gt;&lt;br /&gt;Which modem firmware version do you use?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/550884?ContentTypeID=1</link><pubDate>Wed, 08 Oct 2025 10:32:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a8fda35-3045-43cc-ae26-4e63250ddf53</guid><dc:creator>Arun538</dc:creator><description>&lt;p data-start="75" data-end="86"&gt;Hi Dejan,&lt;/p&gt;
&lt;p data-start="88" data-end="273"&gt;Sorry for the confusion &amp;mdash; I&amp;rsquo;m actually using the &lt;code data-start="137" data-end="164"&gt;nrf/samples/cellular/gnss&lt;/code&gt; example from NCS v3.0.0, not &lt;code data-start="194" data-end="220"&gt;nrf/samples/nrf9160/gnss&lt;/code&gt;.&lt;br data-start="221" data-end="224" /&gt; The build target I used is &lt;code data-start="251" data-end="270"&gt;nrf9151dk_nrf9151 ns&lt;/code&gt;.&lt;/p&gt;
&lt;p data-start="275" data-end="411"&gt;There were no errors during build or compilation, and I uploaded the firmware to my custom board using the nRF9151 DK as a programmer.&lt;/p&gt;
&lt;p data-start="413" data-end="482"&gt;After uploading, when I open RTT Viewer, I see the following error:&lt;/p&gt;
&lt;p data-start="484" data-end="533"&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1759919469723v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p data-start="535" data-end="597"&gt;Could you please advise on what might be causing this issue?&lt;/p&gt;
&lt;p data-start="599" data-end="621"&gt;Best regards,&lt;br data-start="612" data-end="615" /&gt; Arun&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9151 custom board – GNSS sample fails with “Failed to activate GNSS functional mode”</title><link>https://devzone.nordicsemi.com/thread/550871?ContentTypeID=1</link><pubDate>Wed, 08 Oct 2025 08:41:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa339a80-a682-4cef-a0c4-f8dce4694a6a</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I have tested unmodified sample on nrf9151-dk and I could not replicate reported error.&lt;br /&gt;&lt;br /&gt;Which version of the modem firmware do you use on your custom board?&lt;/p&gt;
[quote user=""]&lt;strong&gt;Sample Used:&lt;/strong&gt; &lt;code&gt;nrf/samples/nrf9160/gnss&lt;/code&gt;[/quote]
&lt;p&gt;The GNSS sample is located in nrf\samples\cellular\gnss in NCS v3.0.0.&lt;/p&gt;
[quote user=""]&lt;strong&gt;Build target:&lt;/strong&gt; &lt;code&gt;nrf9151dk_nrf9151&lt;/code&gt;[/quote]
&lt;p&gt;You can try to build the sample for nrf9151dk/nrf9151/ns as specified in&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/cellular/gnss/README.html#overview"&gt;GNSS sample&lt;/a&gt;&amp;nbsp;documentation.&lt;/p&gt;
[quote user=""]I have developed a custom board using the &lt;strong&gt;nRF9151&lt;/strong&gt; controller.[/quote]
&lt;p&gt;&amp;nbsp;Does the error come when building for nrf9151-dk or for custom board?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>