FastSerial incompatability with SD Library

I have a ladyada GPS logger, with a Mediatek GPS from DIY Drones.

I updated my code for the GPS to run at 10 Hz, using the DIY Drones binary code, which works great.

When I added the SD card logging code back in , a compile errors are however generated unless the SD library and calls to the same were commented out. I compiled using the "relaxed" V22 Arduino IDE.

Looks like the FastSerial library is incompatible with the SD library.

I have extracted the setup code that checks for a an initialised SD card and opens a new file on the same. (Plus the code below which is used to write to the log file, which should be OK)

Can anyone assist with replacement code that will work with FastSerial - perhaps using Dataflash??

Thanks in anticipation

;

//#include <SD.h>  //***************FIX PROBLEM HERE***********************

#include <Wire.h>

#include <FastSerial.h>

/* 

  // see if the card is present and can be initialized:

  if (!SD.begin(chipSelect)) {

    Serial.println("Card init. failed!");

    error(1);

  }

   strcpy(buffer, "GPSLOG00.TXT");

  for (i = 0; i < 100; i++) {

    buffer[6] = '0' + i/10;

    buffer[7] = '0' + i%10;

    // create if does not exist, do not open existing, write, sync after write

    if (! SD.exists(buffer)) {

      break;

    }

  }

 logfile = SD.open(buffer, FILE_WRITE);

  if( ! logfile ) {

    Serial.print("Couldnt create "); Serial.println(buffer);

    error(3);

  }

  Serial.print("Writing to "); Serial.println(buffer);

 

 

 

 

**********Write to Log File*******************

// rad. lets log it!

      Serial.print(buffer);

      Serial.print('#', BYTE);

      digitalWrite(led2Pin, HIGH);      // sets the digital pin as output

       bufferidx++;

       logfile.write((uint8_t *) buffer, bufferidx);

       logfile.flush();

       if( != bufferidx) {

        putstring_nl("can't write!");

        error(4);

      }

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • I'm having the same problem and would like to know if you could fix it.

    Thanks a lot.

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @chr1sa: Hey, @a1k0n's amazing "localize by the ceiling lights" @diyrobocars made @hackaday! It's consistently been the fastest in our…
Monday
DIY Robocars via Twitter
RT @IMS: It’s only fitting that @BostonDynamics Spot is waving the green flag for today’s @IndyAChallenge! Watch LIVE 👉 https://t.co/NtKnO…
Sunday
DIY Robocars via Twitter
RT @IndyAChallenge: Congratulations to @TU_Muenchen the winners of the historic @IndyAChallenge and $1M. The first autonomous racecar comp…
Sunday
DIY Robocars via Twitter
RT @JoeSpeeds: 🏎@TU_Muenchen #ROS 2 @EclipseCyclone #DDS #Zenoh 137mph. Saturday 10am EDT @IndyAChallenge @Twitch http://indyautonomouschallenge.com/stream
Sunday
DIY Robocars via Twitter
RT @DAVGtech: Another incident: https://t.co/G1pTxQug6B
Sunday
DIY Robocars via Twitter
RT @DAVGtech: What a great way to connect why @diyrobocars community is so valuable and important! Have to start somewhere @IndyAChallenge…
Sunday
DIY Robocars via Twitter
RT @DAVGtech: https://t.co/GwkbSBjdGa
Saturday
DIY Robocars via Twitter
RT @DAVGtech: Good morning from @IndyAChallenge at @IMS. It was a late night, but worth it. Come see for yourself how the pass ended and ch…
Saturday
DIY Robocars via Twitter
RT @circuitlaunch: Robot fun this Saturday (23) at Circuit Launch! From 10am to 4pm. Lots of robots, autonomous car racing training, tech t…
Oct 22
DIY Robocars via Twitter
RT @chr1sa: 10 of these autonomous racecars will be competing tomorrow at the Indianapolis raceway
Oct 22
DIY Robocars via Twitter
RT @a1k0n: Sync'd @joshu's GoPro w/ my datalogging; video is 2.5X speed, Google imagery upper-right. Found out my track boundaries are WAY…
Oct 18
DIY Robocars via Twitter
RT @a1k0n: Also, at 45mph, the front tires literally blow up like a balloon and it doesn't have much front traction, so the car becomes fai…
Oct 18
DIY Robocars via Twitter
RT @a1k0n: Okay, some datalogs! Green dots are precalculated racing line (from my crummy optimizer -- it veers to the middle after 2 for Re…
Oct 18
DIY Robocars via Twitter
RT @a1k0n: Welp my @selfracingcars entry, hastily conceived heading filter and all, actually worked! Heading home, datalogs and videos to f…
Oct 18
DIY Robocars via Twitter
Oct 18
DIY Robocars via Twitter
Oct 15
More…