<?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>Simultaneous dfu on nRF5340 ncs2.6 without external flash with TFM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110375/simultaneous-dfu-on-nrf5340-ncs2-6-without-external-flash-with-tfm</link><description>I&amp;#39;ve managed to build and flash the project mentioned in this link( devzone.nordicsemi.com/.../459668) to the nrf5340dk with TFM disabled. However, when I attempt to build the project with TFM enabled the project builds, and flashes, but MCUBoot is unable</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 25 Apr 2024 16:36:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110375/simultaneous-dfu-on-nrf5340-ncs2-6-without-external-flash-with-tfm" /><item><title>RE: Simultaneous dfu on nRF5340 ncs2.6 without external flash with TFM</title><link>https://devzone.nordicsemi.com/thread/480761?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2024 16:36:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:702c4d2a-0b47-4fe4-8219-09d1746af737</guid><dc:creator>leadrover</dc:creator><description>&lt;p&gt;Andreas you are awesome.&lt;/p&gt;
&lt;p&gt;Thanks for the detailed replies! At the moment we&amp;#39;re working with a board that only has NAND flash, and this project has been a proof of concept for what we want to build on our own board. I really appreciate the detailed reply regarding the size limitations when considering DFU with internal flash only. We have considered this limitation and are able to make our application work within this limit for now.&lt;/p&gt;
&lt;p&gt;I will look at the sample and documentation you&amp;#39;ve provided and try to get something working asap. Thank you again for taking the time and giving these responses the attention you do.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Trevor&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simultaneous dfu on nRF5340 ncs2.6 without external flash with TFM</title><link>https://devzone.nordicsemi.com/thread/480689?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2024 12:32:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4839bd58-b75d-4b13-b37d-32903a1ae3f1</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;So it looks like there are quite a lot more to adding TF-M than I initially thought w.r.t DFU, so I instead pivoted and took a look at the TF-M samples we have. In&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/tfm/tfm_psa_template/README.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/tfm/tfm_psa_template/README.html&lt;/a&gt;&amp;nbsp;there are a section regarding how to test and set up the sample for firmware updates, so instead of using the simultaneous non-external flash sample in the case you referred to in the original ticket as a foundation, we should use this one as a foundation.&lt;/p&gt;
&lt;p&gt;What I will do in my downtime (which is unfortunately little of before the weekend atleast) and that you can do to get going is&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use and test this sample with the documentation regarding TFM and DFU and verify that it works (not sure if it is nonsimultaneous by default or not, I haven&amp;#39;t looked into the complete requirements)&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Attempt to combine it with&amp;nbsp;&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/device_guides/working_with_nrf/nrf53/nrf5340.html#simultaneous-multi-image-dfu"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/device_guides/working_with_nrf/nrf53/nrf5340.html#simultaneous-multi-image-dfu&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simultaneous dfu on nRF5340 ncs2.6 without external flash with TFM</title><link>https://devzone.nordicsemi.com/thread/480603?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2024 07:56:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a315c9e-1520-434d-9441-edc36f05befb</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for sharing this as well and no worries about the response time&lt;/p&gt;
[quote user="leadrover"]Thanks for the update on the NAND flash. I&amp;#39;ll look into working on that at a later stage. Sorry for the delay in reply.[/quote]
&lt;p&gt;Noted, do also note that we don&amp;#39;t give any guarantee that any proprietary solutions using NAND flash will work as we don&amp;#39;t test for this type of flash devices, but I&amp;#39;ve heard of non-Nordic developers having their own solutions for NAND flashes.&lt;/p&gt;
[quote user="AHaug"]Thank you for sharing. I will try to set this up myself this week and see if it is possible. I need to verify some potential suspects that may cause issues or not[/quote]
&lt;p&gt;Another item for discussion that I should&amp;#39;ve brought up in my initial reply is the aspect of not using an external flash to do DFU for the nRF5340. You might&amp;#39;ve already thought of this aspect, but nonetheless could you expand upon the motivation for why you&amp;#39;re not using an external flash?&lt;/p&gt;
&lt;p&gt;You might already know this, but I&amp;#39;ll explain anyways: how DFU with MCUboot works (non-serial recovery procedures atleast), and partitioning in NCS/Zephyr works, is that the partition manager will split the internal flash into two equally large sections + the sections for bootloader(s) and custom storage.&lt;/p&gt;
&lt;p&gt;This means that the two equally large sections will be limiting your maximum application size, and if you do simultaneous DFU, the largest application size will be approximately be&amp;nbsp;&lt;/p&gt;
&lt;p&gt;application flash size ~= Internal appcore flash size - mcuboot - secondary slot for app core - secondary slot for net core&lt;/p&gt;
&lt;p&gt;-&amp;gt; app size ~= 1MB - mcuboot size - app size - 256&lt;/p&gt;
&lt;p&gt;-&amp;gt; app size ~= (1MB - ~48kB - 256kB)/2 ~= 360kB&amp;nbsp;&lt;/p&gt;
&lt;p&gt;~360kB room for an application using both BLE and TF-M is not much room, although you will save some since the netcore will do most of the BLE activity (do note that I&amp;#39;ve used the standard MCUboot size, you can do a minimal MCUboot configuration which would give you ~10kB more for the application(&lt;/p&gt;
&lt;p&gt;Explained with graphics in this repository, which is the foundation for the DFU topic in our latest&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-bootloaders-and-dfu-fota/"&gt;academy course&lt;/a&gt; :&amp;nbsp;&lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/nrf5340"&gt;https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/nrf5340&lt;/a&gt;&amp;nbsp;and illustrated as:&lt;/p&gt;
&lt;p&gt;&lt;strong&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/4572.pastedimage1714030508091v1.png" alt=" " /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I should&amp;#39;ve explained this on friday, but it didn&amp;#39;t cross my mind then.&lt;/p&gt;
&lt;p&gt;Anyways, to summarize:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is possible to do simultaneous DFU not using an external flash, but you must consider the flash limitations for your application. I am currently trying to create a sample showcasing this + TF-M and hopefully I have one ready for you today.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simultaneous dfu on nRF5340 ncs2.6 without external flash with TFM</title><link>https://devzone.nordicsemi.com/thread/480276?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2024 16:39:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8847ee66-1f92-4d6f-b8ab-2a2aaddf1ebc</guid><dc:creator>leadrover</dc:creator><description>&lt;p&gt;G&amp;#39;day Andreas,&lt;/p&gt;
&lt;p&gt;Thanks for the update on the NAND flash. I&amp;#39;ll look into working on that at a later stage. Sorry for the delay in reply.&lt;/p&gt;
&lt;p&gt;To answer your questions:&lt;br /&gt;1. fih_rc is giving (int) 357913941.&lt;/p&gt;
&lt;p&gt;2. The pm_static.yml file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;app:
  address: 0x10200
  end_address: 0x66000
  region: flash_primary
  size: 0x55E00
mcuboot:
  address: 0x0
  end_address: 0x10000
  region: flash_primary
  size: 0x10000
mcuboot_pad:
  address: 0x10000
  end_address: 0x10200
  region: flash_primary
  size: 0x200
mcuboot_primary:
  address: 0x10000
  end_address: 0x66000
  orig_span: &amp;amp;id001
  - mcuboot_pad
  - app
  region: flash_primary
  size: 0x56000
  span: *id001
mcuboot_primary_app:
  address: 0x10200
  end_address: 0x66000
  orig_span: &amp;amp;id002
  - app
  region: flash_primary
  size: 0x55E00
  span: *id002
mcuboot_secondary:
  address: 0x66000
  end_address: 0xBC000
  size: 0x56000
mcuboot_secondary_1:
  address: 0xBC000
  end_address: 0xFC000
  size: 0x40000
otp:
  address: 0xff8100
  end_address: 0xff83fc
  region: otp
  size: 0x2fc
pcd_sram:
  address: 0x20000000
  end_address: 0x20002000
  region: sram_primary
  size: 0x2000
ram_flash:
  address: 0x40000
  end_address: 0x40000
  region: ram_flash
  size: 0x0
rpmsg_nrf53_sram:
  address: 0x20070000
  end_address: 0x20080000
  placement:
    before:
    - end
  region: sram_primary
  size: 0x10000
settings_storage:
  address: 0xFC000
  end_address: 0x100000
  region: flash_primary
  size: 0x4000
sram_primary:
  address: 0x20002000
  end_address: 0x20070000
  region: sram_primary
  size: 0x6e000
mcuboot_primary_1:
  address: 0x0
  size: 0x40000
  device: flash_ctrl
  region: ram_flash
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3. prj.conf file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_NCS_SAMPLES_DEFAULTS=y

CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME=&amp;quot;Lotic_LBS&amp;quot;

# Enable the LBS service
CONFIG_BT_LBS=y
CONFIG_BT_LBS_POLL_BUTTON=y
CONFIG_DK_LIBRARY=y

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_MCUBOOT_USE_ALL_AVAILABLE_RAM=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y
CONFIG_NRF53_UPGRADE_NETWORK_CORE=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2
CONFIG_ADD_MCUBOOT_MEDIATE_SIM_FLASH_DTS=y


CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and nrf5340dk_nrf5340_cpuapp_ns.conf within MCUBOOT child image directory tree:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Enable support for Simultaneous multi-image DFU
# The following configurations are required to support simultaneous multi image update
CONFIG_PCD_APP=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2
CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_BOOT_IMAGE_ACCESS_HOOK_NRF5340=y
CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y
# The network core cannot access external flash directly. The flash simulator must be used to
# provide a memory region that is used to forward the new firmware to the network core.
CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
CONFIG_FLASH_SIMULATOR_STATS=n


# Use most of the configuration from the sdk-mcuboot/boot/zephyr/prj_minimal.conf

CONFIG_MAIN_STACK_SIZE=10240
CONFIG_MBEDTLS_CFG_FILE=&amp;quot;mcuboot-mbedtls-cfg.h&amp;quot;

CONFIG_FLASH=y
CONFIG_FPROTECT=y
CONFIG_PM=n

CONFIG_BOOT_SWAP_SAVE_ENCTLV=n

CONFIG_BOOT_BOOTSTRAP=n

CONFIG_ASSERT=n
CONFIG_BOOT_BANNER=n
CONFIG_CONSOLE=y
CONFIG_CONSOLE_HANDLER=n
CONFIG_GPIO=n
CONFIG_I2C=n
CONFIG_SPI=n
CONFIG_NORDIC_QSPI_NOR=n
CONFIG_KERNEL_MEM_POOL=n
CONFIG_LOG=y
CONFIG_MINIMAL_LIBC_CALLOC=n
CONFIG_MINIMAL_LIBC_MALLOC=n
CONFIG_MINIMAL_LIBC_REALLOCARRAY=n
CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_NO_RUNTIME_CHECKS=y
CONFIG_NRF_RTC_TIMER=y
CONFIG_PRINTK=y
CONFIG_REBOOT=y
CONFIG_RESET_ON_FATAL_ERROR=y
CONFIG_SECURE_BOOT_DEBUG=n
CONFIG_SERIAL=y
CONFIG_SIZE_OPTIMIZATIONS=y
CONFIG_UART_CONSOLE=y
CONFIG_HW_CC3XX=n
CONFIG_NRF_CC3XX_PLATFORM=n
CONFIG_BUILD_WITH_TFM=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;4. I haven&amp;#39;t made any changes to the firmware prior to raising the ticket, but I did add the debug for mcuboot to get the error code above for this reply.&lt;/p&gt;
&lt;p&gt;5. I tried to flash the image to the development kit using &amp;#39;west flash --recover&amp;#39; just like I did when using the non _ns version to compile.&lt;/p&gt;
&lt;p&gt;Cheers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simultaneous dfu on nRF5340 ncs2.6 without external flash with TFM</title><link>https://devzone.nordicsemi.com/thread/479883?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 08:02:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be622e0e-8a3a-4d2b-943c-36fc088d9c93</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for sharing. I will try to set this up myself this week and see if it is possible. I need to verify some potential suspects that may cause issues or not&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;While waiting, you could you also try to log fih_rc and see where and when the error occurs in mcuboot/boot/zephyr/main.c &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/main/boot/zephyr/main.c"&gt;https://github.com/nrfconnect/sdk-mcuboot/blob/main/boot/zephyr/main.c&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/5810.pastedimage1713772705237v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Could you also share your partition map for both the original firmware and for the update build?&lt;/li&gt;
&lt;li&gt;Could you also share your pfj.conf?&lt;/li&gt;
&lt;li&gt;Could you verify if you make changes to the firmware (at minimum add a print/log/change fw version number) before you build the image you use for image?&lt;/li&gt;
&lt;li&gt;As a sanity check could you also verify what file you use for the update (if it app_update.bin or other)?&lt;/li&gt;
&lt;/ol&gt;
[quote user="leadrover"]I&amp;#39;m also curious as to whether we can use NAND flash with the overlay or if we require NOR flash for DFU. Even if we&amp;#39;re not using the flash for the bootloader. At this stage we need to create a phantom NOR flash entry in the device tree to get the simultaneous multi image DFU working on our hardware.[/quote]
&lt;p&gt;Unfortunately we don&amp;#39;t have any support for NAND flashes in our SDK, so any implementation to get support will have to be proprietary solutions created by the individual developers using our products&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simultaneous dfu on nRF5340 ncs2.6 without external flash with TFM</title><link>https://devzone.nordicsemi.com/thread/479769?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2024 16:21:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3c7b666-1e78-474c-9c16-e40ee354fc96</guid><dc:creator>leadrover</dc:creator><description>&lt;p&gt;G&amp;#39;day AHaug,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using NCS version 2.6. There are no build errors once I make the adjustments I mentioned. However, I can build the _ns version for the dev kit, but MCUBoot is unable to find any valid images. Here is the output from serial:&lt;/p&gt;
&lt;p&gt;I: Starting bootloader&lt;br /&gt;I: Image index: 0, Swap type: nonepen /dev/tty.usbmodem0010500279&lt;br /&gt;I: Image index: 1, Swap type: none&lt;br /&gt;E: Unable to find bootable image&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also curious as to whether we can use NAND flash with the overlay or if we require NOR flash for DFU. Even if we&amp;#39;re not using the flash for the bootloader. At this stage we need to create a phantom NOR flash entry in the device tree to get the simultaneous multi image DFU working on our hardware.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simultaneous dfu on nRF5340 ncs2.6 without external flash with TFM</title><link>https://devzone.nordicsemi.com/thread/479705?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2024 12:42:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57ffd125-a6a2-4c1f-8118-c720d697647c</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you state what version of NCS you&amp;#39;re working with? Is it the same as in the case you&amp;#39;re referring to, i.e NCS v2.4.0? I&amp;#39;m guessing there might be a conflict in between the provided sample/solution and the version you&amp;#39;re working on&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a link to the simultaneous multi image DFU for the 53-series:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/device_guides/working_with_nrf/nrf53/nrf5340.html#simultaneous_multi-image_dfu"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/device_guides/working_with_nrf/nrf53/nrf5340.html#simultaneous_multi-image_dfu&lt;/a&gt;&amp;nbsp;as well as a link to the TFM documentation&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/tfm/index.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/tfm/index.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you also post any build error logs you get when trying to build with TFM and I&amp;#39;ll get back to you next week?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>