<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://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>Read local identity of nRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66174/read-local-identity-of-nrf52832</link><description>Hello! 
 I am beating my head against my desk trying to read the local identity / hardware MAC address of my nRF52832 chip (On a Thingy:52) using Zephyr and nRFConnectSDK v1.2. 
 It is possible to advertise with it by using BT_LE_ADV_OPT_USE_IDENTITY</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Sep 2020 13:45:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66174/read-local-identity-of-nrf52832" /><item><title>RE: Read local identity of nRF52832</title><link>https://devzone.nordicsemi.com/thread/271363?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 13:45:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67ff198f-ee2f-48fe-8e56-4f9f8715bbe4</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;As long as CONFIG_BT_PRIVACY =n then the address should be generated from&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/ficr.html?cp=4_2_0_12_0_13#register.DEVICEADDR-0"&gt;DEVICEADDR[0]&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/ficr.html?cp=4_2_0_12_0_14#register.DEVICEADDR-1"&gt;DEVICEADDR[1]&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read local identity of nRF52832</title><link>https://devzone.nordicsemi.com/thread/270676?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 17:09:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e1bd345-eaa8-4984-826a-5768c7b8042a</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;You might find this useful:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@note
 * Some module manufacturers define a MAC address stored within NRF_UICR, which matches the address inscribed on
 * the module. The Nordic examples use the Device Id in NRF_FICR to form a MAC address, which is different and fixed
 *
 * MAC Address
 * ===========
 * DA:88:19:2D:84:29 MM-7A530EC8 from DE5FDA88192D8429
 *
 * Last 2 bits in 48-bit stream - top 2 bits in last byte of Device Address
 * 00 Public
 * 01 Static
 * 10 Resolvable
 * 11 Non-Resolvable
 *
 * Note that even though the address is &amp;quot;Random&amp;quot;, it is invariant and never changes
 * for a specific Nordic device as the NRF_FICR-&amp;gt;DEVICEADDR registers are Read-Only
 */

bool BleMacAdr(void)
{
#if defined(SOFTDEVICE_PRESENT)
  char Report[180];
  uint32_t Space = sizeof(Report)-1;
  // Get actual BLE address in case it is different from hardware register BLE address
  ble_gap_addr_t device_addr; // 48-bit address, LSB format
  sd_ble_gap_addr_get(&amp;amp;device_addr);
  snprintf(&amp;amp;Report[strlen(Report)], Space, &amp;quot;  - 64-bit Id %08X%08X\r\n&amp;quot;, NRF_FICR-&amp;gt;DEVICEADDR[1], NRF_FICR-&amp;gt;DEVICEADDR[0]);
  Space = sizeof(Report) - strlen(Report) - 1;
  snprintf(&amp;amp;Report[strlen(Report)], Space, &amp;quot;  - BLE MAC: Peer %u, Type %u Addr %02X:%02X:%02X:%02X:%02X:%02X\r\n&amp;quot;, 
                  device_addr.addr_id_peer, device_addr.addr_type, device_addr.addr[0], device_addr.addr[1],
                  device_addr.addr[2], device_addr.addr[3], device_addr.addr[4], device_addr.addr[5]);
  // Send report via whatever ..
#endif
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This give something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; - 64-bit Id 01F4CFCDE1A8BAA2
 - BLE MAC: Peer 0, Type 1 Addr A2:BA:A7:E1:CD:CF&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>