0

problem moving from 19 to 21
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

problem moving from 19 to 21

by jcarroll on Sat Nov 20, 2010 7:30 pm

I have a sketch that compiles and runs beautifully from the 19 installation but hangs when compiled installed from the 21 system.
Windows, Duemilanova and UNO boards. An Adafruit log shield is involved

The includes:

#include <SdFat.h>
#include <SdFatUtil.h>
#include <Wire.h>
#include <RTClib.h>
#include <EEPROM.h>

Then:

Sd2Card card;
SdVolume volume;
SdFile root;
SdFile file;

The program compiles and loads fine and hangs somewhere in this:

PgmPrintln("Program Starting");

if (!card.init(SPI_HALF_SPEED)) error("card.init failed");
Serial.print("card initialized \n");
hilo( 1 , beepPin, 750); // celebrate a good start
if (!volume.init(&card)) error("volume.init failed");
Serial.print("volume initialized \n");
hilo( 1 , beepPin, 750); // celebrate a good start
if (!root.openRoot(&volume)) error("openRoot failed");
Serial.print("Root directory opened \n");
hilo( 1 , beepPin, 750); // celebrate a good start

At this point there has been no activity in any of the buffers. EEPROM is used after a few more lines of code.

This all compiles to 20 K of code. When run from 19 the program reports 60 bytes of remaining RAM.

Can someone see that I have missed something important and obvious about migrating from one version to the other?

It would be inviting to keep using 19 and not solve the problem, but the new boards are UNOs.

Thanks in advance.

John C
jcarroll
 
Posts: 11
Joined: Tue Oct 12, 2010 10:02 pm

Re: problem moving from 19 to 21

by franklin97355 on Sat Nov 20, 2010 8:06 pm

When it compiles in 21 how much ram is remaining? If you included the code others could try it out.

franklin97355
 
Posts: 21488
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: problem moving from 19 to 21

by jcarroll on Sat Nov 20, 2010 8:43 pm

Now that I check, if this is included, it hangs on:

Serial.print("Remaing Ram = ");
Serial.println(FreeRam());

right after the =

I will try the FreeRam function in some sample code.

The code will hang right away if the properly configured and wired shield is not attached.

Thanks,

JC
jcarroll
 
Posts: 11
Joined: Tue Oct 12, 2010 10:02 pm

Re: problem moving from 19 to 21

by jcarroll on Sat Nov 20, 2010 8:49 pm

The freeram function works fine when stuck into some example code.

It seems like I came across a reference to a change that needs to be made in EEPROM or wire but I cannot find it again.
jcarroll
 
Posts: 11
Joined: Tue Oct 12, 2010 10:02 pm

Please be positive and constructive with your questions and comments.