Go Down

Topic: ERROR IN USING NEXTION 3,5" SCREEN WITH ARDUINO DUE  (Read 1 time) previous topic - next topic

hasanturgut


Hello there,
I have a program that I run with mega. I can't run this program with DUE. When I load the Nextion screen library it gives an error in compilation. what is the solution to this.

error message;

Arduino:1.8.12 (Windows 10), Kart:"Arduino Due (Programming Port)"
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:285: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:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp: In member function 'bool SoftwareSerial::listen()':
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:341:23: error: 'SREG' was not declared in this scope
     uint8_t oldSREG = SREG;
                       ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:342:9: error: 'cli' was not declared in this scope
     cli();
         ^
In file included from C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:201:0,
                 from C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:43:

C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp: In member function 'void SoftwareSerial::setTX(uint8_t)':
C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\variants\arduino_due_x/variant.h:63:65: error: invalid conversion from 'Pio*' to 'uint8_t {aka unsigned char}' [-fpermissive]
 #define digitalPinToPort(P)        ( g_APinDescription[P].pPort )
                                                                 ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:517:18: note: in expansion of macro 'digitalPinToPort'
   uint8_t port = digitalPinToPort(tx);
                  ^
C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\variants\arduino_due_x/variant.h:66:44: error: base operand of '->' is not a pointer
 #define portOutputRegister(port)   ( &(port->PIO_ODSR) )
                                            ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:518:27: note: in expansion of macro 'portOutputRegister'
   _transmitPortRegister = portOutputRegister(port);
                           ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp: In member function 'void SoftwareSerial::setRX(uint8_t)':

C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\variants\arduino_due_x/variant.h:63:65: error: invalid conversion from 'Pio*' to 'uint8_t {aka unsigned char}' [-fpermissive]
 #define digitalPinToPort(P)        ( g_APinDescription[P].pPort )
                                                                 ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:528:18: note: in expansion of macro 'digitalPinToPort'
   uint8_t port = digitalPinToPort(rx);
                  ^
C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\variants\arduino_due_x/variant.h:67:44: error: base operand of '->' is not a pointer
 #define portInputRegister(port)    ( &(port->PIO_PDSR) )
                                            ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:529:26: note: in expansion of macro 'portInputRegister'
   _receivePortRegister = portInputRegister(port);
                          ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)':

C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:540:31: error: 'table' was not declared in this scope
   for (unsigned i=0; i<sizeof(table)/sizeof(table[0]); ++i)
                              ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:556:38: error: 'digitalPinToPCICR' was not declared in this scope
     if (digitalPinToPCICR(_receivePin))
                                      ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:558:78: error: 'digitalPinToPCICRbit' was not declared in this scope
       *digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
                                                                              ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:558:79: error: '_BV' was not declared in this scope
       *digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
                                                                               ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:559:37: error: 'digitalPinToPCMSK' was not declared in this scope
       *digitalPinToPCMSK(_receivePin) |= _BV(digitalPinToPCMSKbit(_receivePin));
                                     ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:559:78: error: 'digitalPinToPCMSKbit' was not declared in this scope
       *digitalPinToPCMSK(_receivePin) |= _BV(digitalPinToPCMSKbit(_receivePin));
                                                                              ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp: In member function 'void SoftwareSerial::end()':
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:574:36: error: 'digitalPinToPCMSK' was not declared in this scope
   if (digitalPinToPCMSK(_receivePin))
                                    ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:575:77: error: 'digitalPinToPCMSKbit' was not declared in this scope
     *digitalPinToPCMSK(_receivePin) &= ~_BV(digitalPinToPCMSKbit(_receivePin));
                                                                             ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:575:78: error: '_BV' was not declared in this scope
     *digitalPinToPCMSK(_receivePin) &= ~_BV(digitalPinToPCMSKbit(_receivePin));
                                                                              ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp: In member function 'virtual size_t SoftwareSerial::write(uint8_t)':
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:610:21: error: 'SREG' was not declared in this scope

   uint8_t oldSREG = SREG;
                     ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:611:7: error: 'cli' was not declared in this scope
   cli();  // turn off interrupts for a clean txmit
       ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:615:26: error: 'XMIT_START_ADJUSTMENT' was not declared in this scope
   tunedDelay(_tx_delay + XMIT_START_ADJUSTMENT);
                          ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp: In member function 'virtual void SoftwareSerial::flush()':

C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:658:21: error: 'SREG' was not declared in this scope

   uint8_t oldSREG = SREG;
                     ^
C:\Users\User\Documents\Arduino\libraries\SoftwareSerial-master\SoftwareSerial.cpp:659:7: error: 'cli' was not declared in this scope
   cli();
       ^
exit status 1
Arduino Due (Programming Port) kartı için derleme hatası.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

msneijders

#error This version of SoftwareSerial supports only 20, 16 and 8MHz processors....
you are trying to use a library that is for 8 bit Atmel's only... on a due,  you are running a 32 bit, 84mHz cpu.
this library is not going to help you.

fortunately the due has quite a few hardware serial ports...
try connecting the Nextion screen to one of these, eg Serial1... and then use this port.

Go Up