<?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>What is the relationship between the BLE address and the various FICR registers?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50460/what-is-the-relationship-between-the-ble-address-and-the-various-ficr-registers</link><description>I am working with SDK15.3.0 and a PCA10040 with S132. I have two questions relating to the BLE addresses as seen by the PCA10040 and by nRF Connect. 
 Q1 - What is the relationship between the BLE address and the various FICR registers? 
 I build the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Jul 2019 13:43:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50460/what-is-the-relationship-between-the-ble-address-and-the-various-ficr-registers" /><item><title>RE: What is the relationship between the BLE address and the various FICR registers?</title><link>https://devzone.nordicsemi.com/thread/201631?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2019 13:43:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:264a55a4-9815-49f1-8717-20d4ebe0d8ca</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;No worries. Happy to help &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt; Maybe someone else who has the same questions in the future will find this post helpful, so no need to apologize.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the relationship between the BLE address and the various FICR registers?</title><link>https://devzone.nordicsemi.com/thread/201590?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2019 12:58:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc71fd84-86d6-4904-b38c-9034526006bb</guid><dc:creator>Acutetech</dc:creator><description>&lt;p&gt;Hi Edvin&lt;/p&gt;
&lt;p&gt;First, thanks for pointing out my coding error (DEVICEADDR[0] etc). When I read&amp;nbsp;NRF_FICR-&amp;gt;DEVICEADDR[0] and&amp;nbsp;NRF_FICR-&amp;gt;DEVICEADDR[1] I now get this result, with the board address shown as originating from DEVICEADDR:&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; Board address = E2:2A:8F:50:F5:A3&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addr_type=1, addr_id_peer=0&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; DEVICEADDRTYPE: FFFFFFFF&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; DEVICEID[0]: 4BC5E0FB&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; DEVICEID[1]: 75CAE81E&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; DEVICEADDR[0]: 8F50F5A3&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; DEVICEADDR[1]: 7483622A&lt;/p&gt;
&lt;p&gt;In the case of my own app, you guessed correctly: I was calling sd_ble_gap_addr_get() too soon (error code was 02). When I move this call after the softdevice is initialised it works the same as above.&lt;/p&gt;
&lt;p&gt;My apologies for my simple errors and thank you for your quick response!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the relationship between the BLE address and the various FICR registers?</title><link>https://devzone.nordicsemi.com/thread/201559?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2019 12:06:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e85f8642-7916-4fc7-94c5-d73843b56478</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;A1:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]&lt;p&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_LOG_INFO(&amp;quot;&amp;nbsp;&amp;nbsp; Board address = %02x:%02x:%02x:%02x:%02x:%02x&amp;quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;boardAddress.addr[5], boardAddress.addr[4], boardAddress.addr[3],&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;boardAddress.addr[2], boardAddress.addr[1], boardAddress.addr[0]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_LOG_INFO(&amp;quot;&amp;nbsp;&amp;nbsp;&amp;nbsp; addr_type=%d, addr_id_peer=%d&amp;quot;, boardAddress.addr_type, boardAddress.addr_id_peer);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_LOG_INFO(&amp;quot;&amp;nbsp;&amp;nbsp; DEVICEADDRTYPE: %08X&amp;quot;, NRF_FICR-&amp;gt;DEVICEADDRTYPE);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_LOG_INFO(&amp;quot;&amp;nbsp;&amp;nbsp; DEVICEID0: %08X&amp;quot;, NRF_FICR-&amp;gt;DEVICEID[0]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_LOG_INFO(&amp;quot;&amp;nbsp;&amp;nbsp; DEVICEID1: %08X&amp;quot;, NRF_FICR-&amp;gt;DEVICEID[1]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_LOG_INFO(&amp;quot;&amp;nbsp;&amp;nbsp; DEVICEADDR: %08X&amp;quot;, NRF_FICR-&amp;gt;DEVICEADDR);&lt;/p&gt;&lt;p&gt;The output is as follows:&lt;/p&gt;&lt;p&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; Board address = E2:2A:8F:50:F5:A3&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addr_type=1, addr_id_peer=0&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; DEVICEADDRTYPE: FFFFFFFF&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; DEVICEID0: 4BC5E0FB&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; DEVICEID1: 75CAE81E&lt;br /&gt;&amp;lt;info&amp;gt; app:&amp;nbsp;&amp;nbsp;&amp;nbsp; DEVICEADDR: 100000A4&lt;/p&gt;&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;It is actually the DEVICEADDR that is the BLE address, not the DEVICEID. I see that you missed one thing when printing the DEVICEADDR. Like the DEVICEID registers the DEVICEADDR is two registers. Try to print:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_LOG_INFO(&amp;quot;    DEVICEADDR0 %08x&amp;quot;, NRF_FICR-&amp;gt;DEVICEADDR[0]);
NRF_LOG_INFO(&amp;quot;    DEVICEADDR1 %08x&amp;quot;, NRF_FICR-&amp;gt;DEVICEADDR[1]);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Right now it only prints the address where the DEVICEADDR register is located, 0x1000000A4, which you can see &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fficr.html&amp;amp;cp=3_1_0_12_0&amp;amp;anchor=topic" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;. (baseaddress:&amp;nbsp;&lt;span&gt;0x10000000, offset 0x0A4)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It says in the description of DEVICEADDR (from the link):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;48 bit device address&lt;br /&gt;&lt;/em&gt;&lt;em&gt;DEVICEADDR[0] contains the least significant bits of the device address. DEVICEADDR[1] contains the most significant bits of the device address. Only bits [15:0] of DEVICEADDR[1] are used.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So only 2 bytes of DEVICEADDR are used. Also, the 2 MSBits of the BLE address has to be &amp;#39;11&amp;#39; according to the BLE spec.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You may notice (but it may not be the case on your device) that some bits of DEVICEADDR are &amp;quot;wrong&amp;quot; compared to the board address that you check with sd_ble_gap_addr_get(); This is because the some address bits are tied to the address type. So if your deviceaddr says 0x65, the address will be 0xE5, given that you use a random static address.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;A2:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;These values look semi-random. Do you fetch them the same way as you did in Q1? Where in the project do you do it? Before or after the softdevice is initialized? Does sd_ble_gap_addr_get() return 0? Try:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ble_gap_addr_t boardAddress;
ret_code_t err_code;
err_code = sd_ble_gap_addr_get(&amp;amp;boardAddress);
if (err_code == NRF_SUCCESS)
{
    NRF_LOG_INFO(&amp;quot;   Board address = %02x:%02x:%02x:%02x:%02x:%02x&amp;quot;,
            boardAddress.addr[5], boardAddress.addr[4], boardAddress.addr[3],
            boardAddress.addr[2], boardAddress.addr[1], boardAddress.addr[0]);
    NRF_LOG_INFO(&amp;quot;    addr_type=%d, addr_id_peer=%d&amp;quot;, boardAddress.addr_type, boardAddress.addr_id_peer);
    NRF_LOG_INFO(&amp;quot;   DEVICEADDRTYPE: %08X&amp;quot;, NRF_FICR-&amp;gt;DEVICEADDRTYPE);
    NRF_LOG_INFO(&amp;quot;   DEVICEID0: %08X&amp;quot;, NRF_FICR-&amp;gt;DEVICEID[0]);
    NRF_LOG_INFO(&amp;quot;   DEVICEID1: %08X&amp;quot;, NRF_FICR-&amp;gt;DEVICEID[1]);
    NRF_LOG_INFO(&amp;quot;   DEVICEADDR: %08X&amp;quot;, NRF_FICR-&amp;gt;DEVICEADDR);
}
else
{
    NRF_LOG_INFO(&amp;quot;sd_ble_gap_addr_get() failed with err_code 0x%x&amp;quot;, err_code);
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What does it say?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>