Pages: [1]   Go Down
Author Topic: Arduino reset on SD card read  (Read 1166 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

  If my sketch start reading a file from SD, the board simple reset  smiley-cry
Can any body help me in it?

I´m using the Sdfat lib and IDE 1.5.2 on arduino uno.

The code have 28,302 bytes and several pages



« Last Edit: April 19, 2013, 11:13:02 pm by Cassio_Alvarenga » Logged

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

Quote
Can any body help me in it?
Without seeing your code? No.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 37
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
my first 'suspect' usually is memory overflow, another one could be wrong wiring. In the latter case I would expect this already with sd.init.
Maybe u want to check my blog posts on troubleshooting and memory consumption.
http://robertgetzner.com/PersonalWordpress/arduino-sd-storage-troubleshooting-guidline-public-worldwide-collaboration/
http://robertgetzner.com/PersonalWordpress/experiences-with-arduinosd-card-and-memory-consumption-now-it-works/
Best, Robert
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Can any body help me in it?
Without seeing your code? No.

The code is very big  smiley-fat
If I post only the parts whit SD use, can be?  smiley-mr-green



Hi,
my first 'suspect' usually is memory overflow, another one could be wrong wiring. In the latter case I would expect this already with sd.init.
Maybe u want to check my blog posts on troubleshooting and memory consumption.
http://robertgetzner.com/PersonalWordpress/arduino-sd-storage-troubleshooting-guidline-public-worldwide-collaboration/
http://robertgetzner.com/PersonalWordpress/experiences-with-arduinosd-card-and-memory-consumption-now-it-works/
Best, Robert

 I think is memory overflow, because if I short the code (remove some functions) while the program is parsing the SD they work right, but if I implement all functions while is parsing, the Arduino restart or freeze. Can I fix this memory problem?

PS: Thanks for documentation, I´m reading right now  smiley-wink
Logged

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

Quote
If I post only the parts whit SD use, can be?
No. You can use the Additional Options... link to attach the file.

However, if the program IS very large, and you are running it on a UNO, with 2K of SRAM, then the SD class is using 1/4 of that just for the buffer to write to the SD card. And it is very likely that you don't have enough memory.

Quote
Can I fix this memory problem?
You could upgrade to a Mega, or you could post your code. Posting your code is cheaper and quicker, but may not be the final solution. Upgrading may be required.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If I post only the parts whit SD use, can be?
No. You can use the Additional Options... link to attach the file.

Paul, Do not take it personally, but I'm developing this commercial device for a client and I'm afraid to provide the code on the internet, I hope you understand me.  smiley-roll

However, if the program IS very large, and you are running it on a UNO, with 2K of SRAM, then the SD class is using 1/4 of that just for the buffer to write to the SD card. And it is very likely that you don't have enough memory.

Not only SdFat.h, but LiquidCrystal_I2C.h + wire.h + EEPROMEx.h  smiley-sad

You could upgrade to a Mega, or you could post your code. Posting your code is cheaper and quicker, but may not be the final solution. Upgrading may be required.


I´m tested on Mega right now, and works fine, but whit uno I can make it stand alone, using mega will be more expensive.

 I will keep brushing bits, if not work I will try it http://arduino-related.livejournal.com/1414.html?thread=902
Logged

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

Quote
Paul, Do not take it personally, but I'm developing this commercial device for a client and I'm afraid to provide the code on the internet, I hope you understand me.
Sure. If you'd said that up front, I wouldn't have even harped on the code issue.
Logged

Pages: [1]   Go Up
Jump to: