<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>Failed to build FOTA firmware (nRF 1.9.1)</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88593/failed-to-build-fota-firmware-nrf-1-9-1</link><description>We have an nRF5340 application that builds fine for our custom board. However, it is not very straightforward what steps need to be performed to enable FOTA updates. I have looked into the &amp;quot;bluetooth/peripheral_uart&amp;quot; example and some tutorials, so I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Mon, 13 Jun 2022 12:58:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88593/failed-to-build-fota-firmware-nrf-1-9-1" /><item><title>RE: Failed to build FOTA firmware (nRF 1.9.1)</title><link>https://test-devzone.nordicsemi.com/thread/372156?ContentTypeID=1</link><pubDate>Mon, 13 Jun 2022 12:58:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c76e6301-fad5-4334-95f7-2e2673da3266</guid><dc:creator>user72692</dc:creator><description>[quote user="d.p"]Thanks for the prompt reply &lt;a href="https://test-devzone.nordicsemi.com/members/simoniversen"&gt;Simon&lt;/a&gt;. I&amp;#39;ve managed to update the application of the main processor, but I cannot update both the application processor and the network processor at the same time, using `CONFIG_UPDATEABLE_IMAGE_NUMBER=2`. I am getting the `BUILD_ASSERT(IMG_MGMT_UPDATABLE_IMAGE_NUMBER == 1` error when I try that. Is the only option to update one processor at a time? This is not ideal.&amp;nbsp;[/quote]
&lt;p&gt;Could you take a look at the &lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/v1.9.1/applications/machine_learning"&gt;machine learning sample&lt;/a&gt; and copy the approach there. It &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/applications/machine_learning/README.html#programming-nrf53-dk"&gt;supports multi-image update&lt;/a&gt;. If this approach doesn&amp;#39;t help you, please let me know, and I will take a deeper look at it (I don&amp;#39;t have too much experience with multi image DFU currently). Take a look at this page as well:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/ug_nrf5340.html#simultaneous-multi-image-dfu"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/ug_nrf5340.html#simultaneous-multi-image-dfu&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]We don&amp;#39;t have an external flash chip on our custom board, will there be enough space in the internal flash storage? [/quote]
&lt;p&gt;I just talked to a developer internally, and got informed that multi img DFU (update netcore and appcore) is not supported without external flash at the moment. My apologies for that.&lt;/p&gt;
[quote user=""]I read here there may not be enough:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_thingy53.html#external-flash"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_thingy53.html#external-flash&lt;/a&gt;&amp;nbsp;But we do have an SD card which we could use.[/quote]
&lt;p&gt;I have not tested this, but I think that it should be possible put the secondary slot in the SD card. See&amp;nbsp;&lt;a href="https://test-devzone.nordicsemi.com/f/nordic-q-a/85987/mcuboot-secondary-slot-in-external-spi-flash"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/85987/mcuboot-secondary-slot-in-external-spi-flash&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to build FOTA firmware (nRF 1.9.1)</title><link>https://test-devzone.nordicsemi.com/thread/371923?ContentTypeID=1</link><pubDate>Fri, 10 Jun 2022 13:11:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd36df5c-6a20-481d-98c7-2a15aeb02f14</guid><dc:creator>user68579</dc:creator><description>&lt;p&gt;Thanks for the prompt reply &lt;a href="https://test-devzone.nordicsemi.com/members/user72692"&gt;user72692&lt;/a&gt;. I&amp;#39;ve managed to update the application of the main processor, but I cannot update both the application processor and the network processor at the same time, using `CONFIG_UPDATEABLE_IMAGE_NUMBER=2`. I am getting the `BUILD_ASSERT(IMG_MGMT_UPDATABLE_IMAGE_NUMBER == 1` error when I try that. Is the only option to update one processor at a time? This is not ideal.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;P.S.: I am not sure I can update the title.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to build FOTA firmware (nRF 1.9.1)</title><link>https://test-devzone.nordicsemi.com/thread/371144?ContentTypeID=1</link><pubDate>Tue, 07 Jun 2022 12:37:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d26f941d-af8e-4aee-a9af-5fa994c03510</guid><dc:creator>user72692</dc:creator><description>&lt;p&gt;I was able to update the nRF5340 DK using the peripheral_uart sample and following the steps in&amp;nbsp;&lt;a href="https://test-devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu#dfu_over_bluetooth"&gt;DFU over Bluetooth&lt;/a&gt;. Here is the sample I used,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://test-devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5381.peripheral_5F00_uart_5F00_ble_5F00_dfu_5F00_53.zip"&gt;test-devzone.nordicsemi.com/.../5381.peripheral_5F00_uart_5F00_ble_5F00_dfu_5F00_53.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is the diff of the changes I applied to peripheral_uart:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;diff --git a/samples/bluetooth/peripheral_uart/prj.conf b/samples/bluetooth/peripheral_uart/prj.conf
index e5262de64..e055dfb1e 100644
--- a/samples/bluetooth/peripheral_uart/prj.conf
+++ b/samples/bluetooth/peripheral_uart/prj.conf
@@ -48,3 +48,24 @@ CONFIG_LOG_BACKEND_RTT=y
 CONFIG_LOG_BACKEND_UART=n
 
 CONFIG_ASSERT=y
+
+# Enable mcumgr.
+CONFIG_MCUMGR=y
+
+# Enable most core commands.
+CONFIG_MCUMGR_CMD_IMG_MGMT=y
+CONFIG_MCUMGR_CMD_OS_MGMT=y
+
+# Ensure an MCUboot-compatible binary is generated.
+CONFIG_BOOTLOADER_MCUBOOT=y
+
+# Allow for large Bluetooth data packets.
+CONFIG_BT_L2CAP_TX_MTU=252
+CONFIG_BT_BUF_ACL_RX_SIZE=256
+
+# Enable the Bluetooth (unauthenticated) and shell mcumgr transports.
+CONFIG_MCUMGR_SMP_BT=y
+CONFIG_MCUMGR_SMP_BT_AUTHEN=n
+
+# Some command handlers require a large stack.
+CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
\ No newline at end of file
diff --git a/samples/bluetooth/peripheral_uart/src/main.c b/samples/bluetooth/peripheral_uart/src/main.c
index 8a1ca1e50..c1445c13e 100644
--- a/samples/bluetooth/peripheral_uart/src/main.c
+++ b/samples/bluetooth/peripheral_uart/src/main.c
@@ -32,6 +32,10 @@
 
 #include &amp;lt;logging/log.h&amp;gt;
 
+#include &amp;lt;mgmt/mcumgr/smp_bt.h&amp;gt;
+#include &amp;quot;os_mgmt/os_mgmt.h&amp;quot;
+#include &amp;quot;img_mgmt/img_mgmt.h&amp;quot;
+
 #define LOG_MODULE_NAME peripheral_uart
 LOG_MODULE_REGISTER(LOG_MODULE_NAME);
 
@@ -76,7 +80,9 @@ static const struct bt_data ad[] = {
 };
 
 static const struct bt_data sd[] = {
-	BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_NUS_VAL),
+	BT_DATA_BYTES(BT_DATA_UUID128_ALL,
+		      0x84, 0xaa, 0x60, 0x74, 0x52, 0x8a, 0x8b, 0x86,
+		      0xd3, 0x4c, 0xb7, 0x1d, 0x1d, 0xdc, 0x53, 0x8d),
 };
 
 #if CONFIG_BT_NUS_UART_ASYNC_ADAPTER
@@ -571,6 +577,10 @@ void main(void)
 	if (IS_ENABLED(CONFIG_BT_NUS_SECURITY_ENABLED)) {
 		bt_conn_auth_cb_register(&amp;amp;conn_auth_callbacks);
 	}
+	printk(&amp;quot;build time: &amp;quot; __DATE__ &amp;quot; &amp;quot; __TIME__ &amp;quot;\n&amp;quot;);
+	os_mgmt_register_group();
+	img_mgmt_register_group();
+	smp_bt_register();
 
 	err = bt_enable(NULL);
 	if (err) {
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here is the output I got&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.7.99-ncs1-1  ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0xc000
I: Jumping to the first image slot
*** Booting Zephyr OS build v2.7.99-ncs1-1  ***
Starting Nordic UART service example
build time: Jun  7 2022 14:22:19
*** Booting Zephyr OS build v2.7.99-ncs1-1  ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: test
I: Bootloader chainload address offset: 0xc000
I: Jumping to the first image slot
*** Booting Zephyr OS build v2.7.99-ncs1-1  ***
Starting Nordic UART service example
build time: Jun  7 2022 14:24:45&lt;/pre&gt;&lt;/p&gt;
[quote user=""]&lt;p&gt;1. How to make the project build for multi-image FOTA, BLE updates? Do I need to include the following in the MCUboot configuration?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="overflow:auto;"&gt;&lt;div&gt;&lt;a href="#"&gt;Fullscreen&lt;/a&gt;&lt;div style="width:100%;height:86px;"&gt;&lt;div&gt;&lt;div style="margin-top:0;height:100.8px;width:40px;"&gt;&lt;div style="height:14.4px;"&gt;1&lt;/div&gt;&lt;div style="height:14.4px;"&gt;2&lt;/div&gt;&lt;div style="height:14.4px;"&gt;3&lt;/div&gt;&lt;div style="height:14.4px;"&gt;4&lt;/div&gt;&lt;div style="height:14.4px;"&gt;5&lt;/div&gt;&lt;/div&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="left:40px;right:0;bottom:14px;"&gt;&lt;div style="margin-top:0;width:1116px;height:100.8px;margin-left:0;"&gt;&lt;div&gt;&lt;div style="left:531.82px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div style="padding:0 4px;"&gt;&lt;div style="height:14.4000005722046px;"&gt;CONFIG_BOOT_UPGRADE_ONLY - The simultaneous update of multiple images does not support network core image reversion, so you need to disable application image reversion.&lt;/div&gt;&lt;div style="height:14.4000005722046px;"&gt;&lt;/div&gt;&lt;div style="height:14.4000005722046px;"&gt;CONFIG_PCD_APP - Enable commands exchange with the network core.&lt;/div&gt;&lt;div style="height:14.4000005722046px;"&gt;&lt;/div&gt;&lt;div style="height:14.4000005722046px;"&gt;CONFIG_UPDATEABLE_IMAGE_NUMBER - Enable support for multiple update partitions by setting this option to 2.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="left:89.7708px;top:57.6px;width:6.59775px;height:14.4px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="display:none;width:19px;bottom:14px;"&gt;&lt;div style="width:19px;height:72px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="height:19px;left:40px;right:0;"&gt;&lt;div style="height:19px;width:1116px;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;No,&amp;nbsp;if you just want to update the application, you don&amp;#39;t need to add these&lt;/p&gt;
[quote user=""]2. I haven&amp;#39;t found any nRF samples that demonstrate how to do an FOTA update via BLE, using the nRF5340-DK. Can you please point me to any?[/quote]
&lt;p&gt;Check my attached sample above&lt;/p&gt;
[quote user=""]3. The peripheral_uart example uses external flash for the FOTA update. We don&amp;#39;t have an external flash chip on our custom board, will there be enough space in the internal flash storage? I read here there may not be enough:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_thingy53.html#external-flash"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_thingy53.html#external-flash&lt;/a&gt;&amp;nbsp;But we do have an SD card which we could use.[/quote]
&lt;p&gt;I was able to perform a DFU using the peripheral_uart and the nRF5340 without using external flash (confirmed it by running ninja partition_manager_report from the build folder). However, if your application is large, you might need to use external flash.&lt;/p&gt;
&lt;p&gt;Also, could you change your title and include &amp;#39;nRF5340&amp;#39;, so other people can find it more easily&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>