# BD\_ADDR

**URL:** <https://community.sparkfun.com/t/bd-addr/42349>\
**Category:** Artemis\
**Created:** [June 24, 2021, 9:16pm UTC](https://community.sparkfun.com/t/bd-addr/42349 "2021-06-24T21:16:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![idea-list](https://avatars.discourse-cdn.com/v4/letter/i/e68b1a/32.png) [@idea-list](https://community.sparkfun.com/u/idea-list)\
**Post date:** [June 24, 2021, 9:16pm UTC](https://community.sparkfun.com/t/bd-addr/42349/1 "2021-06-24T21:16:58Z")

</div>

I would like to use BD\_ADDR to uniquely identify my Artemis Thing Plus board.

My board has 66:77:88:23:BB:E0 as BD\_ADDR, however i can not find any manufacturer [[in this list](http://standards-oui.ieee.org/oui/oui.txt) with 66:77:88 indentifier.

This makes wonder if the last 3 bytes are truly unique or they are just the same dummy bytes for all Artemis modules? I have only one of these boards so can not answer the question myself.

Can someone please confirm if the last 3 bytes of BD\_ADDR of the Artemis modules are unique or not?]([http://standards-oui.ieee.org/oui/oui.txt](http://standards-oui.ieee.org/oui/oui.txt))

---

<div class="post-metadata">

**Author:** ![TS-Russell](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/ts-russell/32/6092_2.png) [@TS-Russell](https://community.sparkfun.com/u/TS-Russell)\
**Post date:** [June 24, 2021, 10:48pm UTC](https://community.sparkfun.com/t/bd-addr/42349/2 "2021-06-24T22:48:58Z")

</div>

[https://learn.sparkfun.com/tutorials/bl … ooth-works](https://learn.sparkfun.com/tutorials/bluetooth-basics/all#how-bluetooth-works) it looks like it _should_ be unique 😃

Hope this helps!

---

<div class="post-metadata">

**Author:** ![idea-list](https://avatars.discourse-cdn.com/v4/letter/i/e68b1a/32.png) [@idea-list](https://community.sparkfun.com/u/idea-list)\
**Post date:** [June 25, 2021, 11:47am UTC](https://community.sparkfun.com/t/bd-addr/42349/3 "2021-06-25T11:47:21Z")

</div>

For sure it _should_! But this answer does not help 😉

Question is if it so even in case of Artemis modules despite the manufacturer is not recognizable based on the first 3 bytes.

If the manufacturer would follow best practice we could find them on the list based on the first 3 bytes… so they do not follow best practice.

The last 3 bytes should be assigned by the manufacturer but exactly that is questionable as they do not seem to follow best practice (did not inquire an OUI).

---

<div class="post-metadata">

**Author:** ![paulvha](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@paulvha](https://community.sparkfun.com/u/paulvha)\
**Post date:** [June 25, 2021, 1:59pm UTC](https://community.sparkfun.com/t/bd-addr/42349/4 "2021-06-25T13:59:50Z")

</div>

In earlier versions of the libraries de BD-ADDR was not unique. It was based on the default number in the Apollo3 chip, which was not unique. I had created a sketch where you can set the BD-ADDR ( [viewtopic.php?f=183&t=54319&hilit=Bluetooth](https://forum.sparkfun.com/viewtopic.php?f=183&t=54319&hilit=Bluetooth)) It will need some changes, so read the top of sketch

That said, since then Sparkfun has made changes to also allow BD-ADDR update. It is a bit cryptic described in …/packages/SparkFun/hardware/apollo3/2.1.0/cores/mbed-os/features/FEATURE\_BLE/targets/TARGET\_Ambiq\_Micro/hal/apollo3/hci\_drv\_apollo3.c around line 160.

---

<div class="post-metadata">

**Author:** ![idea-list](https://avatars.discourse-cdn.com/v4/letter/i/e68b1a/32.png) [@idea-list](https://community.sparkfun.com/u/idea-list)\
**Post date:** [June 26, 2021, 2:10am UTC](https://community.sparkfun.com/t/bd-addr/42349/5 "2021-06-26T02:10:49Z")

</div>

Thanks Paul, that info helps a lot!

Forgot to mention that i am coding in official releases of Mbed OS, not with the Arduino core.

Your answer helped me to find hci\_drv\_apollo3.c in Mbed OS. The implementation of ap3\_hciDrvWrite() contains this conditional section around line 660:

```auto
#ifdef AM_CUSTOM_BDADDR
    if (type == HCI_CMD_TYPE)
    {
        uint16_t opcode;
        BYTES_TO_UINT16(opcode, pData);

        if (HCI_OPCODE_RESET == opcode)
        {

            extern uint8_t g_BLEMacAddress[6];
            am_hal_mcuctrl_device_t sDevice;
            am_hal_mcuctrl_info_get(AM_HAL_MCUCTRL_INFO_DEVICEID, &sDevice);
            g_BLEMacAddress[0] = sDevice.ui32ChipID0;
            g_BLEMacAddress[1] = sDevice.ui32ChipID0 >> 8;
            g_BLEMacAddress[2] = sDevice.ui32ChipID0 >> 16;

            HciVendorSpecificCmd(0xFC32, 6, g_BLEMacAddress);
        }
    }
#endif

```

So Mbed OS can change BD\_ADDR based on CHIPID0 register. Based on page 133 of the MCU datasheet that register should contain a unique number.

After defining AM\_CUSTOM\_BDADDR to 1 the BD\_ADDR has been changed for my board and remains the same after powercycling the board.

All this seems promising in case CHIPID0 register really contains a unique number, however i am not sure if that is the case or not.

Can you or someone else please confirm if that register is unique as it should be or even that is not the case?
