<?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>How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39252/how-to-read-public-mac-using-the-nrfjprog-exe-tool</link><description>How to read public MAC using the nrfjprog.exe tool?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Apr 2020 09:26:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39252/how-to-read-public-mac-using-the-nrfjprog-exe-tool" /><item><title>RE: How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/thread/244905?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 09:26:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e68b440-9968-4817-8a7f-fb319e708a7f</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Daniel&lt;/p&gt;
&lt;p&gt;The device address bytes stored in the flash are random numbers, and won&amp;#39;t necessarily follow the Bluetooth specification requirements for a valid BLE address.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When using a static random BLE address the two most significant bits shall both be 1, which is why 0x8B is changed to 0xCB by the SoftDevice before setting the address.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For more information please refer to the Device Address chapter in the Bluetooth specification (Vol 6, Part B, chapter 1.3 in v5.0 of the specification).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/thread/244811?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 18:26:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e416c74-56a8-4d7f-addb-15eeb7334b44</guid><dc:creator>Daniel</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When I used the same command, I was only able to read the 5 bytes correctly. The Most higher byte does not match.&lt;/p&gt;
&lt;p&gt;C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin&amp;gt;nrfjprog --memrd 0x100000A4 --n 8&lt;br /&gt;0x100000A4: &lt;strong&gt;121DCF55&lt;/strong&gt; 7C1D&lt;strong&gt;8BD6&lt;/strong&gt; |U......||&lt;/p&gt;
&lt;p&gt;From Nrfconnect, I noticed a different mac address.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1586975170812v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Am I missing anything?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/thread/152176?ContentTypeID=1</link><pubDate>Tue, 09 Oct 2018 09:14:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e40b7973-6b30-46f9-85f0-b74afd7bbe0c</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;I am glad to hear you figured it out Bon!&lt;/p&gt;
&lt;p&gt;As for your question Hugh it would be better to open a new case.&amp;nbsp;&lt;br /&gt;A quick comment though, why is the code snippet using the&amp;nbsp;sd_ble_gap_device_name_set(..) function, while you refer to sd_ble_gap_address_set() in the text?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/thread/152130?ContentTypeID=1</link><pubDate>Tue, 09 Oct 2018 02:25:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1df6637-c95f-4942-8591-c2a6596b3c3f</guid><dc:creator>bon.chen</dc:creator><description>&lt;p&gt;&lt;span class="" id="result_box" lang="en"&gt;&lt;span class=""&gt;Thank you. &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="" lang="en"&gt;&lt;span class=""&gt;Now I can read the public MAC.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/thread/152109?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 17:28:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4d88f25-d54a-42b2-9090-378fbba148fb</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;For another user on this forum asking a question on the BLE address I tried using the&amp;nbsp;&lt;em&gt;sd_ble_gap_address_set()&lt;/em&gt;&amp;nbsp;but found the address did not change even though the return code &lt;em&gt;rcode&lt;/em&gt; below was &lt;em&gt;NRF_SUCCESS&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; ble_gap_conn_sec_mode_t myMode = {.sm = 0, .lv = 0};
 uint8_t myName[6] = {0x01,0x02,0x03,0x04,0x05,0xC6};
 // Doesn&amp;#39;t allow set if BLE name is in FLASH - maybe see ref sd_ble_cfg_set()
 uint32_t rcode = sd_ble_gap_device_name_set(&amp;amp;myMode, myName, sizeof(myName));
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m curious as to why the actual BLE address reported remained unchanged. I tried both immediately after ble_stack_init() and later with the same result (success but same ble address). It&amp;#39;s not clear where the original ble address variable is located: RAM or Flash? If the latter the return code would have indicated other than success&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    db_discovery_init();
    ble_stack_init();
    ReportSignOnString();   // &amp;lt;- Test here
    gatt_init();
    nus_c_init();

    db_discovery_init();
    ble_stack_init();
    gatt_init();
    nus_c_init();
    ReportSignOnString();   // &amp;lt;- Test here
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/thread/152025?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 11:28:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cf53636-b7c1-4c9f-8fb3-41d72e925108</guid><dc:creator>CheMax</dc:creator><description>&lt;p&gt;&lt;span class="" id="result_box" lang="en"&gt;&lt;span class=""&gt;Thank you, for myself, I learned and understood everything.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=""&gt;I hope the author of this issue will also find a solution for himself.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/thread/151978?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 08:22:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c20443c-9cc7-4ff2-8f1f-d76f8901b160</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi CheMax&lt;/p&gt;
&lt;p&gt;You can set the BLE address to whatever you like using the sd_ble_gap_address_set(..) function, there is no need to change the DEVICEADDR registers.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In other words you have full flexibility in the app to control the address assignment.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/thread/151963?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 07:30:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfff229e-cbd3-4bce-9265-121027fe36bc</guid><dc:creator>CheMax</dc:creator><description>&lt;p&gt;&lt;span class="" id="result_box" lang="en"&gt;&lt;span&gt;Thanks for the addition.&lt;/span&gt;&lt;br /&gt;&lt;span&gt;As far as I understand, if I have my own address, I cannot write it to this area of memory.&lt;/span&gt; &lt;span&gt;If this is the case, then why is the address that you provide does not have high bits set?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;I really don&amp;#39;t understand the reason for this decision.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=""&gt;Thank you,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/thread/151960?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 07:23:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b8dce7b-8ca6-406e-8230-63d49620ef74</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;To add to CheMax&amp;#39;s reply, you can read DEVICEADDR[0] and DEVICEADDR[1] with the following command:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;nrfjprog --memrd 0x100000A4 --n 8&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;The first register returned will be DEVICEADDR[0], containing bits 31-0 of the BLE address.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The second register is DEVICEADDR[1], from which&amp;nbsp;the higher order bits are copied.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Keep in mind that to get a proper public MAC address you have to register it yourself with the IEEE.&amp;nbsp;&lt;br /&gt;The address provided by DEVICEADDR is a random static address only, and not guaranteed to be unique.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read public MAC using the nrfjprog.exe tool?</title><link>https://devzone.nordicsemi.com/thread/151953?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 06:54:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2651f4fd-d7b1-4811-9a66-bb7646bfa69d</guid><dc:creator>CheMax</dc:creator><description>&lt;p&gt;&lt;span class="" id="result_box" lang="en"&gt;&lt;span class=""&gt;If you look at the &amp;quot;help&amp;quot;, you will not see the direct command &amp;quot;Give a Mac&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=""&gt;but you can read the values of the two registers with the factory settings and build the MAC address of the device yourself.&lt;/span&gt; &lt;span class=""&gt;It is worth remembering that the two bits of the address (46 and 47) should be one, because the address is random and public.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="" lang="en"&gt;&lt;span class=""&gt;&lt;span class="" id="result_box" lang="en"&gt;I think that implementing it in a script language (e.g. batch) is not a difficult task.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="" lang="en"&gt;&lt;span class=""&gt;&lt;span class="" lang="en"&gt;Best regards, Max&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="" lang="en"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>