declare big array
Posted: Sat Sep 12, 2015 8:49 am
Hello
I developing weather station I would like to memorize some temperature and humidity values. But I have a problem with this.
I build a simple project to illustrate the problem. Here is the code:
When I declare the temp array globally evrything is OK, but when I declare it locally the program crash, wdt reset occours.
Can anyone help me why this crash occours? Is too big? Its only: uint32_t = 4bytes x 4000 = 16 000byte ~ 16KB.
I developing weather station I would like to memorize some temperature and humidity values. But I have a problem with this.
I build a simple project to illustrate the problem. Here is the code:
Code: Select all
void setup() {
Serial.begin(115200);
delay(3000);
Serial.println("begin");
}
//uint32_t temp[4000]; //when I declare variable globally evrything is OK
void loop() {
Serial.println("Variable declared");
uint32_t temp[4000]; //when I declare variable locally the program crash, wdt reset occours.
while(1)
{
for(int i=0;i<4000;i++) temp[i]=i;
Serial.println("This is test of on big array in ESP8266");
Serial.println(temp[7]);
delay(1000);
}
}
When I declare the temp array globally evrything is OK, but when I declare it locally the program crash, wdt reset occours.
Can anyone help me why this crash occours? Is too big? Its only: uint32_t = 4bytes x 4000 = 16 000byte ~ 16KB.