<?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>To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85747/to-identify-adjust-sleep-period-of-sample-app-threads</link><description>Hello Devzone Community, 
 My name is Ted, and I am continuing my effort to configure a Zephyr based, Nordic aws_iot sample app based firmware to run and support nRF9160 lowest specified power consumption. I am in the process of putting all application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Apr 2022 08:28:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85747/to-identify-adjust-sleep-period-of-sample-app-threads" /><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/362514?ContentTypeID=1</link><pubDate>Fri, 08 Apr 2022 08:28:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66d9f1c3-8d84-461b-807d-d1d07e099b62</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="tedhavelka"]Thank you for helping me to track down the rogue thread, a run-time result of ncs v1.6.1 aws_iot sample app calling &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.6.1/samples/nrf9160/aws_iot/src/main.c#L440" rel="noopener noreferrer" target="_blank"&gt;at_configure() ncs API routine&lt;/a&gt; in its main.c source file.[/quote]
&lt;p&gt;No, the at_configure() isn&amp;#39;t involved. The problem is the at_host library, which runs in the background and don&amp;#39;t interract directly with the application.&lt;/p&gt;
[quote user="tedhavelka"]By the way I notice that in &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.9.1/samples/nrf9160/aws_iot/src/main.c#L402" rel="noopener noreferrer" target="_blank"&gt;ncs v1.9.1 aws_iot main.c&lt;/a&gt; there is no longer any call anywhere to at_configure()[/quote]
&lt;p&gt;Yes, we have reworked the AT command interface, so the at_cmd() and at_notif() libraries no longer is needed.&lt;/p&gt;
&lt;p&gt;Instead, you can use the AT command interface in the modem_lib directly: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrfxlib/nrf_modem/doc/at_interface.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrfxlib/nrf_modem/doc/at_interface.html&lt;/a&gt;&lt;/p&gt;
[quote user="tedhavelka"]Will you please mark this Devzone post as answered?[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll see if I can find some usefull answers to mark as verified.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/362451?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 19:13:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:605941a2-90db-4b57-b6fc-166ee4e2a55a</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Didrik,&lt;/p&gt;
&lt;p&gt;Will you please mark this Devzone post as answered?&amp;nbsp; I strayed from the original threads question at points, but the answers for tracking down the mystery thread in my aws_iot sample based app are here.&amp;nbsp; Plus the &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/86265/gdb-commands-to-list-zephyr-app-threads" rel="noopener noreferrer" target="_blank"&gt;related Zephyr thread debugging questions&lt;/a&gt; have also been answered.&amp;nbsp; Following H&amp;aring;kon&amp;#39;s instructions for gdb server and gdb in each their own terminal window provides me run time inspection of Zephyr 2.6.0 threads in a custom app.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/362444?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 18:16:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb3902f4-b2b3-4ee9-8bd9-0bf167eee1ed</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Didrik,&lt;/p&gt;
&lt;p&gt;Regarding nRF9160 GPIO settings I will open a new Devzone ticket.&amp;nbsp; Thank you for helping me to track down the rogue thread, a run-time result of ncs v1.6.1 aws_iot sample app calling &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.6.1/samples/nrf9160/aws_iot/src/main.c#L440" rel="noopener noreferrer" target="_blank"&gt;at_configure() ncs API routine&lt;/a&gt; in its main.c source file.&lt;/p&gt;
&lt;p&gt;By the way I notice that in &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.9.1/samples/nrf9160/aws_iot/src/main.c#L402" rel="noopener noreferrer" target="_blank"&gt;ncs v1.9.1 aws_iot main.c&lt;/a&gt; there is no longer any call anywhere to at_configure().&lt;/p&gt;
&lt;p&gt;As for the attached low power examples, I only want to note that I&amp;#39;ve yet to obtain approximate 3uA deep sleep current readings.&amp;nbsp; The first of the five versions of attached hello_world I could build and run, but draws about 3mA on nRF9160DK board rev 1.0.0 (known issue there you note and link to an errata sheet).&amp;nbsp; The later attached projects I cannot build.&amp;nbsp; A modified version I tried to adapt, and eventually&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/86265/gdb-commands-to-list-zephyr-app-threads" rel="noopener noreferrer" target="_blank"&gt;in Devzone post 86265&lt;/a&gt; draws too little current for me to trust, about 46nA.&amp;nbsp; Have further testing to perform, and I may open a new ticket on the low power sample app question too.&lt;/p&gt;
&lt;p&gt;Thank you again for the detailed help and your patience Didrik.&amp;nbsp; Stay safe,&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/362420?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 15:14:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d75a5f35-b9c0-4130-8fd3-cfbaf8d5e4b7</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="tedhavelka"]I no longer see any periodic ~25Hz to ~33Hz current pulsing[/quote]
&lt;p&gt;That&amp;#39;s great!&lt;/p&gt;
[quote user="tedhavelka"]Kindly tell me whether this question group is best to open in a new Devzone ticket[/quote]
&lt;p&gt;They are a bit outside of my area of expertise and given that we found the rouge thread (and you no longer see the current pulsing), I think those questions are best answered in a new ticket.&lt;/p&gt;
[quote user="tedhavelka"]As always thank you, Didrik[/quote]
&lt;p&gt;You&amp;#39;re welcome.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/362161?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 17:10:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be348941-3b3e-4e20-81f5-aaa66a2735f6</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Thank you Didrik,&lt;/p&gt;
&lt;p&gt;Your mention of the separate power supply, I believe nRF9160 datasheet names it VDD_GPIO or similar, reminds me of a related question:&amp;nbsp; what is or are the correct &lt;a href="https://docs.zephyrproject.org/2.6.0/reference/peripherals/gpio.html?highlight=gpio_input" rel="noopener noreferrer" target="_blank"&gt;Zephyr 2.6.0 GPIO configuration&lt;/a&gt; to assign to nRF9160 general purpose I/O port pins,&lt;/p&gt;
&lt;p&gt;(a)&amp;nbsp; when I/O pin acts as a chip select line to external device, which itself is powered off (at ground state)&lt;/p&gt;
&lt;p&gt;(b)&amp;nbsp; when I/O pin in wake mode receives interrupts from external device,&lt;/p&gt;
&lt;p&gt;To be clear, during active wake times of nRF9160 + external circuit + firmware, I will configure I/O pins for their normal input or output uses, and set pull-ups and pull-downs as needed.&amp;nbsp; But to enter deep sleep mode and avoid unintended &amp;quot;bleed&amp;quot; currents to and from nRF9160 GPIOs, I expect I must in some cases change pin configurations at run time or &amp;quot;on the fly&amp;quot;.&amp;nbsp; Is my understanding in this correct?&lt;/p&gt;
&lt;p&gt;Kindly tell me whether this question group is best to open in a new Devzone ticket.&lt;/p&gt;
&lt;p&gt;I ask this I/O config question, due to modest progress with my team&amp;#39;s custom 9160-based board.&amp;nbsp; My latest efforts to modify project firmware to emulate the settings and action of your low power hello_world have gotten me to sub-one-hundred uA current draw.&amp;nbsp; It is true my custom board differs from the nRF9160DK kit.&amp;nbsp; In particular, I can only measure total board current, I don&amp;#39;t have a break out solder bridge or test points pair to look only at nRF9160 VDD current use.&amp;nbsp; But this measure-all-board-current is good.&amp;nbsp; I need to bring total board current down to very close to nRF9160 advertised lowest current for battery life requirements.&lt;/p&gt;
&lt;p&gt;The code I run is also still different code with respect to attached low-power code samples.&amp;nbsp; In my firmware project I&amp;#39;ve commented out everything I may reasonably disable.&amp;nbsp; Given custom board however I wrote and use custom board files (dts, yaml).&amp;nbsp; These depart from your shared hello_world sample apps.&lt;/p&gt;
&lt;p&gt;So I am trying to adapt my firmware as near as possible to your hello_world configuration settings and run time functionality.&amp;nbsp; I no longer see any periodic ~25Hz to ~33Hz current pulsing, just small steady current in tens of microamps.&amp;nbsp; I suspect GPIO mis-configuration.&lt;/p&gt;
&lt;p&gt;As always thank you, Didrik.&amp;nbsp; Once I solve our low current conundrums I will share a practical summary of steps taken plus what works.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;( p.s.:&amp;nbsp; I have tested three different Zephyr GPIO pin configurations, which I set in code sequence to enter my custom firmware into deep sleep mode.&amp;nbsp; These configurations include (1) GPIO_INPUT with weak pull-down enabled, (2) GPIO_OUTPUT with output set low, (3) GPIO_DISCONNECTED.&amp;nbsp; These settings I apply to pins which are connected to external sensors, FETs, memory which are themselves at that point powered down.&amp;nbsp; I actually see more current consumption on our custom board when I attempt these settings, than when making no explicit GPIO configuration at all. Strange.&amp;nbsp; I am now working through one and a few pins&amp;#39; settings at a time and building a table of current measurement results, to narrow down whether one or a few pins are contributing the additional currents.&amp;nbsp; But there are many combinations of configurations possible, and pins to configure, which motivate my latest questions! )&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/362147?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 15:40:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5887a959-178c-42bd-80cc-e0e77454196f</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="tedhavelka"]Question - with PPK II connected to &amp;quot;nRF Current Measurement&amp;quot; jumper, is it true that I am measuring the current consumed only and only by the nRF9160 SiP on the nRF9160DK development kit?[/quote]
&lt;p&gt;Yes, the &amp;quot;nRF Current Measurement&amp;quot; header will only give you the current drawn by the nRF9160. The GPIO pins are powered through a sepparate source.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/361918?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2022 18:21:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3f37e65-90b2-4e1e-8668-ac1416ab6f5d</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Didrik,&lt;/p&gt;
&lt;p&gt;&lt;em&gt;On 2022-04-05 Didrik asked:&amp;nbsp; What DK version do you have?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;A white rectangular sticker on the non-component side of my nRF9160DK reads:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;strong&gt;PCA10090&lt;/strong&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;strong&gt;1.0.0&lt;/strong&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;strong&gt;2021.11&lt;/strong&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;strong&gt;960048580&lt;/strong&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;strong&gt;Contains FCC ID:&amp;nbsp; xxxxx . . .&lt;/strong&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;strong&gt;Contains IC:&amp;nbsp; 24529-NRF9160&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Just downloaded and unzipped your latest, number four nRF9160 low power sample app, &amp;quot;blinky_low_power.zip&amp;quot;.&amp;nbsp; I tried to compile again with `west build -b nrf9160dk_nrf9160ns` and again have that cyclic build error where cmake cannot get past what looks to be Kconfig processing.&lt;/p&gt;
&lt;p&gt;All the same, I&amp;#39;d actually gotten the same blinky app code merged in with my prior modified version of the very first intended low power sample you sent / shared in this Devzone post.&amp;nbsp; So my &amp;quot;doubting Thomas&amp;quot; streak is sated that I am indeed able to modify the low power app -- something I cannot see at any terminal with UART and high speed clocks suspended -- and I can now share back with you the code which builds on my host and runs on my hardware.&lt;/p&gt;
&lt;p&gt;Question - with PPK II connected to &amp;quot;nRF Current Measurement&amp;quot; jumper, is it true that I am measuring the current consumed only and only by the nRF9160 SiP on the nRF9160DK development kit?&lt;/p&gt;
&lt;p&gt;I thought I had seen mention of this point in an earlier reply of yours, Didrik, but I could not find it reviewing all our exchanges in this Devzone ticket.&lt;/p&gt;
&lt;p&gt;Thank you and will keep you posted on progress I make with 9160DK current measurements on my side.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/361868?ContentTypeID=1</link><pubDate>Tue, 05 Apr 2022 13:29:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5296764-be76-49ba-9242-08fa853d04bd</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="tedhavelka"]&lt;p&gt;Question 1 - Curious, each of your &amp;#39;hello_world&amp;#39; examples compiles for you with only the prj.conf symbols I find in the zipped archives, correct?&amp;nbsp; Last night&amp;#39;s exercise to revisit and combine elements of two of the example zips you sent provides a good lesson.&amp;nbsp; But if the zips compile for you, is it that you are building in VSCode, and VSCode holds some project settings outside of your shared, zipped sources?&lt;/p&gt;
&lt;p&gt;Question 2 - does your hello_world `west` manifest file pull in any different set of ncs or third party git repositories, with respect to the west.yml file I posted here a day or two ago?&lt;/p&gt;[/quote]
&lt;p&gt;I use the Toolchain Manager to manager my NCS installations, and don&amp;#39;t keep a sepparate West workspace for each application. So, when I open a terminal through the Toolchain Manager, it will create an environment where West/CMake finds the right version of the toolchain, etc. Perhaps the most important effect for this conversation is that it sets ZEPHYR_BASE to point to my NCS 1.6.0 installation (there shouldn&amp;#39;t be any . Similarly, I have configured VS Code to use my 1.6.0 installation (you can see the settings in the .vscode folder).&lt;/p&gt;
&lt;p&gt;But there shouldn&amp;#39;t be any &amp;quot;magic&amp;quot; happening. As long as West finds your 1.6.0 installation, I would have expected it to work.&lt;/p&gt;
[quote user="tedhavelka"]Question 3 - I have our nRF9160DK board connect to PPK II as shown in &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_ppk2%2FUG%2Fppk%2FPPK_user_guide_Intro.html" rel="noopener noreferrer" target="_blank"&gt;measuring current in Ampere Meter mode&lt;/a&gt;.&amp;nbsp; My first current measurements are around 46 nano-amperes, which seems too low to be real.&amp;nbsp; In particular, I kept the `while (1) { printk(...); k_msleep(1000); } code block in main() routine, expecting to see a current spike at about one Hertz.&amp;nbsp; I don&amp;#39;t see that.&amp;nbsp; Is a standard USB-C cable from computer providing 5VDC to the development board?[/quote]
&lt;p&gt;It &lt;em&gt;might&lt;/em&gt; be that the printk is turned into a no-op when the console is disabled (which it will be because we disabled it&amp;#39;s only backend). But I agree that 46 nA is a bit too good. What DK version do you have?&lt;/p&gt;
&lt;p&gt;If your DK didn&amp;#39;t come with a jumper on the &amp;quot;nRF current meassurement&amp;quot; header, you need to cut a solder bridge connecting the two pins: &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/prepare_board.html"&gt;https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/prepare_board.html&lt;/a&gt;&lt;/p&gt;
[quote user="tedhavelka"]Ah wait, I may need to strike my last question. With UARTs and high speed clocks turned off I will not see any &amp;quot;hello world&amp;quot; message, correct?&amp;nbsp; As a sanity check then that firmware is actually running, I would want some alternate heartbeat test such as flashing an LED?[/quote]
&lt;p&gt;Yes, without the UART, you will not see messages over UART &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try to be optimistic and provide another sample project. This time the blinky sample, with the same changes as I made to the hello_world sample. When I meassure it on my 1.0.0 DK with a PPK2 in source meter mode, I get a total average of ~3.8 uA, and ~2.7 uA in the idle periods.&lt;/p&gt;
&lt;p&gt;The compiled .hex file is included as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/blinky_5F00_low_5F00_power.zip"&gt;devzone.nordicsemi.com/.../blinky_5F00_low_5F00_power.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/361108?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2022 22:28:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bf89565-36a2-45d0-bb84-778e6ddaaee3</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Didrik,&lt;/p&gt;
&lt;p&gt;When you hear back findings on the Linux / Ubuntu command line based build, please let me know.&amp;nbsp; I am actually not using VSCode.&amp;nbsp; So far `west` and the other `west` orchestrated command line&amp;nbsp; tools are working well for me. Past experience with integrated development environments has been useful on some points, but always more difficult in terms of understanding compile time settings.&amp;nbsp; IDEs nearly always seem to hide configuration settings of project `make` and more recently cmake files.&lt;/p&gt;
&lt;p&gt;Thank you also for including `merged.hex` in the example app archives.&amp;nbsp; Failing to reach a successful build outcome I could still test the specific board for which those pre-compiled binaries are built.&lt;/p&gt;
&lt;p&gt;Regarding the enumerated changes in your reply, yes, I more or less learned those through some trial and error and searching the hello_world / ncs workspace&amp;#39; Kconfig settings.&amp;nbsp; I am finding `west build -t menuconfig` to be helpful and educational, though I don&amp;#39;t know that I will move much beyond scratching the surface of this programming realm.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Question 1 - Curious, each of your &amp;#39;hello_world&amp;#39; examples compiles for you with only the prj.conf symbols I find in the zipped archives, correct?&amp;nbsp; Last night&amp;#39;s exercise to revisit and combine elements of two of the example zips you sent provides a good lesson.&amp;nbsp; But if the zips compile for you, is it that you are building in VSCode, and VSCode holds some project settings outside of your shared, zipped sources?&lt;/p&gt;
&lt;p&gt;Question 2 - does your hello_world `west` manifest file pull in any different set of ncs or third party git repositories, with respect to the west.yml file I posted here a day or two ago?&lt;/p&gt;
&lt;p&gt;Question 3 - I have our nRF9160DK board connect to PPK II as shown in &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_ppk2%2FUG%2Fppk%2FPPK_user_guide_Intro.html" rel="noopener noreferrer" target="_blank"&gt;measuring current in Ampere Meter mode&lt;/a&gt;.&amp;nbsp; My first current measurements are around 46 nano-amperes, which seems too low to be real.&amp;nbsp; In particular, I kept the `while (1) { printk(...); k_msleep(1000); } code block in main() routine, expecting to see a current spike at about one Hertz.&amp;nbsp; I don&amp;#39;t see that.&amp;nbsp; Is a standard USB-C cable from computer providing 5VDC to the development board?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I flash and run the hello_world app, I see the following Zephyr start up messages arrive over the board-powering USB-C cable:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
Flash regions           Domain          Permissions
00 01 0x00000 0x10000   Secure          rwxl
02 31 0x10000 0x100000  Non-Secure      rwxl

Non-secure callable region 0 placed in flash region 1 with size 32.

SRAM region             Domain          Permissions
00 07 0x00000 0x10000   Secure          rwxl
08 31 0x10000 0x40000   Non-Secure      rwxl

Peripheral              Domain          Status
00 NRF_P0               Non-Secure      OK
01 NRF_CLOCK            Non-Secure      OK
02 NRF_RTC0             Non-Secure      OK
03 NRF_RTC1             Non-Secure      OK
04 NRF_NVMC             Non-Secure      OK
05 NRF_UARTE1           Non-Secure      OK
06 NRF_UARTE2           Secure          SKIP
07 NRF_TWIM2            Non-Secure      OK
08 NRF_SPIM3            Non-Secure      OK
09 NRF_TIMER0           Non-Secure      OK
10 NRF_TIMER1           Non-Secure      OK
11 NRF_TIMER2           Non-Secure      OK
12 NRF_SAADC            Non-Secure      OK
13 NRF_PWM0             Non-Secure      OK
14 NRF_PWM1             Non-Secure      OK
15 NRF_PWM2             Non-Secure      OK
16 NRF_PWM3             Non-Secure      OK
17 NRF_WDT              Non-Secure      OK
18 NRF_IPC              Non-Secure      OK
19 NRF_VMC              Non-Secure      OK
20 NRF_FPU              Non-Secure      OK
21 NRF_EGU1             Non-Secure      OK
22 NRF_EGU2             Non-Secure      OK
23 NRF_DPPIC            Non-Secure      OK
24 NRF_REGULATORS       Non-Secure      OK
25 NRF_PDM              Non-Secure      OK
26 NRF_I2S              Non-Secure      OK
27 NRF_GPIOTE1          Non-Secure      OK

SPM: NS image at 0x10000
SPM: NS MSP at 0x200179e8
SPM: NS reset vector at 0x124dd
SPM: prepare to jump to Non-Secure image.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But I never see the &amp;quot;hello world&amp;quot; or &amp;quot;printk&amp;quot; messages themselves.&amp;nbsp; Am I correct that I should see these messages?&lt;/p&gt;
&lt;p&gt;When the 9160 DK is powered, the Linux station enumerates three /dev/ttyACMx devices:&amp;nbsp; ttyACM0, ttyACM1, ttyACM2.&amp;nbsp; I see no terminal messages on ACM1 nor ACM2.&lt;/p&gt;
&lt;p&gt;My terminal program is configured for no hardware flow control, no software flow control, and baud of 115200.&amp;nbsp; I ought to see at least the starting &amp;quot;hello world&amp;quot; message, yes?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Ah wait, I may need to strike my last question. With UARTs and high speed clocks turned off I will not see any &amp;quot;hello world&amp;quot; message, correct?&amp;nbsp; As a sanity check then that firmware is actually running, I would want some alternate heartbeat test such as flashing an LED?&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/361083?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2022 15:31:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7232b56c-92fb-44ec-b0da-075ad729ad3d</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;I have not seen this kind of loop before. I have also given the hello_world_low_pwer .zip to a colleague of mine with a Linux computer, and for him the project builds just fine.&lt;/p&gt;
&lt;p&gt;However, he did tell me that he have seen such loops when a project has been moved from one location to another. So you could try to delete the build folder and the .vscode folder and see if that helps.&lt;/p&gt;
&lt;p&gt;However, in the low power projects, and the current meassurement blogpost, there should be compiled versions of the programs as well. So you should be able to use them to meassure the current consumption even though you can&amp;#39;t build the projects.&lt;/p&gt;
&lt;p&gt;Or, you could create your own project by applying the same changes:&lt;/p&gt;
&lt;p&gt;1. Enable CONFIG_NRF_MODEM_LIB (which also requires CONFIG_NETWORKING, CONFIG_NET_SOCKETS and CONFIG_HEAP_MEM_POOL_SIZE)&lt;/p&gt;
&lt;p&gt;2. Disable CONFIG_SERIAL in both the application and in any child images (CONFIG_NRF_MODEM_LIB requires that you build the application for the non-secure domain, so you need the SPM to start your application). If you do not, you risk the child image starting the UART, and the application not turning it off.&lt;/p&gt;
&lt;p&gt;3. Ensure that the application doesn&amp;#39;t do anything, so that the idle thread puts the device to sleep.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/360921?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2022 05:58:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7571095b-da3c-41ff-94bf-55a14b73a2c8</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hi again Didrik,&lt;/p&gt;
&lt;p&gt;Working with the first hello_world sample app you sent, I am now able to build and flash that example with `CONFIG_NRF_MODEM_LIB=y` added to this app&amp;#39;s prj.conf file.&amp;nbsp; There were a few build time errors to resolve.&amp;nbsp; These were all resolvable with a few additions to prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Code excerpt - amended prj.conf file to build first version low power hello_world app:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_USE_SEGGER_RTT=y

CONFIG_LOG=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n

CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n

CONFIG_SERIAL=n

# 2022-03-30 WED - Ted adding config from latest, third hello_world zip de Didrik:
CONFIG_NRF_MODEM_LIB=y

# Network - need following networking facilities for cmake to find &amp;#39;sockets_internal.h&amp;#39;:
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y

# Modem library - may or may not need modem lib sys init, but present in aws_iot sample app:
##CONFIG_NRF_MODEM_LIB=y
CONFIG_NRF_MODEM_LIB_SYS_INIT=n

# 2022-03-30 need following kernel features to make k_malloc() defined to &amp;#39;ncs/nrf/lib/nrf_modem_lib/nrf91_sockets.c&amp;#39;:
CONFIG_KERNEL_MEM_POOL=y
CONFIG_HEAP_MEM_POOL_SIZE=2048
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am reviewing proper Power Profiler Kit connections now, preparing to measure current draw.&amp;nbsp; Also I note here that I have not yet added the child_image/spm.conf to this earliest shared hello_world app.&lt;/p&gt;
&lt;p&gt;Also noting that no amendments were needed in CMakeLists.txt.&amp;nbsp; Expressing the three or so Kconfig symbols in prj.conf is sufficient to inform cmake where to locate certain header files and kernel level functions.&lt;/p&gt;
&lt;p&gt;Will update you on current use findings when I have them - Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/360918?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2022 04:45:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd6f25a8-3f0e-4bb1-8eef-a8868aa1b323</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hi again Didrik,&lt;/p&gt;
&lt;p&gt;As I attempt to amend the first hello_world project you posted in this thread, I find that adding to prj.conf the symbol setting `CONFIG_NRF_MODEM_LIB=y` causes for me the build error:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Excerpt - cmake build time snippet:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;$ west build -b nrf9160dk_nrf9160ns
[0/14] Performing build step for &amp;#39;spm_subimage&amp;#39;
ninja: no work to do. 
[2/12] Building C object modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf91_sockets.c.obj
FAILED: modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf91_sockets.c.obj 
ccache /opt/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc -DBUILD_VERSION=v2.6.0-rc1-ncs1 -DEXT_API_MAGIC=0x281ee6de,0xb845acea,23298 -DFIRMWARE_INFO_MAGIC=0x281ee6de,0x8fcebb4c,23298 -DKERNEL -DNRF9160_XXAA -DNRF_TRUSTZONE_NONSECURE -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/ted/projects/zephyr-based/zephyr/include -I/home/ted/projects/zephyr-based/hello-world-0311/build/zephyr/include/generated -I/home/ted/projects/zephyr-based/zephyr/soc/arm/nordic_nrf/nrf91 -I/home/ted/projects/zephyr-based/nrf/include -I/home/ted/projects/zephyr-based/modules/hal/cmsis/CMSIS/Core/Include -I/home/ted/projects/zephyr-based/modules/hal/nordic/nrfx -I/home/ted/projects/zephyr-based/modules/hal/nordic/nrfx/drivers/include -I/home/ted/projects/zephyr-based/modules/hal/nordic/nrfx/mdk -I/home/ted/projects/zephyr-based/zephyr/modules/hal_nordic/nrfx/. -I/home/ted/projects/zephyr-based/modules/debug/segger/SEGGER -I/home/ted/projects/zephyr-based/modules/debug/segger/Config -I/home/ted/projects/zephyr-based/zephyr/modules/segger/. -I/home/ted/projects/zephyr-based/nrfxlib/nrf_modem/include -isystem /home/ted/projects/zephyr-based/zephyr/lib/libc/minimal/include -isystem /opt/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/include -isystem /opt/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/include-fixed -Os -imacros /home/ted/projects/zephyr-based/hello-world-0311/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -imacros /home/ted/projects/zephyr-based/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/ted/projects/zephyr-based/hello-world-0311=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/ted/projects/zephyr-based/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/ted/projects/zephyr-based=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf91_sockets.c.obj -MF modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf91_sockets.c.obj.d -o modules/nrf/lib/nrf_modem_lib/CMakeFiles/..__nrf__lib__nrf_modem_lib.dir/nrf91_sockets.c.obj -c /home/ted/projects/zephyr-based/nrf/lib/nrf_modem_lib/nrf91_sockets.c
/home/ted/projects/zephyr-based/nrf/lib/nrf_modem_lib/nrf91_sockets.c:21:10: fatal error: sockets_internal.h: No such file or directory
   21 | #include &amp;lt;sockets_internal.h&amp;gt;
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I change working directory from hello_world up to ../zephyr and search for this header file, I find it located in `subsys/net/lib/sockets`.&amp;nbsp; So from my ncs top level dir the path and file are `ncs/zephyr/subsys/net/lib/sockets/sockets_internal.h`.&lt;/p&gt;
&lt;p&gt;I have attempted to add this path to hello_world&amp;#39;s build with a stanza in CMakeLists.txt, a line of the form:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;include_directories($ENV{ZEPHYR_BASE}/subsys/net/lib/sockets)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As well I have tried some related paths with fewer path elements.&amp;nbsp; None of these has solved the missing header file error, nor had any visible impact on the -I options reported during build, and visible as part of line 4 in the build snippet above.&lt;/p&gt;
&lt;p&gt;Question 1 - have you a west.yaml file for your latest hello_world_low_power project, which you can share?&lt;/p&gt;
&lt;p&gt;Question 2 - are there one or more other Kconfig symbols, e.g. CONFIG_NETWORKING which I may need to enable?&lt;/p&gt;
&lt;p&gt;My effort here is to build the hello_world sample app, with nRF Modem lib enabled but not explicitly called by the sample, so that I can confirm our nRF9160DK kit can draw as little as 3 microamps.&amp;nbsp; I&amp;#39;m presently copying my own west.yml file.&amp;nbsp; This manifest file works for ncs v1.6.1 sample apps and a couple ncs based projects of my own.&amp;nbsp; I am however unsure if my west.yml sets up the same libraries as you have when you build and run your hello_world app versions.&lt;/p&gt;
&lt;p&gt;Attempting to build and prove your project draws 3uA, so I may adopt its key configurations to my team&amp;#39;s work and achieve the same result there.&amp;nbsp; Will continue researches here to overcome these build time errors.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/360904?ContentTypeID=1</link><pubDate>Wed, 30 Mar 2022 22:04:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da7f4663-f493-4655-aa27-d835cf0b42bc</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Didrik,&lt;/p&gt;
&lt;p&gt;Reporting now findings with the latest low power hello_world code you send.&amp;nbsp; The project zipped in file &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4745.hello_5F00_world_5F00_low_5F00_power.zip" rel="noopener noreferrer" target="_blank"&gt;hello_world_low_power.zip&lt;/a&gt; results for me in the same erroneous, cyclic &amp;#39;endless loop&amp;#39; cmake build behavior which I described first time a couple of days ago.&amp;nbsp; I have unzipped and attempted to build this project four times, in two different ways, on two different Ubuntu 20.04 based work stations.&lt;/p&gt;
&lt;p&gt;My first try was to unzip hello_world_low_power in an extent ncs v1.6.1 workspace.&amp;nbsp; I&amp;#39;ve often called this my &amp;#39;west workspace&amp;#39;.&amp;nbsp; The yaml file which directs `west` how to populate this workspace is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;manifest:
  remotes:
    - name: nrfconnect
      url-base: https://github.com/nrfconnect
  projects:
    - name: nrf
      repo-path: sdk-nrf
      remote: nrfconnect
      revision: v1.6.1
      import: true 
  self:
    # This repository should be cloned to 
    path: aws-iot-stand-alone
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The projects you zipped and have shared with me do not have any manifest file, so I assumed they would build against ncs v1.6.1.&amp;nbsp; I find no reference in these modified hello_world projects to any particular ncs version.&amp;nbsp; You mention however that &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1462.hello_5F00_world.zip" rel="noopener noreferrer" target="_blank"&gt;1462.hello_world.zip&lt;/a&gt; unintentionally was or is built against ncs version 1.9.1.&amp;nbsp; I think that&amp;#39;s today&amp;#39;s latest stable ncs.&amp;nbsp; v1.9.1 is definitely a newer release than the nrf-connect SDK code I am presently using.&lt;/p&gt;
&lt;p&gt;The second way I attempt my builds is to create a fresh ncs folder, add my west.yml file there, and run `west init -l hello_world_low_power` in the ncs folder, and then cd into the hello_world_low_power project folder and `west update` there.&amp;nbsp; There&amp;#39;s no obvious reason I can see this would make a difference, but I wanted to be sure I wasn&amp;#39;t gumming up any works by re-using my existing ncs workspace.&amp;nbsp; ( I have successfully used the same ncs workspace for multiple projects, taking care to know that each one depends on the same ncs and third party git repos. )&lt;/p&gt;
&lt;p&gt;The two work hosts on which I&amp;#39;m developing have mostly identical toolchain elements.&amp;nbsp; I am likely missing some key elements of toolchain description but here are the primary tools I use and think about in my nRF9160 Zephyr application based work:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Excerpt 1 - host 2 toolchain, Nordic Semi + Zephyr + arm-none-eabi-gcc:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ted@dev-host-2:~/projects/zephyr-based$ west --version
West version: v0.12.0

ted@dev-host-2:~/projects/zephyr-based$ cmake --version
cmake version 3.23.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).
ted@dev-host-2:~/projects/zephyr-based$ dtc --version
Version: DTC 1.5.0

ted@dev-host-2:/opt/gcc-arm-none-eabi-10.3-2021.10/bin$ ./arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10.3-2021.10) 10.3.1 20210824 (release)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Excerpt 2 - host 1 toolchain, Nordic Semi ncs 1.6.1 + Zephyr + crosstool-NG compiler:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Ubuntu 20.04 LTS - Dell tower FG

ted@localhost:~/projects/zephyr-based/z4-sandbox-kionix-work$ west --version
West version: v0.11.0

ted@localhost:~/projects/zephyr-based/z4-sandbox-kionix-work$ cmake --version
cmake version 3.21.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

ted@localhost:~/projects/zephyr-based/z4-sandbox-kionix-work$ dtc --version
Version: DTC 1.5.0

ted@localhost:/opt/zephyr-sdk-0.13.0/arm-zephyr-eabi/bin$ ./arm-zephyr-eabi-gcc --version
arm-zephyr-eabi-gcc (crosstool-NG 1.24.0.378_e011758) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The first hello_world.zip project, which lacked the setting of symbol `CONFIG_NRF_MODEM_LIB=y` prj.conf, and also did not include a child_image subdirectory builds and runs on both hosts.&amp;nbsp; I can build this sample app simply unzipping it within my existing ncs west workspace.&amp;nbsp; The two later low power hello_world apps fail to build, but without producing any cmake or other error messages. To recap the build time failure is that cmake or a subordinate tool in the build process keeps cycling back to the start of project processing.&lt;/p&gt;
&lt;p&gt;Do you have any suggestion where further I can look in cmake&amp;#39;s output to determine what&amp;#39;s misguiding the build process?&amp;nbsp; This &amp;#39;cmake endless loop&amp;#39; error so far is specific to the two latest modified projects you share in this Devzone thread.&amp;nbsp; The error travels with the projects from one host to a second, with a similar but not identical build environment.&amp;nbsp; This leads me to believe there is some edge case error somewhere in the project.&amp;nbsp; I will however keep in mind that I may have set up my tools with an edge case fault on each of my favored workstations.&lt;/p&gt;
&lt;p&gt;What I can and will do at this point is return to the working hello_word app, and manually add the prj.conf NRF_MODEM_LIB symbol, try building, and then manually add the child_image folder and Kconfig modifier file for Secure Partition Manager project there.&amp;nbsp; Those are the two key changes I see you make in the second hello_world and later.&lt;/p&gt;
&lt;p&gt;Kindly inform me and our audience if there are additional toolchain details I should include, to decipher from where this endless loop build arises.&lt;/p&gt;
&lt;p&gt;Thanks again Didrik, and stay safe . . .&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/360838?ContentTypeID=1</link><pubDate>Wed, 30 Mar 2022 13:24:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed2d77c1-f034-4320-9b98-708dc7294b0c</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="tedhavelka"]I am very interested to run your modified hello_world app on our nRF9160DK development board.&amp;nbsp; More than curious to see whether we measure a similar 3uA with this application.&amp;nbsp; But can you see any clue in above build process output which explains why `cmake` keeps repeating the first build steps?[/quote]
&lt;p&gt;That is very weird. However, looking at the project again, I see that I made it for NCS v1.9.1, not 1.6.1 which was my intention.&lt;/p&gt;
&lt;p&gt;Here is another version which hopefully works better: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_low_5F00_power.zip"&gt;devzone.nordicsemi.com/.../hello_5F00_world_5F00_low_5F00_power.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Note that you must build it for nrf9160dk_nrf9160ns, as it enables the modem_lib.&lt;/p&gt;
&lt;p&gt;But in general, the changes are only disabling SERIAL, in both the SPM and the application, and enabling the modem_lib to stop the modem from consuming power unnecessary.&lt;/p&gt;
[quote user="tedhavelka"]Again thank you for all your help on this extended, multi-part question and issue![/quote]
&lt;p&gt;No problem. I am happy to be of help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/360390?ContentTypeID=1</link><pubDate>Mon, 28 Mar 2022 20:03:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a2a5f9c-ceb0-4672-9602-144848b6aa9e</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hi Didrik,&lt;/p&gt;
&lt;p&gt;Thank you for the modified &amp;quot;hello_world&amp;quot; project.&amp;nbsp; For some reason I not able to compile this Nordic + Zephyr based application.&amp;nbsp; I am still using ncs SDK 1.6.1.&amp;nbsp; My various compiler tools are recent enough to pass the early tool version checks.&amp;nbsp; But I have never before seen the cyclic behavior I&amp;#39;m now getting as the build process parses all Kconfig dependencies. About every sixty six lines of build output the compiling appears to repeat itself.&amp;nbsp; I have never seen this kind of erroneous behavior in a `west` based build:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;ted@vibratsiya:~/projects/ncs/hello-world-1462$ west build -b nrf9160dk_nrf9160
-- west build: generating a build system
Including boilerplate (Zephyr base): /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake
CMake Deprecation Warning at /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
  The OLD behavior for policy CMP0079 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:5 (find_package)


-- Application: /home/ted/projects/ncs/hello-world-1462
-- Zephyr version: 2.6.0-rc1 (/home/ted/projects/ncs/zephyr), build: v2.6.0-rc1-ncs1
-- Found Python3: /usr/bin/python3.8 (found suitable exact version &amp;quot;3.8.10&amp;quot;) found components: Interpreter 
-- Found west (found suitable version &amp;quot;0.12.0&amp;quot;, minimum required is &amp;quot;0.7.1&amp;quot;)
-- Board: nrf9160dk_nrf9160, Revision: 0.7.0
-- Cache files will be written to: /home/ted/.cache/zephyr
-- Found dtc: /usr/bin/dtc (found suitable version &amp;quot;1.5.0&amp;quot;, minimum required is &amp;quot;1.4.6&amp;quot;)
-- Found toolchain: gnuarmemb (/opt/gcc-arm-none-eabi-10.3-2021.10)
-- Found BOARD.dts: /home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
-- Generated zephyr.dts: /home/ted/projects/ncs/hello-world-1462/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/device_extern.h
Parsing /home/ted/projects/ncs/zephyr/Kconfig
Loaded configuration &amp;#39;/home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig&amp;#39;
Merged configuration &amp;#39;/home/ted/projects/ncs/hello-world-1462/prj.conf&amp;#39;
Configuration saved to &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config&amp;#39;
Kconfig header saved to &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/autoconf.h&amp;#39;

warning: UART_CONSOLE (defined at drivers/console/Kconfig:47) was assigned the value &amp;#39;y&amp;#39; but got the
value &amp;#39;n&amp;#39;. Check these unsatisfied dependencies: SERIAL (=n), SERIAL_HAS_DRIVER (=n). See
http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_UART_CONSOLE.html and/or look up
UART_CONSOLE in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.

-- The C compiler identification is GNU 10.3.1
-- The CXX compiler identification is GNU 10.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc
CMake Deprecation Warning at /home/ted/projects/ncs/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake &amp;lt; 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument &amp;lt;min&amp;gt; value or use a ...&amp;lt;max&amp;gt; suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done
CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run &amp;quot;cmake --help-policy CMP0116&amp;quot; for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/CMakeLists.txt:1198 (configure_linker_script)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run &amp;quot;cmake --help-policy CMP0116&amp;quot; for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/CMakeLists.txt:1253 (configure_linker_script)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/ted/projects/ncs/hello-world-1462/build
-- west build: building application
[0/1] Re-running CMake...
Including boilerplate (Zephyr base (cached)): /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake
CMake Deprecation Warning at /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
  The OLD behavior for policy CMP0079 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
  CMakeLists.txt:5 (find_package)


-- Application: /home/ted/projects/ncs/hello-world-1462
-- Zephyr version: 2.6.0-rc1 (/home/ted/projects/ncs/zephyr), build: v2.6.0-rc1-ncs1
-- Found west (found suitable version &amp;quot;0.12.0&amp;quot;, minimum required is &amp;quot;0.7.1&amp;quot;)
-- Board: nrf9160dk_nrf9160, Revision: 0.7.0
-- Cache files will be written to: /home/ted/.cache/zephyr
-- Found dtc: /usr/bin/dtc (found suitable version &amp;quot;1.5.0&amp;quot;, minimum required is &amp;quot;1.4.6&amp;quot;)
-- Found toolchain: gnuarmemb (/opt/gcc-arm-none-eabi-10.3-2021.10)
-- Found BOARD.dts: /home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
-- Generated zephyr.dts: /home/ted/projects/ncs/hello-world-1462/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/device_extern.h
Parsing /home/ted/projects/ncs/zephyr/Kconfig
Loaded configuration &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config&amp;#39;
No change to configuration in &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config&amp;#39;
No change to Kconfig header in &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/autoconf.h&amp;#39;
CMake Deprecation Warning at /home/ted/projects/zephyr-based-2/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake &amp;lt; 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument &amp;lt;min&amp;gt; value or use a ...&amp;lt;max&amp;gt; suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done
CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run &amp;quot;cmake --help-policy CMP0116&amp;quot; for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/CMakeLists.txt:1198 (configure_linker_script)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run &amp;quot;cmake --help-policy CMP0116&amp;quot; for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/CMakeLists.txt:1253 (configure_linker_script)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/ted/projects/ncs/hello-world-1462/build
[0/1] Re-running CMake...
Including boilerplate (Zephyr base (cached)): /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake
CMake Deprecation Warning at /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
  The OLD behavior for policy CMP0079 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
  CMakeLists.txt:5 (find_package)


-- Application: /home/ted/projects/ncs/hello-world-1462
-- Zephyr version: 2.6.0-rc1 (/home/ted/projects/ncs/zephyr), build: v2.6.0-rc1-ncs1
-- Found west (found suitable version &amp;quot;0.12.0&amp;quot;, minimum required is &amp;quot;0.7.1&amp;quot;)
-- Board: nrf9160dk_nrf9160, Revision: 0.7.0
-- Cache files will be written to: /home/ted/.cache/zephyr
-- Found dtc: /usr/bin/dtc (found suitable version &amp;quot;1.5.0&amp;quot;, minimum required is &amp;quot;1.4.6&amp;quot;)
-- Found toolchain: gnuarmemb (/opt/gcc-arm-none-eabi-10.3-2021.10)
-- Found BOARD.dts: /home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
-- Generated zephyr.dts: /home/ted/projects/ncs/hello-world-1462/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/device_extern.h
Parsing /home/ted/projects/ncs/zephyr/Kconfig
Loaded configuration &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config&amp;#39;
No change to configuration in &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config&amp;#39;
No change to Kconfig header in &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/autoconf.h&amp;#39;
CMake Deprecation Warning at /home/ted/projects/zephyr-based-2/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake &amp;lt; 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument &amp;lt;min&amp;gt; value or use a ...&amp;lt;max&amp;gt; suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done
CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run &amp;quot;cmake --help-policy CMP0116&amp;quot; for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/CMakeLists.txt:1198 (configure_linker_script)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run &amp;quot;cmake --help-policy CMP0116&amp;quot; for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/CMakeLists.txt:1253 (configure_linker_script)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/ted/projects/ncs/hello-world-1462/build
[0/1] Re-running CMake...
Including boilerplate (Zephyr base (cached)): /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake
CMake Deprecation Warning at /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
  The OLD behavior for policy CMP0079 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
  CMakeLists.txt:5 (find_package)


-- Application: /home/ted/projects/ncs/hello-world-1462
-- Zephyr version: 2.6.0-rc1 (/home/ted/projects/ncs/zephyr), build: v2.6.0-rc1-ncs1
-- Found west (found suitable version &amp;quot;0.12.0&amp;quot;, minimum required is &amp;quot;0.7.1&amp;quot;)
-- Board: nrf9160dk_nrf9160, Revision: 0.7.0
-- Cache files will be written to: /home/ted/.cache/zephyr
-- Found dtc: /usr/bin/dtc (found suitable version &amp;quot;1.5.0&amp;quot;, minimum required is &amp;quot;1.4.6&amp;quot;)
-- Found toolchain: gnuarmemb (/opt/gcc-arm-none-eabi-10.3-2021.10)
-- Found BOARD.dts: /home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
-- Generated zephyr.dts: /home/ted/projects/ncs/hello-world-1462/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/device_extern.h
Parsing /home/ted/projects/ncs/zephyr/Kconfig
Loaded configuration &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config&amp;#39;
No change to configuration in &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/.config&amp;#39;
No change to Kconfig header in &amp;#39;/home/ted/projects/ncs/hello-world-1462/build/zephyr/include/generated/autoconf.h&amp;#39;
CMake Deprecation Warning at /home/ted/projects/zephyr-based-2/modules/lib/civetweb/CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake &amp;lt; 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument &amp;lt;min&amp;gt; value or use a ...&amp;lt;max&amp;gt; suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Configuring done
CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run &amp;quot;cmake --help-policy CMP0116&amp;quot; for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/CMakeLists.txt:1198 (configure_linker_script)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /home/ted/projects/ncs/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run &amp;quot;cmake --help-policy CMP0116&amp;quot; for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/CMakeLists.txt:1253 (configure_linker_script)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/ted/projects/ncs/hello-world-1462/build
[0/1] Re-running CMake...
Including boilerplate (Zephyr base (cached)): /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake
CMake Deprecation Warning at /home/ted/projects/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
  The OLD behavior for policy CMP0079 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/ted/projects/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
  CMakeLists.txt:5 (find_package)


-- Application: /home/ted/projects/ncs/hello-world-1462
-- Zephyr version: 2.6.0-rc1 (/home/ted/projects/ncs/zephyr), build: v2.6.0-rc1-ncs1
-- Found west (found suitable version &amp;quot;0.12.0&amp;quot;, minimum required is &amp;quot;0.7.1&amp;quot;)
-- Board: nrf9160dk_nrf9160, Revision: 0.7.0
-- Cache files will be written to: /home/ted/.cache/zephyr
-- Found dtc: /usr/bin/dtc (found suitable version &amp;quot;1.5.0&amp;quot;, minimum required is &amp;quot;1.4.6&amp;quot;)
-- Found toolchain: gnuarmemb (/opt/gcc-arm-none-eabi-10.3-2021.10)
-- Found BOARD.dts: /home/ted/projects/ncs/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
^Cninja: error: rebuilding &amp;#39;build.ninja&amp;#39;: interrupted by user
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One thing I notice is that `cmake` never seems to progress beyond the zero&amp;#39;th of one steps:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Dropping partition &amp;#39;nrf_modem_lib_trace&amp;#39; since its size is 0.
-- Configuring done
CMake Warning (dev) at /home/ted/projects/zephyr-based/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run &amp;quot;cmake --help-policy CMP0116&amp;quot; for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/ted/projects/zephyr-based/zephyr/CMakeLists.txt:1198 (configure_linker_script)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /home/ted/projects/zephyr-based/zephyr/cmake/linker/ld/target.cmake:33 (add_custom_command):
  Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
  add_custom_command().  Run &amp;quot;cmake --help-policy CMP0116&amp;quot; for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.
Call Stack (most recent call first):
  /home/ted/projects/zephyr-based/zephyr/CMakeLists.txt:1253 (configure_linker_script)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/ted/projects/zephyr-based/hello-world-1462-de-didrik/build
-- west build: building application
[0/1] Re-running CMake...
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There are these triplet statements:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;- Configuring done&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;nbsp;. . .&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;- Generating done&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;[0/1] Re-running cmake...&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I am very interested to run your modified hello_world app on our nRF9160DK development board.&amp;nbsp; More than curious to see whether we measure a similar 3uA with this application.&amp;nbsp; But can you see any clue in above build process output which explains why `cmake` keeps repeating the first build steps?&lt;/p&gt;
&lt;p&gt;The first hello_world sample app you sent on 2022-03-11 builds and runs.&amp;nbsp; I will review prj.conf and related diffs between the two hello_world versions you prepared and shared with me.&amp;nbsp; Perhaps I can adapt the first one with the SPM child image and other diffs.&amp;nbsp; There should be only one or a few differences between the two code samples.&lt;/p&gt;
&lt;p&gt;Again thank you for all your help on this extended, multi-part question and issue!&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/360286?ContentTypeID=1</link><pubDate>Mon, 28 Mar 2022 12:15:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d539e04-3294-4a1e-bc67-02488ff43e11</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;I&amp;#39;ve attached a hello_world example modified for low-power.&lt;/p&gt;
[quote user="tedhavelka"]This apparently due to a bug that affect mRF9160 current draw when the Nordic library API function nrf_modem_lib_dfu_handler() is not called.[/quote]
&lt;p&gt;Note that you don&amp;#39;t actually have to call any functions. Having the library enabled is enough.&lt;/p&gt;
&lt;p&gt;Other than enabling the modem lib, the only other change I did was to disable UART (both in the application and the SPM).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1462.hello_5F00_world.zip"&gt;devzone.nordicsemi.com/.../1462.hello_5F00_world.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;With my DK and PPK, I got an average current draw of ~3uA.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/359890?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 21:34:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f126e679-c3f3-4ed8-8ace-1ae932474446</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Didrik,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve disabled AT_HOST_LIBRARY, recompiled and flashed my modified aws_iot based app.&amp;nbsp; The unnamed thread is now gone from Zephyr&amp;#39;s reporting of threads.&amp;nbsp; But in the lowest power mode I can achieve I still see the roughly 30Hz current spikes, some of the spikes to 4 mA and about fifty percent -- at random -- to 0.5 mA for an average of 85 microamps.&lt;/p&gt;
&lt;p&gt;Disabling AT_HOST_LIBRARY makes no impact on lowest 9160 current draw I can achieve.&amp;nbsp; I see that same as yet mysterious current spiking waveform in Nordic&amp;#39;s Power Profiler v3.4.3.&lt;/p&gt;
&lt;p&gt;At this point, if the threads are all sleeping, I don&amp;#39;t know in what source file or which routines to set breakpoints in gdb, to catch the code that seems to be running.&amp;nbsp; I&amp;#39;ve already turned off the two digital sensors on our custom board, and all other hardware pieces are analog, and from what I can tell are not able to produce a periodic or digital signal.&amp;nbsp; That is, those parts are unlikely to draw current in the pulsed way shown in the latest waveform capture I posted a few days ago.&lt;/p&gt;
&lt;p&gt;While I understand that Nordic Semi&amp;#39;s aws_iot sample application is not designed to showcase the lowest power consumption of nRF9160, I am now concerned about being able to reach current draw in the ones of microamps.&amp;nbsp; I&amp;#39;ve spent many days now investigating, testing code change, trouble-shooting hardawre and firmware and have not been able to get lower than ~65 microamps average current draw in our 9160 design.&amp;nbsp; This low spec&amp;#39;d deep sleep current consumption is a design requirement for my team, and is one of the primary bases on which we chose the nRF9160 for a new product design.&lt;/p&gt;
&lt;p&gt;The &amp;quot;hello_world&amp;quot; sample which you shared in an earlier post to this thread draws more current, between 2 and 3 mA.&amp;nbsp; This apparently due to a bug that affect mRF9160 current draw when the Nordic library API function nrf_modem_lib_dfu_handler() is not called.&lt;/p&gt;
&lt;p&gt;Forgive me if I repeat a question, but what would be a good fresh starting point for me to explore and test code that puts the nRF9160 in it&amp;#39;s full deep sleep mode?&amp;nbsp; I am about to revisit your hello_world project, enable nrf_modem_lib_dfu_handler() there if I can, and see what current draw occurs.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/359884?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 18:25:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:971b5f9e-4ea3-4369-b99e-691d2935f4a5</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hi Didrik,&lt;/p&gt;
&lt;p&gt;Regarding ZephyrRTOS_Plugin.so, I actually found that shared object file in the very path you share.&amp;nbsp; So I am good there, and presently I am running JLinkGDBServer version 7.60.&amp;nbsp; This version of a gdb server however does not appear to have thread awareness.&amp;nbsp; When at the gdb prompt, of a session connected to my running Zephyr 2.6.0 based app, I issue the command `thread apply all bt` I do not see the six threads that gdb should detect and which Zephyr is actually running, or has queued, and reports itself.&lt;/p&gt;
&lt;p&gt;According to &lt;a href="https://docs.zephyrproject.org/latest/releases/release-notes-2.6.html" rel="noopener noreferrer" target="_blank"&gt;Zephyr 2.6.0 release notes&lt;/a&gt; Segger&amp;#39;s JLinkGDBServer version 7.11. 7.20 and newer support thread awareness.&amp;nbsp; Again I&amp;#39;m using Segger&amp;#39;s gdb server version 7.60.&amp;nbsp; In my app&amp;#39;s prj.conf I enable:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;205 # 2021-11-11 - Zephyr thread analyzer work:
206 CONFIG_THREAD_ANALYZER=y
207 CONFIG_THREAD_ANALYZER_USE_PRINTK=y
208 CONFIG_THREAD_ANALYZER_AUTO=n
209 CONFIG_THREAD_NAME=y
  . . .
215 CONFIG_DEBUG_THREAD_INFO=y
216 CONFIG_THREAD_STACK_INFO=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and yet I&amp;#39;m not able to access threads in my gdb debugging sessions.&amp;nbsp; Is there some further Kconfig symbol I have missed to enable thread aware debugging?&lt;/p&gt;
&lt;p&gt;Regarding to disable Nordic&amp;#39;s AT host code, I am about to attempt this.&amp;nbsp; Your suggestion involves setting a Kconfig symbol to &amp;#39;n&amp;#39; or no.&amp;nbsp; In doing this I will disable Nordic modem code at compile time, but I have been using at_cmd_write() at run time to issue configuring commands such as AT+CPSMS to the LTE modem.&amp;nbsp; I&amp;#39;ll lose this configurability by making the Kconfig change you describe.&amp;nbsp; Even if this works to bring current lower or to the lowest nRF9160 current consumption specification I will most likely need a means to disable the AT host code dynamically, so I can use it at start up time and brief wake periods, then turn it off for longer deep sleep periods.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/359784?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 12:06:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33abae7c-4cd8-4c64-97ef-31aa79a98278</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="tedhavelka"]As for the above mentioned `RTOSPlugin_Zephyr.dll` this looks like a Windows targeted library file.&amp;nbsp; I&amp;#39;m not sure I can install and run that as part of a Linux application.[/quote]
&lt;p&gt;Yes, the .dll is for Windows, but there is an equivalent file for Linux. On one of my colleagues&amp;#39; computer, who uses Linux, it&amp;#39;s in /opt/SEGGER/JLink/GDBServer/RTOSPlugin_Zephyr.so.&lt;/p&gt;
[quote user="tedhavelka"]What is most interesting to me is gdb&amp;#39;s identifying remark that we are looking at function `at_host_work_q`.[/quote]
&lt;p&gt;That makes sense. The at_host library (which reads AT commands from the UART, and forwards them to the modem) uses its own workqueue, which in turn has its own thread. When enabled, the library starts up before the application reaches main(), and runs in the background, which explains why we have not found it earlier.&lt;/p&gt;
&lt;p&gt;As you don&amp;#39;t use UART, removing the AT host shouldn&amp;#39;t be an issue: CONFIG_AT_HOST_LIBRARY=n.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/359686?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 00:04:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ab23864-640c-4a8d-8bb1-20e94a76610c</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Didrik,&lt;/p&gt;
&lt;p&gt;Thank you for the link to the &lt;a href="https://www.youtube.com/playlist?list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl" rel="noopener noreferrer" target="_blank"&gt;VSCode configuration and use tutorial video series&lt;/a&gt;.&amp;nbsp; I am following these videos to understand and confirm my Ubuntu based installation of VSCode.&amp;nbsp; As for the above mentioned `RTOSPlugin_Zephyr.dll` this looks like a Windows targeted library file.&amp;nbsp; I&amp;#39;m not sure I can install and run that as part of a Linux application.&lt;/p&gt;
&lt;p&gt;So I am also studying &lt;a href="https://interrupt.memfault.com/blog/advanced-gdb" rel="noopener noreferrer" target="_blank"&gt;a Memfault gdb tutorial&lt;/a&gt; and have come across something I hope is the start of a path to the mystery, 25Hz periodic running code in my Zephyr based, aws_iot based application.&amp;nbsp; I&amp;#39;ve reduced my main() function to starting just three things:&amp;nbsp; (1) cJSON library initialization, (2) nrf_modem_lib_dfu_handler(), and (3) custom command line interface (CLI) thread.&amp;nbsp; Just after these three start calls, I call Zephyr&amp;#39;s API to print Zephyr threads and see:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;   1) &amp;#39;at_cmd_socket_thread&amp;#39;     stack size 1472 bytes, stack used 432 bytes, 29%
   2) &amp;#39;thread_simple_cli&amp;#39;        stack size 4096 bytes, stack used 1768 bytes, 43%
   3) &amp;#39;time_thread&amp;#39;              stack size 1024 bytes, stack used 240 bytes, 23%
   4) &amp;#39;0x20015458&amp;#39;               stack size 1024 bytes, stack used 168 bytes, 16%
   5) &amp;#39;sysworkq&amp;#39;                 stack size 2048 bytes, stack used 168 bytes, 8%
   6) &amp;#39;idle 00&amp;#39; &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note the persistent showing of the unnamed thread, now at 0x20015458.&amp;nbsp; I expect the address here to change when I comment out larger blocks of my application code.&amp;nbsp; In an attached gdb session I&amp;#39;ve run the command to show the disassembly which begins at this address:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;(gdb) disassemble 0x20015458
Dump of assembler code for function at_host_work_q:
   0x20015458 &amp;lt;+0&amp;gt;:	strb	r0, [r6, r5]
   0x2001545a &amp;lt;+2&amp;gt;:	movs	r0, #1
   0x2001545c &amp;lt;+4&amp;gt;:	strb	r0, [r6, r5]
   0x2001545e &amp;lt;+6&amp;gt;:	movs	r0, #1
   0x20015460 &amp;lt;+8&amp;gt;:	strb	r0, [r6, r5]
   0x20015462 &amp;lt;+10&amp;gt;:	movs	r0, #1
   0x20015464 &amp;lt;+12&amp;gt;:	lsls	r0, r0, #8
   0x20015466 &amp;lt;+14&amp;gt;:	movs	r2, r1
   0x20015468 &amp;lt;+16&amp;gt;:	movs	r0, r0
   0x2001546a &amp;lt;+18&amp;gt;:	movs	r0, r0
   0x2001546c &amp;lt;+20&amp;gt;:	movs	r0, r0
   0x2001546e &amp;lt;+22&amp;gt;:	movs	r0, r0
   0x20015470 &amp;lt;+24&amp;gt;:	movs	r0, r0
   0x20015472 &amp;lt;+26&amp;gt;:	movs	r0, r0
   0x20015474 &amp;lt;+28&amp;gt;:	movs	r0, r0
   0x20015476 &amp;lt;+30&amp;gt;:	movs	r0, r0
   0x20015478 &amp;lt;+32&amp;gt;:	movs	r0, r0
   0x2001547a &amp;lt;+34&amp;gt;:	movs	r0, r0
   0x2001547c &amp;lt;+36&amp;gt;:	movs	r0, r0
   0x2001547e &amp;lt;+38&amp;gt;:	movs	r0, r0
   0x20015480 &amp;lt;+40&amp;gt;:	movs	r0, r0
   0x20015482 &amp;lt;+42&amp;gt;:	movs	r0, r0
   0x20015484 &amp;lt;+44&amp;gt;:	movs	r0, r0
   0x20015486 &amp;lt;+46&amp;gt;:	movs	r0, r0
   0x20015488 &amp;lt;+48&amp;gt;:	movs	r0, r0
   0x2001548a &amp;lt;+50&amp;gt;:	movs	r0, r0
   0x2001548c &amp;lt;+52&amp;gt;:	movs	r0, r0
   0x2001548e &amp;lt;+54&amp;gt;:	movs	r0, r0
   0x20015490 &amp;lt;+56&amp;gt;:			; &amp;lt;UNDEFINED&amp;gt; instruction: 0xffffffff
   0x20015494 &amp;lt;+60&amp;gt;:			; &amp;lt;UNDEFINED&amp;gt; instruction: 0xffffffff&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The disassembly actually continues on, I&amp;#39;ve included only about twenty percent here.&amp;nbsp; The last two lines are unknown instructions, so I&amp;#39;m not convinced that there is truly one hundred plus lines of assembly code for whatever thread or routine begins at address 0x20015458.&lt;/p&gt;
&lt;p&gt;What is most interesting to me is gdb&amp;#39;s identifying remark that we are looking at function `at_host_work_q`.&amp;nbsp; I think a work queue is a zephyr construct.&amp;nbsp; So while in this low power testing version of my app I have most aws_iot code disabled, could some code that&amp;#39;s eventually set up at run time and or called by nrf_modem_lib_dfu_handler() be executing at a frequency of about 25 Hz?&lt;/p&gt;
&lt;p&gt;In my own CLI thread I found that I obtained a good responsiveness to human typing by checking for character input twenty times a second.&amp;nbsp; That is, I set my CLI thread&amp;#39;s default sleep period to 50 milliseconds.&amp;nbsp; The LTE modem AT command handler has some similar interactive features to my much simpler CLI, so is it possible that the AT command handler is still periodically looking for commands even while I have slept all other threads, and issued an AT+CPSMS= command to the modem?&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll continue on with studies of the materials you have linked for me.&amp;nbsp; I&amp;#39;ll also search for AT handler source code in Nordic&amp;#39;s ncs v1.6.1.&amp;nbsp; I think that code is on hand here.&amp;nbsp; Thank you again for your help thus far.&amp;nbsp; Let me know whether the above gdb output gives any recognizable clue as to what code is keeping my application from entering the full deep sleep mode and lowest current draw of about 1.4 microamps.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/359649?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 14:56:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:775f9197-1ab1-49fe-8c75-dbcefce3aa1f</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="tedhavelka"]In your recent response you mention that VSCode has a gdb plug-in, and would be configured to be thread-aware for Zephyr debugging support.&amp;nbsp; I have VSCode now installed, but am not able to get gdb running nor showing a menu or button interface for detected threads.&amp;nbsp; [/quote]
&lt;p&gt;If you haven&amp;#39;t seen it already, I would recommend this YouTube playlist on how to install and use VS Code with the nRF Connect SDK: &lt;a href="https://www.youtube.com/playlist?list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl"&gt;https://www.youtube.com/playlist?list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;One of the videos is about debugging, but you might want to look through the other videos as well, to double check that you have set everything up correctly.&lt;/p&gt;
[quote user="tedhavelka"]&lt;p&gt;It looks like I must precede my debugging commands to gdb with the token `mon` -- short for monitor? -- in order to do things like halt the firmware and &amp;quot;go&amp;quot; or run again.&lt;/p&gt;
&lt;p&gt;Question (1) can you recommend a good tutorial on the `mon` supported commands for ARM Cortex-M family parts?&lt;/p&gt;[/quote]
&lt;p&gt;It&amp;#39;s been a while since I used GDB manually myself, but I don&amp;#39;t think I used &amp;#39;mon&amp;#39; for much more than &amp;#39;mon reset&amp;#39; and &amp;#39;mon halt&amp;#39;. I don&amp;#39;t know about any good tutorials, but I found a list of the monitor commands supported by Segger: &lt;a href="https://wiki.segger.com/J-Link_GDB_Server#Supported_remote_.28monitor.29_commands"&gt;https://wiki.segger.com/J-Link_GDB_Server#Supported_remote_.28monitor.29_commands&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For thread aware debugging to work, you must add a plugin that is able to read and parse the information about the threads. E.g. when I start debugging the philosophers sample in VS Code, this is how JLinkGDBServerCL is started:&lt;/p&gt;
&lt;p&gt;Launching gdb-server: &amp;quot;C:\\Program Files (x86)\\SEGGER\\JLink\\JLinkGDBServerCL.exe&amp;quot; -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device nRF9160_xxAA -select usb=960060612 -rtos &amp;quot;C:\\Program Files (x86)\\SEGGER\\JLink\\GDBServer\\RTOSPlugin_Zephyr.dll&amp;quot;&lt;/p&gt;
[quote user="tedhavelka"]The result I see from `blinky` is an average current draw around 3.0 mA, with a fair amount of noise.[/quote]
&lt;p&gt;The 3mA current draw is a known issue: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/known_issues.html#other-issues"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/known_issues.html#other-issues&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(Sorry, I should have remembered this).&lt;/p&gt;
&lt;p&gt;The solution is to enable the modem library (CONFIG_NRF_MODEM_LIB=y).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/359447?ContentTypeID=1</link><pubDate>Tue, 22 Mar 2022 19:34:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95e66a12-4414-4401-af0c-d0694261d86a</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Didrik,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve reviewed my project&amp;#39;s Kconfig symbols summary in the build artifacts directory, `ncs/myproject/build` and find that those two out-of-tree &lt;br /&gt;Zephyr sensors libraries do not trigger any threads to be called:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ted@localhost$ grep -nr TRIGGER_OWN_THREAD ./*
\./build/zephyr/.config.old:1626:# CONFIG_IIS2DH_TRIGGER_OWN_THREAD is not set
./build/zephyr/.config.old:1639:# CONFIG_LIS2DH_TRIGGER_OWN_THREAD is not set
./build/zephyr/.config:1626:# CONFIG_IIS2DH_TRIGGER_OWN_THREAD is not set
./build/zephyr/.config:1639:# CONFIG_LIS2DH_TRIGGER_OWN_THREAD is not set

ted@localhost$&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I read through this file as well to be sure, and to see what related symbols are defined or not defined in the few lines before, between and after these &amp;quot;trigger own thread&amp;quot; symbols.&amp;nbsp; As I am not yet using hardware interrupt lines from the IIS2DH or other sensor I have not written any ISR for such hardware based interrupts for these sensors.&lt;/p&gt;
&lt;p&gt;Regarding the known current draw .hex file in your current measurements guide &lt;a href="https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/hardware-design/posts/getting-started-with-current-measurements-on-the-nrf9160?CommentId=b6127988-c126-4d90-a566-86596e84a0f0" rel="noopener noreferrer" target="_blank"&gt;current measurements guide&lt;/a&gt;, I have not tried running that specific .hex file.&amp;nbsp; I tried something very similar by returning to Nordic&amp;#39;s `ncs/nrf/samples/basic/blinky` Zephyr based app, building and running that on our custom board.&amp;nbsp; The result I see from `blinky` is an average current draw around 3.0 mA, with a fair amount of noise.&amp;nbsp; I have to make some adaptation to the blinky app in order to turn off some of our custom peripherals external to the nRF9160.&lt;/p&gt;
&lt;p&gt;Interestingly I see a similar cerca 3.0 mA current draw from my own application, specifically when I disable not only my own threads but also the call to the aws_iot library routine named `nrf_modem_lib_dfu_handler()`.&amp;nbsp; You may recall that my custom firmware is based partly on Nordic&amp;#39;s aws_iot sample app.&amp;nbsp; Only in these recent low power tests have I started to comment out calls to aws_iot library functions.&amp;nbsp; When I comment out and no longer call `nrf_modem_lib_dfu_handler()` I lose the AT command parser for the LTE modem, and I appear to lose a bunch other control over the modem&amp;#39;s behavior and power consumption.&lt;/p&gt;
&lt;p&gt;So I am not sure whether the pre-built hex file in your guide would help show me whether our board can draw that minimal, deep sleep spec&amp;#39;d current of about 1.4uA.&lt;/p&gt;
&lt;p&gt;In your recent response you mention that VSCode has a gdb plug-in, and would be configured to be thread-aware for Zephyr debugging support.&amp;nbsp; I have VSCode now installed, but am not able to get gdb running nor showing a menu or button interface for detected threads.&amp;nbsp; I&amp;#39;ve also invoked a gdb connection to our nRF9160 firmware at the command line with `west -v debug`.&amp;nbsp; I can connect to the ARM Cortex-M33 at a Linux command line with this west invocation.&amp;nbsp; It looks like I must precede my debugging commands to gdb with the token `mon` -- short for monitor? -- in order to do things like halt the firmware and &amp;quot;go&amp;quot; or run again.&lt;/p&gt;
&lt;p&gt;Question (1) can you recommend a good tutorial on the `mon` supported commands for ARM Cortex-M family parts?&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve done some searching for about an hour, and have some basic gdb experience.&amp;nbsp; Nonetheless I have not found any tutorial, how-to article or blog or forum posts which go into a practical working detail of how to interact with gdb at command line, and obtain a list of Zephyr registered threads.&amp;nbsp; Seems like there is a large debugging tool set here, but no instructions or guide on how to get started and make good use of them.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/359399?ContentTypeID=1</link><pubDate>Tue, 22 Mar 2022 13:50:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da4b9a9e-5ecb-489f-a06b-1bd72dbab2bd</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="tedhavelka"]To clarify my first question from above, can I be confident that I have correctly powered down all high frequency clocks in the 9160 SiP when I measure only 65 microamps to 85 microamps average current draw over a minute&amp;#39;s time?[/quote]
&lt;p&gt;Yes, they are not running. If they had been running the high frequency clocks would have drawn more current.&lt;/p&gt;
[quote user="tedhavelka"]I&amp;#39;ll watch for further help on the question of the roughly 25Hz current use spike activity.[/quote]
&lt;p&gt;I&amp;#39;ve talked with one of our current consumption experts, and he&amp;#39;s ideas was that it could be either GPIOTE IN event (edge detection on a GPIO pin), or the UART ENABLE base current (with RX disabled). &lt;/p&gt;
&lt;p&gt;Looking at the UART driver implementation, it looks like the driver disables the peripheral properly, so I don&amp;#39;t think the current draw comes from there. However, the GPIO edge detection might have been set up by one of the sensor drivers you have included in your project.&lt;/p&gt;
&lt;p&gt;Also, looking at the code of the drivers, it looks like both can create a thread, without giving it a name, if CONFIG_&amp;lt;sensor&amp;gt;_TRIGGER_OWN_THREAD is set. Is either of those two configs set in your project?&lt;/p&gt;
&lt;p&gt;Also, did you meassure the current draw of the .hex file in the &lt;a href="https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/hardware-design/posts/getting-started-with-current-measurements-on-the-nrf9160?CommentId=b6127988-c126-4d90-a566-86596e84a0f0"&gt;current meassurement blog post&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;You can also use the blinky sample with CONFIG_SERIAL=n to verify your current meassurement setup. By running an application with a known current consumption on the nRF9160, we can see check if the extra current consumption comes from somewhere else on the board.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/359218?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 17:27:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c219113b-a489-4418-9808-a04e1ca59a3e</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Good morning Didrik,&lt;/p&gt;
&lt;p&gt;Thank you for fast reply to my latest questions on nRF9160 current draw and PSM active and inactive periods.&amp;nbsp; To clarify my first question from above, can I be confident that I have correctly powered down all high frequency clocks in the 9160 SiP when I measure only 65 microamps to 85 microamps average current draw over a minute&amp;#39;s time?&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll watch for further help on the question of the roughly 25Hz current use spike activity.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To identify, adjust sleep period of sample app threads?</title><link>https://devzone.nordicsemi.com/thread/359213?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2022 16:39:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b76260d2-ea75-4836-9951-1c618790219f</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="tedhavelka"]Question (1):&amp;nbsp; is an average current of ~85 microamps indicative of an nRF9180 SICA B1A running with all UARTs and high speed clocks off?[/quote]
&lt;p&gt;Yes, if UART RX or HF clocks were running, you should see a power draw of &amp;gt;500uA.&lt;/p&gt;
[quote user="tedhavelka"]&lt;p&gt;Question (3) - When firmware enables PSM mode in the nRF9160 modem, is the &amp;quot;wake period + sleep period&amp;quot; entered immediately?&lt;/p&gt;
&lt;p&gt;Question (4) - When the new PSM times are configured, does the PSM mode begin by keep the modem on for its active period, or does it begin by keeping the modem in power savings mode for its suspended, low power period?&amp;nbsp; E.g. which part of the power cycle occurs first?&lt;/p&gt;[/quote]
&lt;p&gt;To send data, or communicate with the network, you need an RRC connection. How long you stay in RRC Connected mode depends on the network. After the RRC connection has been inactive for a while, the device is released from the RRC connection and enters RRC Idle mode. How long you stay here depends on the Active Time, and how often you must listen for incomming data depends on the eDRX settings. After the Active Time finishes, the device enters PSM and turn the radio completely off.&lt;/p&gt;
[quote user="tedhavelka"]Question (2)&amp;nbsp; is there a clue in the current spikes, appearing at about 25Hz, and intermittently peaking at 4mA and alternately 0.5mA?&amp;nbsp; Any part of SICA B1A hardware consume power in this way?[/quote]
&lt;p&gt;I&amp;#39;ll have to come back to you on this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>