Board Serial number

Is there a function to obtain the serial ID from a board ?

Board is a Nano 33 BLE

The Arduino Nano 33 BLE uses the Nordic nRF52840 chip. Have a look into the datasheet. Search for FICR. You should find the Factory information configuration registers. There are a a couple you can use to identify the chip. e.g. Device Identifier, Device Address

The registers are memory mapped so you can read them easily.

Here is some example code:

#include <ArduinoBLE.h>

void setup()
{
  Serial.begin( 9600 );
  while ( !Serial );
}

void loop()
{
  Serial.print( "Device ID 0: " );
  Serial.println( NRF_FICR->DEVICEID[0], HEX );
  Serial.print( "Device ID 1: " );
  Serial.println( NRF_FICR->DEVICEID[1], HEX );

  Serial.print( "Device Address 0: " );
  Serial.println( NRF_FICR->DEVICEADDR[0], HEX );
  Serial.print( "Device Address 1: " );
  Serial.println( NRF_FICR->DEVICEADDR[1], HEX );

  delay ( 5000 );
}