I want to get the unique ID of XIAO nRF52840 Sense from supplier, that will not be modifed by user. so that I can trace via this ID. Is there ID like this, and how to get it?
Hi there,
Absolutely there is. Two of them, On the nRF52840, all the factory-programmed identity values live in the FICR (Factory Information Configuration Registers) block.
I have a demo on here that reads it and derives the Serial number “device specific” and the MAC address. Check out the thread for it.
These two 32-bit words form a 64-bit unique device identifier.
Some Nordic docs call this the “Device Identifier.”
uint32_t id0 = NRF_FICR->DEVICEID[0];
uint32_t id1 = NRF_FICR->DEVICEID[1];
Serial.printf("DEVICEID: %08lX%08lX\n", id1, id0);
BLE Mac address
uint32_t addr0 = NRF_FICR->DEVICEADDR[0];
uint32_t addr1 = NRF_FICR->DEVICEADDR[1];
uint8_t mac[6];
mac[0] = (addr0 >> 0) & 0xFF;
mac[1] = (addr0 >> 8) & 0xFF;
mac[2] = (addr0 >> 16) & 0xFF;
mac[3] = (addr0 >> 24) & 0xFF;
mac[4] = (addr1 >> 0) & 0xFF;
mac[5] = (addr1 >> 8) & 0xFF;
Serial.printf("MAC: %02X:%02X:%02X:%02X:%02X:%02X\n",
mac[5], mac[4], mac[3], mac[2], mac[1], mac[0]);
Nordic stores the default BLE MAC in:
FICR->DEVICEADDR[0] (LSB, 32 bits)
FICR->DEVICEADDR[1] (MSB, includes address type bit)
There is also:
FICR->DEVICEADDRTYPE
Where:
-
0= Public -
1= Random Static
Just so you remember the map:
- FICR->INFO.PART → chip model (e.g., 0x52840)
- FICR->INFO.VARIANT → variant code
- FICR->INFO.PACKAGE → QFN/QFN73/WLCSP
- FICR->INFO.RAM / FLASH → size
- FICR->ER, IR, DEVICEADDR, DEVICEID → security + identity blocks
- FICR->TEMP → factory calibration
- FICR->OSC32K → LFCLK tuning
Very useful for boot-time banners or dynamic device labeling.
HTH
GL
PJ ![]()
I use it to give the BLE devices a Unique BLE NAME at Run time. No two generate the same. ![]()