# Compiled Aplication size problems

**URL:** <https://forums.digi.com/t/compiled-aplication-size-problems/6061>\
**Category:** NET+OS\
**Created:** [April 1, 2009, 2:06pm UTC](https://forums.digi.com/t/compiled-aplication-size-problems/6061 "2009-04-01T14:06:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdeabill](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@rdeabill](https://forums.digi.com/u/rdeabill)\
**Post date:** [April 1, 2009, 2:06pm UTC](https://forums.digi.com/t/compiled-aplication-size-problems/6061/1 "2009-04-01T14:06:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fyicc](https://avatars.discourse-cdn.com/v4/letter/f/8e7dd6/32.png) [@fyicc](https://forums.digi.com/u/fyicc)\
**Post date:** [April 2, 2009, 1:43pm UTC](https://forums.digi.com/t/compiled-aplication-size-problems/6061/2 "2009-04-02T13:43:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rdeabill](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@rdeabill](https://forums.digi.com/u/rdeabill)\
**Post date:** [April 2, 2009, 3:43pm UTC](https://forums.digi.com/t/compiled-aplication-size-problems/6061/3 "2009-04-02T15:43:29Z")

</div>

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
