Arduino Primo pins.

I am confused with the pins on the Arduino Primo.

I am running the "WakeUp" example using a LSM6DS3 accelerometer board.

The edited verion of the code of the example is:

#include <CoreSensors.h>

// interrupt pin
#define INT1 21

int wake_up = 0;

void setup() {
  // start serial port at 9600 bps
  // start the core sensors
  // enable wake up detection
  // set up interrupt pin to sensor
  attachInterrupt(INT1, WakeUp, RISING);

void loop() {
  // check interrupt flag
  if (wake_up) {
    wake_up = 0;
    uint8_t status = 0;
    // get wake up detection status
    if (status)
      Serial.println("Wake up Detected!");

// interrupt service routine
void WakeUp()
  wake_up = 1;

I connect the INT1 of the LSM6DS3 board to D9 of the Primo board.
D9 on the Primo board is connected to nRF52832 pin 23 which is P0.20 according to the schematic.
The sample code is:

// interrupt pin
#define INT1 21

How does the pin mapping work?
Surely "#define INT1 21" would be:
"#define INT1 20" (P0.20)
"#define INT1 23" (pin 23)

I am trying to get my head around this as I am attempting to create a SoftwareSerial with pins D2(RX) and D3(TX).

The first argument to attachInterrupt() is NOT a pin number. It is the interrupt number. That interrupt number is related to some pin that you have to physically connect the interrupt generator to.