Go Down

Topic: web server to read file from SD card and show its content as HTML (Read 2 times) previous topic - next topic

belalsaleh

I'm using Arduino Uno Rev3..

can I test the SRAM some how ?

or is there is away to reset the arduino to its "factory settings"?

SurferTim

I include this function code to any sketch I want to check the SRAM.
Code: [Select]
int freeRam() {
  extern int __heap_start,*__brkval;
  int v;
  return (int)&v - (__brkval == 0 ? (int)&__heap_start : (int) __brkval); 
}


Then call it something like this.
Code: [Select]
Serial.print("Free SRAM = ");
Serial.println(freeRam());

It does not show 0 when you run out of memory. It will show an unrealistic amount of SRAM remaining. If I run my Mega out of memory, it will return more free SRAM than my Mega has.

PaulS

Quote
or is there is away to reset the arduino to its "factory settings"?

It is returned to it's "factory settings" every time you upload a new sketch (except for EEPROM, but that has nothing to do with your issue).

belalsaleh

Thanks you all..

The SRAM is 657  right before the open file failed..
and 813 right before the end of setup()....



SurferTim

That should be pretty close to correct. I figured a bit over 300 remaining as an estimate. If you are not out of memory, I don't know what to tell you. It should work.

Go Up