Go Down

Topic: Arduino reset on SD card read (Read 1 time) previous topic - next topic

Cassio_Alvarenga

Apr 20, 2013, 03:20 am Last Edit: Apr 20, 2013, 06:13 am by Cassio_Alvarenga Reason: 1
Hi,

 If my sketch start reading a file from SD, the board simple reset  =(
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




PaulS

Quote
Can any body help me in it?

Without seeing your code? No.

Robert Getzner

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
http://robertgetzner.com/PersonalWordpress/category/computer/arduino/

Cassio_Alvarenga


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  ;)

PaulS

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.

Cassio_Alvarenga


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  :(


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

PaulS

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.

Go Up