<?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>Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48642/generation-of-a-serialized-id-code-at-load-time</link><description>Hello Nordic Pros, 
 I am a retired old school hardware guy doing some firmware for an NRF51822 product using the Kiel IDE. In my prior life, doing similar work, I recollect adding some lines to a linker script in the load section that increments a variable</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Jul 2019 08:24:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48642/generation-of-a-serialized-id-code-at-load-time" /><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/198057?ContentTypeID=1</link><pubDate>Fri, 12 Jul 2019 08:24:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a070c24b-2353-48cd-ad14-8b9c3b1f6af5</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Apparently, the DEVICEID is &lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;not&lt;/em&gt;&lt;/span&gt; guaranteed to be unique:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/49664/deviceid-is-unique---but-is-it-random/198038#198038"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/49664/deviceid-is-unique---but-is-it-random/198038#198038&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f62e.svg" title="Open mouth"&gt;&amp;#x1f62e;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/194197?ContentTypeID=1</link><pubDate>Sun, 23 Jun 2019 22:40:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77fd86f7-f25d-48ad-85ba-c588de77d598</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;yes it&amp;#39;s unique, no it doesn&amp;#39;t matter whether it&amp;#39;s bit and byte swapped or not as long as you use it consistently.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/194191?ContentTypeID=1</link><pubDate>Sun, 23 Jun 2019 15:17:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:835c6e26-8363-4977-939f-3f805c68f9a4</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;So, whoever wrote the ble uart central example did not perform the proper bit swapping when printing out this ID?&lt;/p&gt;
&lt;p style="text-align:left;"&gt;Again, should I care?&amp;nbsp; It seems a truly random generated code, bit shuffled, would still be random, so long as the shuffle is always the same, no?&lt;/p&gt;
&lt;p style="text-align:left;"&gt;Thanks again all,&lt;/p&gt;
&lt;p style="text-align:left;"&gt;Robin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/194188?ContentTypeID=1</link><pubDate>Sun, 23 Jun 2019 08:20:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e38377f9-c41c-4dd1-ade3-b5efcbaef8fa</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;The softdevice uses little endian addresses, contrary to almost anything else in networking (which usually uses big endian &amp;quot;network byte order&amp;quot;). One needs to remember this when printing MAC addresses that originate from SD.&lt;/p&gt;
&lt;p&gt;I think the sd needs the address in little endian format in order to process it properly, especially in cases like &amp;quot;private resolvable addresss&amp;quot;. The Cortex-M0 MCU core runs little endian, too.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/194187?ContentTypeID=1</link><pubDate>Sun, 23 Jun 2019 06:57:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1500958b-35c8-48f1-b1eb-57d405a9b720</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;OK folks,&lt;/p&gt;
&lt;p&gt;I found this case that might get me part way to an answer:&amp;nbsp;Case ID: 102111&lt;/p&gt;
&lt;p&gt;Quoted from this case:&lt;/p&gt;
&lt;p&gt;&amp;quot;By default, the BLE address is derived from the NRF_FICR-&amp;gt;DEVICEADDR[] and is of 48 bits length (6&amp;nbsp; &amp;nbsp; &amp;nbsp; bytes). This registers are randomly generated in our production, and they are unique for each device&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (2^46 different combinations, due to MSbits set to &amp;#39;11&amp;#39;).&lt;/p&gt;
&lt;p&gt;You can read out the address using the API call, &amp;quot;sd_ble_gap_address_get(..);&amp;quot; or reading the FICR-&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;gt;DEVICEADDR[x] registers.&lt;/p&gt;
&lt;p&gt;Example: My device advertises with &amp;quot;0xE724 08C78790&amp;quot;&lt;/p&gt;
&lt;p&gt;DEVICEADDR[0] = 0x08C78790 DEVICEADDR[1] = 0xYYYYA724&lt;/p&gt;
&lt;p&gt;The reason why &amp;quot;A7&amp;quot; becomes &amp;quot;E7&amp;quot; is because the specification says that the 2 MSBit of the address&amp;nbsp; &amp;nbsp; must be set &amp;#39;11&amp;#39; (if you&amp;#39;re very interested, see Bluetooth Core v4.0, Vol 3, Part C, chapter 10.8.1.)&amp;quot;&lt;/p&gt;
&lt;p&gt;However, I am not sure I can resolve&amp;nbsp;how unique this number is once it is &amp;quot;scrambled&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Connecting to target &lt;span style="text-decoration:underline;"&gt;8018236d5ed8&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If I read NRF_FICR-&amp;gt;DEVICEADDR[x] I get:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style="text-decoration:underline;"&gt;6d231880, 23cad85e&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Does it matter that there is word and byte swapping going on here between what is in the&amp;nbsp;FICR and what the central prints?&amp;nbsp; Will the swapped result be as unique as the original?&amp;nbsp; Where might his swapping be occurring?&amp;nbsp; When sent, or when received/printed.&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;/p&gt;
&lt;p&gt;Robin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/194185?ContentTypeID=1</link><pubDate>Sun, 23 Jun 2019 04:44:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc648e60-fd6f-4ab2-8be9-868e68c7b012</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Hello RK,&lt;/p&gt;
&lt;p&gt;Yes I have the code, and yes this is the &amp;quot;target&amp;quot; ID I am interested in possibly using as our board Serial#.&amp;nbsp; But this only tells me where it is in the central, not where it comes from in the peripheral.&amp;nbsp; Nor do I know if it is unique to each board (ie nordic chip).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;/p&gt;
&lt;p&gt;Robin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/194183?ContentTypeID=1</link><pubDate>Sun, 23 Jun 2019 01:25:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4adbcaa4-8b6d-4183-bf2f-1a2071a4359b</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You have all the code, take a look and see what it&amp;#39;s printing out. The only reference to &amp;#39;target&amp;#39; I can see in the ble central uart code is&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Scan is automatically stopped by the connection.
141              NRF_LOG_INFO(&amp;quot;Connecting to target %02x%02x%02x%02x%02x%02x&amp;quot;,
142                       p_connected-&amp;gt;peer_addr.addr[0],
143                       p_connected-&amp;gt;peer_addr.addr[1],
144                       p_connected-&amp;gt;peer_addr.addr[2],
145                       p_connected-&amp;gt;peer_addr.addr[3],
146                       p_connected-&amp;gt;peer_addr.addr[4],
147                       p_connected-&amp;gt;peer_addr.addr[5]
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;is this what you&amp;#39;re talking about? If so then it is the peer address. If not, what &amp;#39;target ID&amp;#39; do you mean&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/194178?ContentTypeID=1</link><pubDate>Sat, 22 Jun 2019 14:57:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c60ddc00-8d9f-4961-b803-ced749f3e974</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Hello Einar,&lt;/p&gt;
&lt;p&gt;When we test we use a Nordic 10028 usb dongle running the ble uart central code as the uart interface for command/resopnse.&amp;nbsp; When the central connects, it print an ID number reference as the &amp;quot;target&amp;quot; it is connected to.&amp;nbsp; What is this number and is it unique for a product serial number?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/194176?ContentTypeID=1</link><pubDate>Sat, 22 Jun 2019 10:18:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b0c0c0c-066c-49ce-b9eb-7aed3e0514c6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Robin,&lt;/p&gt;
&lt;p&gt;Can you elaborate on what you mean by &amp;quot;target&amp;quot; ID? Is it the BLE MAC address, or something else? This is the address that is seen by the BLE peer device. If it is the BLE MAC address, then this comes from the DEVICEADDR registers in FICR (if using the default random static BLE address), and is randomly generated for each device. Given the size (48 bit) you can consider it unique for most practical purposes.&lt;/p&gt;
&lt;p&gt;If you want an incrementing serial number (as it seems from your original question), then it makes sense to do as RK suggested: put this in the UICR, and make sure that you increment the number for each device in your production programming.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/194129?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2019 13:30:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39fc3cec-60c7-46b8-b6fa-44b095bcb4c7</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Hello Einar,&lt;/p&gt;
&lt;p style="text-align:left;"&gt;I understand this, but it is not the same as the &amp;quot;target&amp;quot; ID that the central shows when connecting.&amp;nbsp; Please explain the difference and whether the &amp;quot;target&amp;quot; ID is unique enough to use as a product serial number, and if so, how to access it other than this central message?&lt;/p&gt;
&lt;p style="text-align:left;"&gt;Thank you kindly,&lt;/p&gt;
&lt;p style="text-align:left;"&gt;Robin@TL&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/193987?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2019 06:21:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adff3ce7-92a1-49e6-b057-6ae55521ec3f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The nRF51 has a 64 bit DEVICE ID in FICR (see page 22 in &lt;a href="https://infocenter.nordicsemi.com/pdf/nRF51_RM_v3.0.1.pdf?cp=4_2_0"&gt;nRF51 Reference Manual v3.0.1&lt;/a&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/193944?ContentTypeID=1</link><pubDate>Thu, 20 Jun 2019 16:44:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec17bba9-31c4-47b6-9449-f48861a9c391</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Hello again Turbo, and other Nordic Pro&amp;#39;s,&lt;/p&gt;
&lt;p&gt;So I have dropped the idea of generating my own unique idea, in favor of using something on the chip.&amp;nbsp; To test our boards we are using a BLE UART central device that reports a &amp;quot;target&amp;quot; ID number when it connects.&amp;nbsp; Do any of you know where this ID come from and whether or not is unique among chips, and where in the Nordic documentation maze that this information might reside?&lt;/p&gt;
&lt;p&gt;What a zoo trying to find this seemingly simple information!&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Robin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/193041?ContentTypeID=1</link><pubDate>Sun, 16 Jun 2019 21:44:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a26e91d7-7120-45ef-a59d-12c6249604b0</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;There&amp;#39;s a customer area in the UICR you can use, there&amp;#39;s 32 x 32 bit words there. The easiest way to program that would be to have a custom step after you flash the main software onto the board which just emits the right Segger commands to write a value in there. You can do that with the segger directly or you might find something useful in the Nordic python driver, don&amp;#39;t know as I&amp;#39;ve never looked at it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes you could also do it by stuffing a constant into a linker script and making a section which maps to the UICR and putting the value in however that&amp;#39;s probably going to be more of a pain especially as most of the IDEs abstract the whole link process away.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;d probably put this step in as part of the post flash board testing.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/193034?ContentTypeID=1</link><pubDate>Sun, 16 Jun 2019 14:20:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ca6aaba-e47a-4e62-97b4-5fc07940f9dc</guid><dc:creator>Robin</dc:creator><description>&lt;p&gt;Hello Turbo,&lt;/p&gt;
&lt;p&gt;Thanks for that info. The ID&amp;nbsp; needs to be easily recognizable ID for our customers.&amp;nbsp; So we need to generate.&amp;nbsp; It is also being used as a count of boards in the field.&lt;/p&gt;
&lt;p&gt;Any other ideas are greatly appreciated.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Robin@TL&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generation of a serialized ID code at load time.</title><link>https://devzone.nordicsemi.com/thread/193030?ContentTypeID=1</link><pubDate>Sun, 16 Jun 2019 09:48:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:008e65c1-14f3-4a3f-94fd-7eec3004f44a</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Just use FICR-&amp;gt;DEVICEID[0] and FICR-&amp;gt;DEVICEID[1].&lt;/p&gt;
&lt;p&gt;These contain a 64 bit number that will be unique for each chip.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>