XIAO NRF52840 Plus

Most impressed with the way you have added all the extra IO to the plus version and the way it maintains compatibility with the standard 14 pin layout.

A question though …

I can see there are pins pre-defined for second SPI, UART and the I2S ports, so if say you built a board with a output port of 8 pins, 2 for power and 6 GPIOs, could you re-define those 6 GPIO pins to be whatever interface you wished, be it SPI, I2C or UART ?

It looks like such a re-definition can be done in the pins_arduino.h and variant.h library files, but could the re-definition be done at sketch level ?

1 Like

interesting questions… I know they are working on creating a new standard for the plus sized XIAO, so please continue to explain what you are thinking and experiencing here, it may actually help the process

Its simple really.

I am thinking of a board using the NRF52840 plus that already has an SPI LoRa module on it.

For possible future applications I might want to connect another SPI bus (SD card or TFT display say) a second I2C or second UART.

The NRF52840 plus does have the dedicated pins for SPI1, UART1, I2S, but then to use those ports all the dedicated pins would need to be available on an external connector.

If you were using say an ESP32S3, you could have a connector of say 2 power pins and 6 GPIOs and allocate those GPIOs either to a second SPI or MMC for SD card a second I2C or second UART, no problem.

So does the NRF52840 provide the same flexibility ?

1 Like

So on the XIAO NRF52840 is it not possible to allocate specific GPIOs to SPI, I2C, UART functions etc ?

Hi there,

So, this should address it :grin::+1:

:white_check_mark: Yes, absolutely — you can reassign almost any GPIO on the XIAO nRF52840 for SPI, I²C, UART, or GPIO as long as the function is supported by the hardware peripheral mux (Pin Function Mapping).
The Nordic nRF52840’s GPIO matrix is flexible: you can route the SERCOM peripherals (SPI, I²C, UART) to most pins by reconfiguring them in software. This is part of what makes the chip so adaptable.


:warning: However — and this is the important caveat — not all pin remaps give you identical electrical or performance behavior.
For example:

  • I²C: Only certain pins support hardware pull-ups or the high-drive modes expected for stable I²C at 400 kHz or higher. Moving SDA/SCL to random pins may require stronger external pull-ups or lower speed.
  • SPI: You can relocate MISO/MOSI/SCK/NSS, but drive strength, timing, or interference might vary because of board routing. Some pins share internal connections with the QSPI flash or NFC, and reassigning them can break other functions.
  • UART: TX/RX can be mapped freely, but hardware flow-control (RTS/CTS) only works on specific pins.

:bulb: Bottom line:
You can absolutely assign alternate GPIOs for SPI/I²C/UART, but you may lose optimized hardware features, and the routing or power domain might not be ideal. On compact boards like the XIAO, the default pin mappings are chosen to balance performance, signal integrity, and power draw.


That’s the “truth-in-engineering” way to put it: yes, flexible — but not all configurations are equal.

HTH
GL :grin: PJ :v:

OK, thanks for that, so its possible to re-assign SPI/I²C/UART pins.

How do you do it ?

Any examples for the XIAO NRF52840 ?

Hi there,

So , what is it you want to do Specifically… you don’t really say,
you can do stuff like this in the setup.

Method 1: Using the Arduino IDE

  1. Modify pin definitions: In the setup() function of your Arduino sketch, redefine the pins you want to use.
  2. Use the library’s functions: Use the SPI library’s functions like SPI.begin() to initialize the SPI peripheral with the new pin assignments.
  3. Example:
#include <SPI.h>

// Define your new SPI pins
#define SCK_PIN 13
#define MISO_PIN 12
#define MOSI_PIN 11
#define CS_PIN 10

void setup() {
  Serial.begin(9600);
  
  // Initialize SPI with the new pins
  SPI.begin(SCK_PIN, MISO_PIN, MOSI_PIN, CS_PIN);
  
  Serial.println("SPI initialized with new pins");
}

void loop() {
  // Your main code
}

or…

Method 2: Using nRF Connect SDK or Zephyr Project

  1. Locate configuration files: Find the board’s pin control configuration files, such as <my-board>-pinctrl.dtsi and <board>.overlay.
  2. Modify pin assignments: Edit the files to define new pin multiplexing configurations for the desired peripheral (e.g., spi0_default, uart0_default).
  3. Use the drivers: Use the Nordic Semiconductor (nrfx) drivers or Zephyr’s drivers to uninitialize the old peripheral, then reinitialize it with the new pin configuration.
  4. Example (using zephyr overlay file):
// in <board>.overlay
/ {
  aliases {
    my-spi = &spi0;
  };
};

&spi0 {
  status = "okay";
  pinctrl-0 = <&spi0_default>;
  pinctrl-1 = <&spi0_sleep>;
  pinctrl-names = "default", "sleep";
};

&pinctrl {
  spi0_default: spi0_default {
    group1 {
      psels = <NRF_PSEL(SPIM_SCK, 0, 13)>,
              <NRF_PSEL(SPIM_MISO, 0, 12)>,
              <NRF_PSEL(SPIM_MOSI, 0, 11)>;
    };
  };
  spi0_sleep: spi0_sleep {
    group1 {
      psels = <NRF_PSEL(SPIM_SCK, 0, 13)>,
              <NRF_PSEL(SPIM_MISO, 0, 12)>,
              <NRF_PSEL(SPIM_MOSI, 0, 11)>;
    };
  };
};

and More…
In Zephyr look here :–>

also You can read all about it in the “Technical Reference Guide” for the Nrf52840 :+1:

HTH
GL :slight_smile: Pj :v:

I had already tried the method you suggested in the example above, its the method used on ESP32s of course.

And you get a compile error;

Compilation error: no matching function for call to ‘SPIClass::begin(int, int, int, int)’

Hence my original question.

And as mentioned in the OP, I could see the possibility of making the change in the library pin definition files, but was asking if it was possible to do such a pin assignment directly in a sketch …

Hi there,

Yes, you define the pins you want to use, the PIN macro’s do the extra functions. No each MCU have specific syntax to use in order to do it and it’s an all or nothing approach AFAIK.
Post up some specific code or requirement and we can look further suffice to say the original question is answered, if you want a more focused understanding of the methods and uses, check out TRG for the nRF52840 for more. :+1:

HTH
GL :slight_smile: PJ :v:

Sure, but the question here is specifically about the NRF52840 Plus.

Assume I have a connector on a NRF52840 Plus board I am using that has pins D11, D12,D13,D14,D15 and D16 on it.

I want to run SPI1 on those pins, so the first part of the code would be to setup the SPI1 interface, so I try some basic starting code;

#include <SPI.h>

// Define your new SPI1 pins
#define SCK_PIN D11
#define MISO_PIN D12
#define MOSI_PIN D13
#define CS_PIN D14

void setup() {
  Serial.begin(9600);
  
  // Initialize SPI with the new pins
  SPI1.begin(SCK_PIN, MISO_PIN, MOSI_PIN, CS_PIN);
  
  Serial.println("SPI1 initialized with new pins");
}

void loop() {
  // Your main code
}

Which does not compile.

So is there an alternative way of assigning the SPI1 pins in a sketch ?.

Yes ? No ?

Hi there,

I could do it for you, but better you find the exact syntax, What you have there will NOT work for a Nordic MCU … (your trying to use SILK_numbers & pin macro’s) you need GPIO numbers :face_with_hand_over_mouth: You want lowest level, you need to use bare metal components. :v:

This Does compile

#include <Arduino.h>
#include <SPI.h>

// Your connector pins
#define SCK_PIN  D11
#define MISO_PIN D12
#define MOSI_PIN D13
#define CS_PIN   D14

void setup() {
  Serial.begin(115200);
  while (!Serial) { /* wait for USB */ }

  // Show the resolved numeric GPIOs (if you’re curious)
  Serial.print("SCK=");  Serial.println(SCK_PIN);
  Serial.print("MISO="); Serial.println(MISO_PIN);
  Serial.print("MOSI="); Serial.println(MOSI_PIN);
  Serial.print("CS=");   Serial.println(CS_PIN);

  // Chip-select is just a normal GPIO. Don’t pass it into SPI begin.
  pinMode(CS_PIN, OUTPUT);
  digitalWrite(CS_PIN, HIGH); // inactive

  // Configure SPI1 to use your pins, then start it
#if defined(SPI1)
  SPI1.setPins(SCK_PIN, MISO_PIN, MOSI_PIN);  // <-- the important bit
  SPI1.begin();
  Serial.println("SPI1 started.");
#else
  Serial.println("ERROR: This board/core doesn't define SPI1.");
#endif
}

void loop() {
#if defined(SPI1)
  // Example transaction @ 8 MHz, mode 0
  SPI1.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0));
  digitalWrite(CS_PIN, LOW);

  uint8_t whoami = SPI1.transfer(0x9F); // example byte
  // ... more transfers as needed ...

  digitalWrite(CS_PIN, HIGH);
  SPI1.endTransaction();

  Serial.print("Got byte: 0x"); Serial.println(whoami, HEX);
  delay(500);
#endif
}

I have both Scenarios covered, Both MCU’s ESP32 and Nrf52840
Note the Syntax , and for example pin macro’s and Class defines
is most proper.

SPIClass SPI_2(NRF_SPIM2, D9, D8, D10);   // MISO, SCK, MOSI

check here where I use 2 SPI interfaces, you have to explicitly spell it out for the compiler.
and

YES

for like the 3rd time :grin:

Good Stuff , though tricky to track but it’s there.
HTH
GL :slight_smile: Pj :v:

post some code of what it is you want to do.

Notes that save headaches

  • Use setPins(...) + begin(), not SPI1.begin(SCK,MISO,MOSI,CS). Passing pins to begin() only exists on some cores; setPins works on the Adafruit/Seeed nRF52 cores.
  • CS is not part of the SPI peripheral. Always pinMode()/digitalWrite() it yourself.
  • Verifying pin mapping: If you really need raw GPIO numbers, just Serial.println(D11) etc., or open your board’s variants/*/pins_arduino.h to see exactly which nRF port/pin each Dx maps to.
  • Check that SPI1 exists: Some variants only expose SPI (SPIM0). If SPI1 isn’t defined, you’ll need to either use SPI or create another SPIClass bound to NRF_SPIM1 (varies by core; sticking with SPI1 when available is easier).
1 Like

one thing about programming… and learning and living in general… its trial and error

1 Like

one of my new sayings… is the most dangerious thing in the world is living… because once you are dead… you got nothing else to worry about…

Ah so its SPI.setPins(), not sure why it appears that;

SPI.begin(SCK_PIN, MISO_PIN, MOSI_PIN, CS_PIN);

Was suggested as an example.

I have tested;

SPI1.setPins()
Wire1.setpins()
Serial1.setPins()

And they do appear to work on on the D0 to D10 pins. Will order some 1.27mm to 2.54mm pin pitch convertors so I can give D11 to D19 a try.

The most recently posted code, that uses SPI1,setPins() does compile, but I cannot see how it would work, there does appear to be an error there.

Hi there,

So it is done that way for portability, The “Dx” labels (like D11, D12, etc.) are macros that correspond to nRF52 GPIO numbers defined in the board variant file (variants/xiao_nrf52840_plus/pins_arduino.h).
For example (approximate, depending on BSP version):

Dx nRF GPIO
D11 P0.31
D12 P0.29
D13 P0.02
D14 P0.03
D15 P0.28
D16 P0.04

You can verify the actual mapping with:

Serial.print("D11 = "); Serial.println(D11);

Be aware of the BSP you use.

HTH
GL :slight_smile: PJ :v:

Compiler output from above , code NO ERRORS :+1:

FQBN: Seeeduino:mbed:xiaonRF52840Plus
Using board 'xiaonRF52840Plus' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3
Using core 'arduino' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3

Detecting libraries used...
C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/defines.txt @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/cxxflags.txt -DARDUINO_ARCH_NRF52840 -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_SEEED_XIAO_NRF52840_PLUS -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/api/deprecated -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/api/deprecated-avr-comp -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib/hal_t2t -iprefixC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/includes.txt C:\Users\Dude\AppData\Local\arduino\sketches\C7EB93B531C89CF56CB46567A2786899\sketch\sketch_oct14a.ino.cpp -o nul
Alternatives for SPI.h: [SPI]
ResolveLibrary(SPI.h)
  -> candidates: [SPI]
C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/defines.txt @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/cxxflags.txt -DARDUINO_ARCH_NRF52840 -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_SEEED_XIAO_NRF52840_PLUS -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\libraries\SPI -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/api/deprecated -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/api/deprecated-avr-comp -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib/hal_t2t -iprefixC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/includes.txt C:\Users\Dude\AppData\Local\arduino\sketches\C7EB93B531C89CF56CB46567A2786899\sketch\sketch_oct14a.ino.cpp -o nul
C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/defines.txt @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/cxxflags.txt -DARDUINO_ARCH_NRF52840 -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_SEEED_XIAO_NRF52840_PLUS -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\libraries\SPI -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/api/deprecated -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/api/deprecated-avr-comp -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib/hal_t2t -iprefixC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/includes.txt C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\libraries\SPI\SPI.cpp -o nul
Generating function prototypes...
C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++ -c -w -g3 -nostdlib @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/defines.txt @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/cxxflags.txt -DARDUINO_ARCH_NRF52840 -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_SEEED_XIAO_NRF52840_PLUS -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\libraries\SPI -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/api/deprecated -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/api/deprecated-avr-comp -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib/hal_t2t -iprefixC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\cores\arduino @C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\variants\SEEED_XIAO_NRF52840_PLUS/includes.txt C:\Users\Dude\AppData\Local\arduino\sketches\C7EB93B531C89CF56CB46567A2786899\sketch\sketch_oct14a.ino.cpp -o C:\Users\Dude\AppData\Local\Temp\434020839\sketch_merged.cpp
C:\Users\Dude\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\Dude\AppData\Local\Temp\434020839\sketch_merged.cpp

Compiling sketch...
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -g3 -nostdlib "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/defines.txt" "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/cxxflags.txt" -DARDUINO_ARCH_NRF52840 -MMD -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -DARDUINO=10607 -DARDUINO_SEEED_XIAO_NRF52840_PLUS -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=0 "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\libraries\\SPI" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/api/deprecated" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib/hal_t2t" "-iprefixC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino" "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/includes.txt" "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899\\sketch\\sketch_oct14a.ino.cpp" -o "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899\\sketch\\sketch_oct14a.ino.cpp.o"
Compiling libraries...
Compiling library "SPI"
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -g3 -nostdlib "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/defines.txt" "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/cxxflags.txt" -DARDUINO_ARCH_NRF52840 -MMD -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -DARDUINO=10607 -DARDUINO_SEEED_XIAO_NRF52840_PLUS -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=0 "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\libraries\\SPI" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/api/deprecated" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib/hal_t2t" "-iprefixC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino" "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/includes.txt" "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\libraries\\SPI\\SPI.cpp" -o "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899\\libraries\\SPI\\SPI.cpp.o"
Compiling core...
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -c -w -g3 -nostdlib "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/defines.txt" "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/cxxflags.txt" -DARDUINO_ARCH_NRF52840 -MMD -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -DARDUINO=10607 -DARDUINO_SEEED_XIAO_NRF52840_PLUS -DARDUINO_ARCH_MBED -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=0 "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/api/deprecated" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/api/deprecated-avr-comp" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib" "-IC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib/hal_t2t" "-iprefixC:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino" "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/includes.txt" "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS\\variant.cpp" -o "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899\\core\\variant.cpp.o"
Using precompiled core: C:\Users\Dude\AppData\Local\arduino\cores\Seeeduino_mbed_xiaonRF52840Plus_b40b393947877826c32a7d1e4316b9f1\core.a
Linking everything together...
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -E -P -x c "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/linker_script.ld" -o "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/linker_script.ld"
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" "-LC:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899" -Wl,--gc-sections -w -Wl,--as-needed "@C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/ldflags.txt" "-TC:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/linker_script.ld" "-Wl,-Map,C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/sketch_oct14a.ino.map" --specs=nosys.specs -o "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/sketch_oct14a.ino.elf" "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899\\sketch\\sketch_oct14a.ino.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899\\core\\variant.cpp.o" -Wl,--whole-archive "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\cores\\arduino/mbed/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/nfc/t2t_lib/nfc_t2t_lib_gcc.a" "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/..\\..\\cores\\Seeeduino_mbed_xiaonRF52840Plus_b40b393947877826c32a7d1e4316b9f1\\core.a" "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/libs/libmbed.a" "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/libs/libcc_310_core.a" "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/libs/libcc_310_ext.a" "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3\\variants\\SEEED_XIAO_NRF52840_PLUS/libs/libcc_310_trng.a" -Wl,--no-whole-archive -Wl,--start-group -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -Wl,--end-group
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-objcopy" -O binary "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/sketch_oct14a.ino.elf" "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/sketch_oct14a.ino.bin"
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/sketch_oct14a.ino.elf" "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/sketch_oct14a.ino.hex"
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\hardware\\mbed\\2.9.3/tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe" dfu genpkg --dev-type 0x0052 --application "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/sketch_oct14a.ino.hex" "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/sketch_oct14a.ino.zip"
Zip created at C:\Users\Dude\AppData\Local\arduino\sketches\C7EB93B531C89CF56CB46567A2786899/sketch_oct14a.ino.zip
Using library SPI in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\mbed\2.9.3\libraries\SPI (legacy)
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-size" -A "C:\\Users\\Dude\\AppData\\Local\\arduino\\sketches\\C7EB93B531C89CF56CB46567A2786899/sketch_oct14a.ino.elf"
Sketch uses 88992 bytes (10%) of program storage space. Maximum is 811008 bytes.
Global variables use 44736 bytes (18%) of dynamic memory, leaving 192832 bytes for local variables. Maximum is 237568 bytes.

Did you mean;

SPI1.setPins(MISO_PIN, SCK_PIN, MOSI_PIN) // <-- the important bit ?