Go Down

Topic: Can't load large libraries to Duemilanove w/ ATMEGA328 (Read 1 time) previous topic - next topic

dc42

I've never used the SD card library, so this is a complete guess. I'm wondering whether it allocates a large amount of RAM when you make that  sd_raw_get_info() call. The amount of RAM it allocates might depend on the capacity of the SD card you are reading. Which Atmega chip does your Duemilanove have? The older ones had the 168, which has 1K of RAM; newer ones use the 328 which has 2K.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

abram

#6
Nov 27, 2011, 09:48 pm Last Edit: Nov 27, 2011, 09:50 pm by abram Reason: 1
a good guess at that. the SD library is quite a hog in terms of memory but, from what i understand, only occupies a little over 500 bytes which comes from the 512 byte buffer for addressing the FAT table in 512 byte blocks. mine is a 328 chip though. there was another thread where someone mentioned problems loading Serial.begin() and the SD library at the same time which turned out to be a limitation of the 168 chip. the 168 chip however is at least able (according to that thread) to handle the library by itself. my board can't even do that. :)

i've come across some issues with Gentoo / Arch distributions have issues with certain functions (like millis() and delay()), so i've been scouring the sd_raw library for use of those to no avail. i suspect at the moment the culprit is the avr-gcc compile i did manually since crossdev's emerge of gcc doesn't compile avr-g++ which is needed by the IDE to compile the sketch. i recompiled binutils last night and it's still the same issue so i guess it's onto the gcc debacle.

abram

btw gcc is version 4.3.3. updating to 4.3.4. i'll assume that 4.4.x and 4.5.x still have problems on the AVR platform.

abram

#8
Nov 28, 2011, 01:56 am Last Edit: Nov 28, 2011, 02:35 am by abram Reason: 1
and voila. compile with SD.h was successful after compiling binutils, gcc, and libc from scratch using http://www.nongnu.org/avr-libc/user-manual/install_tools.html as the model. i found it a lot easier than trying to cope with crossdev and the lack of attention placed on those repositories. i wound up using gcc version 4.3.6 instead and all is working.

thanks so much for the help!

dc42

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up