Out of constant data space

I’m trying to port a full-working code-project from RCM3700 to rcm5760. Despite the greater and better features of the new microcontroller, it seems the core can’t handle the amount of data used. I started getting ““Out of root code space”” and after some tweaks following oficials TN238 y got ““out of constant space””. When I look to the Information Window the total data size value gets crazy to 4Gb.
I think the problem is caused by the new libraries’ size of the Dinamic C10.68, in the Rabbit RCM3700 the Dinamic C9.62 the libraries were lighter.
I don’t really know how to go foward.

There are a number of things to look at here:

The out of constant space indicates that the root memory constant data is exhausted. You may be able to reduce the amount of space required by placing constants in far memory so that they don’t take up precious root memory.

DC10.6x makes it far easier to work with memory outside the root through the use of far pointers. If you look at the Rabbit BACnet stack at bacrabbit.sourceforge.net you will find some good examples of how to do this as I ran into exactly the same problems as you when I was portinf this code to Dynamic C. The bactext.c file is a good example of code using lots of constant data.

Regards,
Peter

Thank you for your interest , I have been using the “far” in my variables but the message of compiler is the same one. Erasing some functions I got those statics from memory usage, unfortunatelly I need to compile the whole project, indeed.

Regards

A couple of things:

Do you have seperate instructions and data spaces enabled?
Can you post the .org file for the compile shown above?

Regards,
Peter

Hello Peter it is the resume of the .org file of the non-compiling project.

Type BB pstart lstart used size

RCOD | | 00000h | 0000h | 0421ah | 0c800h |
RESV | | 0c800h | e800h | 01800h | 01800h |
XCOD | | 0e000h | e000h | 01f84h | 02000h |
RESV | | 10000h | 0000h | 55e56h | 55e56h |
RESV | | f8000h | e000h | 08000h | 08000h |
XVAR | | 103000h | f000h | 00000h | 03000h |
RVAR | | 10a03ch | a03ch | 027c4h | 09800h |
RESV | | 10c800h | c800h | 00200h | 00200h |
RESV | | 10ca00h | ca00h | 00100h | 00100h |
WCOD | | 10cb00h | cb00h | 00300h | 00300h |
RVAR | | 10ce04h | ce04h | 001fch | 00200h |
XVAR | | 17a000h | f000h | 00000h | 6d000h |
RESV | | 17a000h | e000h | 05000h | 05000h |
RESV | | 17f000h | e000h | 01000h | 01000h |
XVAR | | 19938eh | 838eh | 06c72h | 20000h |

*Table is even-aligned so values may not match the information above.

And here is the .org of compiling one:
Type BB pstart lstart used size

RCOD | | 00000h | 0000h | 04458h | 0c800h |
RESV | | 0c800h | e800h | 01800h | 01800h |
XCOD | | 0e000h | e000h | 01f84h | 02000h |
RCON | | 10000h | 0000h | 02fd4h | 03000h |
XCOD | | 13000h | e000h | 4dafeh | e5000h |
RESV | | f8000h | e000h | 08000h | 08000h |
XVAR | | 103000h | f000h | 00000h | 03000h |
RVAR | | 10a122h | a122h | 026deh | 09800h |
RESV | | 10c800h | c800h | 00200h | 00200h |
RESV | | 10ca00h | ca00h | 00100h | 00100h |
WCOD | | 10cb00h | cb00h | 00300h | 00300h |
RVAR | | 10ce04h | ce04h | 001fch | 00200h |
XVAR | | 17a000h | f000h | 00000h | 6d000h |
RESV | | 17a000h | e000h | 05000h | 05000h |
RESV | | 17f000h | e000h | 01000h | 01000h |
XVAR | | 19938eh | 838eh | 06c72h | 20000h |

*Table is even-aligned so values may not match the information above.

Thank and regards,

Txowi

Hi Again Peter,
I’ve finally solved it, I fixed the trouble digging in the org file and changing stdbios.lib lines from:
#if SEPARATE_INST_DATA
#ifndef ROOT_SIZE_4K
#define ROOT_SIZE_4K 0x3U
#endif
#ifndef STACK_SIZE_4K
#define STACK_

to:

#if SEPARATE_INST_DATA
#ifndef ROOT_SIZE_4K
#define ROOT_SIZE_4K 0x6U
#endif
#ifndef STACK_SIZE_4K
#define STACK_

I really appreciate your help and I’ve learn a lot about memory management under this architecture.
Thanks and bye.

Thats good news. I was just composing a response to tell you to alter the ROOT_SIZE_4K myself :slight_smile:

You can do it without modifying the lib file by adding:

ROOT_SIZE_4K=6

to the defines tab of the project options.

Regards,
Peter

Hi Peter,
I’ll take note of your reply. I really thank you for the help provided.
Thanks and regard,
Txowi