This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAP-L138: Compress / Optimise AIS by converting repeating byte patterns to Section Fill commands where possible

Part Number: OMAP-L138

I have a firmware binary with an AIS that uses Section Load commands.  In some places, blocks of repeating bytes occur.

I am trying to reduce the flash memory used for AIS by inserting Section Fill commands, where possible. 

For example, a 256 byte block of 0x00 could be swapped for a Section Fill command filling 256 bytes with pattern 0x00, followed by a Section Load command for the remaining data. 

The same is true for patterns of length 2 and 4 bytes. If the sequence length is >32 bytes, space can be saved.  

I wish to process the entire AIS, identifying repeating patterns and inserting Section Fill commands where appropriate.  

Is there already a tool to do this? 

(I do not have access to the source code, I am modifying the binary using Python.)