SEGGER emCompress-Flex

The firmware update accelerator

emCompress-Flex is a compression toolkit, designed to compress data on a host computer and decompress it on a target system.

emCompress-Flex is a cost-effective compression library for speeding up firmware updates. It implements the lossless compression algorithm LZMA, which is used by popular compression tools, such as 7zip. emCompress-Flex enables you to use LZMA decompression even on small embedded targets.

Performance numbers

emCompress-Flex implements the LZMA (Lempel–Ziv–Markov chain) lossless compression algorithm which was first used in the 7z file format. This algorithm uses a dictionary compression scheme similar to the LZ77 algorithm and features a high compression ratio and a variable compression-dictionary size, while still maintaining decompression speed similar to other commonly used compression algorithms.


CodecCompressed size [1]Compression speed [2]Decompression speed [2]Compression RAMDecompression RAM
LZMA(1k,0,0,0)108.676 KB282876.010 MB5,060 B
LZMA(1k,3,1,1)103.675 KB289916.010 MB27.613 KB
LZMA(2k,0,0,0)106.270 KB363916.015 MB6,084 B
LZMA(2k,3,1,1)101.701 KB378936.015 MB28.613 KB
LZMA(4k,0,0,0)104.640 KB582856.025 MB8,132 B
LZMA(4k,3,1,1)100.450 KB593906.025 MB30.613 KB
LZMA(8k,0,0,0)103.592 KB980876.044 MB11.941 KB
LZMA(8k,3,1,1)99.742 KB992876.044 MB34.613 KB
LZMA(16k,0,0,0)102.706 KB1,821826.083 MB19.941 KB
LZMA(16k,3,1,1)99.198 KB1,785856.083 MB42.613 KB
LZMA(32k,0,0,0)102.059 KB2,389976.162 MB35.941 KB
LZMA(32k,3,1,1)98.808 KB2,550866.162 MB58.613 KB
LZMA(64k,0,0,0)100.030 KB4,182896.318 MB67.941 KB
LZMA(64k,3,1,1)97.180 KB4,274836.318 MB90.613 KB
LZMA(128k,0,0,0)99.840 KB5,081856.630 MB131.941 KB
LZMA(128k,3,1,1)97.067 KB5,026866.630 MB154.613 KB
LZMA(256k,0,0,0)99.851 KB3,001837.255 MB259.941 KB
LZMA(256k,3,1,1)97.080 KB3,212877.255 MB282.613 KB

[1]  Uncompressed input size: 182.695 KB

[2]  ns/Byte on Intel i7 @ 4.6GHz, only for comparison between codecs

API use

emCompress-Flex provides a simple zlib-like API, for incremental process of input. This interface enables compression and decompression of data on the fly. It can be used to process data in chunks as they are received from a remote system instead of requiring that all data be available at once. It can also be used to process data and output chunks into a small buffer for further processing instead of requiring a large output buffer that can hold all of the compressed or decompressed data at once. This can reduce memory buffer requirements.

Use case

emCompress-Flex is the cost-effective solution for accelerating firmware updates by compressing and decompressing the firmware image.

Speed up firmware updates

Modern products, in particular IoT devices, require the ability to update their firmware in the field. Most of these devices implement over-the-air (OTA) updates through their main communication channel. When a device is connected via WiFi, available bandwidth is not an issue, but other channels such as Bluetooth or Zigbee might have limited bandwidth. Also, updates via wired connections often have bandwidth restrictions, e.g. the popular CAN bus.

To speed up the update process, lossless compression of firmware images reduces the amount of data to be transferred to the device. emCompress-Flex enables firmware updates with compressed images. They can be easily compressed with the tool included in emCompress-Flex. Once compressed, one can simply deploy the compressed file and send it to the target.

emCompress-Flex interface is suited to receive a compressed data stream and to decompress it on the fly for the update module, which processes the decompressed data afterward. For compressed firmware updates, the target decompresses the received data and immediately writes it to flash in small chunks. This removes the need to decompress the whole firmware image first before doing the update.

emCompress-Flex includes the compressor in a simple-to-use tool as well as in a dynamic library to easily include compression with your tools. It is also compatible with standard LZMA compression tools.

The decompressor is included in a library and can be included into any application, running on a computer or on a microcontroller. It is not limited to 32-bit architectures, but can be used even on 8-bit and 16-bit devices.

Learn more at:

  • Compression and decompression of firmware images
  • Compatible with standard LZMA compression tools
  • Easy-to-use zlib-like API
  • Libraries for host and embedded applications
Tecnologix offre supporto gestito direttamente dal Team di sviluppo.
Non esitare a metterti in contatto con i nostri esperti.
Basta chiedere qui

Hai bisogno di aiuto per sviluppare il tuo progetto?

Con più di 25 anni di esperienza nei servizi di ingegneria elettronica ed informatica, affiancati da consulenza e formazione, Tecnologix è il partner ideale per lo sviluppo di ogni tipo di applicazione nel settore industriale.
Clicca il pulsante qui sotto e inviaci la tua richiesta, il nostro staff ti risponderà il prima possibile.