Go Down

Topic: [SOLVED]Problems with Nextion (Read 375 times) previous topic - next topic

jcdominguez

Dec 28, 2017, 01:31 pm Last Edit: Jan 05, 2018, 09:39 am by jcdominguez
Hi!, at first so sorry for my bad english.

Today I've tried connect my arduino MKRFOX1200 with Nextion display and I've a lot of problems when I try compile from Arduino IDE.

The idea is send data from  a DHT22 sensor to Nextion for show in the display, but Nextion's libraries use the library "SoftwareSerial.h" and when I compile I can read the following output:

ATENTION: la librería SoftwareSerial pretende ejecutarse sobre arquitectura(s) (avr) y puede ser incompatible con tu actual tarjeta la cual corre sobre arquitectura(s) (samd).

/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/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

  ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp: In member function 'bool SoftwareSerial::listen()':
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:184:23: error: 'SREG' was not declared in this scope
     uint8_t oldSREG = SREG;

                       ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:185:9: error: 'cli' was not declared in this scope
     cli();

         ^
In file included from /Users/frux/Library/Arduino15/packages/arduino/hardware/samd/1.6.17/cores/arduino/delay.h:27:0,
                 from /Users/frux/Library/Arduino15/packages/arduino/hardware/samd/1.6.17/cores/arduino/Arduino.h:81,
                 from /Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:43:
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp: In member function 'void SoftwareSerial::setTX(uint8_t)':
/Users/frux/Library/Arduino15/packages/arduino/hardware/samd/1.6.17/variants/mkrfox1200/variant.h:46:78: error: invalid conversion from 'PortGroup*' to 'uint8_t {aka unsigned char}' [-fpermissive]
 #define digitalPinToPort(P)      (&(PORT->Group[g_APinDescription[P].ulPort]))
                                                                              ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:360:18: note: in expansion of macro 'digitalPinToPort'
   uint8_t port = digitalPinToPort(tx);

                  ^
/Users/frux/Library/Arduino15/packages/arduino/hardware/samd/1.6.17/variants/mkrfox1200/variant.h:49:41: error: base operand of '->' is not a pointer
 #define portOutputRegister(port) (&(port->OUT.reg))
                                         ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:361:27: note: in expansion of macro 'portOutputRegister'
   _transmitPortRegister = portOutputRegister(port);

                           ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp: In member function 'void SoftwareSerial::setRX(uint8_t)':
/Users/frux/Library/Arduino15/packages/arduino/hardware/samd/1.6.17/variants/mkrfox1200/variant.h:46:78: error: invalid conversion from 'PortGroup*' to 'uint8_t {aka unsigned char}' [-fpermissive]
 #define digitalPinToPort(P)      (&(PORT->Group[g_APinDescription[P].ulPort]))
                                                                              ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:371:18: note: in expansion of macro 'digitalPinToPort'
   uint8_t port = digitalPinToPort(rx);

                  ^
/Users/frux/Library/Arduino15/packages/arduino/hardware/samd/1.6.17/variants/mkrfox1200/variant.h:50:41: error: base operand of '->' is not a pointer
 #define portInputRegister(port)  (&(port->IN.reg))
                                         ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:372:26: note: in expansion of macro 'portInputRegister'
   _receivePortRegister = portInputRegister(port);

                          ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)':
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:383:31: error: 'table' was not declared in this scope
   for (unsigned i=0; i<sizeof(table)/sizeof(table[0]); ++i)

                               ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:399:38: error: 'digitalPinToPCICR' was not declared in this scope
     if (digitalPinToPCICR(_receivePin))

                                      ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:401:78: error: 'digitalPinToPCICRbit' was not declared in this scope
       *digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));

                                                                              ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:401:79: error: '_BV' was not declared in this scope
       *digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));

                                                                               ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:402:37: error: 'digitalPinToPCMSK' was not declared in this scope
       *digitalPinToPCMSK(_receivePin) |= _BV(digitalPinToPCMSKbit(_receivePin));

                                     ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:402:78: error: 'digitalPinToPCMSKbit' was not declared in this scope
       *digitalPinToPCMSK(_receivePin) |= _BV(digitalPinToPCMSKbit(_receivePin));

                                                                              ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp: In member function 'void SoftwareSerial::end()':
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:417:36: error: 'digitalPinToPCMSK' was not declared in this scope
   if (digitalPinToPCMSK(_receivePin))

                                    ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:418:77: error: 'digitalPinToPCMSKbit' was not declared in this scope
     *digitalPinToPCMSK(_receivePin) &= ~_BV(digitalPinToPCMSKbit(_receivePin));

                                                                             ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:418:78: error: '_BV' was not declared in this scope
     *digitalPinToPCMSK(_receivePin) &= ~_BV(digitalPinToPCMSKbit(_receivePin));

                                                                              ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp: In member function 'virtual size_t SoftwareSerial::write(uint8_t)':
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:453:21: error: 'SREG' was not declared in this scope
   uint8_t oldSREG = SREG;

                     ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:454:7: error: 'cli' was not declared in this scope
   cli();  // turn off interrupts for a clean txmit

       ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:458:26: error: 'XMIT_START_ADJUSTMENT' was not declared in this scope
   tunedDelay(_tx_delay + XMIT_START_ADJUSTMENT);

                          ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp: In member function 'virtual void SoftwareSerial::flush()':
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:501:21: error: 'SREG' was not declared in this scope
   uint8_t oldSREG = SREG;

                     ^
/Users/frux/Documents/Arduino/libraries/SoftwareSerial/src/SoftwareSerial.cpp:502:7: error: 'cli' was not declared in this scope
   cli();

       ^
exit status 1


The problem seems to be that the SoftwareSerial library is for AVR architectures and MKRFOX1200 is SAMD, are there options with Nextion to change this?

Thank you very much!

PD: The library that I use for Nextion is Nextion-master and NeoNextion.

jcdominguez

Finally, I solved this problem using the library "ITEADLIB_Arduino_Nextion-master" and not using SoftwareSerial.  :)  :)

Go Up