rom to ram compression

Anyone know of a good small fast compression routine I could use to compress my 128k rom? I need to have it uncrompress at bootup.

Reply to
Bob Bins
Loading thread data ...

Run-length encoding is the fastest method I know. The compression ratio is very dependent on the content of the data.

--
John B
Reply to
John B

The 128k is nothing. Why would you need to compress it? Even if the compression will reduce the boot image to a half (a very optimistic assumption), would this improvement be worthy?

As for the simple and fast methods of compression, LZSS is my preference. There are the numerous references in the Internet.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

Surely you want fast decompression? Compression time I would expect to be secondary if not close to irrelevant.

Robert

--
Posted via a free Usenet account from http://www.teranews.com
Reply to
Robert Adsett

Look up UPX (and its related compression library).

I used an LZW like compression on Atari Lynx (65SC02 based) which loads compressed images faster then uncompressed (giving ROM and RAM have different wait-states).

The packer (in source) is here:

formatting link

--
42Bastian
Do not email to bastian42@yahoo.com, it's a spam-only account :-)
Use @monlynx.de instead !
Reply to
42Bastian Schick

Yes, if you have 128k flash and your image is 130k compressing it is it worth. Choosing a MCU with bigger flash if often no option as if either does not exist or does cost too much.

--
42Bastian
Do not email to bastian42@yahoo.com, it's a spam-only account :-)
Use @monlynx.de instead !
Reply to
42Bastian Schick

I was follow you, but now I am not sure.

An MCU most times mean a single chip processor with ROM(Flash), RAM and IO Ports.

To compress an image into the flash to save space is a good idea. But, where do you un-compress that image on an MCU.

As in your example, 130K image inside of 128K Flash would need 130K RAM.

Did you mean MCU or CPU with external ROM and RAM ??

don

Reply to
Donald

Ok, your got a point. Normaly a single-chip MCU has more ROM(Flash) than RAM, so no way to uncompress into RAM (unless you think of very complicated cenarios, like uncompressing the currently needed parts ..).

But I was thinking of these MCU which come with interal flash, but external RAM (e.g. LPC2294, MCF5282).

If you run out of internal flash, it might cost you more to add external flash than just increasing the existing RAM.

Anyway, my initial follow-up was mainly to show that there _are_ reasons to compress the image (or parts).

BTW: AFAIK, the RVCS (ARM Ltd. Compiler) has an option to compress initialized data during linking and uncompress during C-startup.

--
42Bastian
Do not email to bastian42@yahoo.com, it's a spam-only account :-)
Use @monlynx.de instead !
Reply to
42Bastian Schick

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.