<?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>Using flash_img.h in Zephyr boot</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102445/using-flash_img-h-in-zephyr-boot</link><description>I want to include #include &amp;lt;zephyr/dfu/flash_img.h&amp;gt; in boot/zephyr/main.c (path: C:\ncs\v2.4.0\bootloader\mcuboot\boot\zephyr\main.c) And header file path (C:\ncs\v2.4.0\zephyr\include\zephyr\dfu\flash_img.h). 
 But after adding flash_img.h I get a linker</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 Aug 2023 14:53:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102445/using-flash_img-h-in-zephyr-boot" /><item><title>RE: Using flash_img.h in Zephyr boot</title><link>https://devzone.nordicsemi.com/thread/442811?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 14:53:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e1c592a-3530-4946-86a0-281b4df3439b</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for your patience.&lt;/p&gt;
&lt;p&gt;My colleague has informed that this should be handled through configs and not the cmake.&lt;/p&gt;
&lt;p&gt;He has suggested to add FLASH_MAP config that would include flash_map.c, and would also resolve other dependencies including img-block-size.&lt;/p&gt;
&lt;p&gt;I have updated the proj.conf of the mcuboot accordingly by appending following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_FLASH_MAP=y
CONFIG_STREAM_FLASH=y
CONFIG_IMG_MANAGER=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And correspondingly&amp;nbsp;BOOTLOADER_MCUBOOT is enabled in the main project conf.&lt;/p&gt;
&lt;p&gt;I can now use the function that you have mentioned, and project compiles successfully.&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/pastedimage1692802397640v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;BR, Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using flash_img.h in Zephyr boot</title><link>https://devzone.nordicsemi.com/thread/442180?ContentTypeID=1</link><pubDate>Sun, 20 Aug 2023 14:34:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ffe41e6-a094-4a41-8e66-1cdb019ae175</guid><dc:creator>lorao</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/naeem-maroof"&gt;Naeem Maroof&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am trying to implement a logic on nRF52840, to send image file over UART in bootloader mode.&lt;br /&gt;Please can you suggest what needs to be taken care for this.&lt;/p&gt;
&lt;p&gt;Note: I dont want to use dependencies like mcumgr.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using flash_img.h in Zephyr boot</title><link>https://devzone.nordicsemi.com/thread/440320?ContentTypeID=1</link><pubDate>Tue, 08 Aug 2023 13:09:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca99c52f-a88b-44c6-8282-cfd42d6a0313</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Please try by adding following (for flash_img) in the /bootloader/mcuboot/boot/zephyr/CMakeLists.txt&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;zephyr_library_sources(
  ${ZEPHYR_BASE}/subsys/dfu/img_util/flash_img.c
  )&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using flash_img.h in Zephyr boot</title><link>https://devzone.nordicsemi.com/thread/439955?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2023 15:02:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea4c3ded-1f0f-409a-9567-5bb0309f2157</guid><dc:creator>lorao</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/naeem-maroof"&gt;Naeem Maroof&lt;/a&gt;&amp;nbsp;Any comment for the above issue&lt;br /&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using flash_img.h in Zephyr boot</title><link>https://devzone.nordicsemi.com/thread/439604?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2023 06:49:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01cb25e5-e36d-4b43-b791-ec87f5eb7307</guid><dc:creator>lorao</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/naeem-maroof"&gt;Naeem Maroof&lt;/a&gt;&amp;nbsp;Thank you for the information.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I had done the changes already&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1691044504806v1.png" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It works fine, when just&amp;nbsp;&lt;strong&gt;flash_img.h &lt;/strong&gt;is included.&lt;/p&gt;
&lt;p&gt;But, when I try to use&lt;strong&gt;&amp;nbsp;flash_img_init_id and&amp;nbsp;flash_img_buffered_write which is defined in&amp;nbsp;&lt;em&gt;flash_img.h&lt;/em&gt;&lt;span&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;shows an linker error. Also tried to add this in CmakeList.txt, but still shows an linker error:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;Error:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1691045364370v1.png" /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;Thank you&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using flash_img.h in Zephyr boot</title><link>https://devzone.nordicsemi.com/thread/439545?ContentTypeID=1</link><pubDate>Wed, 02 Aug 2023 14:58:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9336d280-4840-45fb-8890-7dacbebd2bd7</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I tried to build an application with the mcuboot, and then applied the change which you wanted to do (that is adding flash_img header in the source code of mcuboot).&lt;/p&gt;
&lt;p&gt;I was able to see that the build was unsuccessful, and it mentioned the error &amp;quot;FATAL ERROR: command exited with status 1:&amp;quot;&lt;/p&gt;
&lt;p&gt;However, the reason of the failure was that a symbol &amp;quot;CONFIG_IMG_BLOCK_BUF_SIZE&amp;quot; in undefined.&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/pastedimage1690988072399v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This symbol is used in the FLASH_IMG.H file, and it is not defined there.&lt;/p&gt;
&lt;p&gt;I tried to configure this symbol but it was giving the same error (maybe I was not able to satisfy all its dependencies, or even further 2nd level dependencies).&lt;/p&gt;
&lt;p&gt;As the default value of symbol is 512 Bytes, I replaced the symbol in the file with 512, and it was able to compile correctly.&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/pastedimage1690988302077v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using flash_img.h in Zephyr boot</title><link>https://devzone.nordicsemi.com/thread/439342?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2023 16:55:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a5392fb-7efe-42a9-9b39-eafc982b5e8d</guid><dc:creator>lorao</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/naeem-maroof"&gt;Naeem Maroof&lt;/a&gt;&amp;nbsp;I am trying to implement some changes in the MCUboot, where I can send image file over UART and then the files are written in the specified partition.&lt;/p&gt;
&lt;p&gt;In that case I want to use&amp;nbsp;&lt;strong&gt;flash_img.h, &lt;/strong&gt;where I can specify the slot where the image needs to be flashed&lt;strong&gt;.&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using flash_img.h in Zephyr boot</title><link>https://devzone.nordicsemi.com/thread/439322?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2023 15:02:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10da8213-57d2-4a6f-9193-ab7cc42b7087</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;What you are trying to do ?&lt;/p&gt;
&lt;p&gt;Bootloader, or Mcuboot are not the sample codes.&lt;/p&gt;
&lt;p&gt;You typically start with the sample code and then add your changes into it.&lt;/p&gt;
&lt;p&gt;So, what you are trying to build actually? are you using some example code and want to include the bootloader?&lt;/p&gt;
&lt;p&gt;If I search for mcuboot in the NCS VS Code extension, then I can see NSIB sample, also note that all samples are either in the nrf/samples or zephyr/samples.&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/pastedimage1690902090875v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Please let me know what project / sample you want to build and then what changes you to incorporate.&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>