How does the MCUboot compressed update routine extract the decompressed upgrade package?

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, but neither appeared in the log.May I ask how the whole receiving, decompression and upgrading process of this example is, and where the decompression part is to see?

DFU TEST DEBUG



  • Hi, 

    You can enable CONFIG_OUTPUT_BOOT_MESSAGE to output a message at run-time.

    There are two functions for decompression:

    • nrf_compress_decompress_bytes_needed_t - This function determines the ideal amount of data to supply for decompression. It typically matches the value of the CONFIG_NRF_COMPRESS_CHUNK_SIZE Kconfig option, unless limited by a header or the final amount of data required is predetermined.

    • nrf_compress_decompress_func_t() - 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 offset 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 last_part value to true when submitting the final segment of the data stream for decompression. This is crucial as some compression libraries require this information.

    See the documents: nRF Compression: MCUboot compressed update and the nRF Compression library. 

    Regards,
    Amanda H.

Related