1

Please help me with this library "Softwareserial". The basic sketch does not work. Please look the errors:

    C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:128:2: error: #error This version of SoftwareSerial supports only 20, 16 and 8MHz processors

 #error This version of SoftwareSerial supports only 20, 16 and 8MHz processors

  ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'bool SoftwareSerial::listen()':

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:184:23: error: 'SREG' was not declared in this scope

     uint8_t oldSREG = SREG;

                       ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:185:9: error: 'cli' was not declared in this scope

     cli();

         ^

In file included from C:\Users\Vladyslav\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.0.9\cores\arduino/delay.h:27:0,

                 from C:\Users\Vladyslav\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.0.9\cores\arduino/Arduino.h:76,

                 from C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:43:

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::setTX(uint8_t)':

C:\Users\Vladyslav\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.0.9\variants\arduino_zero/variant.h:62:82: error: invalid conversion from 'PortGroup*' to 'uint8_t {aka unsigned char}' [-fpermissive]

 #define digitalPinToPort(P)        ( &(PORT->Group[g_APinDescription[P].ulPort]) )

                                                                                  ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:360:18: note: in expansion of macro 'digitalPinToPort'

   uint8_t port = digitalPinToPort(tx);

                  ^

C:\Users\Vladyslav\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.0.9\variants\arduino_zero/variant.h:65:44: error: base operand of '->' is not a pointer

 #define portOutputRegister(port)   ( &(port->OUT.reg) )

                                            ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:361:27: note: in expansion of macro 'portOutputRegister'

   _transmitPortRegister = portOutputRegister(port);

                           ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::setRX(uint8_t)':

C:\Users\Vladyslav\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.0.9\variants\arduino_zero/variant.h:62:82: error: invalid conversion from 'PortGroup*' to 'uint8_t {aka unsigned char}' [-fpermissive]

 #define digitalPinToPort(P)        ( &(PORT->Group[g_APinDescription[P].ulPort]) )

                                                                                  ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:371:18: note: in expansion of macro 'digitalPinToPort'

   uint8_t port = digitalPinToPort(rx);

                  ^

C:\Users\Vladyslav\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.0.9\variants\arduino_zero/variant.h:66:44: error: base operand of '->' is not a pointer

 #define portInputRegister(port)    ( &(port->IN.reg) )

                                            ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:372:26: note: in expansion of macro 'portInputRegister'

   _receivePortRegister = portInputRegister(port);

                          ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)':

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:383:31: error: 'table' was not declared in this scope

   for (unsigned i=0; i<sizeof(table)/sizeof(table[0]); ++i)

                               ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:399:38: error: 'digitalPinToPCICR' was not declared in this scope

     if (digitalPinToPCICR(_receivePin))

                                      ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:401:78: error: 'digitalPinToPCICRbit' was not declared in this scope

       *digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));

                                                                              ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:401:79: error: '_BV' was not declared in this scope

       *digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));

                                                                               ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:402:37: error: 'digitalPinToPCMSK' was not declared in this scope

       *digitalPinToPCMSK(_receivePin) |= _BV(digitalPinToPCMSKbit(_receivePin));

                                     ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:402:78: error: 'digitalPinToPCMSKbit' was not declared in this scope

       *digitalPinToPCMSK(_receivePin) |= _BV(digitalPinToPCMSKbit(_receivePin));

                                                                              ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::end()':

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:417:36: error: 'digitalPinToPCMSK' was not declared in this scope

   if (digitalPinToPCMSK(_receivePin))

                                    ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:418:77: error: 'digitalPinToPCMSKbit' was not declared in this scope

     *digitalPinToPCMSK(_receivePin) &= ~_BV(digitalPinToPCMSKbit(_receivePin));

                                                                             ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:418:78: error: '_BV' was not declared in this scope

     *digitalPinToPCMSK(_receivePin) &= ~_BV(digitalPinToPCMSKbit(_receivePin));

                                                                              ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'virtual size_t SoftwareSerial::write(uint8_t)':

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:453:21: error: 'SREG' was not declared in this scope

   uint8_t oldSREG = SREG;

                     ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:454:7: error: 'cli' was not declared in this scope

   cli();  // turn off interrupts for a clean txmit

       ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:458:26: error: 'XMIT_START_ADJUSTMENT' was not declared in this scope

   tunedDelay(_tx_delay + XMIT_START_ADJUSTMENT);

                          ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'virtual void SoftwareSerial::flush()':

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:501:21: error: 'SREG' was not declared in this scope

   uint8_t oldSREG = SREG;

                     ^

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:502:7: error: 'cli' was not declared in this scope

   cli();

       ^
PLEASE HELP ME!
  • 1
    Welcome. This is a Q&A system and not a dump and answer forum. Also if you provide more info and about the board used and also bother formatting the code. The answer will be as simple as you have probably tried to use the library with a board that is no compatible. – RSM Jun 28 '16 at 16:54
  • This is impossible to answer without your code, and without knowing what board you are compiling for. Please read How do I ask a good question?. – Nick Gammon Jun 30 '16 at 9:13
1

You're trying to use the AVR SoftwareSerial library with an ARM based board. It won't work. Ever.

There should be no need to use SoftwareSerial - the SAMD chips have multiple UART channels - just use one of those.

  • Thanks, I understand what you mean. BTW one more question. What about Bluetooth which connecting to Arduino board. I have this line in my code: SoftwareSerial bluetooth(1,0); In this case, i use the softwareserial library, how then to be? – user23441 Jun 28 '16 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.