[En-Nut-Discussion] Receiving data problem
MUHAMMAD AZEEM AZAM
muhammadazeemazam786 at yahoo.com
Mon Jan 22 21:12:57 CET 2007
I can use malloc
But i have to send 131072 Bytes of data (ie 2Dimensional array , 128KB Data ,
char array accessing memory )
How is that possible.
can Malloc reserve that amonut of memory
My microcontroller is ATmega 128.
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" this array.
> "char var" 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;
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 Hertlein | Software Development
Kleiststr. 23-26 | 10787 Berlin | Germany
Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
More information about the En-Nut-Discussion