Hi, I’m using XIAO nRF52840 — pinout ; with the following platformi.ini config:
[env]
framework = arduino
platform = nordicnrf52
[env:xiaoble_arduinocore_mbed]
platform = https://github.com/maxgerhardt/platform-nordicnrf52
board = xiaoble
lib_deps =
adafruit/Adafruit GFX Library@^1.11.9
adafruit/Adafruit LED Backpack Library@^1.5.0
adafruit/Adafruit BusIO@^1.15.0
featherfly/SoftwareSerial@^1.0
Only including the library results in the compile error as seen below:
#include <Arduino.h>
#include <Wire.h>
#include <SPI.h>
#include <SoftwareSerial.h>
void setup() {
// code
}
void loop() {
// code
}
Compilation errors:
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\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
^~~~~
Compiling .pio\build\xiaoble_arduinocore_mbed\FrameworkArduino\USB\USBCDC.cpp.o
Compiling .pio\build\xiaoble_arduinocore_mbed\FrameworkArduino\USB\USBSerial.cpp.o
Compiling .pio\build\xiaoble_arduinocore_mbed\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\xiaoble_arduinocore_mbed\FrameworkArduino\abi.cpp.o
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp: In member function 'bool SoftwareSerial::listen()':
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:341:23: error: 'SREG' was not declared in this scope
uint8_t oldSREG = SREG;
^~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:341:23: note: suggested alternative: 'SING'
uint8_t oldSREG = SREG;
^~~~
SING
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:342:5: error: 'cli' was not declared in this scope
cli();
^~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::setTX(uint8_t)':
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:516:22: error: 'digitalPinToBitMask' was not declared in this scope
_transmitBitMask = digitalPinToBitMask(tx);
^~~~~~~~~~~~~~~~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:516:22: note: suggested alternative: 'digitalPinToPinName'
_transmitBitMask = digitalPinToBitMask(tx);
^~~~~~~~~~~~~~~~~~~
digitalPinToPinName
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:518:27: error: 'portOutputRegister' was not declared in this scope
_transmitPortRegister = portOutputRegister(port);
^~~~~~~~~~~~~~~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:518:27: note: suggested alternative: '_transmitPortRegister'
_transmitPortRegister = portOutputRegister(port);
^~~~~~~~~~~~~~~~~~
_transmitPortRegister
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::setRX(uint8_t)':
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:527:21: error: 'digitalPinToBitMask' was not declared in this scope
_receiveBitMask = digitalPinToBitMask(rx);
^~~~~~~~~~~~~~~~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:527:21: note: suggested alternative: 'digitalPinToPinName'
_receiveBitMask = digitalPinToBitMask(rx);
^~~~~~~~~~~~~~~~~~~
digitalPinToPinName
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:529:26: error: 'portInputRegister' was not declared in this scope
_receivePortRegister = portInputRegister(port);
^~~~~~~~~~~~~~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)':
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:540:31: error: 'table' was not declared in this scope
for (unsigned i=0; i<sizeof(table)/sizeof(table[0]); ++i)
^~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:540:31: note: suggested alternative: 'tanl'
for (unsigned i=0; i<sizeof(table)/sizeof(table[0]); ++i)
^~~~~
tanl
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:556:9: error: 'digitalPinToPCICR' was not declared in this scope
if (digitalPinToPCICR(_receivePin))
^~~~~~~~~~~~~~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:556:9: note: suggested alternative: 'digitalPinToPort'
if (digitalPinToPCICR(_receivePin))
^~~~~~~~~~~~~~~~~
digitalPinToPort
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:558:46: error: 'digitalPinToPCICRbit' was not declared in this scope
*digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
^~~~~~~~~~~~~~~~~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:558:46: note: suggested alternative: 'digitalPinToPort'
*digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
^~~~~~~~~~~~~~~~~~~~
digitalPinToPort
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:558:42: error: '_BV' was not declared in this scope
*digitalPinToPCICR(_receivePin) |= _BV(digitalPinToPCICRbit(_receivePin));
^~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:559:8: error: 'digitalPinToPCMSK' was not declared in this scope
*digitalPinToPCMSK(_receivePin) |= _BV(digitalPinToPCMSKbit(_receivePin));
^~~~~~~~~~~~~~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:559:8: note: suggested alternative: 'digitalPinToPort'
*digitalPinToPCMSK(_receivePin) |= _BV(digitalPinToPCMSKbit(_receivePin));
^~~~~~~~~~~~~~~~~
digitalPinToPort
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:559:46: error: 'digitalPinToPCMSKbit' was not declared in this scope
*digitalPinToPCMSK(_receivePin) |= _BV(digitalPinToPCMSKbit(_receivePin));
^~~~~~~~~~~~~~~~~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:559:46: note: suggested alternative: 'digitalPinToPort'
*digitalPinToPCMSK(_receivePin) |= _BV(digitalPinToPCMSKbit(_receivePin));
^~~~~~~~~~~~~~~~~~~~
digitalPinToPort
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::end()':
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:574:7: error: 'digitalPinToPCMSK' was not declared in this scope
if (digitalPinToPCMSK(_receivePin))
^~~~~~~~~~~~~~~~~
Compiling .pio\build\xiaoble_arduinocore_mbed\FrameworkArduino\api\Common.cpp.o
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:574:7: note: suggested alternative: 'digitalPinToPort'
if (digitalPinToPCMSK(_receivePin))
^~~~~~~~~~~~~~~~~
digitalPinToPort
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:575:45: error: 'digitalPinToPCMSKbit' was not declared in this scope
*digitalPinToPCMSK(_receivePin) &= ~_BV(digitalPinToPCMSKbit(_receivePin));
^~~~~~~~~~~~~~~~~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:575:45: note: suggested alternative: 'digitalPinToPort'
*digitalPinToPCMSK(_receivePin) &= ~_BV(digitalPinToPCMSKbit(_receivePin));
^~~~~~~~~~~~~~~~~~~~
digitalPinToPort
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:575:41: error: '_BV' was not declared in this scope
*digitalPinToPCMSK(_receivePin) &= ~_BV(digitalPinToPCMSKbit(_receivePin));
^~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp: In member function 'virtual size_t SoftwareSerial::write(uint8_t)':
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:610:21: error: 'SREG' was not declared in this scope
uint8_t oldSREG = SREG;
^~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:610:21: note: suggested alternative: 'SING'
uint8_t oldSREG = SREG;
^~~~
SING
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:611:3: error: 'cli' was not declared in this scope
cli(); // turn off interrupts for a clean txmit
^~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:615:26: error: 'XMIT_START_ADJUSTMENT' was not declared in this scope
tunedDelay(_tx_delay + XMIT_START_ADJUSTMENT);
^~~~~~~~~~~~~~~~~~~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp: In member function 'virtual void SoftwareSerial::flush()':
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:658:21: error: 'SREG' was not declared in this scope
uint8_t oldSREG = SREG;
^~~~
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:658:21: note: suggested alternative: 'SING'
uint8_t oldSREG = SREG;
^~~~
SING
.pio\libdeps\xiaoble_arduinocore_mbed\SoftwareSerial\SoftwareSerial.cpp:659:3: error: 'cli' was not declared in this scope
cli();
^~~
Compiling .pio\build\xiaoble_arduinocore_mbed\FrameworkArduino\api\IPAddress.cpp.o
*** [.pio\build\xiaoble_arduinocore_mbed\libee8\SoftwareSerial\SoftwareSerial.cpp.o] Error 1
There are HW TX+RX ports, however these require to set the device into undesireable modes (for my usecase)
I’m just wondering whether somebody encountered this issue (and solved it) as I’ve browsed nearly half of the internet and tried nearly every “alternative” under the sun. I’ve tried porting the library for my board, however I’m starting out with embedded and was unable to complete it with my current knowledge (and I don’t have enough time for porting it rn).
Any help would be appreciated!