> static u_char bufr[4096]; // THIS IS THE PROBLEM If used as a local variable, this is taken from stack. Again, I strongly recommend to read http://www.ethernut.de/pdf/enmem100.pdf It's a bit outdated, but still worth reading. malloc() is defined in stdlib.h, which is part of avr-libc or the ImageCraft Compiler. Harald