I have some code written to initialize and fill a 2D buffer of unsigned 8 bit integers over the serial interface on the atmega2560. When initializing a small buffer say 10 by 10 the code executes exactly as planned but when i initialize a buffer to contain say 657 by 8 for loops tend to misbehave and i get unsigned 32bit integers turning up negative when i print them on the serial console. i have written a python script to upload the array data to the micro-controller with pyserial i will attach it with the c code so anyone can try to recreate the issue. I assume i am not running out of memory cause the malloc calls would simply fail correct? Anyway been stuck on this for a while would even pay someone to figure out the solution so please any help would be appreciated and potentially compensated. Even if someone were to simply point me in thee right direction or suggest someone i should contact that would be appreciated.