This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Error in Energia while using SoftwareSerial.h file

Other Parts Discussed in Thread: ENERGIA

I have following program with file name Bluetooth_try in energia which is to communicate bluetooth module HC-06:

// #include <SoftwareSerial.h>  // I have tryed this also

#include <E:\setup\energia-0101E0016-windows\energia-0101E0016\hardware\msp430\libraries\SoftwareSerial\SoftwareSerial.h>

SoftwareSerial myserial(3,4); 

// connect BT module TX to 3

// connect BT module RX to 4

// connect BT Vcc to 5V, GND to GND

void setup()  

{

  // set digital pin to control as an output

 pinMode(13, OUTPUT);

 Serial.begin(9600);

  // set the data rate for the SoftwareSerial port

  myserial.begin(9600);

}

char a; // 

void loop() 

{

  if (myserial.available())

   {

    a=(myserial.read());

    if (a=='1')

    {

      digitalWrite(13, HIGH);

      myserial.println("LED on");

    }

    else if (a=='2')

    {

      digitalWrite(13, LOW);

     }

    else

    {

      myserial.println("Send '1' to turn LED on");

      myserial.println("Send '2' to turn LED on");

    }   

    }

}

and during compilation, it gives the following errors:

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-g++, -c, -Os, -w, -fno-rtti, -fno-exceptions, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=17, -IG:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\lm4f\cores\lm4f, -IG:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\lm4f\variants\stellarpad, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\Bluetooth_try.cpp, -o, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\Bluetooth_try.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\dtostrf.c.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\itoa.c.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\random.c.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\startup_gcc.c.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\WInterrupts.c.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\wiring.c.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\wiring_analog.c.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\wiring_digital.c.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\wiring_pulse.c.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\wiring_shift.c.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\HardwareSerial.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\IPAddress.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\MACAddress.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\main.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\new.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\Print.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\Stream.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\Tone.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\WMath.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-ar, rcs, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\WString.cpp.o]

[G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\tools\lm4f\bin\arm-none-eabi-g++, -Os, -nostartfiles, -nostdlib, -Wl,--gc-sections, -T, G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\lm4f\cores\lm4f\lm4fcpp_blizzard.ld, -Wl,--entry=ResetISR, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -o, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\Bluetooth_try.cpp.elf, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\Bluetooth_try.cpp.o, C:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp\core.a, -LC:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp, G:\Softwares\energia-0101E0017-windows\energia-0101E0017\hardware\lm4f\cores\lm4f\driverlib\libdriverlib.a, -lm, -lc, -lgcc, -LC:\Users\DELL3020\AppData\Local\Temp\build2791634299513467255.tmp, -lm]

Bluetooth_try.cpp.o: In function `setup':

Bluetooth_try.cpp:(.text.setup+0x1e): undefined reference to `SoftwareSerial::begin(long)'

Bluetooth_try.cpp.o: In function `_GLOBAL__sub_I_myserial':

Bluetooth_try.cpp:(.text.startup._GLOBAL__sub_I_myserial+0xc): undefined reference to `SoftwareSerial::SoftwareSerial(unsigned char, unsigned char, bool)'

Bluetooth_try.cpp:(.text.startup._GLOBAL__sub_I_myserial+0x24): undefined reference to `SoftwareSerial::~SoftwareSerial()'

Bluetooth_try.cpp.o: In function `loop':

Bluetooth_try.cpp:(.text.loop+0x4): undefined reference to `SoftwareSerial::available()'

Bluetooth_try.cpp:(.text.loop+0xc): undefined reference to `SoftwareSerial::read()'

collect2.exe: error: ld returned 1 exit status

 I am going to use TIVA C Seris TM4C123G launchpad Kit

can anyone help me to deal with this problem..

//#include <SoftwareSerial.h>#include <E:\setup\energia-0101E0016-windows\energia-0101E0016\hardware\msp430\libraries\SoftwareSerial\SoftwareSerial.h>SoftwareSerial myserial(3,4); // connect BT module TX to 3// connect BT module RX to 4// connect BT Vcc to 5V, GND to GNDvoid setup()  {  // set digital pin to control as an output pinMode(13, OUTPUT); Serial.begin(9600);  // set the data rate for the SoftwareSerial port  myserial.begin(9600);}char a; // void loop() {  if (myserial.available())   {    a=(myserial.read());    if (a=='1')    {      digitalWrite(13, HIGH);      myserial.println("LED on");    }    else if (a=='2')    {      digitalWrite(13, LOW);     }    else    {      myserial.println("Send '1' to turn LED on");      myserial.println("Send '2' to turn LED on");    }       }}