<?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>Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111234/issues-with-completing-dfu-after-updated-to-ncs-v2-6-0</link><description>We have some custom hardware that utilises an NRF52832. Up until recently, all our firmware was built on NCS V2.2.0, which I believe used Zephyr V3.2.99. We have implemented DFU for firmware upgrades, and haven&amp;#39;t had any issues with this. Up until now</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 May 2024 20:54:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111234/issues-with-completing-dfu-after-updated-to-ncs-v2-6-0" /><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/486749?ContentTypeID=1</link><pubDate>Thu, 30 May 2024 20:54:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63a864d9-dbea-4e05-af73-d37f665d1546</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Thanks Vidar.&lt;/p&gt;
&lt;p&gt;We have something working now - &amp;quot;hacked&amp;quot; the smt_bt.c file so that with&amp;nbsp;&lt;span&gt;CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN=n, we set the permissions on the SMP service to&amp;nbsp;BT_GATT_PERM_WRITE_ENCRYPT &amp;amp; BT_GATT_PERM_READ_ENCRYPT.&amp;nbsp; If its set to &amp;quot;y&amp;quot;, then it defaults to&amp;nbsp;&amp;nbsp;BT_GATT_PERM_WRITE_AUTHEN &amp;amp; BT_GATT_PERM_READ_AUTHEN.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We&amp;#39;re still not sure how we managed to get the upgrade from v1.6 to v1.7 of our firmware to work, as it looks like we had set CONFIG_MCUMGR_SMP_BT_AUTHEN=y in v1.6.&amp;nbsp; For the product we have out in the field, we&amp;#39;re trying another &amp;quot;hack&amp;quot; in our App that detects a device that has firmware v1.6 and approaches the OTA process slightly differently.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Appreciate all your help in getting a resolution to this one!&amp;nbsp; Certainly one of the more challenging tickets I&amp;#39;ve had up on DevZone&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mike&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/486424?ContentTypeID=1</link><pubDate>Wed, 29 May 2024 12:21:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:950d71f0-c23a-4f6d-8f1b-34ee1f8560cf</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;The &amp;#39;erase settings&amp;#39; option will cause the bonding information to be deleted, so I think this may explain some of the problems you&amp;#39;ve been experiencing, at least.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;CONFIG_MCUMGR_SMP_BT_AUTHEN was renamed to CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN in Zephyr v.3.3 (&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/doc/releases/release-notes-3.3.rst"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/main/doc/releases/release-notes-3.3.rst&lt;/a&gt;), and is used in the service declaration here:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/db34adf9c3d856b15f9662e034e44727aa16de47/subsys/mgmt/mcumgr/transport/src/smp_bt.c#L355"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/db34adf9c3d856b15f9662e034e44727aa16de47/subsys/mgmt/mcumgr/transport/src/smp_bt.c#L355&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Mike Austin (LPI)"]Interestingly, in our factory code, we have this set to &amp;quot;n&amp;quot;, but in our operational code (in both v1.6 and v1.7) we have this set to &amp;quot;y&amp;quot;, yet the upgrade from v1.6 to v1.7 [/quote]
&lt;p&gt;That is strange. Did you verify that the symbol ended up being selected in the generated .config file?&lt;/p&gt;
[quote user="Mike Austin (LPI)"]&lt;p&gt;&lt;span&gt;As we&amp;#39;re sending an unencrypted file, it seems we need the encrypted connection but as we don&amp;#39;t have any means of entering or displaying passkeys, we can&amp;#39;t have the requirement for authentication.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is there a way to have BT_GATT_PERM_WRITE_ENCRYPT &amp;amp; BT_GATT_PERM_READ_ENCRYPT permission setting on the SMP service within v2.2.0 and v2.6.0 without needing to &amp;quot;hack&amp;quot; the Zephyr files?&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Authentication limits who can initiate DFU (typcically those who have physical access to the device), but I don&amp;#39;t think encryption itself offers much added security as the update binary is not encrypted in the app.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can change the sec. level to require encryption, but this requires the smp service to be modified as there is no Kconfig symbol setting to only enable encryption.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/db34adf9c3d856b15f9662e034e44727aa16de47/subsys/mgmt/mcumgr/transport/src/smp_bt.c#L355"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/db34adf9c3d856b15f9662e034e44727aa16de47/subsys/mgmt/mcumgr/transport/src/smp_bt.c#L355&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/486284?ContentTypeID=1</link><pubDate>Wed, 29 May 2024 03:48:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16dee255-0f35-4830-b3c5-876285716472</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;We tried turning that setting off, but it had on effect on our ability to do a DFU OTA.&lt;/p&gt;
&lt;p&gt;We did some logging from within the nRF Connect App to see if we could get some further information.&amp;nbsp;&amp;nbsp;We currently have 3 versions of firmware we are using for testing:&lt;/p&gt;
&lt;p&gt;V1.6 - this is what is currently in field deployed devices, and is built on NCS v2.2.0&lt;/p&gt;
&lt;p&gt;V1.7 - this is an upgrade that we were planning to release, but when we tested it noticed it had a few bugs we hadn&amp;#39;t uncovered in V1.6.&amp;nbsp; This is also built on NCS V2.2.0&lt;/p&gt;
&lt;p&gt;V1.8 - this is the newest version, that fixes the bugs in V1.7, but it built around NCS V2.6.0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We tried going from V1.6 -&amp;gt; V1.7 -&amp;gt; V1.8. In each case we had nRF Connect set to &amp;quot;Test and Confirm&amp;quot;,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Upgrade from V1.6 (NCS V2.2.0) to V1.7 (NCS V2.2.0) &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Found valid Firmware in file:///private/var/mobile/Containers/Data/Application/C16C782E-248A-43B7-98F8-B64C510541BD/Documents/6_update_1.7.bin for Device DFU McuMgr.

Upgrade started with 1 image(s) using &amp;#39;Test and Confirm&amp;#39; mode

Firmware Upgrade Started.

State changed from none to requestMcuMgrParameters

Peripheral connected

Device ready

Mcu Manager parameters received (4 x 2475)

State changed from requestMcuMgrParameters to bootloaderInfo

Bootloader info not supported

State changed from bootloaderInfo to validate

Image List response: Header: {&amp;quot;version&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;op&amp;quot;: &amp;quot;1&amp;quot;, &amp;quot;flags&amp;quot;: 0, &amp;quot;length&amp;quot;: 134, &amp;quot;group&amp;quot;: 1, &amp;quot;seqNum&amp;quot;: 130, &amp;quot;commandId&amp;quot;: 0}, Payload: {&amp;quot;images&amp;quot; : {{&amp;quot;bootable&amp;quot; : true, &amp;quot;version&amp;quot; : &amp;quot;0.0.0&amp;quot;, &amp;quot;hash&amp;quot; : 0xC25B88AA20BEC2CC7E5BE0415A93344EF27AC17E641194893AAC3D88BFDE0A45, &amp;quot;pending&amp;quot; : false, &amp;quot;active&amp;quot; : true, &amp;quot;permanent&amp;quot; : false, &amp;quot;confirmed&amp;quot; : true, &amp;quot;slot&amp;quot; : 0}}, &amp;quot;splitStatus&amp;quot; : 0}

Scheduling upload (hash: 0x2A78A535D1BAB0A61ED01DEC2872F2CB60C6B15DE7A26AF0C2E3DD2212FB4079) for image 0 (slot: 1)

State changed from validate to upload

No remaining chunks to be sent? chunkOffset: 203620, imageData: 203620.

No remaining chunks to be sent? chunkOffset: 203620, imageData: 203620.

Upload finished (1 of 1)

State changed from upload to test

Image Test response: Header: {&amp;quot;version&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;op&amp;quot;: &amp;quot;3&amp;quot;, &amp;quot;flags&amp;quot;: 0, &amp;quot;length&amp;quot;: 244, &amp;quot;group&amp;quot;: 1, &amp;quot;seqNum&amp;quot;: 215, &amp;quot;commandId&amp;quot;: 0}, Payload: {&amp;quot;images&amp;quot; : {{&amp;quot;hash&amp;quot; : 0xC25B88AA20BEC2CC7E5BE0415A93344EF27AC17E641194893AAC3D88BFDE0A45, &amp;quot;confirmed&amp;quot; : true, &amp;quot;active&amp;quot; : true, &amp;quot;slot&amp;quot; : 0, &amp;quot;pending&amp;quot; : false, &amp;quot;version&amp;quot; : &amp;quot;0.0.0&amp;quot;, &amp;quot;permanent&amp;quot; : false, &amp;quot;bootable&amp;quot; : true}, {&amp;quot;confirmed&amp;quot; : false, &amp;quot;version&amp;quot; : &amp;quot;0.0.0&amp;quot;, &amp;quot;bootable&amp;quot; : true, &amp;quot;hash&amp;quot; : 0x2A78A535D1BAB0A61ED01DEC2872F2CB60C6B15DE7A26AF0C2E3DD2212FB4079, &amp;quot;pending&amp;quot; : true, &amp;quot;slot&amp;quot; : 1, &amp;quot;active&amp;quot; : false, &amp;quot;permanent&amp;quot; : false}}, &amp;quot;splitStatus&amp;quot; : 0}

State changed from test to reset

Reset request confirmed

Disconnected.

Peripheral disconnected

Device has disconnected

Waiting 10 seconds reconnecting...

Reconnecting...

Reconnect deferred

State changed from reset to confirm

Peripheral connected

Device ready

Image Confirm response: Header: {&amp;quot;version&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;op&amp;quot;: &amp;quot;3&amp;quot;, &amp;quot;flags&amp;quot;: 0, &amp;quot;length&amp;quot;: 244, &amp;quot;group&amp;quot;: 1, &amp;quot;seqNum&amp;quot;: 216, &amp;quot;commandId&amp;quot;: 0}, Payload: {&amp;quot;splitStatus&amp;quot; : 0, &amp;quot;images&amp;quot; : {{&amp;quot;hash&amp;quot; : 0x2A78A535D1BAB0A61ED01DEC2872F2CB60C6B15DE7A26AF0C2E3DD2212FB4079, &amp;quot;bootable&amp;quot; : true, &amp;quot;pending&amp;quot; : false, &amp;quot;permanent&amp;quot; : false, &amp;quot;active&amp;quot; : true, &amp;quot;version&amp;quot; : &amp;quot;0.0.0&amp;quot;, &amp;quot;slot&amp;quot; : 0, &amp;quot;confirmed&amp;quot; : true}, {&amp;quot;hash&amp;quot; : 0xC25B88AA20BEC2CC7E5BE0415A93344EF27AC17E641194893AAC3D88BFDE0A45, &amp;quot;bootable&amp;quot; : true, &amp;quot;permanent&amp;quot; : false, &amp;quot;slot&amp;quot; : 1, &amp;quot;confirmed&amp;quot; : false, &amp;quot;pending&amp;quot; : false, &amp;quot;version&amp;quot; : &amp;quot;0.0.0&amp;quot;, &amp;quot;active&amp;quot; : false}}}

Upgrade complete

State changed from confirm to success

Success!
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Upgrade from V1.7 (NCS V2.2.0) to V1.8 (NCS V2.6.0)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Upgrade started with 1 image(s) using &amp;#39;Test and Confirm&amp;#39; mode

Firmware Upgrade Started.

State changed from none to requestMcuMgrParameters

Peripheral connected

Device ready

Mcu Manager parameters received (4 x 2475)

State changed from requestMcuMgrParameters to bootloaderInfo

Bootloader info not supported

State changed from bootloaderInfo to validate

Image List response: Header: {&amp;quot;version&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;op&amp;quot;: &amp;quot;1&amp;quot;, &amp;quot;flags&amp;quot;: 0, &amp;quot;length&amp;quot;: 244, &amp;quot;group&amp;quot;: 1, &amp;quot;seqNum&amp;quot;: 116, &amp;quot;commandId&amp;quot;: 0}, Payload: {&amp;quot;images&amp;quot; : {{&amp;quot;permanent&amp;quot; : false, &amp;quot;confirmed&amp;quot; : true, &amp;quot;bootable&amp;quot; : true, &amp;quot;pending&amp;quot; : false, &amp;quot;hash&amp;quot; : 0x2A78A535D1BAB0A61ED01DEC2872F2CB60C6B15DE7A26AF0C2E3DD2212FB4079, &amp;quot;version&amp;quot; : &amp;quot;0.0.0&amp;quot;, &amp;quot;active&amp;quot; : true, &amp;quot;slot&amp;quot; : 0}, {&amp;quot;pending&amp;quot; : false, &amp;quot;slot&amp;quot; : 1, &amp;quot;bootable&amp;quot; : true, &amp;quot;version&amp;quot; : &amp;quot;0.0.0&amp;quot;, &amp;quot;active&amp;quot; : false, &amp;quot;permanent&amp;quot; : false, &amp;quot;confirmed&amp;quot; : false, &amp;quot;hash&amp;quot; : 0xC25B88AA20BEC2CC7E5BE0415A93344EF27AC17E641194893AAC3D88BFDE0A45}}, &amp;quot;splitStatus&amp;quot; : 0}

Secondary slot of image 0 will be overwritten

Scheduling upload (hash: 0x79834FF4F72A0934C370B232E754CD1FF56971FCCB565A7593A4B3A88EE487CA) for image 0 (slot: 1)

State changed from validate to upload

Retry 1 for seq: 159

Retry 1 for seq: 181

No remaining chunks to be sent? chunkOffset: 207260, imageData: 207260.

No remaining chunks to be sent? chunkOffset: 207260, imageData: 207260.

Upload finished (1 of 1)

State changed from upload to test

Image Test response: Header: {&amp;quot;version&amp;quot;: &amp;quot;0&amp;quot;, &amp;quot;op&amp;quot;: &amp;quot;3&amp;quot;, &amp;quot;flags&amp;quot;: 0, &amp;quot;length&amp;quot;: 244, &amp;quot;group&amp;quot;: 1, &amp;quot;seqNum&amp;quot;: 208, &amp;quot;commandId&amp;quot;: 0}, Payload: {&amp;quot;splitStatus&amp;quot; : 0, &amp;quot;images&amp;quot; : {{&amp;quot;pending&amp;quot; : false, &amp;quot;version&amp;quot; : &amp;quot;0.0.0&amp;quot;, &amp;quot;confirmed&amp;quot; : true, &amp;quot;hash&amp;quot; : 0x2A78A535D1BAB0A61ED01DEC2872F2CB60C6B15DE7A26AF0C2E3DD2212FB4079, &amp;quot;slot&amp;quot; : 0, &amp;quot;permanent&amp;quot; : false, &amp;quot;active&amp;quot; : true, &amp;quot;bootable&amp;quot; : true}, {&amp;quot;confirmed&amp;quot; : false, &amp;quot;hash&amp;quot; : 0x79834FF4F72A0934C370B232E754CD1FF56971FCCB565A7593A4B3A88EE487CA, &amp;quot;bootable&amp;quot; : true, &amp;quot;slot&amp;quot; : 1, &amp;quot;active&amp;quot; : false, &amp;quot;version&amp;quot; : &amp;quot;0.0.0&amp;quot;, &amp;quot;pending&amp;quot; : true, &amp;quot;permanent&amp;quot; : false}}}

State changed from test to reset

Reset request confirmed

Peripheral disconnected

Device has disconnected

Waiting 10 seconds reconnecting...

Disconnected.

Reconnecting...

Reconnect deferred

State changed from reset to confirm

Peripheral connected

The handle is invalid.

Request (SMPv1, group: image, seq: 209, command: state) failed: The handle is invalid.

The handle is invalid.

DFU failed: The handle is invalid.

DFU Failed with Error: The handle is invalid.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;A colleague stumbled across this&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/66828/smp-server-sample-with-config_mcumgr_smp_bt_authen-y"&gt;ticket&lt;/a&gt;, which seems to indicate that with&amp;nbsp;&lt;span&gt;CONFIG_MCUMGR_SMP_BT_AUTHEN=y, that you need encryption and authentication.&amp;nbsp; Interestingly, in our factory code, we have this set to &amp;quot;n&amp;quot;, but in our operational code (in both v1.6 and v1.7) we have this set to &amp;quot;y&amp;quot;, yet the upgrade from v1.6 to v1.7 works as long as the device is paired, which sort of doesn&amp;#39;t make sense&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;(Note - we don&amp;#39;t have any display options for passkeys on our device, so can&amp;#39;t authenticate)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In NCS v2.6.0, the config setting&amp;nbsp;CONFIG_MCUMGR_SMP_BT_AUTHEN doesn&amp;#39;t seem to be valid and I can&amp;#39;t find anywhere in the corresponding smt_bt.c file where the SMP service is declared, so I can&amp;#39;t see how its configured in terms of encryption/authentication&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As we&amp;#39;re sending an unencrypted file, it seems we need the encrypted connection but as we don&amp;#39;t have any means of entering or displaying passkeys, we can&amp;#39;t have the requirement for authentication.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is there a way to have BT_GATT_PERM_WRITE_ENCRYPT &amp;amp; BT_GATT_PERM_READ_ENCRYPT permission setting on the SMP service within v2.2.0 and v2.6.0 without needing to &amp;quot;hack&amp;quot; the Zephyr files?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mike&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/485808?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 12:17:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc479d9c-3984-4a3c-879a-614a1c3ec0a0</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Sorry for not noticing this earlier, but this setting will erase the settings partition when you do DFU:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1716553017051v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Do you experience the same if you turn it off? I have requested that we make this disabled by default&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/485615?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 11:28:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ae5eab9-0792-4512-bfe7-01745cd28e98</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Is it possible to enable logging in the new version to see if there are any errors reported? E.g., if the&amp;nbsp; link fails to be secured. You can also use the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/connectivity/bluetooth/api/gap.html"&gt;bt_foreach_bond()&lt;/a&gt;&amp;nbsp;function to find out how many bonds are stored to check that bonds are not being erased during the DFU process.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/485525?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 05:22:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6d78a56-2814-4e96-97fb-1dd8b06fd9d8</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;OK, checked the Attributes Table order between the two versions of firmware built around the two versions of NCS, and they are exactly the same.&lt;/p&gt;
&lt;p&gt;So, something seems to have changed in how the SMP service is set up.&lt;/p&gt;
&lt;p&gt;To try and get around this in the short term (we have product that customers are unable to update the firmware for, so I&amp;#39;m trying to get something that will work), I did the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Went back to NCS v2.2.0/Zephyr v3.2.99&lt;/li&gt;
&lt;li&gt;Took the version of firmware that used to work, which was v1.7.&amp;nbsp; This successfully upgrades from v1.6 via our custom app.&lt;/li&gt;
&lt;li&gt;Made the very minor changes that I need to make to sort out the bug we have uncovered&lt;/li&gt;
&lt;li&gt;Set that as v1.9 (v1.8 is the one built around NCS v2.6.0 that we have been having issues with) and did a pristine build, using NCS v2.2.0&lt;/li&gt;
&lt;li&gt;Attempted to do the upgrade via the Device Manager&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Testing using Device Manager,&amp;nbsp;we are now seeing something similar to before, even though we aren&amp;#39;t changing the version of NCS/Zephyr now!&amp;nbsp; The steps are the same, and the failure occurs at the same point - the CONFIRM step - but the error is now different and is unrecoverable without rolling back to the previous version of firmware on the device.&lt;/p&gt;
&lt;p&gt;These are the details:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;At the CONFIRM step with our latest firmware version.&amp;nbsp; Attempting to Read the Image data and the error returned is &amp;quot;&lt;span style="color:#ff0000;"&gt;Encryption is insufficient&lt;/span&gt;&amp;quot;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/STEP1.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Attempting to Read the Image data again and the error changes to &amp;quot;&lt;span style="color:#ff0000;"&gt;Connection failed&lt;/span&gt;&amp;quot;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/2477.STEP2.png" /&gt;&lt;/li&gt;
&lt;li&gt;After &amp;lsquo;Forgetting the device&amp;rsquo; and turning Bluetooth Off and On again on the phone and attempting to Read the Image data again you get prompted to Pair to the device:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7268.STEP3.png" /&gt;&lt;/li&gt;
&lt;li&gt;The error retuned at this stage is &amp;quot;&lt;span style="color:#ff0000;"&gt;Authentication is insufficient&lt;/span&gt;&amp;quot;.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/6663.STEP4.png" /&gt;&lt;/li&gt;
&lt;li&gt;Device Manager thinks it is disconnected but the phone thinks it is connected:&lt;/li&gt;
&lt;li&gt;Turning Bluetooth Off and On on the phone and attempting to Read the Image data again and the error is back to &lt;span style="color:#ff0000;"&gt;Encryption is insufficient&lt;/span&gt; and then &lt;span style="color:#ff0000;"&gt;Connection failed&lt;/span&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Basically at this point it is not possible to connect to the SMP characteristic to CONFIRM the image and on the next device reboot it rolls back to the previous firmware version.&lt;/p&gt;
&lt;p&gt;For&amp;nbsp;all previous firmware, and&amp;nbsp;for this firmware also, the SMP Characteristic has been set to have Encryption without Authentication.&lt;/p&gt;
&lt;p&gt;We&amp;#39;re a bit stuck at this stage, as we basically can&amp;#39;t release product because we can&amp;#39;t upgrade the firmware.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/485387?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 11:48:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bd04488-6c55-49b4-83c6-a236d48b4607</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Yes, if I recall correctly, you had to register the SMP service from the app, while in version 2.6.0 you can use the Kconfig symbols to have the service registered automatically at startup before main(). This may affect the order in which the services are placed in the attribute table.&lt;/p&gt;
&lt;p&gt;You can use the nRF Connect app to check if the services have switched places. However, if you do this, make sure your phone is not bonded and that you turn Bluetooth off and on to avoid the attributes being cached across connections.&lt;/p&gt;
&lt;p&gt;E.g.&lt;/p&gt;
&lt;p&gt;1. Flash v2.2.0 to your board.&lt;br /&gt;2. Forget the device from settings if it is bonded.&lt;br /&gt;3. Turn Bluetooth off and on to clear any existing cache.&lt;br /&gt;4. Connect to your device using the nRF Connect app and take note of the order in which the services are placed.&lt;br /&gt;5. Repeat steps 1-4 with your new app based on v2.6.1.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/485379?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 11:27:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51f9ff3f-4b27-42eb-8719-c2884219cd60</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Thanks for the info.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve not actually changed the service definitions from one version to another, and if I understand how the SMP service is set up, its all bundled in with these two CONFIG settings, at least in NCS V2.6.0:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;CONFIG_BOOTLOADER_MCUBOOT=y&lt;br /&gt;CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;In V2.2.0, I needed to set up most of the CONFIG settings separately.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;At this point, I&amp;#39;ve decided to attempt to make the minor updates I need to keep moving forward with our product using NCS v2.2.0, but I will need to resolve this issue at some point when I do need to update my NCS&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Mike&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/484971?ContentTypeID=1</link><pubDate>Tue, 21 May 2024 07:23:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a5062d7-99d0-4ceb-9945-24738f83e7ef</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Thanks for the additional information, and sorry for the delayed response. I was out of the office on Friday and Monday as those were public holidays here in Norway.&amp;nbsp;&lt;/p&gt;
[quote user="Mike Austin (LPI)"]Go to iPhone Bluetooth Settings and ‘Forget the Device’[/quote]
&lt;p&gt;Instead of removing the bond, could you try enabling logging or debugging the new app to confirm if the link becomes secured? Alternatively, you can confirm this by capturing a sniffer trace.&lt;/p&gt;
&lt;p&gt;It could be that the bonding information is not corrupted, but that the SMP service and characteristic have been assigned different attribute handles in the new version. And that for some reason, the app may be trying to access the characteristic through the old handle. The attribute handle assigned to the SMP service depends on the order in which your BLE services are registered in the app.&lt;/p&gt;
[quote user="Mike Austin (LPI)"]Alternatively, with the changes to Zephyr and the SDK, is the SMP Characteristic no longer being set to require Authentication??[/quote]
&lt;p&gt;The SMP serivce did not require authentication by default in v2.2.0 either.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/484794?ContentTypeID=1</link><pubDate>Fri, 17 May 2024 00:16:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5598e17-c67c-4f22-a970-38d7ac0540ad</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Yep - using the same static partition layout for both versions.&amp;nbsp; Flash utilisation is around 91%&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Memory region         Used Size  Region Size  %age Used
           FLASH:       26002 B        48 KB     52.90%
             RAM:       23680 B        64 KB     36.13%
        IDT_LIST:          0 GB        32 KB      0.00%
[34/42] Linking C executable zephyr\zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:      206412 B     224768 B     91.83%
             RAM:       62408 B        64 KB     95.23%
        IDT_LIST:          0 GB        32 KB      0.00%
[37/42] Generating ../../zephyr/app_update.bin
image.py: sign the payload
[38/42] Generating ../../zephyr/app_signed.hex
image.py: sign the payload
[40/42] Generating ../../zephyr/app_test_update.hex
image.py: sign the payload
[42/42] Generating zephyr/merged.hex&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;OK, here are the details of what I did to do the upgrade:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using Confirm Only from the Basic Menu, Upgrade from 1.7 (which was built on V2.2.0) to 1.8 (which was built on V2.6.0) which completes;&lt;/li&gt;
&lt;li&gt;Switch to Advanced and &lt;strong&gt;UNSUCCESSULLY&lt;/strong&gt; Read the Image data from the device.&amp;nbsp; The error returned is &amp;lsquo;The handle is invalid&amp;rsquo;&lt;/li&gt;
&lt;li&gt;Go to iPhone Bluetooth Settings and &amp;lsquo;Forget the Device&amp;rsquo;&lt;/li&gt;
&lt;li&gt;Go back to Device Manager Advanced and &lt;strong&gt;Successfully&lt;/strong&gt; read the Image data from the device&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I took a bunch of screen shots of the upgrade process as per above.&lt;/p&gt;
&lt;p&gt;The selected firmware prior to to starting the Confirm Only upgrade (image1.png)&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4705.Image1.png" /&gt;&lt;/p&gt;
&lt;p&gt;The Upload Complete state after the upgrade and Reset of the device (image 2.png)&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/40283.Image2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Attempting to Read the Image data immediately after the Upgrade (image 3.png)&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4375.Image-3.png" /&gt;&lt;/p&gt;
&lt;p&gt;Successfully reading the Image data after &amp;lsquo;Forgetting the Device&amp;rsquo; in phone Bluetooth Settings (image4.png)&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Image-4.png" /&gt;&lt;/p&gt;
&lt;p&gt;So in summary, the upgrade is completing, but the Pairing/Bonding information appears to be corrupted/lost.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Alternatively, with the changes to Zephyr and the SDK, is the SMP Characteristic no longer being set to require Authentication??&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with completing DFU after updated to NCS V2.6.0</title><link>https://devzone.nordicsemi.com/thread/484693?ContentTypeID=1</link><pubDate>Thu, 16 May 2024 12:52:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93cf2996-84b7-4f80-84f8-e6797df6c966</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;The confirm action should not require authentication (i.e., bonding) unless the CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN symbol is selected, which does not seem to be the case based on the configuration you posted. Could you please try performing the update from the device manager using the &amp;quot;Confirm only&amp;quot; method from the &amp;quot;basic&amp;quot; menu to see if that enables you to complete the update? This will help narrow down the problem.&lt;/p&gt;
&lt;p&gt;Additionally, are you using the same static partition layout for both versions, and what is the flash utilization of the app you are uploading? You can see this from the build log.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>