Sparkfun LTE Shield troubles
Posted: Tue Jun 16, 2020 9:16 pm
I'm planning to use the Sparkfun LTE Shield on a Nucleo 64 board (Nucleo F401RE). I've installed the Sparkfun library and I am attempting to compile their SMS_Send example. This compiles fine for an Arduino Uno. When I try to compile for the Nucleo board, I'm getting an undefined reference during the linker stage. The Sparkfun library .cpp file seemed to compile OK and an object file was created. See code snippets below. I suspect the pointer to the SoftwareSerial definition is the problem, but I don't know how to work around it. I'm hoping someone might have some similar experience and can provide guidance or can tell me if this is a problem with SoftwareSerial.
Thanks, Max
This is the error message:
The relevant sample sketch section:
And the definition of the begin function in the library .cpp file:
Thanks, Max
This is the error message:
Code: Select all
01_SMS_Send.ino.cpp:(.text.setup+0x16): undefined reference to `LTE_Shield::begin(SoftwareSerial&, unsigned long)'
collect2.exe: error: ld returned 1 exit status
Using library SparkFun_LTE_Shield_Arduino_Library at version 1.2.0 in folder: E:\Affinity\Water Device\libraries\SparkFun_LTE_Shield_Arduino_Library
Using library SoftwareSerial at version 1.0 in folder: E:\Documents\ArduinoData\packages\STM32\hardware\stm32\1.9.0\libraries\SoftwareSerial
Using library SrcWrapper at version 1.0.1 in folder: E:\Documents\ArduinoData\packages\STM32\hardware\stm32\1.9.0\libraries\SrcWrapper
exit status 1
Error compiling for board Nucleo-64.
Code: Select all
#define LTE_SHIELD_SOFTWARE_SERIAL_ENABLED
//Click here to get the library: http://librarymanager/All#SparkFun_LTE_Shield_Arduino_Library
#include <SparkFun_LTE_Shield_Arduino_Library.h>
// Create a SoftwareSerial object to pass to the LTE_Shield library
SoftwareSerial lteSerial(8, 9);
// Create a LTE_Shield object to use throughout the sketch
LTE_Shield lte;
// Set the cell phone number to be texted
String DESTINATION_NUMBER = "11234567890";
void setup() {
Serial.begin(9600);
if ( lte.begin(lteSerial, 9600) ) {
Serial.println(F("LTE Shield connected!"));
}
Serial.println(F("Type a message. Send a Newline (\\n) to send it..."));
}
Code: Select all
#ifdef LTE_SHIELD_SOFTWARE_SERIAL_ENABLED
boolean LTE_Shield::begin(SoftwareSerial &softSerial, unsigned long baud)
{
LTE_Shield_error_t err;
_softSerial = &softSerial;
err = init(baud);
if (err == LTE_SHIELD_ERROR_SUCCESS)
{
return true;
}
return false;
}
#endif