Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By Yaro
#41797 Hi all,

I've a newbie question about globals. We define if hold code into RAM or FLASH with attribute on function. But Globals variables(that defined outside a function) where are they stored? It's possible to also change where to store them?
User avatar
By jayeye
#41833 As far as the processor is concerned, globals are just another piece of data in RAM. Depending on your compiler options and/or attributes in the declaration, if something is declared const it may end up in Flash, since it won't have to change.

BTW, it is generally good practice to declare variables that don't change as const.