Nano Every connect to Serial1

I am trying to connect the Adafruit Bluefruit LE UART Friend to an Arduino Nano Every. For now, I am just trying to run the atcommand example sketch that comes with the library. In the config file, bluefruitConfig.h, I have enabled the Hardware Serial with this:

#ifdef Serial1    // this makes it not complain on compilation if there's no Serial1
  #define BLUEFRUIT_HWSERIAL_NAME      Serial1
#endif

This throws curious errors. When left alone the compiler will tell me that BLUEFRUIT_HWSERIAL_NAME is not defined in this scope which means that Serial1 is not defined. But the Arduino Nano Every has 4 serial ports and Serial1 is defined as UART1 on pins D0/D1. So if I omit the #ifdef the code compiles & uploads just fine (as though Serial1 is defined) but the arduino does not connect to the BT chip. So I believe that the answer lies in defining Serial1 properly.
this is how its wired up

I have tried:
-Connecting BT chip CIS pin -> GND
-switching RX & TX
-Connecting BT MODE pin -> Arduino D6

Please let me know what you think...

TLDR: How do I connect this BT module to the arduino nano every?

What I think is your header pins are mounted and soldered on the wrong side, if they’re soldered at all, cannot tell.

That said, I did not look at your configuration or code due to the obvious hardware issues.

I can not confirm you findings. When I compile the atcommand sketch from the library examples I see no errors. Arduino 1.8.15
Board selected Arduino Nano Every. The register emulation selection makes not difference. Library Version 1.10.0.

Did you install the library following these instructions
https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-uart-friend/software

Do we have to guess? Please post them using code tags as described in How to get the best out of this forum.

You were supposed to read the part where I said that BLUEFRUIT_HWSERIAL_NAME is not defined in this scope which meant that !Serial1.

I tried to confirm your hunch and I am unfortunately getting the same errors.
Configuration 1

#ifdef Serial1    // this makes it not complain on compilation if there's no Serial1
  #define BLUEFRUIT_HWSERIAL_NAME      Serial1
#endif

Yields


/usr/share/arduino/arduino-builder -dump-prefs -logger=machine -hardware /usr/share/arduino/hardware -hardware /home/jcristia/.arduino15/packages -tools /usr/share/arduino/tools-builder -tools /home/jcristia/.arduino15/packages -libraries /home/jcristia/Arduino/libraries -fqbn=arduino:megaavr:nona4809:mode=off -vid-pid=2341_0058 -ide-version=10819 -build-path /tmp/arduino_build_906921 -warnings=none -build-cache /tmp/arduino_cache_307339 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/home/jcristia/.arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=/home/jcristia/.arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.avrdude.path=/home/jcristia/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/home/jcristia/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=/home/jcristia/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=/home/jcristia/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5 -verbose /tmp/arduino_modified_sketch_10907/atcommand.ino
/usr/share/arduino/arduino-builder -compile -logger=machine -hardware /usr/share/arduino/hardware -hardware /home/jcristia/.arduino15/packages -tools /usr/share/arduino/tools-builder -tools /home/jcristia/.arduino15/packages -libraries /home/jcristia/Arduino/libraries -fqbn=arduino:megaavr:nona4809:mode=off -vid-pid=2341_0058 -ide-version=10819 -build-path /tmp/arduino_build_906921 -warnings=none -build-cache /tmp/arduino_cache_307339 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/home/jcristia/.arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=/home/jcristia/.arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.avrdude.path=/home/jcristia/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/home/jcristia/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=/home/jcristia/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=/home/jcristia/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5 -verbose /tmp/arduino_modified_sketch_10907/atcommand.ino
Using board 'nona4809' from platform in folder: /home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7
Using core 'arduino' from platform in folder: /home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7
Detecting libraries used...
/home/jcristia/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino/api/deprecated -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/variants/nona4809 /tmp/arduino_build_906921/sketch/atcommand.ino.cpp -o /dev/null
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
  -> candidates: [SPI@1.0]
/home/jcristia/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino/api/deprecated -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/variants/nona4809 -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SPI/src /tmp/arduino_build_906921/sketch/atcommand.ino.cpp -o /dev/null
Alternatives for Adafruit_BLE.h: [Adafruit_BluefruitLE_nRF51-master@1.10.0]
ResolveLibrary(Adafruit_BLE.h)
  -> candidates: [Adafruit_BluefruitLE_nRF51-master@1.10.0]
/home/jcristia/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino/api/deprecated -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/variants/nona4809 -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SPI/src -I/home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master /tmp/arduino_build_906921/sketch/atcommand.ino.cpp -o /dev/null
Alternatives for SoftwareSerial.h: [SoftwareSerial@1.0]
ResolveLibrary(SoftwareSerial.h)
  -> candidates: [SoftwareSerial@1.0]
/home/jcristia/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino/api/deprecated -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/variants/nona4809 -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SPI/src -I/home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SoftwareSerial/src /tmp/arduino_build_906921/sketch/atcommand.ino.cpp -o /dev/null
Using cached library dependencies for file: /home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SPI/src/SPI.cpp
Using cached library dependencies for file: /home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master/Adafruit_ATParser.cpp
Using cached library dependencies for file: /home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master/Adafruit_BLE.cpp
Using cached library dependencies for file: /home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master/Adafruit_BLEBattery.cpp
Using cached library dependencies for file: /home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master/Adafruit_BLEEddystone.cpp
Using cached library dependencies for file: /home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master/Adafruit_BLEGatt.cpp
Using cached library dependencies for file: /home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master/Adafruit_BLEMIDI.cpp
Using cached library dependencies for file: /home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master/Adafruit_BluefruitLE_SPI.cpp
Using cached library dependencies for file: /home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master/Adafruit_BluefruitLE_UART.cpp
Using cached library dependencies for file: /home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master/utility/Adafruit_FIFO.cpp
Using cached library dependencies for file: /home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SoftwareSerial/src/SoftwareSerial.cpp
Generating function prototypes...
/home/jcristia/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino/api/deprecated -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/variants/nona4809 -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SPI/src -I/home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SoftwareSerial/src /tmp/arduino_build_906921/sketch/atcommand.ino.cpp -o /tmp/arduino_build_906921/preproc/ctags_target_for_gcc_minus_e.cpp
/usr/bin/arduino-ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_906921/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/home/jcristia/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino5/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino/api/deprecated -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/cores/arduino -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/variants/nona4809 -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SPI/src -I/home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master -I/home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SoftwareSerial/src /tmp/arduino_build_906921/sketch/atcommand.ino.cpp -o /tmp/arduino_build_906921/sketch/atcommand.ino.cpp.o
atcommand:67:31: error: 'BLUEFRUIT_HWSERIAL_NAME' was not declared in this scope
 Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);
                               ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/arduino_modified_sketch_10907/atcommand.ino:67:31: note: suggested alternative: 'BLUEFRUIT_SPI_MOSI'
 Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);
                               ^~~~~~~~~~~~~~~~~~~~~~~
                               BLUEFRUIT_SPI_MOSI
Using library SPI at version 1.0 in folder: /home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SPI 
Using library Adafruit_BluefruitLE_nRF51-master at version 1.10.0 in folder: /home/jcristia/Arduino/libraries/Adafruit_BluefruitLE_nRF51-master 
Using library SoftwareSerial at version 1.0 in folder: /home/jcristia/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/SoftwareSerial 
exit status 1
'BLUEFRUIT_HWSERIAL_NAME' was not declared in this scope

Configuration 2

//#ifdef Serial1    // this makes it not complain on compilation if there's no Serial1
  #define BLUEFRUIT_HWSERIAL_NAME      Serial1
//#endif

Yields successful upload with bad output

Are you using Hardware Serial? The sketch has SPI enabled by default. I ran into this issue this morning.
In ATcommand.ino

/* ...or hardware serial, which does not need the RTS/CTS pins. Uncomment this line */
Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);

/* ...hardware SPI, using SCK/MOSI/MISO hardware SPI pins and then user selected CS/IRQ/RST */
//Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);

by default, the second line is enabled and so the SPI connection superficially appears to work but AT commands just don't run.

Can you share your configuration with me?

Apologies.

Some new developments.
I decided to set up a software serial instead of the hardware serial as a sanity check.
here is the relevant portion of BluefruitConfig.h

// COMMON SETTINGS
// ----------------------------------------------------------------------------------------------
// These settings are used in both SW UART, HW UART and SPI mode
// ----------------------------------------------------------------------------------------------
#define BUFSIZE                        160   // Size of the read buffer for incoming data
#define VERBOSE_MODE                   true  // If set to 'true' enables debug output


// SOFTWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the pins that will be used for 'SW' serial.
// You should use this option if you are connecting the UART Friend to an UNO
// ----------------------------------------------------------------------------------------------
#define BLUEFRUIT_SWUART_RXD_PIN       9    // Required for software serial!
#define BLUEFRUIT_SWUART_TXD_PIN       8   // Required for software serial!
#define BLUEFRUIT_UART_CTS_PIN         7   // Required for software serial!
#define BLUEFRUIT_UART_RTS_PIN         -1   // Optional, set to -1 if unused


// HARDWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the HW serial port you are using. Uncomment
// this line if you are connecting the BLE to Leonardo/Micro or Flora
// ----------------------------------------------------------------------------------------------
//#ifdef Serial1    // this makes it not complain on compilation if there's no Serial1
  #define BLUEFRUIT_HWSERIAL_NAME      Serial1
//#endif

Here is the relevant part of atcommand.ino

// Create the bluefruit object, either software serial...uncomment these lines

SoftwareSerial bluefruitSS = SoftwareSerial(BLUEFRUIT_SWUART_TXD_PIN, BLUEFRUIT_SWUART_RXD_PIN);

Adafruit_BluefruitLE_UART ble(bluefruitSS, BLUEFRUIT_UART_MODE_PIN,
                      BLUEFRUIT_UART_CTS_PIN, BLUEFRUIT_UART_RTS_PIN);


/* ...or hardware serial, which does not need the RTS/CTS pins. Uncomment this line */
//Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);

This yields the good output

However, the question remains. Why does Hardware Serial1 not work?
The fact that the software serial works tells me that I'm onto something with my original hypothesis-- Serial1 is not defined properly.

"Serial1" is a C++ object, not a pre-processor symbol, so I don't think that will work correctly.

You could try #ifdef HWSERIAL1

with these changes


// HARDWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the HW serial port you are using. Uncomment
// this line if you are connecting the BLE to Leonardo/Micro or Flora
// ----------------------------------------------------------------------------------------------
#ifdef HWSERIAL1    // this makes it not complain on compilation if there's no Serial1
  #define BLUEFRUIT_HWSERIAL_NAME      HWSERIAL1
#endif
/* ...or hardware serial, which does not need the RTS/CTS pins. Uncomment this line */
Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);

Yields compiler error


C:\Program Files (x86)\arduino-1.8.19\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\arduino-1.8.19\hardware -hardware C:\Users\zajos\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\arduino-1.8.19\tools-builder -tools C:\Program Files (x86)\arduino-1.8.19\hardware\tools\avr -tools C:\Users\zajos\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\arduino-1.8.19\libraries -libraries C:\Users\zajos\Documents\Arduino\libraries -fqbn=arduino:megaavr:nona4809:mode=off -vid-pid=2341_0058 -ide-version=10819 -build-path C:\Users\zajos\AppData\Local\Temp\arduino_build_237333 -warnings=none -build-cache C:\Users\zajos\AppData\Local\Temp\arduino_cache_57339 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5 -prefs=runtime.tools.arduinoOTA.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avrdude.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -verbose C:\Users\zajos\Documents\Arduino\BlueFruit\atcommand\atcommand.ino

C:\Program Files (x86)\arduino-1.8.19\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\arduino-1.8.19\hardware -hardware C:\Users\zajos\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\arduino-1.8.19\tools-builder -tools C:\Program Files (x86)\arduino-1.8.19\hardware\tools\avr -tools C:\Users\zajos\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\arduino-1.8.19\libraries -libraries C:\Users\zajos\Documents\Arduino\libraries -fqbn=arduino:megaavr:nona4809:mode=off -vid-pid=2341_0058 -ide-version=10819 -build-path C:\Users\zajos\AppData\Local\Temp\arduino_build_237333 -warnings=none -build-cache C:\Users\zajos\AppData\Local\Temp\arduino_cache_57339 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5 -prefs=runtime.tools.arduinoOTA.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avrdude.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -verbose C:\Users\zajos\Documents\Arduino\BlueFruit\atcommand\atcommand.ino

Using board 'nona4809' from platform in folder: C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7

Using core 'arduino' from platform in folder: C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7

Detecting libraries used...

"C:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino5/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino/api/deprecated" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\variants\\nona4809" "C:\\Users\\zajos\\AppData\\Local\\Temp\\arduino_build_237333\\sketch\\atcommand.ino.cpp" -o nul

Alternatives for SPI.h: [SPI@1.0]

ResolveLibrary(SPI.h)

  -> candidates: [SPI@1.0]

"C:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino5/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino/api/deprecated" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\variants\\nona4809" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\libraries\\SPI\\src" "C:\\Users\\zajos\\AppData\\Local\\Temp\\arduino_build_237333\\sketch\\atcommand.ino.cpp" -o nul

Alternatives for Adafruit_BLE.h: [Adafruit_BluefruitLE_nRF51@1.10.0]

ResolveLibrary(Adafruit_BLE.h)

  -> candidates: [Adafruit_BluefruitLE_nRF51@1.10.0]

"C:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino5/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino/api/deprecated" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\variants\\nona4809" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\libraries\\SPI\\src" "-IC:\\Users\\zajos\\Documents\\Arduino\\libraries\\Adafruit_BluefruitLE_nRF51" "C:\\Users\\zajos\\AppData\\Local\\Temp\\arduino_build_237333\\sketch\\atcommand.ino.cpp" -o nul

Alternatives for SoftwareSerial.h: [SoftwareSerial@1.0]

ResolveLibrary(SoftwareSerial.h)

  -> candidates: [SoftwareSerial@1.0]

"C:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino5/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino/api/deprecated" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\variants\\nona4809" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\libraries\\SPI\\src" "-IC:\\Users\\zajos\\Documents\\Arduino\\libraries\\Adafruit_BluefruitLE_nRF51" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\libraries\\SoftwareSerial\\src" "C:\\Users\\zajos\\AppData\\Local\\Temp\\arduino_build_237333\\sketch\\atcommand.ino.cpp" -o nul

Using cached library dependencies for file: C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\SPI\src\SPI.cpp

Using cached library dependencies for file: C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51\Adafruit_ATParser.cpp

Using cached library dependencies for file: C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51\Adafruit_BLE.cpp

Using cached library dependencies for file: C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51\Adafruit_BLEBattery.cpp

Using cached library dependencies for file: C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51\Adafruit_BLEEddystone.cpp

Using cached library dependencies for file: C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51\Adafruit_BLEGatt.cpp

Using cached library dependencies for file: C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51\Adafruit_BLEMIDI.cpp

Using cached library dependencies for file: C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51\Adafruit_BluefruitLE_SPI.cpp

Using cached library dependencies for file: C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51\Adafruit_BluefruitLE_UART.cpp

Using cached library dependencies for file: C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51\utility\Adafruit_FIFO.cpp

Using cached library dependencies for file: C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\SoftwareSerial\src\SoftwareSerial.cpp

Generating function prototypes...

"C:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino5/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino/api/deprecated" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\variants\\nona4809" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\libraries\\SPI\\src" "-IC:\\Users\\zajos\\Documents\\Arduino\\libraries\\Adafruit_BluefruitLE_nRF51" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\libraries\\SoftwareSerial\\src" "C:\\Users\\zajos\\AppData\\Local\\Temp\\arduino_build_237333\\sketch\\atcommand.ino.cpp" -o "C:\\Users\\zajos\\AppData\\Local\\Temp\\arduino_build_237333\\preproc\\ctags_target_for_gcc_minus_e.cpp"

"C:\\Program Files (x86)\\arduino-1.8.19\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\zajos\\AppData\\Local\\Temp\\arduino_build_237333\\preproc\\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino5/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR -DMILLIS_USE_TIMERB3 -DNO_EXTERNAL_I2C_PULLUP "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino/api/deprecated" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\cores\\arduino" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\variants\\nona4809" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\libraries\\SPI\\src" "-IC:\\Users\\zajos\\Documents\\Arduino\\libraries\\Adafruit_BluefruitLE_nRF51" "-IC:\\Users\\zajos\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\megaavr\\1.8.7\\libraries\\SoftwareSerial\\src" "C:\\Users\\zajos\\AppData\\Local\\Temp\\arduino_build_237333\\sketch\\atcommand.ino.cpp" -o "C:\\Users\\zajos\\AppData\\Local\\Temp\\arduino_build_237333\\sketch\\atcommand.ino.cpp.o"

atcommand:67:79: error: no matching function for call to 'Adafruit_BluefruitLE_UART::Adafruit_BluefruitLE_UART(USART_t*, int)'

 Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);

                                                                               ^

In file included from C:\Users\zajos\Documents\Arduino\BlueFruit\atcommand\atcommand.ino:19:0:

C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51/Adafruit_BluefruitLE_UART.h:69:5: note: candidate: Adafruit_BluefruitLE_UART::Adafruit_BluefruitLE_UART(SoftwareSerial&, int8_t, int8_t, int8_t)

     Adafruit_BluefruitLE_UART(SoftwareSerial &port,

     ^~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51/Adafruit_BluefruitLE_UART.h:69:5: note:   no known conversion for argument 1 from 'USART_t* {aka USART_struct*}' to 'SoftwareSerial&'

C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51/Adafruit_BluefruitLE_UART.h:64:5: note: candidate: Adafruit_BluefruitLE_UART::Adafruit_BluefruitLE_UART(arduino::HardwareSerial&, int8_t, int8_t, int8_t)

     Adafruit_BluefruitLE_UART(HardwareSerial &port,

     ^~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51/Adafruit_BluefruitLE_UART.h:64:5: note:   no known conversion for argument 1 from 'USART_t* {aka USART_struct*}' to 'arduino::HardwareSerial&'

C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51/Adafruit_BluefruitLE_UART.h:49:7: note: candidate: constexpr Adafruit_BluefruitLE_UART::Adafruit_BluefruitLE_UART(const Adafruit_BluefruitLE_UART&)

 class Adafruit_BluefruitLE_UART : public Adafruit_BLE

       ^~~~~~~~~~~~~~~~~~~~~~~~~

C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51/Adafruit_BluefruitLE_UART.h:49:7: note:   candidate expects 1 argument, 2 provided

Using library SPI at version 1.0 in folder: C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\SPI 

Using library Adafruit_BluefruitLE_nRF51 at version 1.10.0 in folder: C:\Users\zajos\Documents\Arduino\libraries\Adafruit_BluefruitLE_nRF51 

Using library SoftwareSerial at version 1.0 in folder: C:\Users\zajos\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\SoftwareSerial 

exit status 1

no matching function for call to 'Adafruit_BluefruitLE_UART::Adafruit_BluefruitLE_UART(USART_t*, int)'

I was not configured properly, and can now indeed reproduce your findings.

I believe there is something broken with the library. I have tried compiling for a variety of platforms with Serial1 and the same error appears.

Adafruit supplies a specific example of use with the Mega but I could not compile for that platform.
https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-uart-friend/wiring

Same story with the NanoEvery and 32u4 platforms with Serial1 like the Leonardo.

The library even mentions that the files for Adafruit_BluefruitLE_UART.h were modified to deal with the SamD 21/51 variants without software serial, but I could not compile for the Feather M0 or M4.
https://github.com/adafruit/Adafruit_BluefruitLE_nRF51/blob/master/Adafruit_BluefruitLE_UART.h

What does compile, is this, but I have no way to test if the module indeed communicates properly.

//Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);
 Adafruit_BluefruitLE_UART ble(Serial1, BLUEFRUIT_UART_MODE_PIN);
1 Like

Looks like it might be related to Serial1 being a USART_t, which on Every is a subclass of HardwareSerial, while on Uno/etc it's a bottom-level class.
Except that I thought C++ would cast that sort of think automatically (and I'm pretty sure I have a library function that uses &Stream and accepts Serial, where they have a similar relationship.

(Alas, my knowledge of deeper C++ issues ends before this, and I've probably mangled some of the terms above...)

(Maybe it's another thing "broken" by the move to api/ ? HardwareSerial is now a class with only virtual methods.)

1 Like

Serial1 is a UartClass which is a subclass of HardwareSerial.
USART_t is a struct used for direct register access.
HWSERIAL1 is USART_t, do not use it where you would use Serial1.

#ifdef HAVE_HWSERIAL1 
  #define BLUEFRUIT_HWSERIAL_NAME      Serial1
#endif

Ah hah! Thanks; I missed that, and had intended something like:

#ifdef HWSERIAL1    // this makes it not complain on compilation if there's no Serial1
  #define BLUEFRUIT_HWSERIAL_NAME      Serial1
#endif

(but using HAVE_HWSERIAL1 is better.)

Tried this:

// HARDWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the HW serial port you are using. Uncomment
// this line if you are connecting the BLE to Leonardo/Micro or Flora
// ----------------------------------------------------------------------------------------------
#ifdef HAVE_HWSERIAL1    // this makes it not complain on compilation if there's no Serial1
  #define BLUEFRUIT_HWSERIAL_NAME      Serial1
#endif
/* ...or hardware serial, which does not need the RTS/CTS pins. Uncomment this line */
Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);
//Adafruit_BluefruitLE_UART ble(Serial1, BLUEFRUIT_UART_MODE_PIN);  //same issue

with this setup


before you ask, I have tried switching the RX/TX connections

This still gets the bad output. (see post #6 because forum only allows me 1 photo)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.