<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Retrieve BLE MAC address in Zephyr environment</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/76344/retrieve-ble-mac-address-in-zephyr-environment</link><description>When using the nRF5 SDK v17.x development environment, the BLE MAC address can be retrieved using: 
 
 This will return the assigned MAC address (eg. from the nRF52840 on a Laird Module). Does a similar call exist when using nRF Connect SDK (NCS) (I see</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Tue, 15 Jun 2021 07:40:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/76344/retrieve-ble-mac-address-in-zephyr-environment" /><item><title>RE: Retrieve BLE MAC address in Zephyr environment</title><link>https://test-devzone.nordicsemi.com/thread/315283?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 07:40:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42dd154b-0885-449e-92e0-ce60e22c41ad</guid><dc:creator>user7377</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can use&amp;nbsp;&lt;code&gt;bt_id_get()&lt;/code&gt; or&amp;nbsp;&lt;code&gt;bt_le_oob_get_local()&lt;/code&gt; as mentioned in the example code in &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/bluetooth/bluetooth-dev.html#developing-bluetooth-applications"&gt;Developing Bluetooth Applications&lt;/a&gt;&amp;nbsp;or get it from FICR as allready suggested provided the default random static address is used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve BLE MAC address in Zephyr environment</title><link>https://test-devzone.nordicsemi.com/thread/315250?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 23:11:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec945967-ad68-4e97-b45f-af706b75bb74</guid><dc:creator>user79780</dc:creator><description>&lt;p&gt;I was looking for this too. My solution was using the ficr.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void get_mac_address(uint8_t mac_address[6]) {
	unsigned int device_addr_0 = NRF_FICR-&amp;gt;DEVICEADDR[0];
	unsigned int device_addr_1 = NRF_FICR-&amp;gt;DEVICEADDR[1];
	const uint8_t* part_0 = reinterpret_cast&amp;lt;const uint8_t*&amp;gt;(&amp;amp;device_addr_0);
	const uint8_t* part_1 = reinterpret_cast&amp;lt;const uint8_t*&amp;gt;(&amp;amp;device_addr_1);
	mac_address[0] = part_1[1];
	mac_address[1] = part_1[0];
	mac_address[2] = part_0[3];
	mac_address[3] = part_0[2];
	mac_address[4] = part_0[1];
	mac_address[5] = part_0[0];
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>