<?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>What&amp;#39;s the proper way to run nrf9160 DK&amp;#39;s app working on nrf9160 SiP?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43115/what-s-the-proper-way-to-run-nrf9160-dk-s-app-working-on-nrf9160-sip</link><description>Hi there, 
 I&amp;#39;m having a lot of fun with running apps on nrf9160 SiP on board of nrf9160 DK. 
 nrf52840 SoC contains the standard board controller fw. 
 nrf9160 SiP contains the standard secure bootloader from samples and modem fw. 
 My app is very simple</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Jan 2019 10:53:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43115/what-s-the-proper-way-to-run-nrf9160-dk-s-app-working-on-nrf9160-sip" /><item><title>RE: What's the proper way to run nrf9160 DK's app working on nrf9160 SiP?</title><link>https://devzone.nordicsemi.com/thread/168665?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 10:53:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b5fe685-dd14-40f7-b0fc-f316ff70eadc</guid><dc:creator>Aleksei Vegner</dc:creator><description>&lt;p&gt;Thanks a lot! Yes, the only option which is preventing a quick start is&amp;nbsp;&lt;/p&gt;
&lt;p&gt;CONFIG_LTE_LINK_CONTROL=y&lt;/p&gt;
&lt;p&gt;Disabling the option has helped.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What's the proper way to run nrf9160 DK's app working on nrf9160 SiP?</title><link>https://devzone.nordicsemi.com/thread/168659?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 10:27:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48315b07-7bf7-49dc-8efb-f8ecf01499ac</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Alex,&lt;/p&gt;
&lt;p&gt;&lt;em&gt;First things first,&lt;/em&gt; the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/0.3.0/nrf/samples/nrf9160/lte_ble_gateway/README.html"&gt;lte_ble_gateway sample&lt;/a&gt; is not necessary the best sample to build upon in your case where you test out&amp;nbsp;&lt;em&gt;basic&lt;/em&gt; functionality.&lt;/p&gt;
&lt;p&gt;(&lt;em&gt;for simple samples I would suggest you to check out this &lt;a href="https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160"&gt;repository&lt;/a&gt;&lt;/em&gt;.)&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;The reason you see this &amp;quot;&lt;em&gt;strange&lt;/em&gt;&amp;quot; behaviour is that you have enabled alot of things in the&amp;nbsp;&lt;strong&gt;prj.conf&amp;nbsp;&lt;/strong&gt;file which you do not need.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;For example, when you set:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;# LTE link control
CONFIG_LTE_LINK_CONTROL=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You say to the application to try to establish a link with a base station before your&amp;nbsp;&lt;em&gt;main&amp;nbsp;&lt;/em&gt;runs. This can take ~30-60 seconds, and that is why you see this delay when running your application before the LED starts to toggle.&lt;/p&gt;
&lt;hr /&gt;
&lt;ul&gt;
&lt;li&gt;What you can do is strip everything down from the &lt;em&gt;lte_ble_gateway&lt;/em&gt; sample.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;1. Only enable the necessary things in&amp;nbsp;&lt;strong&gt;prj.conf&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;# Trusted execution
CONFIG_TRUSTED_EXECUTION_NONSECURE=y

# Library for buttons and LEDs
CONFIG_DK_LIBRARY=y
CONFIG_DK_LIBRARY_INVERT_LEDS=n &lt;/pre&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;2. Strip down the &lt;strong&gt;main.c&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*

* Copyright (c) 2012-2014 Wind River Systems, Inc.

*

* SPDX-License-Identifier: Apache-2.0

*/

#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;misc/printk.h&amp;gt;
#include &amp;lt;dk_buttons_and_leds.h&amp;gt;

static void leds_init(void)
{
	int err;

	err = dk_leds_init();
	if (err) {
		printk(&amp;quot;Could not initialize leds, err code: %d\n&amp;quot;, err);
	}

	err = dk_set_leds_state(0, DK_ALL_LEDS_MSK);
	if (err) {
		printk(&amp;quot;Could not set leds state, err code: %d\n&amp;quot;, err);
	}
}

void main(void)
{
	static bool led_1_on = false;
	int err;
	u32_t leds_on_mask;

	printk(&amp;quot;BLE to NB-IoT gateway started\n&amp;quot;);
	leds_init();

	while (true) {
		led_1_on = !led_1_on;
		leds_on_mask = 0;
		if (led_1_on) {
			leds_on_mask |= DK_LED1_MSK;
		}

		err = dk_set_leds_state(leds_on_mask, DK_ALL_LEDS_MSK);
		if (err) {
			printk(&amp;quot;Could not set leds state, err code: %d\n&amp;quot;, err);
		}

		k_sleep(K_MSEC(200));
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;3. Strip down the &lt;strong&gt;CMakeLists.txt&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#

cmake_minimum_required(VERSION 3.8.2)

include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(NONE)

target_sources(app PRIVATE src/main.c)
&lt;/pre&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;ul&gt;
&lt;li&gt;Or another option is to unzip&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-1a405ba0fd01412cac227c84bb95d170/simple_5F00_led.zip"&gt;devzone.nordicsemi.com/.../simple_5F00_led.zip&lt;/a&gt; in [&amp;nbsp;&lt;em&gt;nrf\samples\nrf9160\&lt;/em&gt;] and build/run.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It should work out-of-the box with your specification for the application. (and it should be easier to build upon)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What's the proper way to run nrf9160 DK's app working on nrf9160 SiP?</title><link>https://devzone.nordicsemi.com/thread/168609?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 07:31:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2d049dc-d875-4190-a969-363d7c96e227</guid><dc:creator>Aleksei Vegner</dc:creator><description>&lt;p&gt;Power cycling and/or reset after flashing don&amp;#39;t help to get a 100% successful run. You&amp;#39;re right SiP&amp;#39;s app runs after secure boot.&lt;/p&gt;
&lt;p&gt;I meant the following:&lt;/p&gt;
&lt;p&gt;- DK has 2 onboard ICs (nrf52 + nrf91)&lt;/p&gt;
&lt;p&gt;- when I switch DK on LED1 starts blinking for a very short moment of time&lt;/p&gt;
&lt;p&gt;- it seems like board controller nrf52 interrupts (resets) SiP during power up, performs board initialization. That&amp;#39;s why blinking stops&lt;/p&gt;
&lt;p&gt;- then only after ~30-60 seconds led starts blinking again. But it&amp;#39;s not guaranteed and resembles very random behaviour&lt;/p&gt;
&lt;p&gt;I just can&amp;#39;t figure out why each power up results in different time to run my SiP&amp;#39;s app if it&amp;#39;s been run at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What's the proper way to run nrf9160 DK's app working on nrf9160 SiP?</title><link>https://devzone.nordicsemi.com/thread/168524?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 15:32:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d57b21c0-0dc2-4f78-950f-8f2d787228b9</guid><dc:creator>Aleksei Vegner</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void leds_init(void)
{
	int err;

	err = dk_leds_init();
	if (err) {
		printk(&amp;quot;Could not initialize leds, err code: %d\n&amp;quot;, err);
	}

	err = dk_set_leds_state(0, DK_ALL_LEDS_MSK);
	if (err) {
		printk(&amp;quot;Could not set leds state, err code: %d\n&amp;quot;, err);
	}
}

void main(void)
{
	static bool led_1_on = false;
	int err;
	u32_t leds_on_mask;

	printk(&amp;quot;BLE to NB-IoT gateway started\n&amp;quot;);
	leds_init();

	while (true) {
		led_1_on = !led_1_on;
		leds_on_mask = 0;
		if (led_1_on) {
			leds_on_mask |= DK_LED1_MSK;
		}

		err = dk_set_leds_state(leds_on_mask, DK_ALL_LEDS_MSK);
		if (err) {
			printk(&amp;quot;Could not set leds state, err code: %d\n&amp;quot;, err);
		}

		k_sleep(K_MSEC(200));
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# General config
CONFIG_NEWLIB_LIBC=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_ASSERT=y
CONFIG_REBOOT=y

# Trusted execution
CONFIG_TRUSTED_EXECUTION_NONSECURE=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y

# MQTT
CONFIG_MQTT_SOCKET_LIB=y
CONFIG_MQTT_LIB_TLS=y
CONFIG_MQTT_MAX_PACKET_LENGTH=2048

# LTE link control
CONFIG_LTE_LINK_CONTROL=y

# BSD library
CONFIG_BSD_LIBRARY=y

# Disable Modem traces, since we need UART1 for HCI
CONFIG_BSD_LIBRARY_TRACE_ENABLED=n

# nRF Cloud
CONFIG_NRF_CLOUD=n

# Library for buttons and LEDs
CONFIG_DK_LIBRARY=y
CONFIG_DK_LIBRARY_INVERT_LEDS=n

# Console
CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_HANDLER=y
CONFIG_CONSOLE_GETCHAR=y

CONFIG_CONSOLE=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_UART_CONSOLE=y

# Main thread
CONFIG_MAIN_THREAD_PRIORITY=7

# Enable Bluetooth stack and libraries
CONFIG_BT=y
CONFIG_BT_H4=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_DM=y
CONFIG_BT_SCAN=y
CONFIG_BT_SCAN_FILTER_ENABLE=y
CONFIG_BT_SCAN_UUID_CNT=1
CONFIG_BT_SCAN_ADDRESS_CNT=1

CONFIG_UART_2_NRF_UARTE=y
CONFIG_UART_2_NRF_FLOW_CONTROL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

CONFIG_LOG=y
CONFIG_BT_GATT_DM_LOG_LEVEL_INF=y

# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_MAIN_STACK_SIZE=8192
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;based on &lt;strong&gt;ncs/nrf/samples/nrf9160/lte_ble_gateway&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;login@host&amp;gt;: cat ~/.zephyrrc 
export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
export GNUARMEMB_TOOLCHAIN_PATH=&amp;quot;/opt/gnuarmemb&amp;quot;

&amp;lt;login@host&amp;gt;: . ~/nrf91/sdk/ncs/zephyr/zephyr-env.sh
&amp;lt;login@host&amp;gt;: cd ~/nrf91/sdk/ncs/nrf/samples/nrf9160/lte_ble_gateway
&amp;lt;login@host&amp;gt;: BOARD=nrf9160_pca10090 cmake -Bbuild -H.
&amp;lt;login@host&amp;gt;: cd build &amp;amp;&amp;amp; make -j $(nproc)
&amp;lt;login@host&amp;gt;: nrfjprog --program zephyr/zephyr.hex -f nrf91 --sectorerase -r --verify
&amp;lt;login@host&amp;gt;: /opt/gnuarmemb/bin/arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 8-2018-q4-major) 8.2.1 20181213 (release) [gcc-8-branch revision 267074]
&lt;/pre&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What's the proper way to run nrf9160 DK's app working on nrf9160 SiP?</title><link>https://devzone.nordicsemi.com/thread/168506?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 14:52:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccd6ae50-7d10-474d-94f2-ba922c08b345</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Alex,&lt;/p&gt;
&lt;p&gt;Please share your code.&lt;/p&gt;
&lt;p&gt;You should not need to add a delay in your main application, because it will not run &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/0.3.0/nrf/ug_nrf9160.html"&gt;parallel with the &lt;em&gt;secure_boot&lt;/em&gt;&lt;/a&gt;. (it runs after)&lt;/p&gt;
&lt;p&gt;If you are using the default board controller and only need to reset the nrf91 the Reset button should be enough.&lt;/p&gt;
&lt;p&gt;Then again when you flash new firmware, it is recommended to power cycle the board.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>