<?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>Update custom net core image on nrf5340 with NCS v2.7.0 using external SPI flash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114981/update-custom-net-core-image-on-nrf5340-with-ncs-v2-7-0-using-external-spi-flash</link><description>Hello, I&amp;#39;ve spend some time updating our nrf5340 application to NCS v2.7.0, including using the new hardware model and using sysbuild. We have a custom application that we are running on the network core. It seems that mcuboot, b0, and both our applications</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Oct 2024 19:47:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114981/update-custom-net-core-image-on-nrf5340-with-ncs-v2-7-0-using-external-spi-flash" /><item><title>RE: Update custom net core image on nrf5340 with NCS v2.7.0 using external SPI flash</title><link>https://devzone.nordicsemi.com/thread/504901?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2024 19:47:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b76adc4a-c4b0-47df-867b-7c109835da51</guid><dc:creator>sachrmed</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That was very helpful.&lt;/p&gt;
&lt;p&gt;I was able to port the relevant changes over to my application and I am now able to update both the app core and net core.&lt;/p&gt;
&lt;p&gt;I think part of the confusion is that we are used to using the nRF Connect phone app to send .bin files for update, and that was working with version 2.1.0 of the SDK.&lt;/p&gt;
&lt;p&gt;It appears that nRF Connect always sets the SMP &amp;quot;image&amp;quot; field of the Image Upload request to 0. Device Manager, on the other hand, sets &amp;quot;image&amp;quot; to 0 for the app core and sets it to 1 for the net core.&lt;/p&gt;
&lt;p&gt;We have a custom SMP application here that I was able to experiment with. It appears that you can indeed update only the app core or net core so long as you send the .bin file with the correct &amp;quot;image&amp;quot; field. So it seems it&amp;#39;s possible to update only one of the cores or both at the same time. I&amp;#39;m not sure if this behaviour is documented anywhere.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks again for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update custom net core image on nrf5340 with NCS v2.7.0 using external SPI flash</title><link>https://devzone.nordicsemi.com/thread/504689?ContentTypeID=1</link><pubDate>Wed, 02 Oct 2024 12:01:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10c8d034-1aa1-47cb-ae60-6419b6502663</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="sachrmed"]It looks like it was able to send the file, but the console of my nrf5340dk printed out the following:[/quote]
&lt;p&gt;The &amp;#39;mcuboot_primary_1&amp;#39; RAM partition is not accessible from the application, which causes an error when the mcumgr client attempts to read the state of each MCUBoot slot (you can find which ID a given flash partition is mapped to from the generated pm_config.h file). This error message can safely be ignored.&lt;/p&gt;
[quote user="sachrmed"]Also, how can I confirm that the upgrade was indeed successful?[/quote]
&lt;p&gt;One way to verify if the application is updated&amp;nbsp;is to&amp;nbsp;print the app version string by adding the following code to main.c (version string is generated from the VERSION file located in the project root):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;app_version.h&amp;gt;

...

int main(void)
{
	int blink_status = 0;
	int err;

	//MOD: print version string on startup
	printk(&amp;quot;Starting Bluetooth Peripheral LBS example %s\n&amp;quot;, 
		APP_VERSION_STRING);
	...
	&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Log showing a successful update:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Starting Bluetooth Peripheral LBS example 1.1.0
I: 2 Sectors of 4096 bytes
I: alloc wra: 0, f98
I: data wra: 0, ac
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF53x (0x0003)
I: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: C4:B5:E5:CB:42:EF (random)
I: HCI: version 5.4 (0x0d) revision 0x21fb, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x21fb
Advertising successfully started
Connected
Security changed: 78:64:C0:20:53:23 (public) level 4
W: Ignoring data for unknown channel ID 0x003a
I: Image index: 0, Swap type: none
I: Erased 0x25000 bytes of image slot
I: Erased 0x1000 bytes of image slot trailer
I: Image index: 0, Swap type: none
I: Image index: 1, Swap type: none
E: Failed to open flash area ID 2: -2
I: Image index: 0, Swap type: none
I: Image index: 0, Swap type: perm
I: Image index: 1, Swap type: perm
E: Failed to open flash area ID 2: -2
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
Attempting to boot slot 0.
Attempting to boot from address 0x8200.
Verifying signature against key 0.
Hash: 0xd2...10
Firmware signature verified.
Firmware version 2
*** Booting MCUboot v2.1.0-dev-daf2946a0f07 ***
*** Using nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: Starting bootloader
I: Image index: 0, Swap type: perm
I: Image index: 1, Swap type: none
I: Image 0 upgrade secondary slot -&amp;gt; primary slot
I: Erasing the primary slot
I: Image 0 copying the secondary slot to the primary slot: 0x245f0 bytes
I: Bootloader chainload address offset: 0x28000
�I: mx25r6435f@0: 8 MiBy flashslot
*** Booting My Application v1.2.0-f8c506039b0b ***
*** Using nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
Starting Bluetooth Peripheral LBS example 1.2.0
I: 2 Sectors of 4096 bytes
I: alloc wra: 0, f80
I: data wra: 0, c8
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF53x (0x0003)
I: Firmware: Standard Bluetooth controller (0x00) Version 214.51162 Build 1926957230
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: C4:B5:E5:CB:42:EF (random)
I: HCI: version 5.4 (0x0d) revision 0x21fb, manufacturer 0x0059
I: LMP: version 5.4 (0x0d) subver 0x21fb
Advertising successfully started&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Updating application image with nRF Device manager app on iOS from the advanced menu:&lt;/p&gt;
&lt;p&gt;Select which binary to upload (peripheral_lbs.bin in this case):&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/dfu_5F00_1.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;After uploading, read the image slots and confirm that the new image in the secondary slot has a higher version number.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/dfu_5F00_2.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Then confirm the update by pressing &amp;#39;confirm&amp;#39;. After confirming the image, you can send the reset command to have the bootloader activate the update.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1727870468257v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update custom net core image on nrf5340 with NCS v2.7.0 using external SPI flash</title><link>https://devzone.nordicsemi.com/thread/504595?ContentTypeID=1</link><pubDate>Tue, 01 Oct 2024 21:14:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d88784dc-76c1-4dce-9321-3b110d8cbd0b</guid><dc:creator>sachrmed</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;br /&gt;&lt;br /&gt;Thanks very much for putting that together.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/114981/update-custom-net-core-image-on-nrf5340-with-ncs-v2-7-0-using-external-spi-flash/504371"]Do you have any existing devices that need to be updated? The reason I ask is that it&amp;#39;s not possible to change the memory layout through DFU.[/quote]
&lt;p&gt;Fortunately we are still in development so we have the freedom to make these changed right now.&lt;/p&gt;
&lt;p&gt;I also have a &lt;span&gt;nRF5340DK&lt;/span&gt; that I have used to try out your sample.&lt;br /&gt;I built it using the nRF Connect VS Code extension. I set up the build for a nrf5340dk/nrf5340/cpuapp and selected &amp;quot;Use sysbuild&amp;quot;.&lt;/p&gt;
&lt;p&gt;After flashing, I placed the generated dfu_application.zip onto my phone and opened it with the nRF Device Manager app.&lt;/p&gt;
&lt;p&gt;It looks like it was able to send the file, but the console of my nrf5340dk printed out the following:&lt;br /&gt;&lt;br /&gt;I: Image index: 0, Swap type: none&lt;br /&gt;I: Image index: 1, Swap type: none&lt;br /&gt;E: Failed to open flash area ID 2: -2&lt;br /&gt;I: Image index: 1, Swap type: none&lt;br /&gt;I: Erased 0x2c000 bytes of image slot&lt;br /&gt;I: Erased 0x4000 bytes of image slot trailer&lt;br /&gt;E: Failed to open flash area ID 2: -2&lt;br /&gt;I: Image index: 1, Swap type: none&lt;br /&gt;I: Image index: 0, Swap type: none&lt;br /&gt;I: Image index: 1, Swap type: none&lt;br /&gt;E: Failed to open flash area ID 2: -2&lt;/p&gt;
&lt;p&gt;I&amp;#39;m a bit concerned about those flash errors. Is that expected?&lt;br /&gt;Also, how can I confirm that the upgrade was indeed successful?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update custom net core image on nrf5340 with NCS v2.7.0 using external SPI flash</title><link>https://devzone.nordicsemi.com/thread/504371?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2024 13:08:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f91a7c59-61c9-432b-aea7-7902cb8328da</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Unfortunately, one of the developers has confirmed that it&amp;#39;s currently not possible to update the network core from external flash unless simultaneous updates are enabled. Do you have any existing devices that need to be updated? The reason I ask is that it&amp;#39;s not possible to change the memory layout through DFU.&lt;/p&gt;
&lt;p&gt;Attached below is the&amp;nbsp;&lt;span&gt;simultaneous DFU demo sample I created. It uses the nRF immutable bootloader (B0) + MCUBoot, and SPI flash for the secondary DFU slots. Is tested on a nRF5340DK.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0410.peripheral_5F00_lbs_5F00_ble_5F00_fota.zip"&gt;devzone.nordicsemi.com/.../0410.peripheral_5F00_lbs_5F00_ble_5F00_fota.zip&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Limitations:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;- This patch:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/16894"&gt;https://github.com/nrfconnect/sdk-nrf/pull/16894&lt;/a&gt;&amp;nbsp;needs to be applied to the &amp;#39;nrf&amp;#39; repo to allow the signing key for mcuboot (SB_CONFIG_BOOT_SIGNATURE_KEY_FILE) to be set with a path relative to the project directory.&lt;/p&gt;
&lt;p&gt;- The mcuboot, application, and netcore image need to be updated and confirmed individually from the advanced menu in the nRF Device Manager app on iOS/Android.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update custom net core image on nrf5340 with NCS v2.7.0 using external SPI flash</title><link>https://devzone.nordicsemi.com/thread/504041?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 16:47:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a0adf7a-6cc1-47b6-a55b-cedd10748bbb</guid><dc:creator>sachrmed</dc:creator><description>&lt;p&gt;No problem! Thanks for the reply.&lt;/p&gt;
&lt;p&gt;Currently I&amp;#39;m trying with non-encrypted images. We are using signed images though.&lt;br /&gt;Encryption could be an option in the future, but we can keep it simple for now &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;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking forward to seeing your sample!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update custom net core image on nrf5340 with NCS v2.7.0 using external SPI flash</title><link>https://devzone.nordicsemi.com/thread/504025?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2024 15:12:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04f5411c-1a48-47c1-9a36-5b942cce8ddd</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry for the delayed response. I&amp;#39;m not aware of any samples in v2.7.0 that do exactly this, so I will try to create a small demo to see if I can get it to work. Before starting, could you please confirm whether you use encrypted DFU images or not? I know&amp;nbsp;&amp;nbsp;the detection mechanism used to determine if the image in the secondary slot belongs to the app or netcore does not work with encrypted images.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
[quote user="ykavi"]Any possible solutions to this would be appreciated. I’ve been facing the same exact problem for a while and have been looking for a solution.[/quote]
&lt;p&gt;Could you please confirm if your application has the exact same requirements as OP? i.e., non-simultaneous DFU, external SPI flash, and B0n + MCUBoot bootloader with SDK v2.7.0?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update custom net core image on nrf5340 with NCS v2.7.0 using external SPI flash</title><link>https://devzone.nordicsemi.com/thread/503644?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2024 23:16:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d175d6e-3e8c-4862-a5d4-dfef14990a80</guid><dc:creator>ykavi</dc:creator><description>&lt;p&gt;Any possible solutions to this would be appreciated. I&amp;rsquo;ve been facing the same exact problem for a while and have been looking for a solution.&lt;/p&gt;
&lt;p&gt;Thank you.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>