Go Down

Topic: SD.h resetting arduino [solved] (Read 681 times) previous topic - next topic

mrjonny2

Jul 05, 2012, 03:44 pm Last Edit: Jul 06, 2012, 11:49 am by Nick Gammon Reason: 1
Hi,
Has anyone come across the problem when if you are reading a long string off an SD card it causes the arduino to reset from the beginning of void loop()?

Any advice would be nice

Thanks

PaulS

Quote
Has anyone come across the problem when if you are reading a long string off an SD card it causes the arduino to reset from the beginning of void loop()?

That seems highly unlikely. Resetting, and rerunning setup(), then starting to loop again is more likely.

Quote
Any advice would be nice

Well, there's the usual. Post your code.

mrjonny2

Hi Paul
I found the problem, what it would do was begin from setup again, hang on the ethernet begin and stop.  The problem was when it ran out of memory as I was having it print the string which was pretty long.  As soon as I removed the print everything worked. 

Nick Gammon

Try looking up the F macro and printing from PROGMEM.

eg.

Code: [Select]
Serial.println (F("Hello, world"));
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

mrjonny2

Thanks Nick
but I was just printing a massively long string for debugging over serial.

Go Up