10 years, 2 months ago.

File compression possible on LPC1768?

Hi folks,

First question on this forum, so greetings to everyone.

I came from a mixed background of C on MSP430 and C#(.Net Micro Framework) on STM32F4, so hopefully my journey into mbed will not be that bumpy.

Here is my situation: I have a bunch of text files that contains data from sensors and those text files need to be uploaded to a ftp server via cellular network. To save some bandwidth, I figure I can try to compress those files first before uploading. Using deflate algorism, the compression ratio is actually very good, somewhere between 1/5 and 1/8. Therefore the savings on bandwidth can be actually considerable. Of course this was done a windows via 7-zip.

My question is: will LPC1768 be able to handle this type of compression work? The text files can limited to 25KB or so in size. A few seconds of processing is acceptable. I assume LPC1768 is the most powerful mbed MCU.

The prototype without file compression has been written in C# (.Net Micro Framework). So I am weighing two options: use native code in .Net Micro Framework and take advantage of STM32F4(168MHz, 192kB RAM) vs. rewrite the whole thing in mbed.

Please advise,

Thanks, ZL

An answer in part is the LPC1768 is not the most powerful uC for mbed, the EA LPC4088 is at the moment, and I expect it may well do what you want! I don't recall seeing a compression lib for mbed, but somebody may say there is, so good luck!

Dave.

posted by David Fletcher 07 Feb 2014

LPC4088 is indeed much more powerful. Is it possible to use zlib which is written in ANSI C.

posted by Zhiyong Li 07 Feb 2014

Then to add to the previous comments, the EA LPC4088 has a core M4 with floating point unit: if you run for example a quadrocopters algorithm on it, it will be alot faster. If compressing is faster is not something I am sure of.

You can search around on the mbed site if someone has a compression lib available. I don't know of one, but then again I don't know all libs :P

posted by Erik - 07 Feb 2014

A google search and also search on mbed site did not give me any hit regarding compression. So I assume no libraries are available at this point. LZO seems the best algorism for compression in embedded system, but its license policy is rather complicated. The next best would be LZW. There seems to be quite a few implementation in C. I will see if I can adapt one of them into mbed.

posted by Zhiyong Li 08 Feb 2014
Be the first to answer this question.