0

Compilation issues with Feather nRF52
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Compilation issues with Feather nRF52

by nraymond on Mon Jul 30, 2018 1:17 am

Hi there,

I also ran into this issue when trying to compile with the nrf52. The example sketch compiles for the UNO just fine. Did you find a solution or quick fix?

Code: Select all | TOGGLE FULL SIZE
no matching function for call to 'Adafruit_GPS::Adafruit_GPS(SoftwareSerial*)'


Thanks-

nraymond
 
Posts: 12
Joined: Sat Jun 01, 2013 1:13 am

Re: Compilation issues with Feather nRF52

by kllassen on Mon Jul 30, 2018 8:06 am

No fix yet. My project is currently shelved. I worked through a few other issues with this board+GPS with help from support, but there was no answer to this issue.

Please post if you find a fix.

kllassen
 
Posts: 14
Joined: Fri Oct 07, 2016 10:27 pm

Re: Compilation issues with Feather nRF52

by hathach on Wed Aug 01, 2018 12:13 am

Hi, the issue is with the Adafruit_GPS.h header

https://github.com/adafruit/Adafruit_GP ... ruit_GPS.h

It use defined(__AVR__) to check and inlcude the SoftwareSerial.h which is not true since nrf52 is an ARM.
A quick hack to by pass this for now is to modify the header in your library and add

#define __AVR__

right at line 26 here https://github.com/adafruit/Adafruit_GP ... _GPS.h#L26

The library is targeted avr, it may have other run-time issue by some other assumption. Please let's us know if it works for you or not. I will try to contact the library maintainer for other mcu support.

hathach
 
Posts: 969
Joined: Tue Apr 23, 2013 1:02 am

Re: Compilation issues with Feather nRF52

by nraymond on Wed Aug 01, 2018 3:14 pm

Hi hathach,

Yep, adding #define __AVR__ to line #26 in the GPS header file did the trick. The parsing example still had a hangup with the interrupts, but I was able to get the following code working just fine for my application by pulling the gps from within the void loop:

Code: Select all | TOGGLE FULL SIZE
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver and Software Serial
//
#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>

SoftwareSerial mySerial(15, 16);
Adafruit_GPS GPS(&mySerial);

// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
// Set to 'true' if you want to debug and listen to the raw GPS sentences.
#define GPSECHO  false

void setup() 
{
   
  // connect at 115200 so we can read the GPS fast enough and echo without dropping chars
  // also spit it out
  Serial.begin(115200);
  Serial.println("Adafruit GPS library basic test!");

  // 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
  GPS.begin(9600);
 
  // uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude
  //GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  // uncomment this line to turn on only the "minimum recommended" data
  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);
  // For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since
  // the parser doesn't care about other sentences at this time
 
  // Set the update rate
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);   // 1 Hz update rate
  // For the parsing code to work nicely and have time to sort thru the data, and
  // print it out we don't suggest using anything higher than 1 Hz

  // Request updates on antenna status, comment out to keep quiet
  GPS.sendCommand(PGCMD_ANTENNA);

  // the nice thing about this code is you can have a timer0 interrupt go off
  // every 1 millisecond, and read data from the GPS for you. that makes the
  // loop code a heck of a lot easier!
  //useInterrupt(true);

  delay(1000);
  // Ask for firmware version
  mySerial.println(PMTK_Q_RELEASE);
}


uint32_t timer = millis();

void loop()                     // run over and over again
{
  // in case you are not using the interrupt above, you'll
  // need to 'hand query' the GPS, not suggested :(
  if (true) {
    // read data from the GPS in the 'main loop'
    char c = GPS.read();
    // if you want to debug, this is a good time to do it!
    if (GPSECHO)
      if (c) Serial.print(c);
  }
 
  // if a sentence is received, we can check the checksum, parse it...
  if (GPS.newNMEAreceived()) {
    // a tricky thing here is if we print the NMEA sentence, or data
    // we end up not listening and catching other sentences!
    // so be very wary if using OUTPUT_ALLDATA and trytng to print out data
    //Serial.println(GPS.lastNMEA());   // this also sets the newNMEAreceived() flag to false
 
    if (!GPS.parse(GPS.lastNMEA()))   // this also sets the newNMEAreceived() flag to false
      return;  // we can fail to parse a sentence in which case we should just wait for another
  }

  // if millis() or timer wraps around, we'll just reset it
  if (timer > millis())  timer = millis();

  // approximately every 2 seconds or so, print out the current stats
  if (millis() - timer > 2000) {
    timer = millis(); // reset the timer
   
    Serial.print("\nTime: ");
    Serial.print(GPS.hour, DEC); Serial.print(':');
    Serial.print(GPS.minute, DEC); Serial.print(':');
    Serial.print(GPS.seconds, DEC); Serial.print('.');
    Serial.println(GPS.milliseconds);
    Serial.print("Date: ");
    Serial.print(GPS.day, DEC); Serial.print('/');
    Serial.print(GPS.month, DEC); Serial.print("/20");
    Serial.println(GPS.year, DEC);
    Serial.print("Fix: "); Serial.print((int)GPS.fix);
    Serial.print(" quality: "); Serial.println((int)GPS.fixquality);
    if (GPS.fix) {
      Serial.print("Location: ");
      Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);
      Serial.print(", ");
      Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);
      Serial.print("Location (in degrees, works with Google Maps): ");
      Serial.print(GPS.latitudeDegrees, 4);
      Serial.print(", ");
      Serial.println(GPS.longitudeDegrees, 4);
     
      Serial.print("Speed (knots): "); Serial.println(GPS.speed);
      Serial.print("Angle: "); Serial.println(GPS.angle);
      Serial.print("Altitude: "); Serial.println(GPS.altitude);
      Serial.print("Satellites: "); Serial.println((int)GPS.satellites);
    }
  }
}


=========

for reference, here is the error message when trying to run the parsing example WITH the modified header file:

Code: Select all | TOGGLE FULL SIZE
parsing:92: error: expected constructor, destructor, or type conversion before '(' token
 SIGNAL(TIMER0_COMPA_vect) {
        ^
parsing:92: error: expected constructor, destructor, or type conversion before '(' token
 SIGNAL(TIMER0_COMPA_vect) {
       ^
/Users/nickraymond/Documents/Arduino/libraries/Adafruit_GPS/examples/parsing/parsing.pde: In function 'void useInterrupt(boolean)':
parsing:107: error: 'OCR0A' was not declared in this scope
     OCR0A = 0xAF;
     ^
parsing:108: error: 'TIMSK0' was not declared in this scope
     TIMSK0 |= _BV(OCIE0A);
     ^
parsing:108: error: 'OCIE0A' was not declared in this scope
     TIMSK0 |= _BV(OCIE0A);
                   ^
parsing:108: error: '_BV' was not declared in this scope
     TIMSK0 |= _BV(OCIE0A);
                         ^
parsing:112: error: 'TIMSK0' was not declared in this scope
     TIMSK0 &= ~_BV(OCIE0A);
     ^
parsing:112: error: 'OCIE0A' was not declared in this scope
     TIMSK0 &= ~_BV(OCIE0A);
                    ^
parsing:112: error: '_BV' was not declared in this scope
     TIMSK0 &= ~_BV(OCIE0A);
                          ^





Thanks for the quick reply.

nraymond
 
Posts: 12
Joined: Sat Jun 01, 2013 1:13 am

Re: Compilation issues with Feather nRF52

by adafruit2 on Mon Aug 13, 2018 11:37 pm

oof you can't use softwareserial on nrf52, i dont think we support it :/ sorry!

adafruit2
Site Admin
 
Posts: 18327
Joined: Fri Mar 11, 2005 7:36 pm

Please be positive and constructive with your questions and comments.


cron