Compression Libraries for ARM Cortex M3/4
Asked Answered
C

5

6

I need a proven compression library for ARM cortex M3 or 4. I will use this library for compressing some data from the peripherals before shipping out of the IC.

Any pointers would be appreciated. I have so far looked at LZ4c but it is not easy to get it working on ARM.

Colitis answered 20/7, 2012 at 6:40 Comment(0)
S
2

I really like BCL, it is a light weight, easy to integrate library. I've used it on Cortex M3 and M4 parts.

Swigart answered 14/11, 2012 at 21:44 Comment(2)
Link is dead with "Internal Server Error"Immobile
There's a related github repo at github.com/MariadeAnton/bclSurrender
V
5

https://github.com/pfalcon/uzlib is highly optimized, minimal library (based on the earlier tinf library), which works with the standard DEFLATE/zlib/gzip compression. It can work in both memory buffer and streaming mode for decompression (in the latter case it can process files of unlimited size). For compression, it implements a simpler compression algorithm, but still formats result as a zlib compatible bitstream, so any other software can decompress it.

The library wouldn't have any problems running on Cortex-M0 (depending on dictionary size used, for small-RAM systems, values less than default 32KB should be used).

It's used in MicroPython https://github.com/pfalcon/micropython , where with ~40KB of free RAM, an application written in Python can download tarballs over TLS connection and decompress them into the filesystem (the "upip" package manager).

Va answered 5/2, 2018 at 18:53 Comment(3)
"Currently, compressor doesn't support streaming operation, both input and output must reside in memory. Neither it supports incremental operation, entire input buffer is compressed at once with a single call to uzlib." makes this a no-go for most embedded applications.Immobile
@Navin, many embedded applications don't need compression, that's why streaming mode is implemented only for decompression. Feel free to implement streaming mode for compression yourself. I'm also available for contract work to implement features particular applications need.Va
Right, but OP is specifically asking for "compressing some data from the peripherals before shipping out of the IC". I got here from google looking for the same thing. I guess I'm just surprised that I couldn't find a portable library that does this so I'll have to do it myself :(Immobile
W
3

If you have a standard C compiler, you have many choices. zlib, lz4, libbzip2, lzma.

Whitcomb answered 20/7, 2012 at 14:35 Comment(0)
C
2

I have spent some time to integrate LZ4. It is a nice one, 20KB data is compressed in 0.5mSec using an ARM Cortex M4. Stack requirement is about 16Kb (configurable down to 4). Good one.

Colitis answered 21/7, 2012 at 7:21 Comment(0)
S
2

I really like BCL, it is a light weight, easy to integrate library. I've used it on Cortex M3 and M4 parts.

Swigart answered 14/11, 2012 at 21:44 Comment(2)
Link is dead with "Internal Server Error"Immobile
There's a related github repo at github.com/MariadeAnton/bclSurrender
A
0

you can check this repo, I made example here for compression : https://github.com/Bsm-B/Stm32-FatFs-Gzip

Agnew answered 24/2, 2024 at 23:2 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.