Zlib Compression on MSP430

Has anyone tried to use zlib compression on MSP430? Do you have any tips on how to compile the library for use in the MSP430 project (I use the IAR Embedded Workbench)?

+6
source share
3 answers

According to the MSP430 datasheets and Wikipedia article , you don’t have enough memory (it has a majority of 16 KiB) even for a sliding window (32 KiB). Therefore, you cannot use the deflation algorithm for the MSP430. Given that ZLIB is just a deflated implementation, which is true for ZLIB as well. Even you are trying to write your own deflationary implementation that you cannot achieve. Because deflate requires 32 KiB for a sliding dictionary and some extra memory for huffman trees. This is for the decompression part only. For compression, you need additional memory to search for links to the hash chain, the dictionary size is 7.5 * = 240 KiB (in accordance with the implementation of 7zip deflate). If you really need compression for this small architecture, I advise you to look at the LZSS compression algorithms encoded in bytes. They are fast and light. But, not strong enough to compete with deflate due to especially entropy differences in coding.

+8
source

I used to build zlib as a test for developing a processor, but as the world began to switch to 64-bit, they randomly used an unsigned long and unsigned int and mix without thorough casting, etc. could hurt compilers. He may have calmed down, but I left him.

he needs / needs a ton of memory, msp430 is especially small on the side of the plunger compared to some competitors.

I have a msp430 simulator that you can use http://github.com/dwelch67/msp430sim . which is easy to set up to have a lot of ram, more than you will find in the chip. Althogh zlib can still get the full 64k and not leave you with anyone. You just need to see what happens. Maybe I'll take this and try it myself as a test for my simulator. On the above simulator, or perhaps in one of my others, I have another compression tool that has a very (relatively) small amount of memory. Not sure if you need zlib specifically, or you just need decompression in general.

+2
source

I built it for several purposes, not just for the MSP430, but that doesn't matter. This is all ISO C and depends only on standard library calls. It uses dynamic memory allocation, so you will need a bunch.

+1
source

Source: https://habr.com/ru/post/905944/


All Articles