#33 Not enough internal ram?

closed
nobody
None
5
2005-07-21
2005-01-18
Andrea
No

I'm trying to port to SDCC a sample program that
comes with the Atmel devkit, equipped with the
AT89C51RD2.
This program sends back data sent to him via UDP.
I'm having problems compiling it with SDCC.
With the default options it compiles the libraries but
when I link the main.c it tells me:

ERROR: Couldn't get 147 bytes allocated in internal RAM
for area DSEG.

I've already made some of the fixes to port the code
from Keil (which the code was originally written for) to
SDCC.

If I use --model-large option it is able to compile but
then the program works oddly for a while and then hangs
up.

If I use --stack-auto when compiling socket.c it gives
this error:

socket.c:1201: error 16: variable 'UDPHeader' must be
static to have storage class in reentrant function

Help!
Thanks

PS: This help request refers to the topic
Atmel AT89C5131 Support?
on the Open discussion forum

Discussion

  • Andrea
    Andrea
    2005-01-18

    source files for UDP loopback program

     
  • Maarten Brock
    Maarten Brock
    2005-01-18

    Logged In: YES
    user_id=888171

    Andrea,

    It seems you don't need --stack-auto. Forget about it for
    now as it also requires you to recompile the libraries with the
    same option. Just for clarification: when using --stack-auto
    all functions are reentrant and all local variables are stored on
    the stack. Therefor you cannot use a storage class
    specification like xdata for local variables unless they are
    made static, which means there is only one instance.

    My recommendation: stick to --model-large and try to find
    out what goes wrong. Unfortunately I can not help you more
    as I don't have this controller. Wouldn't have the time either I
    guess. Try to insert some debugging output here and there
    (printf/sprintf/PutString?) if you don't have an In-Circuit-
    Emulator.

    Greets,
    Maarten

     
  • Maarten Brock
    Maarten Brock
    2005-07-21

    • status: open --> closed