<?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>Only low power after programming low power hex file</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110154/only-low-power-after-programming-low-power-hex-file</link><description>Hi, 
 I am developing a custom board which a based on the CircuitDojo designs. I try to get it in a low power state. 
 Step 1: 
 If I upload my application I have a average power consumption of 2,85 mA 
 Step 2: Now I program the 1452.sysoff.hex from</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Apr 2024 14:41:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110154/only-low-power-after-programming-low-power-hex-file" /><item><title>RE: Only low power after programming low power hex file</title><link>https://devzone.nordicsemi.com/thread/478368?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2024 14:41:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9460c34a-5773-4980-94b7-035564421ebf</guid><dc:creator>thijsfranssen</dc:creator><description>&lt;p&gt;That fixed it! Great, thanks for the super fast reply :)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For anyone who has the same issues, this is the new main.c file:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/*
 * Copyright (c) 2016 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;
#include &amp;lt;zephyr/pm/device.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/logging/log_ctrl.h&amp;gt;
#include &amp;lt;modem/lte_lc.h&amp;gt;
#include &amp;lt;zephyr/drivers/flash.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/devicetree.h&amp;gt;
#include &amp;lt;zephyr/drivers/i2c.h&amp;gt;
#include &amp;lt;zephyr/drivers/regulator.h&amp;gt;
#include &amp;lt;modem/nrf_modem_lib.h&amp;gt;


#define SLEEP_TIME_MS 11000
#define LED0_NODE DT_ALIAS(led0)

const struct device *gpio_dev = DEVICE_DT_GET(DT_NODELABEL(gpio0));
const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
const struct device *reg_dev = DEVICE_DT_GET(DT_NODELABEL(reg_5v));

int pins[] = {1, 2, 3, 4, 5, 6, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
int num_pins = sizeof(pins) / sizeof(pins[0]);

void setPowerLow()
{
	const struct device *flash_dev = DEVICE_DT_GET(DT_ALIAS(spi_flash0));
	static const struct device *const console_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
	NRF_CLOCK-&amp;gt;TASKS_HFCLKSTOP = 1;
	pm_device_action_run(flash_dev, PM_DEVICE_ACTION_SUSPEND);
	pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);
}

int main(void)
{
	setPowerLow();
	lte_lc_power_off();
	nrf_modem_lib_init();
	for (int i = 0; i &amp;lt; num_pins; i++)
	{
		gpio_pin_configure(gpio_dev, pins[i], GPIO_INPUT | GPIO_PULL_UP);
	}
	gpio_pin_configure(gpio_dev, 9, GPIO_INPUT | GPIO_PULL_UP);
	gpio_pin_configure(gpio_dev, 10, GPIO_INPUT | GPIO_PULL_UP);
	gpio_pin_configure_dt(&amp;amp;led, GPIO_OUTPUT_ACTIVE);

	while (1)
	{
		k_msleep(SLEEP_TIME_MS);
	}

	return 0;
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Only low power after programming low power hex file</title><link>https://devzone.nordicsemi.com/thread/478367?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2024 14:36:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64812b25-137c-46f2-b8a0-5623c6d6764c</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It looks like you might have run into &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/known_issues.html#modem_libraries"&gt;NCSDK-10106&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Can you try to enable the modem library by enabling CONFIG_NRF_MODEM_LIB and calling nrf_modem_lib_init()?&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></channel></rss>