[En-Nut-Discussion] Receiving data problem

Thiago A. Corrêa thiago.correa at gmail.com
Mon Jan 22 21:40:03 CET 2007


Hi,

One can not allocate more memory then what is phisicaly avaliable ( see
NutHeapAvailable() ). If possible, try to generate and send data as you go,
instead if generating it all at once to then send later. If that is not
possible in anyway, then you will need more memory in your board, like
Ethernut2/3 which uses memory banks and a CPLD as memory controler.

Regards,
    Thiago A. Correa


On 1/22/07, MUHAMMAD AZEEM AZAM <muhammadazeemazam786 at yahoo.com> wrote:
>
> Hello
>
>   I can use malloc
>   But i have to send 131072 Bytes of data (ie 2Dimensional array ,  128KB
> Data ,
>   char array[1024][128] accessing memory )
>   How is that possible.
>   can Malloc reserve that amonut of memory
>   My microcontroller is ATmega 128.
>
>   Thanks
>   Bye
>
> Ulrich Hertlein <ulrich.hertlein at artcom.de> wrote:
>   MUHAMMAD AZEEM AZAM wrote:
> > i am unable to sent 2d ARRAY TO MY CLIENT ON PC.
> > the code is below.
> > I have to use tcp sockets.
> > i need to send "char var[1024][128]" this array.
> > "char var[4][128]" this thing is working but after that my client
> application hangs.
> >
> > if (strncmp(buff, "2darray", got_data) == 0) //If Match
> > {
> > int a = 5;
> > int b = 128;
> > char mvar[a][b];
> > char mvarr[128];
>
> When using variables like that you're allocating from the stack.
> It's possible you're overwriting your stack and thereby messing up your
> app.
>
> Try using malloc to allocate from the heap and see if it makes a
> difference.
>
> /Ulrich
>
> --
> Ulrich Hertlein | Software Development
>
> ART+COM AG
> Kleiststr. 23-26 | 10787 Berlin | Germany
>
> phone: +49.30.21001-433
> fax: +49.30.21001-555
> http://www.artcom.de
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>
>
> ---------------------------------
> Looking for earth-friendly autos?
> Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>



More information about the En-Nut-Discussion mailing list