Error undefined reference to `Serial' in arduino IDE with XIAO nRF52840 Sense

Look at the first error, not the last

`C:\Users\Damhir\Documents\Arduino\sketch_aug15a/sketch_aug15a.ino:7: undefined reference to ` Adafruit_USBD_CDC::available()’

Now there is NOTHING in your sketch that should be dealing with something named Adafruit_USBD_CDC::available()

So, here’s the deal: Something is Wrong, Really Wrong, with your setup.

And here’s the Something Really Wrong that continues to disgust me:
Sigh…
Once again, the Seeed software tools developers have released a buggy hardware boards package. Oh, well…

I get your errors when I use the Seeed XIAO nRF52840 board from the Seeed nRF52 Boards package. That’s just flat wrong. No XIAO BLE (or XIAO BLE Sense) project with Serial anything can possibly compile with this selection.

So here’s what you do: (At least here’s what I did)
Use the Boards Manager to load the Seeed nrf52 mbed-enabled Boards package (See the attachment below)

Then select the Seeed XIAO BLE - nRF52840 board from that package. (Or you can select the Seeed XIAO BLE Sense - nRF52840 board — it makes no difference).

This works for me with your unmodified code. See Footnote.

Regards,

Dave

Footnote: When you get your code to compile and run, you will find that the LED is active-low. That is, digitalWrite(LED_BUILTIN, LOW) turns it on and digitalWrite(LED_BUILTIN, HIGH) turns it off

1 Like