Compiled Aplication size problems

Hi,

I am using NetOS 7.4.1 and Eclipse on the Digi ME.

My application has now grown so that the compiled size is over 2M as shown below.

Compressing image.uncompressed to image.compressed
Using LZSS Encoder/Decode (v2)

Input bytes: 2248296
Output bytes: 925196
Compression ratio: 59%
Build complete for project Size_test

Initially this caused the linker to provide an error about overlapping segments. I solved this by increasing MAX_CODE_SIZE to 3M in bsp/7_4/connectem/customize.ldr. This removes the error from the linker and I can now run the application under the debugger.

However once I load this image into flash the system fails to boot at all. I guess that there is some other setting that also need changing when MAX_CODE_SIZE changes, but I have not managed to decode the cryptic comments to work out what to change.

Any help sincerely appreciated

Take a look at the “MaxFileSize” in bootldr.dat. I believe this is the max file size for the image.bin file. Also take a look at the “ramAddress” in blbootldr.dat. This is the location in ram that the bootloader gets decompressed to and run from. The default “ramAddress” is 0x204000. Since your application size is 2248296 (0x224E68) bytes, when the bootloader decompresses the application firmware into ram, it will overwrite the bootloader itself. You need to increase the “ramAddress” so to a value greater than the application size.

Hi,

Thanks for that.

I have now got it working with MAX_CODE_SIZE at 3M in customixe.ldr and by changing “ramAddress” in blbootldr.dat to 0x304000. MaxFileSize is set to 0x3a0000 so I left it as it was.

It then needs a Release build to generate the bootlader (rom.bin) and once this is downloaded it all seems to work