Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By xtal
#37989 Thanks a bunch Martin
its working fine.....I'm seeing 36-37K
I would have never figured that out.
I glad someone who knows the answers is willing to help out.

Is there any way to see the stack size? Just courious,,,,
User avatar
By martinayotte
#37992 Stack is growing while declaring local variables and calling sub-functions, so it is a moving target while the program is executed. Let says that if you wish to print the stack size at a certain moment, you can simply declare a local variable at the moment and the address of this variable will tell you where it is. If you have added same kind of local variable in the main() or setup() and push this address into a global pointer, you can subtract them to actually print the stack consumption.

Here is an example found on the net : https://bytes.com/topic/c/answers/52416 ... ze-runtime
User avatar
By xtal
#38054 I'm even more courious now...
Compiling says I use 223k of 434k which leaves 211k bytes
getting free mem says 35-37 k
surley the stack isn't using the remaining 170k - where has the memory gone?

On serial.available does that pertain to software serial ? I've found some ESPserial stuff..
I was thinking the ESP used HW serial ?
Do I need any includes on this ?

Thx
User avatar
By martinayotte
#38055 Don't confuse RAM size and Flash size, the number you mentioned is the remaining Flash.
serial.available() is the function that tell you if some characters are present in the receive buffer, it has nothing with any software serial implementation.