Pages: [1]   Go Down
Author Topic: SD.h resetting arduino [solved]  (Read 657 times)
0 Members and 1 Guest are viewing this topic.
London, UK
Offline Offline
Full Member
***
Karma: 4
Posts: 190
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: July 06, 2012, 04:49:10 am by Nick Gammon » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 654
Posts: 50931
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

London, UK
Offline Offline
Full Member
***
Karma: 4
Posts: 190
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19358
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try looking up the F macro and printing from PROGMEM.

eg.

Code:
Serial.println (F("Hello, world"));
Logged

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

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

London, UK
Offline Offline
Full Member
***
Karma: 4
Posts: 190
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: