EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Compressing MSP430 binaries?

Started by decatodd February 22, 2013
So I have a spiffy new wireless sensing node built on an F2419. Now my thoughts turn to updating the device's firmware over the radio link (FOTA).

I'd sure like to compress the binary before sending it over the air and storing it in the node. Our first attempts at using an already implemented form of LZW didn't offer much compression. So I'm looking for a better choice.

Can someone suggest another compression algorithm that offers decent compression on MSP430 binaries. It would also be nice if the decompressor itself was reasonably small.

Thanks,

~Todd

Beginning Microcontrollers with the MSP430

Todd,

> So I have a spiffy new wireless sensing node built on an F2419. Now my
> thoughts turn to updating the device's firmware over the radio link
> (FOTA).
>
> I'd sure like to compress the binary before sending it over the air and
> storing it in the node. Our first attempts at using an already implemented
> form of LZW didn't offer much compression. So I'm looking for a better
> choice.
>
> Can someone suggest another compression algorithm that offers decent
> compression on MSP430 binaries. It would also be nice if the decompressor
> itself was reasonably small.

Compression ratio varies by a number of factors:

1. Entropy of the message sent (see Shannon theory)
2. The compression scheme selected
3. Usually, a constraint on the size of the compression or decompression
temporary data.

On an MSP430 (1) is a given and you are constrained by (2) by code size and
(3) by data size.

Rather than use LZW with (I assume) a fairly large window, why not
investigate Huffman coding?

http://en.wikipedia.org/wiki/Huffman_coding

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
SolderCore Development Platform http://www.soldercore.com

How about generating a diff between the two versions and shipping that?
Bet that there are long sequences of identical bits. Of course, you'll
want to have trustworthy (multi-level?) checksums on both copies so that
you aren't propagating garbage.

HTH,

Mike

PS: Another reason for run-anywhere code -- it isn't polluted by absolute
addresses that change when the code is relocated.



The 2024 Embedded Online Conference