<?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>Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104903/bootloader-different-behavior-between-pca10056_s140_ble_debug-and-non-debug</link><description>Hi, 
 I want to be able to flash my programme with SWD link when doing many tests, while having bootloader. Testing with \nRF5_SDK_17.0.2\examples\dfu\secure_bootloader\pca10100_s140_ble debug version of bootloader, I can push my program with SWD when</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 Oct 2023 13:21:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104903/bootloader-different-behavior-between-pca10056_s140_ble_debug-and-non-debug" /><item><title>RE: Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/thread/451989?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2023 13:21:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d480e3a-81fe-48a8-a97e-98ca591b87eb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry about that, you are right. I but forgot about one important detail. A failed CRC check is ignored. This comes from section in&amp;nbsp;components/libraries/bootloader/dfu/nrf_dfu_validation.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;            if (crc != current_crc)
            {
                // CRC does not match with what is stored.
                NRF_LOG_DEBUG(&amp;quot;CRC check of app failed. Return %d&amp;quot;, NRF_DFU_DEBUG);
                return NRF_DFU_DEBUG;
            }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So if&amp;nbsp;NRF_DFU_DEBUG is rue, which it will be when&amp;nbsp;NRF_DFU_DEBUG_VERSION is defined, the app is considered valid even if the CRC does not match.&lt;/p&gt;
&lt;p&gt;Note that even if you use the debug version, the settings page needs to indicate that a valid app is present (which it does after generating and programming the settings page or performing a DFU operation). If you do as I suggested initially and modify app_is_valid() you will not need this either.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/thread/451965?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2023 12:34:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a11a03f-63e5-4ab6-966e-98a5d1838842</guid><dc:creator>Salmat</dc:creator><description>&lt;p&gt;&amp;quot;blinky.hex&amp;quot; and &amp;quot;hrs.hex&amp;quot; are not the same file at all !&lt;br /&gt;&lt;br /&gt;You do not seem to believe me. Just do it yourself on any kit&lt;/p&gt;
&lt;p&gt;When I say DO NOT WORK, it goes in DFU.&lt;br /&gt;WORKS it is the application&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/thread/451962?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2023 12:27:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4cbc31d-0e6c-4cf7-ab07-9783049433fa</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the explanation. Now I understand what you are doing.&lt;/p&gt;
[quote user="salmat"]nrfjprog -f nrf52 --program hrs.hex --sectorerase --reset&lt;br /&gt;WORKS (you said it should not)[/quote]
&lt;p&gt;Have you changed the application in this case or are you programming the same file? If it is the same file, the CRC have not changed, and this will work. But if you do a change and re-build, this will not work as the CRC will not match and the bootloader will enter DFU mode instead of jumping to the seemingly corrupt application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/thread/451959?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2023 12:16:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec493bfd-6307-4d89-bd11-88c9815f9fc0</guid><dc:creator>Salmat</dc:creator><description>&lt;p&gt;I have done using settings files as you proposed. It works the same as it did with zip pkg.&lt;/p&gt;
&lt;p&gt;extract SDK 17.1.0 downloaded zip&lt;br /&gt;&lt;br /&gt;in \external\micro-ecc&lt;br /&gt;git clone &lt;a id="" href="https://github.com/kmackay/micro-ecc.git"&gt;https://github.com/kmackay/micro-ecc.git&lt;br /&gt;&lt;/a&gt;make&lt;br /&gt;&lt;br /&gt;Make all :&lt;br /&gt;\examples\dfu\secure_bootloader\pca10056_s140_ble\armgcc&lt;br /&gt;\examples\dfu\secure_bootloader\pca10056_s140_ble_debug\armgcc&lt;br /&gt;\examples\ble_peripheral\ble_app_blinky\pca10056\s140\armgcc&lt;br /&gt;\examples\ble_peripheral\ble_app_hrs\pca10056\s140\armgcc&lt;/p&gt;
&lt;p&gt;rename hex files : bootloader,&amp;nbsp;bootloader_debug, blinky, hrs&lt;br /&gt;&lt;br /&gt;Move in a directory, and go in it.&lt;br /&gt;./nrfutil settings generate --family NRF52840 --application blinky.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 --key-file private.key blinky_settings.hex&lt;br /&gt;./nrfutil settings generate --family NRF52840 --application hrs.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 --key-file private.key hrs_settings.hex&lt;br /&gt;&lt;br /&gt;We have all files.&lt;br /&gt;&lt;br /&gt;With bootloader_debug :&lt;br /&gt;nrfjprog -f nrf52 --eraseall&lt;br /&gt;nrfjprog -f nrf52 --program s140_nrf52_7.2.0_softdevice.hex&lt;br /&gt;nrfjprog -f nrf52 --program bootloader_debug.hex&lt;br /&gt;nrfjprog -f nrf52 --program blinky_settings.hex&lt;br /&gt;nrfjprog -f nrf52 --program blinky.hex&lt;br /&gt;nrfjprog -f nrf52 --reset&lt;br /&gt;WORKS (it is normal)&lt;br /&gt;&lt;br /&gt;nrfjprog -f nrf52 --program hrs.hex --sectorerase --reset&lt;br /&gt;WORKS (you said it should not)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;With normal bootloader :&lt;br /&gt;nrfjprog -f nrf52 --eraseall&lt;br /&gt;nrfjprog -f nrf52 --program s140_nrf52_7.2.0_softdevice.hex --sectorerase&lt;br /&gt;nrfjprog -f nrf52 --program bootloader.hex --sectorerase&lt;br /&gt;nrfjprog -f nrf52 --program blinky_settings.hex --sectorerase&lt;br /&gt;nrfjprog -f nrf52 --program blinky.hex --sectorerase&lt;br /&gt;nrfjprog -f nrf52 --reset&lt;br /&gt;WORKS (it is normal)&lt;br /&gt;&lt;br /&gt;nrfjprog -f nrf52 --program hrs.hex --sectorerase --reset&lt;br /&gt;DO NOT WORK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/thread/451887?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2023 06:49:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1db25681-b922-48bd-bcf1-497bce3748d4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Then I must be misunderstanding what you are doing or what you are seeing/expecting. Can you elaborate in more detailed steps?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/thread/451783?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2023 15:01:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d225f79-f85c-4d3b-93f1-10d18f070204</guid><dc:creator>Salmat</dc:creator><description>&lt;p&gt;No just extracted the zip of SDK, and added micro-ecc (easy to reproduce)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/thread/451781?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2023 14:57:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09252132-bde9-4f50-96c7-d24d8dad60cd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;That is odd, the integrity check before starting an application is always there by default. Did you inherit the project from someone&amp;nbsp;so that perhaps they have made a change in the SDK code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/thread/451774?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2023 14:47:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7d3e934-ed5f-485d-801c-be5c8d50baaa</guid><dc:creator>Salmat</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;OK. I did not know how to generate the setting page, thanks ! (it can be a way to solve the problem)&lt;br /&gt;&lt;br /&gt;But, as I said, with debug version, I do not have any problem to modify application.&lt;br /&gt;I just tried again with this time SDK 17.1.0,&amp;nbsp; without any modifications, I can modify the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/thread/451707?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2023 12:02:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2950f6d-1506-4c52-a6a8-bb57a4af6314</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The default behavior of the bootloader is to perform an integrity check of the application before booting it. If the application is not valid, it will enter DFU mode instead. This is the same with debug and non-debug versions though, but it is something that&amp;nbsp;can cause irritation during development as you&amp;nbsp;will have to &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/nrfutil_settings_generate_display.html"&gt;generate and program a new bootloader settings page&lt;/a&gt; in order for the bootloader to flash the new app you have just uploaded via SWD (for instance for debugging).&lt;/p&gt;
&lt;p&gt;In order to avoid this you can eider test your application without a bootloader present, live with generating and programming the settings page every time, or disable the integrity check at boot. If you just use this when debugging, you could modify the bootloader so that it skips checks altogether by making&amp;nbsp;app_is_valid() in&amp;nbsp;components/libraries/bootloader/nrf_bootloader.c always return true (if you like, you can make it so that only happens when&amp;nbsp;NRF_DFU_DEBUG_VERSION is set). Make sure you don&amp;#39;t go to production with this change though, it should only be used for debugging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader : Different behavior between pca10056_s140_ble_debug and Non debug</title><link>https://devzone.nordicsemi.com/thread/451564?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2023 19:32:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8c1f4e6-90b1-48a1-bdfb-b149132c05ec</guid><dc:creator>Salmat</dc:creator><description>&lt;p&gt;I have find ... it is the NRF_DFU_DEBUG_VERSION parameter defined in &amp;quot;debug&amp;quot; makefile&lt;br /&gt;&lt;br /&gt;But I have the feeling NRF_BL_APP_SIGNATURE_CHECK_REQUIRED can not be disabled when NRF_DFU_DEBUG_VERSION is set ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>