<?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>Modify and log MCUBOOT version</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99232/modify-and-log-mcuboot-version</link><description>To demonstrate that MCUBoot FOTA is working properly, I would like to modify the MCUBOOT version and log it from the mcuboot main.c. 
 
 I modified bootloader\mcuboot\boot\zephyr\main.c like this: 
 BOOT_LOG_INF(&amp;quot;MCUBoot, version: %s&amp;quot;, CONFIG_MCUBOOT_IMAGE_VERSION</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 May 2023 15:07:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99232/modify-and-log-mcuboot-version" /><item><title>RE: Modify and log MCUBOOT version</title><link>https://devzone.nordicsemi.com/thread/424056?ContentTypeID=1</link><pubDate>Fri, 05 May 2023 15:07:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eea8a876-0d71-442d-86e2-9bd364963d2c</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;&amp;nbsp;Set&amp;nbsp;CONFIG_FW_INFO_FIRMWARE_VERSION in application/child_image/mcuboot.conf. See my colleague&amp;#39;s example in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/93928/dfu-of-mcuboot-over-ble-fails-with-not_supported/396004"&gt;this post&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify and log MCUBOOT version</title><link>https://devzone.nordicsemi.com/thread/423874?ContentTypeID=1</link><pubDate>Thu, 04 May 2023 23:49:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60f314a4-ca42-40fc-9b66-e755e192c432</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;I think I have misunderstood CONFIG_MCUBOOT_IMAGE_VERSION.&lt;/p&gt;
&lt;p&gt;I am now understanding it like this:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_MCUBOOT_IMAGE_VERSION -- S0/S1 application version passed during application dfu package generation.&amp;nbsp; mcuboot will receive this version in the metadata of a dfu image.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_REST_FOTA_SAMPLE_VERSION -- version string&amp;nbsp;specific to the sample but not part of DFU&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_FW_INFO_FIRMWARE_VERSION -- version of mcuboot which secureboot/b0 will receive via metadata.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It seems if I want to have a consistent version logged by mcuboot that matches the mcuboot dfu package metadata then I need to set&amp;nbsp;CONFIG_FW_INFO_FIRMWARE_VERSION.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Should I&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;* set&amp;nbsp;&amp;nbsp;CONFIG_FW_INFO_FIRMWARE_VERSION in application prj.conf&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;* set&amp;nbsp;CONFIG_FW_INFO_FIRMWARE_VERSION in application/child_image/mcuboot.conf&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;* both ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify and log MCUBOOT version</title><link>https://devzone.nordicsemi.com/thread/423873?ContentTypeID=1</link><pubDate>Thu, 04 May 2023 23:28:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19440c46-d719-416d-ae0a-14e4a5b9a346</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;Perfect!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you give me an idea of which CMake file I need to edit and some example of what it would look like?&amp;nbsp; Is it possible to set this up from the application folder or would it require editing SDK files?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify and log MCUBOOT version</title><link>https://devzone.nordicsemi.com/thread/423553?ContentTypeID=1</link><pubDate>Wed, 03 May 2023 12:45:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34168799-e47e-42f2-9eb1-658e3b188449</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This has to be solved in CMake, as there is no mechanism in Kconfig that could solve this.&lt;/p&gt;
&lt;p&gt;In CMake you have access to all kconfig options for all images, and it is possible to set options for specific child images (see multi_image.cmake for details on how to pass options to specific child images).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify and log MCUBOOT version</title><link>https://devzone.nordicsemi.com/thread/423362?ContentTypeID=1</link><pubDate>Tue, 02 May 2023 15:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7264a9e-9072-4a83-8fa1-3aef65f4103f</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;That is not correct.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Having the application report the version of mcuboot it was built with completely missing the point.&amp;nbsp; The mcuboot is updated independently from the application by secureboot.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;During the build a dfu_mcuboot.zip file is generated.&amp;nbsp; This file contains update images for mcuboot by itself.&amp;nbsp; The secure boot handles the mcuboot update.&amp;nbsp; I have proven this is true by manually editing the log lines in v2.3.0/bootloader/mcuboot/zephyr/main.c&amp;nbsp; and then performing the update and confirming the updated logs were generated after entering the mcuboot.&lt;/p&gt;
&lt;p&gt;Now I would like to pass a CONFIG variable that is set to a version string to mcuboot.&amp;nbsp; How do I pass the value of&amp;nbsp;&lt;span&gt;CONFIG_MCUBOOT_IMAGE_VERSION into the mcuboot childimage build?&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have been able to add my own CONFIG_ANTHONY_VERSION to mcuboot and log that value, but I don&amp;#39;t know how to make CONFIG_ANTHONY_VERSION =&amp;nbsp;CONFIG_MCUBOOT_IMAGE_VERSION and to pass it from the application folder to the mcuboot childimage build.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify and log MCUBOOT version</title><link>https://devzone.nordicsemi.com/thread/423327?ContentTypeID=1</link><pubDate>Tue, 02 May 2023 13:53:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dad5effa-ac6f-4842-9de6-309fb4712b78</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The mcuboot cannot be updated singly. It has to be built with an application to update, so you can use the application to report the mcuboot version.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify and log MCUBOOT version</title><link>https://devzone.nordicsemi.com/thread/423146?ContentTypeID=1</link><pubDate>Mon, 01 May 2023 19:28:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48e170c7-092c-414d-bc92-bdd5af2f9d9a</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;I&amp;#39;m specifically wanting mcuboot to log the version since I am testing mcboot updates.&amp;nbsp; The application is not aware of the mcuboot update and would log the version it was built with, not the version that is actually running with.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify and log MCUBOOT version</title><link>https://devzone.nordicsemi.com/thread/423145?ContentTypeID=1</link><pubDate>Mon, 01 May 2023 19:26:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d775022-58dc-4526-8260-ee049a3d255c</guid><dc:creator>Anthony Ambuehl</dc:creator><description>&lt;p&gt;Your log shows the application reporting the value of&amp;nbsp;CONFIG_MCUBOOT_IMAGE_VERSION, however the mcuboot is actually&amp;nbsp; not logging the version it was built with.&amp;nbsp; The mcuboot logs are ending at &amp;quot;Bootloader chainload address offset: 0xc000&amp;quot;&amp;nbsp; The subsequent logs are the application code.&lt;/p&gt;
&lt;p&gt;The main.c for mcuboot is &lt;span&gt;bootloader\mcuboot\boot\zephyr\main.c&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modify and log MCUBOOT version</title><link>https://devzone.nordicsemi.com/thread/423134?ContentTypeID=1</link><pubDate>Mon, 01 May 2023 15:57:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d3632b4-02c5-4900-8555-17a608c9532a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In prj.conf, you can set&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_MCUBOOT_IMAGE_VERSION=&amp;quot;1.0.0+0&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In the main, you can have this code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void main(void)
{
    printk(&amp;quot;Board config %s\n&amp;quot;, CONFIG_BOARD);
	printk(&amp;quot;IMAGE_VERSION %s\n&amp;quot;, CONFIG_MCUBOOT_IMAGE_VERSION);
	printk(&amp;quot;build time: &amp;quot; __DATE__ &amp;quot; &amp;quot; __TIME__ &amp;quot;\n&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here is my test project&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_mcuboot.7z"&gt;devzone.nordicsemi.com/.../hello_5F00_world_5F00_mcuboot.7z&lt;/a&gt; and &lt;br /&gt;the output&lt;br /&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/pastedimage1682956638973v2.png" alt=" " /&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Beware that this code/configuration is not fully tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>