Yup the IMEI is one. If you have AT commands enabled you can use the command @AchimKraus outlined. We also use the device ID which is accessible via the programmer or inside the code:
probe-rs read b32 0x00FF0208 1 --chip nRF9151_xxAA
probe-rs read b32 0x00FF0204 1 --chip nRF9151_xxAA
The first is the most significant word followed by the least significant.
In the code you can enable:
# Hardware info
CONFIG_HWINFO=y
Then read it
#include <zephyr/drivers/hwinfo.h>
/* Hardware info */
uint8_t buf[8];
err = hwinfo_get_device_id(buf, sizeof(buf));
if (err < 0)
LOG_ERR("Unable to get hwid: %i", err);
else
{
char id_str[64] = "";
for (int i = 0; i < 8; i++)
sprintf(&id_str[strlen(id_str)], "%02X", buf[i]);
LOG_INF("Device ID: %s", id_str);
}
You can also look it up if you have the hwinfo_shell enabled:
# Enable shell
CONFIG_SHELL=y
CONFIG_SHELL_WILDCARD=n
CONFIG_AT_SHELL=y
CONFIG_SHELL_CMD_BUFF_SIZE=4096
CONFIG_GPIO_SHELL=y
CONFIG_HWINFO_SHELL=y
CONFIG_I2C_SHELL=y
CONFIG_FILE_SYSTEM_SHELL=y