<?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>FMFU segments SHA</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122327/fmfu-segments-sha</link><description>We are currently working on a custom modem firmware update. For this, we would like to use the CBO file you provided. Updating the segments with the CBO file is working so far. However, we have some questions regarding the SHA of the segments. When we</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Jun 2025 08:55:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122327/fmfu-segments-sha" /><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/540554?ContentTypeID=1</link><pubDate>Thu, 26 Jun 2025 08:55:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a42ff945-44ff-4878-b6ff-240945b012ee</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;y&lt;span&gt;es, that is correct, the &lt;/span&gt;&lt;span&gt;CBOR&lt;/span&gt;&lt;span&gt; file only contains information about the encrypted image, and the modem only reports digests of plaintext.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/540520?ContentTypeID=1</link><pubDate>Wed, 25 Jun 2025 18:38:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba23fbe3-3db2-4808-98b1-4f5e58f42575</guid><dc:creator>Norbert H.</dc:creator><description>&lt;p&gt;Thanks for the response!&amp;nbsp;&lt;br /&gt;&lt;br /&gt;To come back to my question. So it is not possible to generate the hashes for a verification from the cbor-file. This is because the image in the cbor-file is encrypted, and the hashes that can be read from the modem are generated from the decrypted image. So i have to use the hashes from the firmware.update.image.digest.txt to verify a successful update.&lt;br /&gt;&lt;br /&gt;Is this correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/540434?ContentTypeID=1</link><pubDate>Wed, 25 Jun 2025 08:52:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fabab857-54c0-431f-bd23-e6543432c2f9</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello again,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the modem team informs me that t&lt;span&gt;he file firmware.update.image.digest.txt refers to digests of plaintext modem firmware FLASH contents, whereas the transfer image contains encrypted firmware.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/540279?ContentTypeID=1</link><pubDate>Tue, 24 Jun 2025 08:22:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1cd0706e-7af8-4696-a012-aac71b63c459</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello, sorry the late answers on your inquiry. Our team working on this have a high workload and are not able to provide answers at quick as they want. There might not be any answers until end of July/beginning of August, but I hope to get answer within this week.&lt;/p&gt;
&lt;p&gt;Sorry for any inconvenience this may cause.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/540067?ContentTypeID=1</link><pubDate>Fri, 20 Jun 2025 14:38:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c93cfcb-12b3-42af-9672-3046f722d292</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;HI, I have not received any updates on this, but we are still working with an answer. I hope to have an answer by end of Tuesday.&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/539680?ContentTypeID=1</link><pubDate>Wed, 18 Jun 2025 10:11:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d543e128-569f-4117-9315-75201520d535</guid><dc:creator>Norbert H.</dc:creator><description>&lt;p&gt;My calculated sha of the segments at mfw-nr+_nrf91x1_1.0.2.cbor are:&lt;/p&gt;
&lt;p&gt;Segment 3/5: 0x6000 - 0xFFFF&lt;br /&gt;Expected SHA256: ddc883e1ef382344fba5601684ecbe7fcd7a57a313afa9a0f828c15915a5621c&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Segment 4/5: 0x38000 - 0xB3FFF&lt;br /&gt;Expected SHA256: d7fbe7d35810491d4e834a3cf885f7c65a9ce193c26b1ad1151eba79773bb0af&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Segment 5/5: 0x27C000 - 0x27FFFF&lt;br /&gt;Expected SHA256: 83932f5f9a35cce7ae2990cc48402b4d011233d0cfe54b89c45d2c8951b69d1c&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;span class="jCAhz ChMk0b"&gt;&lt;span class="ryNqvb"&gt;and here is a small simplified snippet of how I implemented the whole thing in python&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="HwtZe" lang="en"&gt;&lt;pre class="ui-code" data-mode="python"&gt;bootloader_size = 0x000018B0 + 0x0000039C
segment_length = 0x0000A000
segment_data = blob_data[bootloader_size : bootloader_size + segment_length]
expected_sha = sha256(segment_data).digest()&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/539574?ContentTypeID=1</link><pubDate>Tue, 17 Jun 2025 14:06:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb52add9-8a86-4869-b615-1a91f569ffca</guid><dc:creator>Norbert H.</dc:creator><description>&lt;p&gt;Yes we are targeting with the&amp;nbsp;DECT NR+ modem FW. But the&amp;nbsp;SHA calculation of the modem segments should be the same for LTE or DECT. The big question is can we calculate the sha&amp;#39;s from the binary blob (cbor-file) or do we need the pre-calculated sha&amp;#39;s from the&amp;nbsp;firmware.update.image.digest.txt.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I think the binary bob (in the cbor-file) is encrypted and if the SHA is returned from the modem via the unencrypted content, it would not be possible to calculate from the cbor file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/539572?ContentTypeID=1</link><pubDate>Tue, 17 Jun 2025 13:53:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d78a4f7c-bc60-4e74-8817-70e179513710</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;And just to clarify, you are targeting DECT NR+ modem FW?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/539566?ContentTypeID=1</link><pubDate>Tue, 17 Jun 2025 13:43:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a89e76ab-7883-4552-b15c-83f23238ff47</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello, and thanks for the elaborate answer. I don&amp;#39;t have a good answer for you right now, but let me forward this internally and discuss with out modem experts. I hope to have an answer by end of tomorrow or Thursday.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/539560?ContentTypeID=1</link><pubDate>Tue, 17 Jun 2025 13:03:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d1498e1-2abc-41e0-95f6-64a4e16f9dc4</guid><dc:creator>Norbert H.</dc:creator><description>&lt;p&gt;We adapted your FMFU over SMP (UART) to work with SPI.&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/cellular/fmfu_smp_svr/README.html#fmfu-smp-svr-sample"&gt;docs.nordicsemi.com/.../README.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In your example, you provide the mfw_xxxx.zip file to the non-public library at pynrfjprog. To have full control, we reimplemented the functionality in Python by parsing and processing the cbor-file. The update is working. Now, we want to verify the FW update. To do this, we want to compare the SHAs from the segments. This is similar to what you do under the hood in pynrfjprog. To do this, we calculate the SHA of a segment from the cbor-file and read the SHA of the segments from the modem (via SMP). The SHA that we read over SMP is the same as that in the firmware.update.image.digest.txt file. However, the calculated SHA of the segment from the cbor-file/binary does not correlate to it. Therefore, the version of the nRF Connect SDK is not necessary for resolving this issue. You provided a documentation for the cbor-file. The COSE_Sign1_Manifest with the binary blob of the segments. The blob_hash is the SHA for the whole binary-blob, but how can we calculate the SHA for the segments? So that we can get the same result as in your firmware.update.image.digest.txt file?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/dfu/fmfu_fdev.html"&gt;docs.nordicsemi.com/.../fmfu_fdev.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FMFU segments SHA</title><link>https://devzone.nordicsemi.com/thread/539537?ContentTypeID=1</link><pubDate>Tue, 17 Jun 2025 12:07:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d41f179f-d73c-4dfd-8c99-731d2aede69d</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello, could you please provide more details to your problem. What exactly are you trying to achieve? What are you basing this &amp;quot;custom modem fw update&amp;quot; on? What version of the nRF Connect SDK are you using?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>