Skip to main content
  • 产品
  • Software evaluation
  • 下载
  • Free utilities
  • 购买
  • 芯片厂商
  • 支持
  • 关于我们
  • Search
  • 工作机会
  • 新闻简报
  • 联系我们
  • 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
    Previous case study:
    SEGGER’s Flasher PRO increases production reliability for Viessmann
    Next case study:
    Forze Hydrogen Racing — Pole position thanks to SEGGER

    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

    全球总部

    德国: SEGGER Microcontroller GmbH

    地址: Ecolab-Allee 5
    40789 Monheim am Rhein, Germany
    电邮: info@segger.com
    电话: +49-2173-99312-0
    传真: +49-2173-99312-28

    网点分布

    中国:哲戈微系统科技(上海)有限公司

    地址: 中国上海市闵行区秀涟路133号
    大虹桥国际A 栋218室
    邮编201199
    电邮: china@segger.com
    电话: +86-133-619-907-60


    简易信息聚合

    通过ISO 9001认证

    ISO 9001

    通过ISO 27001认证

    ISO 27001

    30多年的嵌入式行业经验

    First-class embedded software tools since 1992
    • 版本说明
    • 免责声明
    • 行为准则
    • 隐私策略
    • 沪ICP备2022005181号
    • 沪公网安备 31011202014525号
    © 2026 SEGGER - 版权所有.

    您即将离开 segger.cn 而访问境外网站,是否继续?