<?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>Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117526/retrieve-mcuboot-version-from-main-application</link><description>Hi, 
 I&amp;#39;m trying to retrieve the MCUBoot version inside my application (from the VERSION file). 
 In the Zephyr documentation ( docs.zephyrproject.org/.../index.html) , I found that I can access app_version.h (located in /app/build/app/zephyr/include</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Jan 2025 12:35:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117526/retrieve-mcuboot-version-from-main-application" /><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/519054?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2025 12:35:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5af34287-eef7-4238-8cf0-123a6265bc3e</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;MCUboot and the application has no method (other than FW_INFO) to communicate with each other.&lt;br /&gt;As far as I know, MCUboot version is just complied as part of the project. Therefore it is not stored anywhere specifically, I think.&lt;/p&gt;
&lt;p&gt;I think the best way to read the version from the application will be to change MCUboot to write its value to a specific place in memory when the version changes. &lt;br /&gt;Then you can read it from that part of flash from the application&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/517456?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2025 12:19:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c343148-1b38-478f-8644-e998a2be7d77</guid><dc:creator>Eyal_Gal</dc:creator><description>&lt;p&gt;Hi Sigurd, i&amp;#39;m Eyal, the TL of Udi who opened the ticket.&lt;br /&gt;The &amp;quot;running sequence number&amp;quot; is indeed something we will use for FOTA, but still we want to be able to send the version number of the mcu boot. the version number is not the sequence number that we decide on in the&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_FW_INFO_FIRMWARE_VERSION"&gt;CONFIG_FW_INFO_FIRMWARE_VERSION&lt;/a&gt;&amp;nbsp;we set ourselves but the VERSION file that resides in the mcuboot repo.&lt;br /&gt;The way zephyr works, that file is integrated into the mcuboot binary (s1\s0 if build or just s0 if not dual boot).&lt;br /&gt;We cannot find that data in the binary, we are asking why and where can we find it cause not finding it means something is wrong.&lt;br /&gt;Please refer to the question and not the scenario.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Eyal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/517413?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2025 09:38:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:819fc896-a67c-4068-b4c5-56bc735dfef0</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="Udi Vahaba"]because i want to know what is the version of mcuboot.[/quote]
&lt;p&gt;But why?&lt;/p&gt;
&lt;p&gt;If you build your project, you are free to set both MCUboot version and FW_INFO version right?&lt;/p&gt;
&lt;p&gt;In this case you can make sure FW_INFO mathces MCUboot version, and the product should work the same right?&lt;/p&gt;
&lt;p&gt;From what I know, we decided to use FW_INFO instead of the Zephyr version of MCUboot when adding the feature for updatable bootloaders and therefore we have not implemented any way of reading MCUboot version. This is why I recommend FW_INFO.&lt;/p&gt;
&lt;p&gt;I am maybe a bit difficult here, but knowing the use-case to why you need this version will help me best help you in finding the best solution&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/517226?ContentTypeID=1</link><pubDate>Tue, 07 Jan 2025 13:18:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02b93f64-36dc-497d-a51f-22e6f90d713b</guid><dc:creator>Udi Vahaba</dc:creator><description>&lt;p&gt;because i want to know what is the version of mcuboot. not the version i declare it is.&lt;br /&gt;the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_FW_INFO_FIRMWARE_VERSION"&gt;CONFIG_FW_INFO_FIRMWARE_VERSION&lt;/a&gt;&amp;nbsp;value can be set to be 300 if i want, but it wont let me know that a real new MCUBoot version is out.&lt;/p&gt;
&lt;p&gt;as i said, in my code i perform DFU to upgrade the mcuboot. but to do that i need to know that the version was changed.&lt;/p&gt;
&lt;p&gt;The usage of FW Info was an attempt to grab this data, but as long as im digging into the mcuboot versioning i see that the VERSION file info is not embedded into the binary file!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/517222?ContentTypeID=1</link><pubDate>Tue, 07 Jan 2025 13:12:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e3b1e30-d8b3-44c1-8b74-498fb8246585</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hold up, why do you talk about byte 20?&lt;/p&gt;
&lt;p&gt;Did you not try the FW Info library?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/517188?ContentTypeID=1</link><pubDate>Tue, 07 Jan 2025 11:16:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4949452c-c77c-456e-9c34-6102fd278b58</guid><dc:creator>Udi Vahaba</dc:creator><description>&lt;p&gt;I changed the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_FW_INFO_FIRMWARE_VERSION"&gt;CONFIG_FW_INFO_FIRMWARE_VERSION&lt;/a&gt;&lt;span&gt;. still zeros from byte 20.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;same goes for the manifest inside the zip.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/517006?ContentTypeID=1</link><pubDate>Mon, 06 Jan 2025 13:55:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6705e169-c0c0-4531-8056-c6795347d069</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Try to change &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_FW_INFO_FIRMWARE_VERSION"&gt;CONFIG_FW_INFO_FIRMWARE_VERSION&lt;/a&gt;. Can you read that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/516877?ContentTypeID=1</link><pubDate>Sun, 05 Jan 2025 13:50:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:159ca70d-ca87-4db6-9558-9f39d3701e5f</guid><dc:creator>Udi Vahaba</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;I tried working with this, but the version (from byte 20) is always 0.&lt;/p&gt;
&lt;p&gt;I tested it with three different versions (changing the &lt;code&gt;VERSION&lt;/code&gt; file from 2.1.0 to 2.2.0 and 2.3.0), but none of these versions appeared in the hex file.&lt;/p&gt;
&lt;p&gt;Next, I checked the zip file generated during the build process, and the manifest file showed the following values: &lt;code&gt;&amp;quot;version_MCUBOOT&amp;quot;: &amp;quot;0.0.0+0&amp;quot;&lt;/code&gt; for both s0 and s1.&lt;/p&gt;
&lt;p&gt;Does this mean I cannot retrieve the version of MCUBoot using this method?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/516649?ContentTypeID=1</link><pubDate>Thu, 02 Jan 2025 13:35:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:964f59fa-a3cc-4023-8de6-a3c606c2862a</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;We do something similar in TF-M. See &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/9abba2029b75e5b4f8990f7b55b28817ed01a0e1/modules/trusted-firmware-m/tfm_boards/src/tfm_ioctl_ns_api.c#L62"&gt;here&lt;/a&gt;. You can check both the version and if the slot is valid using FW Info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/516645?ContentTypeID=1</link><pubDate>Thu, 02 Jan 2025 13:05:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5365e7a2-140b-4ad2-9ddf-29f5ffd8bc8c</guid><dc:creator>Udi Vahaba</dc:creator><description>&lt;p&gt;Hi Sigard,&lt;/p&gt;
&lt;p&gt;Thank you for your response. I&amp;rsquo;ve been trying to use the FW Info API as suggested, but I&amp;rsquo;m still struggling with some aspects. I need to gather the following data before proceeding with the DFU for MCUBoot:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Determine which slot is active (s0/s1):&lt;/strong&gt;&lt;br /&gt;The issue here is that the version alone isn&amp;rsquo;t enough. For example, the second slot might have a newer version, but if it&amp;rsquo;s invalid, it doesn&amp;rsquo;t count, and only the other slot would be relevant. In this case, I need to reliably determine the active slot.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Retrieve the firmware version:&lt;/strong&gt;&lt;br /&gt;For this, I have an idea: I plan to read the TLV using the &lt;code&gt;fw_info&lt;/code&gt; struct to extract the &lt;code&gt;uint32_t&lt;/code&gt; version variable. Is this a good way to retrieve the version at runtime? Alternatively, should I use retained memory to get this information, assuming MCUBoot has the ability to write to that area?&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Could you please confirm if this is the correct approach, or suggest any better alternatives?&lt;/p&gt;
&lt;p&gt;Thanks for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/516609?ContentTypeID=1</link><pubDate>Thu, 02 Jan 2025 08:48:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1f52bdc-4b71-4076-abbf-dbf135d1d85c</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;NSIB uses &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/nrf/libraries/security/bootloader/fw_info.html"&gt;FW Info&lt;/a&gt; to keep track of MCUboot version.&lt;/p&gt;
&lt;p&gt;You can use the FW info API to read out the FW Info version from MCUboot. This should be enough to know if you need to upgrade MCUboot.&lt;br /&gt;Try this and let me know how it goes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/516557?ContentTypeID=1</link><pubDate>Tue, 31 Dec 2024 06:50:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a8e8f80-7b4c-4c10-b7ae-e8ebc9dfc553</guid><dc:creator>Udi Vahaba</dc:creator><description>&lt;p&gt;Yes, I want to have the current version of mcuboot.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using that to check if i need to upgrade the mcuboot firmware&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/516465?ContentTypeID=1</link><pubDate>Mon, 30 Dec 2024 08:30:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21a37a77-f878-4f61-900e-6cb8b6cb47a9</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;You say you would want to include mcuboot&amp;#39;s header in your code. But with this, you would only have the version the code was built with and not the updated version of MCUboot. Is this what you want?&lt;/p&gt;
&lt;p&gt;Or would you rather want to check MCUboot version in realtime?&lt;/p&gt;
&lt;p&gt;What is your use-case for knowing the version?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/516431?ContentTypeID=1</link><pubDate>Sun, 29 Dec 2024 09:07:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c2482bf-5929-4a73-a2a0-37c37121130f</guid><dc:creator>Udi Vahaba</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have dual bootloader (NSIB + MCUBoot).&lt;/p&gt;
&lt;p&gt;using sdk 2.7.0 (will update later to latest)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve MCUBoot version from main application</title><link>https://devzone.nordicsemi.com/thread/516353?ContentTypeID=1</link><pubDate>Fri, 27 Dec 2024 13:39:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5490fe2-4db2-4f4c-abcc-4998fdb5e874</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you have dual bootloaders so you can upgrade MCUboot?&lt;/p&gt;
&lt;p&gt;Which version of the SDK do you use?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>