Hey guys,
I have a weird problem.
My script uses 48% of dynamic memory and works fine. As soon as I reach 51% dynamic memory the script doesn't work any more.
When I use my original script that works and add a bunch of random pointer = new something variables to exceed 48% dynamic memory, the script doesnt work properly anymore.
Any idea whats wrong?
Cheers
Felix
kaul:
Hey guys,
I have a weird problem.
My script uses 48% of dynamic memory and works fine. As soon as I reach 51% dynamic memory the script doesn't work any more.
When I use my original script that works and add a bunch of random pointer = new something variables to exceed 48% dynamic memory, the script doesnt work properly anymore.
Any idea whats wrong?
With that little of real info, that is pretty hard.
Maybe start be clearly stating what you are refer to as "dynamic memory". This term is a bit on the hazy side... (It could be that you refer actually to the SRAM of the 32u4 or you could refer to "dynamically allocated" memory via malloc() or similar C(++) functions...
Ralf
Thank you for your help. The problem was that I ran out of SRAM. Didnt know that console.print uses SO much SRAM.
kaul:
Thank you for your help. The problem was that I ran out of SRAM. Didnt know that console.print uses SO much SRAM.
Well, the main problem with the AVR side of the Yun, just like the Leonardo and the other Arduino boards (bar the Mega2560 maybe and the Due) are SO limited in the amount of (S)RAM available (2.5kB on a Yun/Leonardo). If you use excessive print() statements, then those will add up quickly.
To help mitigate the problem, check out the references to the F() macro as well as to PROGMEM/PSTR (http://www.arduino.cc/en/Reference/PROGMEM)...
Ralf