<?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 can I determine the softdevice ID from data in the dfu package?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61117/how-can-i-determine-the-softdevice-id-from-data-in-the-dfu-package</link><description>I have implemented a bootloader without BLE that simply transfers softdevice/application/bootloader from external flash to the internal flash, performs usual validation and copy. 
 
 To avoid the possible incompatibility between the stored softdevice</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 May 2020 14:46:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61117/how-can-i-determine-the-softdevice-id-from-data-in-the-dfu-package" /><item><title>RE: How can I determine the softdevice ID from data in the dfu package?</title><link>https://devzone.nordicsemi.com/thread/248774?ContentTypeID=1</link><pubDate>Thu, 07 May 2020 14:46:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d45f08f-dfd8-43e7-a8a3-795058b7aa15</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Anthony,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user=""][/quote]&lt;/p&gt;
&lt;p&gt;I am just now trying to implement this check but I have hit a snag...&amp;nbsp; I don&amp;#39;t see any indication of the sd-id in the init_cmd.&amp;nbsp; Since&amp;nbsp; I am installing a softdevice+bootloader, the fw_version is reporting the bootloader version.&amp;nbsp; I considered using the value stored in the sd-req field,&amp;nbsp; however its possible this field would contain multiple values.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is it possible to get the sd-id value that was provided to nrfutil pkg generate from the init command?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;the init packet does not have any sd-id field, see&amp;nbsp;&lt;span&gt;&lt;a title="Init packet" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_bootloader_dfu_validation.html?cp=7_1_3_5_1_1_0#lib_bootloader_dfu_init"&gt;Init packet&lt;/a&gt;&amp;nbsp;on the Infocenter&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When performing SD+BL+APP update, then as we discussed in the previous ticket nrfutil will split this into two updates, first a SD+BL update and then APP update.&amp;nbsp; So when generating a&amp;nbsp;&lt;span&gt;SD+BL+APP firmware package the zip will contain two init packets(.dat files) one for the SD+BL and one for the Application.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The value passed as&amp;nbsp;&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;--sd-id is he new SoftDevice ID to be used as --sd-req &lt;/span&gt;&lt;span style="font-family:inherit;"&gt;for the Application update. So if want to check the sd-id&amp;nbsp; then you need to check the sd_req field of the application init packet.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user=""]Is there anyway to look into the softdevice data and extract the softdevice ID, for example is it stored in a fixed location?[/quote]
&lt;p&gt;&amp;nbsp;Yes, the ID of the SoftDevice is stored at a fixed location, 0x300C&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/** @brief Defines the SoftDevice Information Structure location (address) as an offset from
the start of the SoftDevice (without MBR)*/
#define SOFTDEVICE_INFO_STRUCT_OFFSET (0x2000)

/** @brief Defines the offset for FWID value relative to the SoftDevice base address. The FWID value
 *         is of type uint16_t.  */
#define SD_FWID_OFFSET (SOFTDEVICE_INFO_STRUCT_OFFSET + 0x0C)&lt;/pre&gt;The&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>