<?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>Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70795/replacing-s140-with-s340-softdevice</link><description>Hello, 
 nRF SDK v16.0 , Softdevices s140_nrf52_7.0.1_softdevice and ANT_s340_nrf52840_6.1.1 
 Recently we wanted to add ANT to our BLE application. So we changed the softdevice in the application from S140 to S340. The new BLE+ANT app runs smoothly.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 05 Oct 2021 07:11:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70795/replacing-s140-with-s340-softdevice" /><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/332476?ContentTypeID=1</link><pubDate>Tue, 05 Oct 2021 07:11:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:366c5723-0c2e-4b70-8790-3f3f642c5202</guid><dc:creator>mrono</dc:creator><description>[quote userid="76817" url="~/f/nordic-q-a/70795/replacing-s140-with-s340-softdevice/331990#331990"]&lt;p&gt;&lt;span&gt;The behavior is consistent and I cannot understand why it&amp;#39;s successful first time but not the second time.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It always gives error on step#4, never has any issue on step #2&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Version checking for bootloader updates is more strict than for application updates. The bootloader will reject attempts to update the bootloader itself unless the new bootloader has a higher version number than the currently installed bootloader.&lt;/p&gt;
&lt;p&gt;This is normally not a problem, but is a real headache in your use case:&lt;/p&gt;
[quote userid="76817" url="~/f/nordic-q-a/70795/replacing-s140-with-s340-softdevice/331990#331990"]My goal is that the end user should be able to switch b/w S140 and S340 based files any time.[/quote]
&lt;p&gt;I would change the version check in the bootloader to accept also bootloader updates with the same version. Otherwise you&amp;#39;d need to increment the version and recreate the DFU package every time the user wants to do this change.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/332466?ContentTypeID=1</link><pubDate>Tue, 05 Oct 2021 06:51:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8c6385f-59d8-4518-bfa1-f5379e8f3a1f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Aftab,&lt;/p&gt;
&lt;p&gt;Can you test with the debug bootloader (with RTT logging) and post the log here, so that we can hopefully understand a bit more about which check fails where?&lt;/p&gt;
&lt;p&gt;Also, please note that while I do not see any problems switching between SoftDevice types that is not directly supported nor something we test (which is why it is prevented by the default bootloader), so it is important that you test this properly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/331990?ContentTypeID=1</link><pubDate>Thu, 30 Sep 2021 15:32:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ba06b23-d47f-4ac1-8147-f17cdb82565b</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;Now I&amp;#39;m trying to reverse change the SD and App. I.e, from S340 to S140.&lt;/p&gt;
&lt;p&gt;I created the BL+SD+APP for the S140, the same way as for S340 as explained in above posts.&lt;/p&gt;
&lt;p&gt;I am able to reverse the firmware from S340 to S140.&lt;/p&gt;
&lt;p&gt;So here is what I have achieved till now:&lt;/p&gt;
&lt;p&gt;1. I erase all firmware from a device + upload SD(S140)+BL. Then upload the firmware (APP) with same S140 settings.&lt;/p&gt;
&lt;p&gt;2. I am able change from the firmware with S140 (BLE only) to the firmware with S340 (BLE+ANT) -&lt;strong&gt;successful&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;3. C&lt;span&gt;hange from the firmware with S340 (BLE+ANT) to the firmware with S140 (BLE only) - &lt;strong&gt;successful&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4. Again,&amp;nbsp;change from the firmware with S140 (BLE only) to the firmware with S340 (BLE+ANT) - &lt;strong&gt;FAILED&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Step#4 is where&amp;nbsp;the problems arrives,&amp;nbsp;here it gives following error:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/1663.Capture.JPG" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I repeated this many times but it stops at this step.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The behavior is consistent and I cannot understand why it&amp;#39;s successful first time but not the second time.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It always gives error on step#4, never has any issue on step #2&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My goal is that the end user should be able to switch b/w S140 and S340 based files any time.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/290799?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 15:10:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f776f43-785e-4750-b2fd-8ddf95615425</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;Well I just succeeded in upgrading from S140 to S340. The key point here is that you device should be running modified BL+SD+APP (of S140) and now you can upgrade it with BL+SD+APP (of S340).&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;m testing going back from S340 to S140. Will update this thread accordingly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/290785?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 14:36:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6e16100-a291-4df7-bebb-2cdd798ce3dd</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;I also tried to increase bootloader version number in the package generator command. Still the same.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/290782?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 14:35:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ae0457b-9a44-4dac-bb42-574dfb6f6cd7</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;After the changes in the last step (where S340 based bootloader now shows DfuTarg and new firmware can be uploaded), I tried again.&lt;/p&gt;
&lt;p&gt;1. Uploaded device with S140 based softdevice+bootloader (aka merged_SD_bootloader.hex file).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. Tried to upload S340 based new firmware, got this error:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/code3_5F00_uploading_5F00_s340_5F00_zipfile_5F00_over_5F00_existing_5F00_s140.JPG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/290778?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 14:23:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d38623e8-9476-4bdd-b3dd-24a36d0bc29a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;So what is the current FW version in your settings? Or perhaps it is the bootloader version that you need to increase.&lt;/p&gt;
&lt;p&gt;If you are not sure, please try the debug version of the bootloader (pca10056_s140_ble_debug), and monitor the RTT log. Why was the image rejected?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/290772?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 14:09:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e570f4d-a434-4d2a-aa33-69ea2da79299</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;Later I noticed that my device wouldn&amp;#39;t come to bootloader mode (DfuTarg name) if I merge the new bootloader with software and simple flash it. This post helped me to correct the error, I had to change the headers in the include path from s140 to s340.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/67302/ble-bootloader-example"&gt;devzone.nordicsemi.com/.../ble-bootloader-example&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I noticed that simple flash of bootloader+SD gives correct results (Can see DfuTarg and upload file).&lt;/p&gt;
&lt;p&gt;Now heading towards main issue (Upgrading S140 based app to S340 based app).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/290703?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 10:28:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d47c93cd-6c45-433c-8d7b-49dfa2851206</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;Here is what I did and it&amp;#39;s result.&lt;/p&gt;
&lt;p&gt;1. I commented out the following lines from old bootloader (used with S140 softdevice) and generated the bootloader.hex. Copied it to my old project location where I generate hex file.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;else if (SD_PRESENT &amp;amp;&amp;amp; (SD_ID_GET(MBR_SIZE) != SD_ID_GET(sd_start_addr)))
{
    NRF_LOG_ERROR(&amp;quot;The new SoftDevice is of a different family than the present SoftDevice. Compatibility cannot be guaranteed.&amp;quot;);
    result = false;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp;Created new firmware zip file: &lt;strong&gt;modified bootloader+S140+APP&lt;/strong&gt;&amp;nbsp;and uploaded to my device&lt;/p&gt;
&lt;p&gt;3. Copied the secure bootloader project in SDK 16 and renamed it secure_bootloader_s340 (just to be on safe end)&lt;/p&gt;
&lt;p&gt;4. In the pre-processor settings of this project, changed line to following.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_SD_BLE_API_VERSION=6
S340&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using softdevice&amp;nbsp;ANT_s340_nrf52840_6.1.1.hex for ANT. Previously these values were 7 and S140 respectively for old bootloader.&lt;/p&gt;
&lt;p&gt;5. Generated the new bootloader, created two files&lt;/p&gt;
&lt;p&gt;i. BL + SD&lt;/p&gt;
&lt;p&gt;ii. BL + SD + APP&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;6. Tried to upload the file, in both cases I get following error message:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/error5_5F00_uploading_5F00_s340_5F00_zipfile_5F00_over_5F00_existing_5F00_s140.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;7. This time it&amp;#39;s not about softdevice, it gives FW_VERSION_FAILURE, so I tried to increment --application-version from 1 to 2 in the package generator command, &lt;strong&gt;the issue still remains&lt;/strong&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/290701?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 10:23:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56c91403-3e3e-4b57-ac34-96ea2f824572</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
&lt;p&gt;A colleague of mine made me aware of a change that you would need to do in your bootloader.&lt;/p&gt;
&lt;p&gt;The bootloader has a check:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    else if (SD_PRESENT &amp;amp;&amp;amp; (SD_ID_GET(MBR_SIZE) != SD_ID_GET(sd_start_addr)))
    {
        NRF_LOG_ERROR(&amp;quot;The new SoftDevice is of a different family than the present SoftDevice. Compatibility cannot be guaranteed.&amp;quot;);
        result = false;
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If this is present in your current bootloader, you would need to change this bit in the bootloader, perform a DFU with this bootloader update (image containing bootloader with fix and old softdevice), then you can update to the new softdevice using the method described above.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Replacing s140 with s340 softdevice</title><link>https://devzone.nordicsemi.com/thread/290693?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 10:05:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc7a24a6-db0e-4c17-84b0-b4d79a61c722</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t really tried this myself with the ANT softdevices before, but when you change the softdevice, you should in general also update the bootloader. Perhaps this is why it doens&amp;#39;t work in the first case. The bootloader denies the softdevice update because if it turns out having a bootloader and softdevice that doesn&amp;#39;t match, then the device is possibly (probably) bricked.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Try either generating a package including:&lt;/p&gt;
&lt;p&gt;1: SD + BL&lt;/p&gt;
&lt;p&gt;2: SD + BL + APP.&lt;/p&gt;
&lt;p&gt;Either of them should work. If the softdevice S140 and S340 is the same version, then you can use the same bootloader as you are currently using when generating the packet.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you update using SD + BL, then it should start advertising as DfuTarg. If you include the APP, it will start the app. Note that when you generate a DFU image using SD + BL + APP, then this is actually split into two transfers. First SD + BL, and then the application at last.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So try generating an image using BL + SD, and let me know whether it is accepted or not.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>