This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F-Q1: Bluetooth address vs MAC address

Part Number: CC2640R2F-Q1

Hi Team,

Sorry, I have a very basic query and Google is not clearing my doubt, so reaching to you guys.

 

As per my understanding in BLE case BD_Addr (Bluetooth address) and MAC Address are same.

Is this correct?

 

If yes, we are using “GAP_ConfigDeviceAddr” API to set the Bluetooth address,

will this also change the MAC address of the device?

 

If we don’t change the BD_Addr (i.e. MAC Addr) using “GAP_ConfigDeviceAddr”,

then the default MAC Address will be unique which will be used by TI BLE Stack? – does TI write the unique (IEEE registered) BD or MAC address already for this purpose on each BLE IC?

Regards,

Pawan

  • Hi Pawan,

    Let me share this picture summarizing the way BLE addresses work:

    The Public address has to meet the IEEE 802-2001 standards. The public address  has a OUI (Organizationally Unique Identifier) obtained from the IEEE. A registered Public address is hard coded on the device. This address has a OUI obtained by TI from the IEEE. There is a way to modify this address and to replace it by another address obtained from the IEEE (this needs to be modified in the ccfg.c file through the defines SET_CCFG_IEEE_BLE_0 and SET_CCFG_IEEE_BLE_1).
    So if your question is does the the BLE Public address (also called BD_ADDR) is the same address as the MAC, then the answer is YES.

    However, if your question is does the BLE address used by a device is always the same as its MAC address, then the answer is NO (because as you can see on the graph, a BLE device can use a random addres).

    Regarding GAP_ConfigDeviceAddr, this function cannot be used to change the MAC address (BD_ADDR) of the device. This function is used to tell the stack what kind of address has to be used (public, static, private resolvable, private non-resolvable). As you may have seen, the function GAP_ConfigDeviceAddr() takes two parameters (an address mode and an actual address). The parameter passed as actual address is NOT used if you chose to use the public address or private resolvable. 

    In summary:

    • BD_ADDR and MAC address are the same.
    • GAP_ConfigDeviceAddr() is used to change the address of the device. But GAP_ConfigDeviceAddr() cannot change the MAC address of the device.

    I hope this will help,

    Kind regards,

  • Thank you Clément for the deep dive.

     

    If we want to use the random static BD_Addr using "GAP_ConfigDeviceAddr(ADDRMODE_STATIC, fixedaddr)" then does it need to follow the IEEE standard?

    Can i use same fixedaddr for all the devices in production? what possible issues we may face when connecting with central? - i hope its not dumb question :)

     

    If we are using the public MAC address (i.e. inbuild TI address) using ""GAP_ConfigDeviceAddr(ADDRMODE_PUBLIC, fixedaddr)" , will there be any limitation. (i mean why we have the Random address?)

     

    Is there any way to read the public MAC address of the TI BLE IC? (GAPRole_GetParameter(GAPROLE_BD_ADDR, inputAddr) - is this right API?)?

  • Hi Pawan,

    The rules for static addresses are provided within the Bluetooth Core Specifications in BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 3, Part C, §10.8.1 and BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 6, Part B, §1.3.2.1:

    As you can see, the static address has to be random and changed at each power cycle. It means you are not allowed to use a fixed addr as static address for all the devices in production. I don't know what could happen if two devices have the same address but probably nothing goo (at the same time this case is almost impossible).

    The random addresses are used for privacy reasons, to avoid to have someone tracking a device. You may want to review the user's guide for more details on addresses types.

    To read the MAC address, GAPRole_GetParameter(GAPROLE_BD_ADDR , ownAddress) is the correct function for peripheral devices. For central devices, you can use GAPCentralRole_GetParameter(GAPCENTRALROLE_BD_ADDR, ownAddress). Just FYI, these are not the only ways to read the address (you could use an HCI command like HCI_ReadBDADDRCmd()).

    Best regards,

  • Hi,

    We tried using " GAPRole_GetParameter(GAPROLE_BD_ADDR , ownAddress) " to read the public MAC address.

    but it does not return the address until the advertizement is started.

    Do we have any API to get the MAC address any time?

  • Hi,

    You can also read the MAC address directly by reading the corresponding CCFG register (see details in the Technical Reference Manual of the device).

    Here is a code snippet that could help:

    #include <inc/hw_fcfg1.h>
    
    uint64_t bleMacAddress = *((uint64_t *)(FCFG1_BASE + FCFG1_O_MAC_BLE_0)) & 0xFFFFFFFFFFFF;

    I hope this will help,

    Kind regards,