cancel
Showing results for 
Search instead for 
Did you mean: 

How to read and print Unique serial number of STBLUENRG LP device?

anuj
Associate II

In the programming Bluetooth ble stack manual it says :

The BlueNRG-LP device does not have a valid preassigned MAC address, but a unique serial number (read only for the user).The unique serial number is a 6-byte value stored at address 0x10001EF0: it is stored as two words (8 bytes) at address 0x10001EF0 and 0x10001EF4 with unique serial number padded with 0xAA55.

Now in the APIs given for the same there are two functions in the file bluenrg_lp_ll_utils.h,

to get the value from 0x10001EF0 and 0x10001EF4.

The UID_BASE_ADDRESS is 0x10001EF0.

/**  
    * @brief  Get Word0 of the unique device identifier (UID based on 64 bits)
    * @retval Word0 of UID64
    */
  __STATIC_INLINE uint32_t LL_GetUID_Word0(void)
  {
    return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));
  }
 
  /**
    * @brief  Get Word1 of the unique device identifier (UID based on 64 bits)
    * @retval Word1 of UID64
    */
  __STATIC_INLINE uint32_t LL_GetUID_Word1(void)
  {
    return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));
  }

Now my question is how to derive the 6 byte Unique address from the these two words, kindly please explain the process to do it.

Everytime I read the value it's 0xFFFFFFFF

2 REPLIES 2
Winfred LU
ST Employee

Due to a programming error,

in older BlueNRG-LP devices, the unique serial numbers were programmed at 0x10001F18, 0x10001F1C instead, and no padding (0xAA55) is added.

Kindly please add this note in the datasaheet/manual so that one doesn't get stuck and waste their time.