<?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 query SD140 version from application code?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53081/how-to-query-sd140-version-from-application-code</link><description>How can application code interrogate the SD140 to identify which version (such as 6.0.0) is running. 
 We pre-flash (before SMT) our nRF52840 with a bootloader and SD140, and then later flash our application code using the USB bootloader. That application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Oct 2019 07:43:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53081/how-to-query-sd140-version-from-application-code" /><item><title>RE: How to query SD140 version from application code?</title><link>https://devzone.nordicsemi.com/thread/214280?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 07:43:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd6b08c4-920a-4a39-b096-94d81223610a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What Keith is saying is correct, you&amp;#39;ll have to read the FWID and &amp;quot;translate&amp;quot; it into the SoftDevice version they represent, this is done in the nRFConnect for desktop Programmer app, whereupon SoftDevice detection, it prints the FWID and SoftDevice version, I.E &amp;quot;&lt;span&gt;SoftDevice detected, id 0x87 (S130 v2.0.1)&amp;quot;. I&amp;#39;m not 100% sure, but I think you should be able to find the source code for this &lt;a href="https://github.com/NordicSemiconductor/pc-nrfconnect-core"&gt;here&lt;/a&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;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to query SD140 version from application code?</title><link>https://devzone.nordicsemi.com/thread/214235?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 23:14:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a54c3836-a611-4f5c-b5f8-6560aeea1222</guid><dc:creator>Keith Brafford</dc:creator><description>&lt;p&gt;It looks like we need to do it ourselves. The original answer did suggest this strategy. This is pretty lame, but I guess it saves them bytes?&lt;br /&gt;&lt;br /&gt;&lt;em&gt;The list of what firmware ID maps to which softdevice version is not public. What you can do however, is to flash all the different versions of softdevices that are possible to reside on your chips and see what firmware ID those return and you can obtain the mapping yourself&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;...also...&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span&gt;About a year ago we started printing the FWID in the SoftDevice release notes. In SDK 15 you will find those in &amp;lt;sdk folder&amp;gt;/components/softdevice/&amp;lt;sxxx&amp;gt;/doc/, where &amp;lt;sxxx&amp;gt; is the particular SoftDevice (e.g. s132, s140, etc.)&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to query SD140 version from application code?</title><link>https://devzone.nordicsemi.com/thread/214234?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 23:02:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa543659-a5dc-4f42-80e2-cd2333b8cd30</guid><dc:creator>t_prachar</dc:creator><description>&lt;p&gt;My question isn&amp;#39;t how to get the magic byte, but rather how to identify *which* version is running.&amp;nbsp; The answer would be in the form such as 6.0.0 which is how Nordic publishes the versions and names the hex files.&amp;nbsp; I don&amp;#39;t see any hex file published by Nordic named SD140_0xA9.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to query SD140 version from application code?</title><link>https://devzone.nordicsemi.com/thread/214233?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 22:56:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d7cd156-bba6-4bac-bf4b-2df62be377bc</guid><dc:creator>Keith Brafford</dc:creator><description>&lt;p&gt;It looks like you can use nrfjprog to read memory (the &amp;quot;memrd&amp;quot; option) at location 0x0000300C and look for the value 0xA9&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrfjprog --family NRF52 --memrd 0x0000300C&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/1171/how-do-i-access-softdevice-version-string"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/1171/how-do-i-access-softdevice-version-string&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;So from your application code I suspect you can do something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define SD140_VAL_600 0xA9&lt;br /&gt;#define SD132_VAL_601 0xB7&lt;br /&gt;&lt;br /&gt;int verify_sd_is_good(uint8_t sd_sanity_value)&lt;br /&gt;{&lt;br /&gt;  uint32_t *addr_loc = 0x0000300C;&lt;br /&gt;&lt;br /&gt;  return ((*addr_loc) &amp;amp; 0x000000FF) == &lt;/code&gt;sd_sanity_value;&lt;br /&gt;}&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>