<?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>Firmware detect NRF51/NRF52 at runtime</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23204/firmware-detect-nrf51-nrf52-at-runtime</link><description>Greetings, 
 We&amp;#39;ve got a product which has a NRF51 device on it, which has since updated the design to NRF52. Both variants have a DFU feature. 
 For the NRF52 I can positively identify it at runtime by reading NRF_FICR-&amp;gt;INFO.PART (which is 0x52832</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Jul 2017 12:10:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23204/firmware-detect-nrf51-nrf52-at-runtime" /><item><title>RE: Firmware detect NRF51/NRF52 at runtime</title><link>https://devzone.nordicsemi.com/thread/91264?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2017 12:10:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f5a21ee-a8d2-4467-83a8-9c915a81a264</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I think this has been requested internally before. I will forward your request, but at least the information is still available in the nRFgo studio file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware detect NRF51/NRF52 at runtime</title><link>https://devzone.nordicsemi.com/thread/91263?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2017 11:17:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ae894ed-ef83-499b-bb46-1fdd0d5407fa</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Thanks Jørgen, I&amp;#39;ve missed the condition that I need to run the tool at least once;) However last update seems to be from &lt;code&gt;20160831&lt;/code&gt;, wouldn&amp;#39;t it be really possible to support actual list on Infocenter or GitHub?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware detect NRF51/NRF52 at runtime</title><link>https://devzone.nordicsemi.com/thread/91262?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2017 10:51:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:947d9f2f-7673-489b-8401-72fe7343b5a7</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;&lt;em&gt;nrF51deviceids.xml&lt;/em&gt; will be available in &lt;em&gt;%LOCALAPPDATA%\Nordic Semiconductor\nRFgo Studio\nrF51deviceids.xml&lt;/em&gt; after you have run nRFgo Studio.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Firmware detect NRF51/NRF52 at runtime</title><link>https://devzone.nordicsemi.com/thread/91261?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2017 09:09:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2601f63c-ee10-4905-b993-8f71d9a6a5cb</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;There is indeed such identification on nRF51 family devices as well;) However it&amp;#39;s not as nice as on nRF52:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;See &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf51/dita/nrf51/pdflinks/ref_manual.html?cp=3_2"&gt;nRF51 Reference Manual on Infocenter&lt;/a&gt; and specifically CONFIGID register within &lt;code&gt;FICR&lt;/code&gt; region.&lt;/li&gt;
&lt;li&gt;There is 16-bit HWID which identifies every silicon + packaging combination Nordic&amp;#39;ve ever released.&lt;/li&gt;
&lt;li&gt;Unfortunately it&amp;#39;s not human readable value like on nRF52 &lt;code&gt;FICR&lt;/code&gt; and also Nordic doesn&amp;#39;t release public list/database of these HWIDs.&lt;/li&gt;
&lt;li&gt;Solution is to either use information from &lt;code&gt;nrF51deviceids.xml&lt;/code&gt; file which used to be distributed with nRFgo Studio installation - but Nordic has deprecated this method and now they hardcode and obfuscate this list directly into binaries of that tool (as far as I know).&lt;/li&gt;
&lt;li&gt;Alternatively you can also simply read this from every device you produce (I believe you get chips only from certain badges so each production batch has the same nRF5x HW ID) and build your own DB.&lt;/li&gt;
&lt;li&gt;You can also &lt;code&gt;CODESIZE&lt;/code&gt; and &lt;code&gt;CODEPAGESIZE&lt;/code&gt; registers from &lt;code&gt;FICR&lt;/code&gt; region as indication.&lt;/li&gt;
&lt;li&gt;In the end the information that it&amp;#39;s nRF51 can be simply added by your FW because it will be always known to it that it&amp;#39;s nRF51 (simply because I don&amp;#39;t think you could build &amp;quot;dual boot&amp;quot; FW image which would be able to run on both nRF51 and nRF52. Based on that information you again process DFU with specific FW image which can run only on one family. The only cosmetic drawback is that &amp;quot;HW identification&amp;quot; code snippet will differ for nRF51 and nRF52 but even if you want to have almost identical code (and you run on S13x SDs which are as close as possible on both platforms - which is S13x V2) there will be much more &lt;code&gt;#if defined(NRF51)&lt;/code&gt; - &lt;code&gt;#elseif defined(NRF52)&lt;/code&gt; constructions...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>