How to generate lzma compression package?

I tested it on the lzma example (ncs\v2.8.0\nrf\tests\subsys\nrf_compress\decompression\lzma),on the Cmakelist.txt code

generate_inc_file_for_target(
  app
  ${ZEPHYR_NRFXLIB_MODULE_DIR}/tests/subsys/nrf_compress/decompression/dummy_data_input.txt.lzma
  ${ZEPHYR_BINARY_DIR}/include/generated/dummy_data_input.inc
  )

I found the dummy_data_input.txt.lzma in "ncs\v2.8.0\nrfxlib\tests\subsys\nrf_compress\decompression" path.I tried to use 7z.exe to generate lzma compressed package to replace, and in the NRF5340DK development board to do decompression, found that failed.Later, I compared their bin files and found that the compressed package of the routine was not generated by the common compression method




How is the compressed package of LZMA routine generated?
Parents Reply Children
  • Hi jared
    I am currently testing the unzip of Lzma on Nrf5340-DK.This routine uses the  “generate_inc_file_for_target ” function to convert the compressed package into a binary header file for inclusion in the project.I found the sample compression package in the path  " ncs\v2.8.0\nrfxlib\tests\subsys\nrf_compress\decompression " in the SDK.As shown in the figure above, when I tried to generate a compressed package in LZMA format to test it, I found that I could not extract it successfully.What tool is used to compress the dummy_data_input.txt.lzma compressed file that comes with the SDK routine?

  • Hi,

    From our developers I got the information that it was a modified version of xz.

    regards

    Jared 

  • Hi,
    I copied the decompression data from the "ncs\v2.8.0\nrf\tests\subsys\nrf_compress\decompression\lzma" routine printed out on the MCU to TXT.Subsequently, I ran "xz inputdata" on the Ubuntu16.04 virtual machine to compress the file. After replacing the compressed file of the routine, it failed to decompress the file on the MCU. May I ask how to set the compression parameters to complete the decompression of the LZMA compressed file on the MCU like the routine

  • HI,

    What's the error when it fails?

    You can try to configure the kconfig to use LZMA version 2 instead as described in the documentation. It might use LZMA version 1 by default and Ubuntu use version 2. 

    regards

    Jared 

Related