nrf52833 MAC adress reading issue

Hi All!

I am using NCS 2.3.0,nrf52833DK 's(2), and VScode Studio as an IDE. I want to read the MAC address of nrf52833 .

For this, I followed the link

 RE: How to get Mac address using NRF5340_DK 

Main.c 

struct bt_hci_vs_static_addr  * addrs;
static char addr_str[BT_ADDR_STR_LEN];


int ret,addr_count;



     addr_count = bt_read_static_addr(&addrs, 1);
	 
    if (err) {
        printf("Failed to read static address (err %d)\n", err);
        return;
    }

   /*  if (err>0) {
          
		   printf("Static address: %02x:%02x:%02x:%02x:%02x:%02x\n",
           addrs[0].bdaddr.val[5], addrs[0].bdaddr.val[4], addrs[0].bdaddr.val[3],
           addrs[0].bdaddr.val[2], addrs[0].bdaddr.val[1], addrs[0].bdaddr.val[0]);
   }
   */
  //  if(addr_count>0){
		   
	 	bt_addr_to_str(&(addrs->bdaddr), addr_str, sizeof(addr_str));
		printf("BT addr: %s\n", addr_str);

//	}

When I comment on the 

//  if(addr_count>0){     then I get the BT addr: 07:75:20:00:7A:C0  on BOTH Dk's the same address 
if un comment the above line then no address is printed.

and prj.conf 

CONFIG_BT_HCI_VS_EXT=y
Can you please help me in this regard?
Thanks & Regards,
Muhammad Usman
Parents Reply Children
Related