<?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>How does the MCUboot compressed update routine extract the decompressed upgrade package?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117169/how-does-the-mcuboot-compressed-update-routine-extract-the-decompressed-upgrade-package</link><description>This sample can be found under samples/nrf_compress/mcuboot_update in the nRF Connect SDK folder structure.I want to know the whole decompression process,I added a lot of journal prints.I added prints to the lzma_decompress and arm_thumb_decompress functions</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Dec 2024 16:03:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117169/how-does-the-mcuboot-compressed-update-routine-extract-the-decompressed-upgrade-package" /><item><title>RE: How does the MCUboot compressed update routine extract the decompressed upgrade package?</title><link>https://devzone.nordicsemi.com/thread/514334?ContentTypeID=1</link><pubDate>Tue, 10 Dec 2024 16:03:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a39705f-0163-4cf5-9c7e-e72c72030986</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can enable&amp;nbsp;&lt;span&gt;CONFIG_OUTPUT_BOOT_MESSAGE to&amp;nbsp;output a message at run-time.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;There are two functions for decompression:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a title="" href="https://docs.nordicsemi.com/bundle/nrf-apis-2.8.0/page/group_compression_decompression_subsystem_ga3ba5cda95820f028c2967b5663b736d5.html#ga3ba5cda95820f028c2967b5663b736d5"&gt;&lt;code&gt;&lt;span&gt;nrf_compress_decompress_bytes_needed_t&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;- This function determines the ideal amount of data to supply for decompression. It typically matches the value of the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/kconfig/index.html#CONFIG_NRF_COMPRESS_CHUNK_SIZE"&gt;&lt;code&gt;&lt;span&gt;CONFIG_NRF_COMPRESS_CHUNK_SIZE&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;Kconfig option, unless limited by a header or the final amount of data required is predetermined.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;&lt;span&gt;nrf_compress_decompress_func_t()&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;- This function processes input data and, if decompressed output data is available, returns a buffer containing that data along with its size. Not all input data may be consumed when this function is called. The compression library might require complete blocks and might not process the final block if it is incomplete, especially if multiple blocks are provided. In such cases, the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;&lt;span&gt;offset&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;value will be updated to reflect the amount of data that was read from the input buffer The application or module must monitor the amount of data it intends to decompress. It will set the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;&lt;span&gt;last_part&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;value to true when submitting the final segment of the data stream for decompression. This is crucial as some compression libraries require this information.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See&amp;nbsp;the documents:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/nrf/samples/nrf_compress/mcuboot_update/README.html"&gt;nRF Compression: MCUboot compressed update&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;span&gt;the&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/nrf/libraries/others/nrf_compression.html#nrf-compression"&gt;&lt;span&gt;nRF Compression&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;library.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>