This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Reading static MAC address on nRF52 series

I am following this post regarding reading the static MAC address for the nRF52840: https://devzone.nordicsemi.com/f/nordic-q-a/68376/trying-to-extract-the-static-mac-address-using-ncs 

However, I looked in hci_driver.c and the function is not available if CONFIG_BT_HCI_VS_EXT is enabled. This doesn't make too much sense given the description of the config variable that I found here: CONFIG_BT_HCI_VS_EXT — Kconfig reference (nordicsemi.com) I will probably just copy the function into my own source but would like an explanation of why this is not available when CONFIG_BT_HCI_VS_EXT is set

Parents
  • Hi Ethan, 


    From what i can find, It's correct that the bt_read_static_addr() is available when Zephyr HCI Vendor-Specific Extensions is not used. When Zephyr HCI Vendor-Specific Extensions is used, the API to be used is sdc_hci_cmd_vs_zephyr_read_static_addresses() . You can have a look here. I would assume when you set CONFIG_BT_HCI_VS_EXT =1 you need to follow suit, because there are other vendor specific modules not just Nordic. 

    In addition, the default way of getting Bluetooth address is to use bt_id_get() as shown here.

    Of course you can implement your own function to read the FICR the same way that we did in the bt_read_static_addr()

  • Hey Hung,

    Something interesting I saw yesterday was that when I was working on my application for the 52820, the config variable enabled the compilation of the function as expected. But I found the opposite to be true when working on the 52840 application as mentioned in my original post. Using NCS v1.7.0 for both. Not a huge issue but wanted to make a note of it.

    Edit: Sorry Hung, I misread your first message. I read it as "is not available when Zephyr HCI Vendor-Specific Extensions is not used" instead of "is available.. when not used". This makes sense then with what I'm seeing then.

Reply
  • Hey Hung,

    Something interesting I saw yesterday was that when I was working on my application for the 52820, the config variable enabled the compilation of the function as expected. But I found the opposite to be true when working on the 52840 application as mentioned in my original post. Using NCS v1.7.0 for both. Not a huge issue but wanted to make a note of it.

    Edit: Sorry Hung, I misread your first message. I read it as "is not available when Zephyr HCI Vendor-Specific Extensions is not used" instead of "is available.. when not used". This makes sense then with what I'm seeing then.

Children
No Data
Related