Re: Setting a default public MAC address in Zephyr HCI samples

Nathan Miller

Yes Carles, that is what we're trying to do. I've gone ahead and forked the repo so that I can change the reset function to apply the public MAC stored in the UICR.

On Mon, May 14, 2018 at 10:58 AM Cufi, Carles <Carles.Cufi@...> wrote:

So let me get this straight, you program the address into the UICR during production, and then you want the controller to read it from there right?


In that case unfortunately you will need to modify the actual controller code. The only currently supported feature in that regard is for the Host to read the *FICR* address that comes with every Nordic chip. The other option is to also store the address in your Host IC during production of course.






From: Nathan Miller <nathan.miller@...>
Sent: 11 May 2018 19:52
To: Cufi, Carles <carles.cufi@...>
Cc: users@...

Subject: Re: [Zephyr-users] Setting a default public MAC address in Zephyr HCI samples


That's correct Carles, we wanted the MCU to set the MAC instead of relying on the host, which cannot read the programmed MAC in the UICR. I was trying to avoid modifying the HCI code directly, hoping for something I could do from main.c, since the HCI spec makes mention of a non-volatile default value. If that's not possible, I can add the call to ll_addr_set into hci_init.


On Fri, May 11, 2018 at 10:33 AM Cufi, Carles <Carles.Cufi@...> wrote:

Hi Nathan,


Sorry I think I might have misread your original email. You want to set the address directly from the controller image, without interaction from the Host? If that is the case then you can simply add a call to ll_addr_set() in the hci_* sample you need. Not sure if that is what you need.





From: <users@...> on behalf of "Cufi, Carles" <carles.cufi@...>
Date: Friday, 11 May 2018 at 17:31
To: Nathan Miller <nathan.miller@...>, "users@..." <users@...>
Subject: Re: [Zephyr-users] Setting a default public MAC address in Zephyr HCI samples


Hi Nathan,


You need to use the Zephyr Vendor-Specific extension for this:


This is currently implemented for the native Link Layer:


It is not stored non-volatile memory though. See the hci.txt spec for details.




From: <users@...> on behalf of Nathan Miller <nathan.miller@...>

Date: Friday, 11 May 2018 at 17:24
To: "users@..." <users@...>

Subject: [Zephyr-users] Setting a default public MAC address in Zephyr HCI samples


Is it possible, using the HCI samples (hci_uart, hci_spi, etc) to set a default public MAC address from within zephyr? We have a MAC we'd like to use, and in my exploration of documentation I found the HCI vendor specific command Write BD_ADDR. This seems similar to what I need but the host has no way to read the MAC address to be used from the UICR on the chip, so it's not actually a viable solution. In the documentation for that command, however, it states:

The vendor specific Reset command will reset the BD_ADDR to its non-volatile default if available. Otherwise the BD_ADDR shall be reset to the invalid / non-existent 00:00:00:00:00:00 address value.

This implies there is a way to set a non-volatile public MAC address, but doesn't give any hints on how to do that. I looked through the Bluetooth documentation ( as much as I can but I'm not having much luck finding anything. Is there a standard way to set a non-volatile, default public MAC address?

Join to automatically receive all group messages.