Arduino Nano BLE Sense and Radiohead Library- Compatibility Issues

Hi All,

I have been trying to get my Arduino Nano 33 BLE to work with the Radiohead Library (RadioHead: RadioHead Packet Radio library for embedded microprocessors) . I am trying to get the Nano to scan for BLE Tags and LoRa to transmit data. The only issue is I run into a lot of compilation errors. It begins with

C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RHHardwareSPI.cpp: In member function 'virtual void RHHardwareSPI::begin()':
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RHHardwareSPI.cpp:133:57: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'BitOrder' [-fpermissive]
    _settings = SPISettings(frequency, bitOrder, dataMode);
                                                         ^
In file included from C:\Users\thomas\Documents\ArduinoData\packages\arduino\hardware\mbed_nano\2.2.0\libraries\SPI/SPI.h:22:0,
                 from C:\Users\thomas\Documents\Arduino\libraries\RadioHead/RadioHead.h:1438,
                 from C:\Users\thomas\Documents\Arduino\libraries\RadioHead/RHGenericSPI.h:10,
                 from C:\Users\thomas\Documents\Arduino\libraries\RadioHead/RHHardwareSPI.h:10,
                 from C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RHHardwareSPI.cpp:7:
C:\Users\thomas\Documents\ArduinoData\packages\arduino\hardware\mbed_nano\2.2.0\cores\arduino/api/HardwareSPI.h:47:3: note:   initializing argument 2 of 'arduino::SPISettings::SPISettings(uint32_t, BitOrder, int)'
   SPISettings(uint32_t clock, BitOrder bitOrder, int dataMode) {
   ^~~~~~~~~~~
exit status 1
Error compiling for board Arduino Nano 33 BLE.

which goes away when I add defined(ARDUINO_ARCH_NRF52840) in RHHardwareSPI.cpp at lines 77 and 134 :

#if ((RH_PLATFORM == RH_PLATFORM_ARDUINO) && defined (__arm__) && (defined(ARDUINO_SAM_DUE) || defined(ARDUINO_ARCH_SAMD))) || defined(ARDUINO_ARCH_NRF52) || defined(ARDUINO_ARCH_NRF52840) || defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32L0) || defined(NRF52)
    // Arduino Due in 1.5.5 has its own BitOrder :-(
    // So too does Arduino Zero
    // So too does rogerclarkmelbourne/Arduino_STM32
    // So too does GrumpyOldPizza/ArduinoCore-stm32l0 
    ::BitOrder bitOrder;
// This no longer relevant: new versions is uint8_t
//#elif (RH_PLATFORM == RH_PLATFORM_ATTINY_MEGA)
//   ::BitOrder bitOrder;
#else
    uint8_t bitOrder;
#endif

Only to get more:

C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:17:1: error: 'HardwareTimer' does not name a type
 HardwareTimer timer(TIM1);
 ^~~~~~~~~~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:53:1: error: 'RH_DRAM_ATTR' does not name a type
 RH_DRAM_ATTR static uint8_t symbols[] =
 ^~~~~~~~~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp: In member function 'uint8_t RH_ASK::timerCalc(uint16_t, uint16_t, uint16_t*)':
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:149:40: error: 'F_CPU' was not declared in this scope
         unsigned long inv_clock_time = F_CPU / ((unsigned long)prescalerValue);
                                        ^~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:149:40: note: suggested alternative: 'FPU'
         unsigned long inv_clock_time = F_CPU / ((unsigned long)prescalerValue);
                                        ^~~~~
                                        FPU
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp: In member function 'void RH_ASK::timerSetup()':
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:439:5: error: 'TCCR1A' was not declared in this scope
     TCCR1A = 0; // Output Compare pins disconnected
     ^~~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:440:5: error: 'TCCR1B' was not declared in this scope
     TCCR1B = _BV(WGM12); // Turn on CTC mode
     ^~~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:440:18: error: 'WGM12' was not declared in this scope
     TCCR1B = _BV(WGM12); // Turn on CTC mode
                  ^~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:440:14: error: '_BV' was not declared in this scope
     TCCR1B = _BV(WGM12); // Turn on CTC mode
              ^~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:440:14: note: suggested alternative: '_B'
     TCCR1B = _BV(WGM12); // Turn on CTC mode
              ^~~
              _B
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:447:5: error: 'OCR1A' was not declared in this scope
     OCR1A = nticks;
     ^~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:454:5: error: 'TIMSK' was not declared in this scope
     TIMSK |= _BV(OCIE1A);
     ^~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:454:18: error: 'OCIE1A' was not declared in this scope
     TIMSK |= _BV(OCIE1A);
                  ^~~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp: In member function 'virtual bool RH_ASK::send(const uint8_t*, uint8_t)':
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:608:18: error: 'symbols' was not declared in this scope
     p[index++] = symbols[count >> 4];
                  ^~~~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp: At global scope:
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:749:16: error: variable or field 'interrupt' declared void
 void interrupt(HardwareTimer*)
                ^~~~~~~~~~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:749:16: error: 'HardwareTimer' was not declared in this scope
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:749:30: error: expected primary-expression before ')' token
 void interrupt(HardwareTimer*)
                              ^
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp: In member function 'uint8_t RH_ASK::symbol_6to4(uint8_t)':
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:843:16: error: 'symbols' was not declared in this scope
  if (symbol == symbols[i]) return i;
                ^~~~~~~
C:\Users\thomas\Documents\Arduino\libraries\RadioHead\RH_ASK.cpp:843:16: note: suggested alternative: 'symbol'
  if (symbol == symbols[i]) return i;
                ^~~~~~~
                symbol
exit status 1
Error compiling for board Arduino Nano 33 BLE.

There previously had been discussions on this topic- such as : Arduino 33 BLE Sense – libraries compatybility , Can’t compile with RadioHead library on Nano 33 BLE, or Error on compiling radiohead RF_ASK transmission example on Nano BLE with the discussions getting nowhere. I was just wondering if anyone had figured a way to resolve the matter.

Any help is appreciated.

Regards,
Joseph