Skip navigation

emCompress-ToGo

Compress your data in real-time on any embedded system!

  • Small ROM footprint
  • No static RAM required
  • Compression of data streams
  • High performance

What is emCompress-ToGo?

emCompress-ToGo is a portable compression software, designed primarily for but not only embedded systems. It can compress and decompress data with basically no RAM requirements.

The lossless compression is fast and efficient and can be easily done on the embedded system, just like the decompression. In general, there are multiple compression algorithms that allow compression on the host and decompression on target (emCompress-Embed). There are not many, if any, options to compress easily and efficiently on an embedded system, especially with limited RAM.

emCompress-ToGo uses SEGGER's SMASH-2 (Small Microcontroller Advanced Super High) compression algorithm, specifically designed for this type of application, and achieving amazing compression.

One Professional Solution For All Applications

A multitude of applications will benefit from compression. Whether compression is used to reduce the required memory size, to reduce the required bandwidth or just to safe time, emCompress-ToGo enables compression and decompression for all applications even in resource-constrained microcontroller based systems.

compression-to-go.png

Data Loggers

The amount of data collected and stored by data loggers make them a prime application for compression. emCompress-ToGo enables compression even on data loggers running with low performance, low RAM microcontrollers.

embOS and the Internet of Things

Internet of Things

emCompress-ToGo provides an edge for IoT nodes. By compressing communication and storage it reduces the requirements for bandwidth, performance and storage. This enables using less power hungry hardware for battery-powered application.

satellite.png

Space/Avionics

In Space and Avionics applications such as satellites communication channels are restricted by the distance that data has to travel. Reducing the required bandwidth using emCompress-ToGo reduces the communication time significantly.

embOS and the usage in networking devices

Networking

emCompress-ToGo provides compression of streams reducing the bandwidth required to transmit data, making it a perfect fit your networking product.

embOS-Safe - the ideal solution for every medical device

Medical Devices

Similar to IoT devices most medical devices will benefit from compressed data and data streams. The smaller the requirements in storage, bandwidth and power usage are, the longer the medical device will retain its operation without the need of changing batteries.

embos-consumer.jpg

Consumer Electronics

Consumer electronics such as devices used in home automation or personal assistants often use low power communication like Bluetooth, Zigbee, Z-Wave or others. Using compressed communication streams with emCompress-ToGo for exchanging data or firmware images will provide a significant boost in bandwidth available.

Compression ratios

We have been looking at a large variety of different data types. SMASH works well in all cases. The table below displays the compression ratios for various use cases. If the compression ratio is 25%, the compression rate is 4, as the resulting data size is a fourth of the original data.

Type of dataDataWindow size
256 bytes512 bytes1024 bytes2 kB4 kB
HTML file
(324751 bytes)
 37.43% (121586 bytes)31.96% (103809 bytes)28.16% (91455 bytes)20.69% (67199 bytes)15.77% (51234 bytes)
10037!CALCULATE_BAR_1!32!CALCULATE_BAR_3!28!CALCULATE_BAR_5!21!CALCULATE_BAR_7!16!CALCULATE_BAR_9!
Blog article
(20895 bytes)
 49.22% (10285 bytes)44.14% (9224 bytes)39.99% (8356 bytes)36.77% (7685 bytes)34.20% (7147 bytes)
10049!CALCULATE_BAR_1!44!CALCULATE_BAR_3!40!CALCULATE_BAR_5!37!CALCULATE_BAR_7!34!CALCULATE_BAR_9!
FPGA bitstream
(114618 bytes)
 27.23% (31221 bytes)26.48% (30351 bytes)26.14% (29963 bytes)25.36% (29077 bytes)22.49% (25779 bytes)
10027!CALCULATE_BAR_1!26!CALCULATE_BAR_3!26!CALCULATE_BAR_5!25!CALCULATE_BAR_7!22!CALCULATE_BAR_9!
MIDI file
(56805 bytes)
 36.11% (20516 bytes)28.30% (16081 bytes)21.96% (12476 bytes)18.28% (10384 bytes)16.83% (9561 bytes)
10036!CALCULATE_BAR_1!28!CALCULATE_BAR_3!22!CALCULATE_BAR_5!18!CALCULATE_BAR_7!17!CALCULATE_BAR_9!
Firmware
(218824 bytes)
 48.22% (105530 bytes)44.04% (96381 bytes)41.80% (91472 bytes)40.53% (88703 bytes)39.85% (87202 bytes)
10048!CALCULATE_BAR_1!44!CALCULATE_BAR_3!42!CALCULATE_BAR_5!41!CALCULATE_BAR_7!40!CALCULATE_BAR_9!
FirmwareHEX
(615547 bytes)
 40.68% (250424 bytes)37.67% (231885 bytes)35.45% (218245 bytes)34.13% (210121 bytes)33.48% (206115 bytes)
10041!CALCULATE_BAR_1!38!CALCULATE_BAR_3!35!CALCULATE_BAR_5!34!CALCULATE_BAR_7!33!CALCULATE_BAR_9!

Compression ratios are quite good, especially given that this can be done quickly and with no work RAM on the target. The 512 byte setting is the recommended default for on target compression. To verify the compression results on your own, please refer to the evaluation package.

Performance

Compression

Compression performance and time go up with larger window sizes.
A Cortex-M7 running at 200 MHz has been used to measure the performance.
Using RAM to RAM compression with 256 bytes window, the compression performance is about 400 kB/sec.
An enhanced function that requires an additional work buffer in RAM will achieve about 1500 kB/sec compression speed.

Decompression

Decompression performance is largely independent of the parameters, so that the window size does not have a major effect on decompression performance.
Similar to the performance values for compression, a Cortex-M7 running at 200 MHz has been used to measure the performance.
Using RAM to RAM decompression, an average of 6.3 MB/sec of compressed input data is processed while around 13 MB/sec uncompressed output data is generated.
Using the stream interface, the decompressor will process an average of 4.3 MB/sec input data while generating 9 MB/sec uncompressed output.

Resource usage

RAM usage

In most cases, no RAM is required! Since SMASH works with references, it uses the uncompressed part as “window”. In cases of compression of a stream, compressing blocks of 2KB or even less at a time (down to as little as just 256 bytes) can be done.

ROM usage

Decompression

There are different decompressors available, basically 2 types: A memory to memory decompressor and a decompressor providing a stream interface. The first one needs only about 370 bytes!
The stream variant requires about 540 bytes.

Compression

The compressor needs about 1100 bytes of ROM for the memory to memory variant and about 1280 bytes using the stream interface.

Evaluation Packages

PC Evaluation Software

Compression and decompression with SMASH can be evaluated on a Windows PC with the tools of the software package available for download. It includes a compressor and a decompressor tool and the data files we used in the compression table previously mentioned.

emcompress-togo-stats.png

PC Evaluation Software Package Content

FileDescription
ShowStats.bat
Windows batch file, that runs Smash.exe with window size parameters 8 to 12 for the input files mentioned below (Blog.txt, Firmware.bin, Firmware.hex, FPGA.bin, Index.htm, MIDI.mid)
Smash.exeWindows executable of SMASH compressor
Unsmash.exeWindows executable of SMASH decompressor
Blog.txtText content of "What's cooking at SEGGER" blog
Firmware.binBinary file of a firmware image for a microcontroller
Firmware.hexHex file of above mentioned firmware image
FPGA.binFPGA bitstream
Index.htmHTML code taken from the SEGGER website
MIDI.midStandard .midi file

Running ShowStats.bat

The software package includes a batch file, ShowStats.bat, which compresses the included data files. You can compare the compression results of the different files with different window sizes being used.

You can also compress and decompress your own files to test the efficiency of the SMASH-2 compression algorithm and to find the best balance of compression ratio and window size (i.e. memory requirement) for your use cases.

Evaluation on a Microcontroller

To evaluate the use of emCompress-ToGo in an embedded application, a trial package for Embedded Studio is available for download. It includes a project to test compression and decompression in Embedded Studio's simulator. It can also easily be configured to run on actual hardware.

Running the Simulator Project in Embedded Studio

Running the emCompress-ToGo demo project will generate some output in the terminal that provides data of the compressed or decompressed file in different compression modes. emCompress-ToGo can run compression and decompression from memory to memory, from function to function, from memory to function and vice versa. All four resulting combinations are tested in the simulation project.

emcompress-togo-trial.png

To get started, follow these steps:

  • Open Start.emProject with Embedded Studio.
  • Select "Decode_Release" for testing the decompressor or "Encode_Release" for testing the compressor as the active build configuration.
  • Build the project.
  • Start a debug session and let it run.
  • The debug terminal will show the compression or decompression results of the example application.

List of available Downloads

emCompress-ToGo Media

SEGGR - Video Thumbnail emCompress-ToGo

Compression on any Embedded System

FAQs

Can the software be used for streaming data?

A: Yes. This can easily be done. It actually comes with a sample showing how to do this.

Can I use the software to compress data I want to store in files?

A: Yes, No problem!

I am storing a long file. Is there a way to "fast forward" in the file, so to extract a portion of it without having to extract the whole file?

A: Yes, this can easily be done by chunking the output and prefixing every chunk with the chunk size

(compressed and uncompressed). The software comes with a sample showing how to do this.

Can I test the software?

A: A Windows executable can be downloaded which compresses a file.

Do I have to select parameters for compression?

A: No. There basically is only one parameter, and that is the size of the window.

This affects the amount of uncompressed data which needs to be in memory at any given time as well as the compression speed.

More Information