cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a True Random Address

juen
Associate
Posted on December 09, 2015 at 16:55

How do I set a true random address?

Using

hci_le_set_random_address

() I get 0xFF FF FF FF FF FF.

Hardware is Nucleo-L053R8 & IDB05A1

Also setting a Beacon with BlueNRG GUI v1.8.0 with a random address also results in a address of 0xFF * 6

Following is the code I tried:-

uint8_t RANDOM_BDADDR[] = {0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa};

uint8_t bdaddr[BDADDR_SIZE];

uint8_t stack_mode = 4;

BlueNRG_RST();

ret = aci_hal_write_config_data(CONFIG_DATA_ROLE,CONFIG_DATA_ROLE_LEN,stack_mode);

ret = hci_le_set_random_address(RANDOM_BDADDR));

ret = hci_read_bd_addr(bdaddr);

//

bdaddr = 0xFF FF FF FF FF FF  !?!

1 REPLY 1
Posted on January 13, 2016 at 10:38

Dear Customer,

Using the BlueNRG-MS, the static random address is stored inside the Flash. The address is loaded when doing ACI_GAP_INIT. Hence, to overwrite the static random address the HCI_LE_SET_RANDOM_ADDRESS must be called after ACI_GAP_INIT.

To read the random address, you have to use the command:

ACI_HAL_READ_CONFIG_DATA (Offset=0x80).

To do this,  It nedded to download the latest version of GUI DK.

N.B.: the HCI_READ_BD_ADDR command reads the Public Device Address.

Regards,

GM

How do I set a true random address?

Using

hci_le_set_random_address

() I get 0xFF FF FF FF FF FF.

Hardware is Nucleo-L053R8 & IDB05A1

Also setting a Beacon with BlueNRG GUI v1.8.0 with a random address also results in a address of 0xFF * 6

Following is the code I tried:-

uint8_t RANDOM_BDADDR[] = {0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa};

uint8_t bdaddr[BDADDR_SIZE];

uint8_t stack_mode = 4;

BlueNRG_RST();

ret = aci_hal_write_config_data(CONFIG_DATA_ROLE,CONFIG_DATA_ROLE_LEN,stack_mode);

ret = hci_le_set_random_address(RANDOM_BDADDR));

ret = hci_read_bd_addr(bdaddr);

//

bdaddr = 0xFF FF FF FF FF FF  !?!