# Out of root code space?

**URL:** <https://forums.digi.com/t/out-of-root-code-space/10522>\
**Category:** Rabbit\
**Created:** [October 4, 2010, 5:55pm UTC](https://forums.digi.com/t/out-of-root-code-space/10522 "2010-10-04T17:55:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmeyer](https://avatars.discourse-cdn.com/v4/letter/n/97f17d/32.png) [@nmeyer](https://forums.digi.com/u/nmeyer)\
**Post date:** [October 4, 2010, 5:55pm UTC](https://forums.digi.com/t/out-of-root-code-space/10522/1 "2010-10-04T17:55:47Z")

</div>

I am new to the Dynamic C and i am trying to pick up a project where a previous engineer left off. i have the source files and i have tried to comipile a program that the previous engineerng had compiled and loaded into a BL4S160 board. When i try to compile i get a ERROR UTIL.LIB: out of root code space. Since the previous engineer was able to get this compiled and loaded, i am not sure what i am doing wrong. Is there different set ups in the compiler that makes the end code space smaller? Or do i have some other issue?

---

<div class="post-metadata">

**Author:** ![fredbasset](https://avatars.discourse-cdn.com/v4/letter/f/7c8e57/32.png) [@fredbasset](https://forums.digi.com/u/fredbasset)\
**Post date:** [October 17, 2010, 5:49pm UTC](https://forums.digi.com/t/out-of-root-code-space/10522/2 "2010-10-17T17:49:22Z")

</div>

Are you loading the project file? It will contain various settings that can affect memory. Once you know you are loading the project file (or have created a new one), try turning on use separate I&D spaces, this uses separate memory for instructions and data and can up to double the memory you have.

Also check out  
[http://www.rabbit.com/documentation/docs/refs/TN238/TN238.pdf](http://www.rabbit.com/documentation/docs/refs/TN238/TN238.pdf)  
for lots of good “hacks” on how to save memory.

My Rabbit app. has gotten quite large and I am constantly running into memory problems, it’s making for very slow progress.

Good luck, feel free to contact me if you need more help.

---

<div class="post-metadata">

**Author:** ![petermcs](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@petermcs](https://forums.digi.com/u/petermcs)\
**Post date:** [October 18, 2010, 9:07am UTC](https://forums.digi.com/t/out-of-root-code-space/10522/3 "2010-10-18T09:07:48Z")

</div>

Some projects are code heavy and some projects are data heavy. The default build options for a particular target may not be the optimum for the particular application you are trying to build.

You can adjust the mixture of space allocated for code and data by changing the XMEMCODE\_SIZE macro definition. This is done by selecting the defines tab in the Project Options dialog and adding a line like:

XMEMCODE\_SIZE=0x70000

With appropriate values for your app instead of 0x70000

I had to use this approach to get the BACnet stack to build for the BL5S220 as the WiFi code in that device takes up a big chunk of the code space (see the BL5S220 port at [https://sourceforge.net/projects/bacrabbit/](https://sourceforge.net/projects/bacrabbit/) for details).

Regards,  
Peter
