Skip to main content
  • Products
  • Software evaluation
  • Downloads
  • Free utilities
  • Purchase
  • Silicon Vendors
  • Support
  • About us
  • Blog
  • Forum
  • Search
  • Jobs
  • Newsletter
  • Blog
  • Contact
  • Shop
  • Case studies
  • emCompress

    Size matters — Using emCompress to accelerate firmware updates via CAN bus

    • emCompress

    Published: May 12th, 2021

    The image illustrates a data flow between a laptop running SEGGER emCompress and an ECU (Electronic Control Unit) via a CAN bus. Arrows indicate communication and data transfer direction between the devices.

    With the increasing complexity of today’s embedded devices, customers expect multiple firmware updates over the life of an embedded device. Generally speaking, firmware upgrades and other static content only grow in size over the life of a device, e.g. the Electronic Control Unit (ECU) installed in modern cars. The larger the firmware image and the slower the data transmission rate, the longer an update takes. SEGGER’s compression software emCompress is an ideal solution for reducing the update time dramatically.

    In the automotive industry, and now also in factory automation, CAN (Controller Area Network) is a common standard. Often the devices involved are complex systems with a fast CPU and a lot of memory. Unfortunately, the achievable data transmission rates are relatively low. Details can be found at the end of this article.

    Reducing transmission time by compressing data

    To address these speed limitations, SEGGER’s development team was approached by a customer from the automotive industry. This customer regularly manages firmware updates for ECUs from their suppliers. The only available connection with these ECUs is the CAN bus. Figure 1 shows an example of the basic structure of a setup in which the firmware update is imported via CAN. In this case, a firmware update of 1.5 MB took almost 40 minutes, an unacceptably long time.

    Since the speed limitations of the CAN bus cannot be changed, the only option was to reduce the amount of data to be transferred. To this end, SEGGER’s compression software emCompress was integrated into the customer’s bootloader.

    emCompress offers solutions to compress data for all kinds of applications where size matters. Designed for embedded systems, emCompress can compress and decompress data even on the smallest microcontrollers.

    Why SEGGER’s emCompress-LZMA is the ideal solution here

    emCompress is available in three editions – emCompress-ToGo, emCompress-LZMA, and emCompress-Embed – that cover different use cases for compression. Each edition is optimized for its specific use to provide the most efficient and convenient way to compress and decompress data.

    There is sufficient RAM and non-volatile memory on the automotive ECUs, so the goal was not so much to achieve the smallest possible footprint as to achieve maximum data compression in order to minimize the transmission time via the CAN bus.

    This led to emCompress-LZMA, with its LZMA algorithm, as the go-to solution. The Lempel–Ziv–Markov chain algorithm (LZMA) is an algorithm used to perform lossless data compression. LZMA uses a dictionary-based compression algorithm, whose output is then encoded with a range encoder, using a complex model to make a probability prediction of each bit. Independent studies show that – depending on the data set – compressions with a factor of more than 6 to 1 are possible with this algorithm [1]. Typical compression rates for firmware images range from 2 to 4 reducing the update time between 50 and 75 percent.

    emCompress-Flex supports LZMA as well as other algorithms (e.g. LZMA2). In this use case, the decompression algorithm also supports files that were created by PC-based tools such as “7-ZIP” or “Lzip” which use LZMA as well.

    The compressed firmware image is then sent via the CAN bus to the system. emCompress-Flex directly receives and decompresses it in chunks. The decompressed chunks are passed to the firmware update function.

    Conclusion

    A flowchart illustrating the communication between a PC, Master MCU, and Target MCUs via UART and CAN interfaces, detailing the transmission of firmware, bootloader, and application data. Arrows indicate direction of data flow among components.

    With emCompress highest compression rates can be achieved, and the transmission time via the slow CAN bus is reduced accordingly.

    The software is written in well-commented ANSI C and is both compiler and target independent. emCompress is not covered by an open-source or required-attribution license and can be integrated into any commercial or proprietary product, without the obligation to attribute the vendor or disclose the combined source. In addition, SEGGER supports the special needs of automotive customers – e.g. MISRA compliance and extensive regression tests – which makes emCompress an ideal solution for ECU firmware updates.

    You can find more information about emCompress here.

    About CAN

    A Controller Area Network (CAN bus) is a robust vehicle bus standard designed to allow microcontrollers and devices to communicate with each other’s applications without a host computer. It is a message-based protocol. Designed originally for multiplex electrical wiring within automobiles, it is now also used in a lot of other industries.

    Compared to modern protocols such as Ethernet, which allows transmission rates from 10 Mbit/s to 100 Mbit/s and now 1 Gbit/s, CAN is very slow. The so-called “high-speed CAN” according to ISO 11898-2 allows only 1 Mbit/s or 5 Mbit/s for CAN-FD (Flexible Data Rate). Interestingly, the original requirement of the automotive industry for the development of CAN-FD was to accelerate the software download at the end-of-line and in the garages for software updates.

    Related videos

    SEGGER emCompress: Sample application project

    Jan. 2018 | 2:43 min
    emCompress — Example application project

    YouTubebilibili

    Contact us for your own success story

    If this success story inspired you, let's talk about how we can help you achieve similar results.

    • Tailored solutions for your specific requirements
    • Expert support from development to production
    • Reliable tools that let you focus on what matters most

    We look forward to hearing from you.

    Contact us

    Headquarters

    SEGGER Microcontroller GmbH

    Ecolab-Allee 5
    40789 Monheim am Rhein, Germany
    info@segger.com
    Tel.: +49-2173-99312-0
    Fax: +49-2173-99312-28

    Locations

    USA: SEGGER Microcontroller Systems LLC

    Boston area
    101 Suffolk Lane
    Gardner, MA 01440, USA
    us-east@segger.com
    Tel.: +1-978-874-0299
    Fax: +1-978-874-0599

    Silicon Valley
    Milpitas, CA 95035, USA
    us-west@segger.com
    Tel.: +1-408-767-4068

    China: SEGGER Microcontroller China Co., Ltd.

    Room 218, Block A, Dahongqiaoguoji
    No. 133 Xiulian Road
    Minhang District, Shanghai 201199, China
    china@segger.com
    Tel.: +86-133-619-907-60

    ISO 9001 certified

    ISO 9001

    30+ years of experience

    First-class embedded software tools since 1992
    • Imprint
    • Disclaimer
    • Code of Conduct
    • Privacy Policy
    © 2026 SEGGER - All rights reserved.