0

Compilation issues with Feather nRF52
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Compilation issues with Feather nRF52

by kllassen on Sun Dec 31, 2017 3:50 pm

I'm following the "Bluefruit nRF52 Feather Learning Guide" and can't get the Blink example to compile. I keep getting fatal errors for missing .H files. I have manually copied many of them to the path called out in the error, but some I can't be found on the computer. I have installed Arduino 1.8.5 (latest) on Windows 10 and have followed the instructions (skipped step #2, third party tools as I'm using windows).

Do I have a file structure issue? Is there a best practice for files and sketch locations?

I have used Arduino IDE successfully on this computer with other hardware and didn't have these issues.

Files causing fatal crashes so far...
stdint.H - copied, fixed
stdlib.H - copied, fixed
malloc.H - copied from Github, fixed
features.H - can't find on computer... time to seek help:)

Thanks for the help!

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

Re: Compilation issues with Feather nRF52

by adafruit_support_mike on Mon Jan 01, 2018 2:53 am

What code are you trying to compile? I don't know of any standard header named 'features.h'

adafruit_support_mike
 
Posts: 51988
Joined: Thu Feb 11, 2010 2:51 pm

Re: Compilation issues with Feather nRF52

by kllassen on Mon Jan 01, 2018 1:07 pm

I'm trying to compile the "blink" test code just to establish a working toolchain. Here is the code I'm trying to use...

https://www.arduino.cc/en/Tutorial/Blin ... lock&num=1

/*
Blink

Turns an LED on for one second, then off for one second, repeatedly.

Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products

modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/Blink
*/

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

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

Re: Compilation issues with Feather nRF52

by adafruit_support_mike on Tue Jan 02, 2018 3:21 am

I just compiled that for an nRF52 without any problems.

Try deleting your Arduino15 folder and reinstalling the nRF52 board support package from scratch. Errors like that often trace back to old files that should have been deleted during a version upgrade, but weren't.

adafruit_support_mike
 
Posts: 51988
Joined: Thu Feb 11, 2010 2:51 pm

Re: Compilation issues with Feather nRF52

by kllassen on Wed Jan 03, 2018 11:21 pm

It Worked! I can now compile and upload the test code.

One possible issue, I can't send new code while the GPS Feather Wing is mounted. I need to dismount the GPS Wing to program. Do you expect this?

PS. I'm using the Feather Double to mound the Feather Board and GPS Wing.

Thanks.

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

Re: Compilation issues with Feather nRF52

by adafruit_support_mike on Thu Jan 04, 2018 6:01 am

That's a hardware limitation.

The nRF52 uses an external USB-to-Serial converter to talk to the computer, just like the Arduino Uno. The TX/RX pins are connected to the Serial side of the converter, so you can't talk to the computer and another Serial device at the same time.

adafruit_support_mike
 
Posts: 51988
Joined: Thu Feb 11, 2010 2:51 pm

Re: Compilation issues with Feather nRF52

by kllassen on Thu Jan 04, 2018 7:51 am

Thanks. So the GPS wing is compatible with nRF52, I just can't use USB (program, serial monitor, download GPS logged data, etc) while the wing is attached.

Can I move the GPS to different pins to resolve? Will I be able to perform the USB functions listed above via Bluetooth?

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

Re: Compilation issues with Feather nRF52

by adafruit_support_mike on Fri Jan 05, 2018 3:50 am

kllassen wrote:Thanks. So the GPS wing is compatible with nRF52, I just can't use USB (program, serial monitor, download GPS logged data, etc) while the wing is attached.

That's correct.

kllassen wrote:Can I move the GPS to different pins to resolve?

That will work. The GPS FeatherWing has solder jumpers on the underside that you can cut to disconnect the signals from the Feather's TX/RX pins, and a set of TX/RX holes at the end that you can connect to other GPIO pins.

The nRF52's SoftwareSerial library should be able to make a connection on any pair of GPIO pins you choose.

kllassen wrote:Will I be able to perform the USB functions listed above via Bluetooth?

No. BLE and Bluetooth different and incompatible protocols that happen to be managed by the same working group, and the working group seems to love to come up with confusingly-similar names.

The BLE interface can't upload firmware or make a connection to the Arduino IDE's Serial Monitor.

adafruit_support_mike
 
Posts: 51988
Joined: Thu Feb 11, 2010 2:51 pm

Re: Compilation issues with Feather nRF52

by kllassen on Sat Jan 06, 2018 12:15 pm

Can you recommend another pin set for TX/RX? I am also using a FeatherWing OLED 128x32 stacked on the FeatherBoard. I don't know what pins will create a conflict.

Can you recommend any "Example" or sample code I can try to using SoftwareSerial and GPS parsing?


Thanks again for all the help.

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

Re: Compilation issues with Feather nRF52

by adafruit_support_mike on Sun Jan 07, 2018 3:18 am

The OLED FeatherWing uses the SDA and SCL pins, so any of the other GPIO pins between those and the USB pin will be free.

There's really nothing beyond that to put in a tutorial. The relevant line of code is:

Code: Select all | TOGGLE FULL SIZE
SoftwareSerial mySerial( RXpin, TXpin );

adafruit_support_mike
 
Posts: 51988
Joined: Thu Feb 11, 2010 2:51 pm

Re: Compilation issues with Feather nRF52

by kllassen on Sun Jan 21, 2018 1:20 pm

I have cut the TX/RX connections on the GPS Feather and jumped the GPS TX to Pin 7 and GPS RX to Pin 11. I am now trying to run a basic RX-TX test to see the GPS messages. I'm trying to modify the sample code from the tutorial here... https://learn.adafruit.com/adafruit-ult ... rx-tx-test

I tried to add "SoftwareSerial mySerial(7, 11);" to the setup, but I get errors. Can you help me understand how to communicate to the GPS Feather now it's RX/TX pins are moved?

Thanks.

Actual Code from tutorial...
// test a passthru between USB and hardware serial

void setup() {
Serial.println("GPS echo test");
Serial.begin(9600);
Serial1.begin(9600); // default NMEA GPS baud
}


void loop() {
if (Serial.available()) {
char c = Serial.read();
Serial1.write(c);
}
if (Serial1.available()) {
char c = Serial1.read();
Serial.write(c);
}
}

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

Re: Compilation issues with Feather nRF52

by adafruit_support_mike on Fri Jan 26, 2018 4:59 am

What error messages are you getting?

adafruit_support_mike
 
Posts: 51988
Joined: Thu Feb 11, 2010 2:51 pm

Re: Compilation issues with Feather nRF52

by kllassen on Sat Mar 17, 2018 11:36 pm

I am now able to read the GPS and watch the output on the Serial Monitor. I was missing the following in my simple test...

#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 11);

I'm now trying to run a sample parsing example and I get the following error compiling the sample code...

ERROR: no matching function for call to 'Adafruit_GPS::Adafruit_GPS(SoftwareSerial*)'

I think it may be hardware related rather than a library issue. When I choose another board it is able to compile with out this error.

Any ideas.

Thanks,
Kent

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

Re: Compilation issues with Feather nRF52

by kllassen on Mon Mar 26, 2018 11:46 am

Here is the code with the compilation error...

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <SoftwareSerial.h>

Adafruit_SSD1306 display = Adafruit_SSD1306();

#define BUTTON_A 31
#define BUTTON_B 30
#define BUTTON_C 27
#define LED 17

// For hardware serial 1:
// GPS TX to nRF52 RX pin 7
// GPS RX to nRF52 TX pin 11
// #define mySerial Serial1

SoftwareSerial mySerial(7, 11);
Adafruit_GPS GPS(&mySerial); ERROR

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

Re: Compilation issues with Feather nRF52

by kllassen on Mon Mar 26, 2018 11:53 am

Also, here is the Parsing Example code that is providing the same error... no matching function for call to 'Adafruit_GPS::Adafruit_GPS(SoftwareSerial*)

Parsing Example:
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
//
// This code shows how to listen to the GPS module in an interrupt
// which allows the program to have more 'freedom' - just parse
// when a new NMEA sentence is available! Then access data when
// desired.
//
// Tested and works great with the Adafruit Ultimate GPS module
// using MTK33x9 chipset
// ------> http://www.adafruit.com/products/746
// Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada

#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>

// If you're using a GPS module:
// Connect the GPS Power pin to 5V
// Connect the GPS Ground pin to ground
// If using software serial (sketch example default):
// Connect the GPS TX (transmit) pin to Digital 3
// Connect the GPS RX (receive) pin to Digital 2
// If using hardware serial (e.g. Arduino Mega):
// Connect the GPS TX (transmit) pin to Arduino RX1, RX2 or RX3
// Connect the GPS RX (receive) pin to matching TX1, TX2 or TX3

// If you're using the Adafruit GPS shield, change
// SoftwareSerial mySerial(3, 2); -> SoftwareSerial mySerial(8, 7);
// and make sure the switch is set to SoftSerial

// If using software serial, keep this line enabled
// (you can change the pin numbers to match your wiring):
SoftwareSerial mySerial(3, 2);

// If using hardware serial (e.g. Arduino Mega), comment out the
// above SoftwareSerial line, and enable this line instead
// (you can change the Serial number to match your wiring):

//HardwareSerial mySerial = Serial1;


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 true

// this keeps track of whether we're using the interrupt
// off by default!
boolean usingInterrupt = false;
void useInterrupt(boolean); // Func prototype keeps Arduino 0023 happy

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


// Interrupt is called once a millisecond, looks for any new GPS data, and stores it
SIGNAL(TIMER0_COMPA_vect) {
char c = GPS.read();
// if you want to debug, this is a good time to do it!
#ifdef UDR0
if (GPSECHO)
if (c) UDR0 = c;
// writing direct to UDR0 is much much faster than Serial.print
// but only one character can be written at a time.
#endif
}

void useInterrupt(boolean v) {
if (v) {
// Timer0 is already used for millis() - we'll just interrupt somewhere
// in the middle and call the "Compare A" function above
OCR0A = 0xAF;
TIMSK0 |= _BV(OCIE0A);
usingInterrupt = true;
} else {
// do not call the interrupt function COMPA anymore
TIMSK0 &= ~_BV(OCIE0A);
usingInterrupt = false;
}
}

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 (! usingInterrupt) {
// 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);
}
}
}

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

Please be positive and constructive with your questions and comments.