<?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 considers application is not valid</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15853/bootloader-considers-application-is-not-valid</link><description>Hello to all,I have developed a board using the NRF51822;
Currently I am using SDK v11, S130 v2. 
 I have a problem in my bootloader, since bootloader_app_is_valid (from the ble_dfu example from Nordic) is always false. 
 My application just blinks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Aug 2016 16:36:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15853/bootloader-considers-application-is-not-valid" /><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60513?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2016 16:36:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c19d60a-55a1-4879-9757-72ac4ed85362</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;Hello Einar, I have found the following links that helped me a lot:&lt;/p&gt;
&lt;p&gt;1 - &lt;a href="https://devzone.nordicsemi.com/question/70080/nrf51822-s130-200-7alpha-bare-minimum-bootloader-which-starts-app-at-0x1b000" title="LINK1"&gt;link text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2 - &lt;a href="https://devzone.nordicsemi.com/question/67196/how-to-start-dfu-bootloader-from-application-without-using-ble-dfu-service" title="LINK2"&gt;link text&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I am using 1 for my bootloader and 2 in my application.
I now am facing with an issue to start DFU with this new bootloader. Do you have any idea to overcome this.
Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60510?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2016 10:50:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f6233d8-2d4b-4e23-9f68-856c59a701aa</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;I tried the DFU example together with the ble_app_hrs and the problem continues.
The application is considered invalid.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60504?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 15:37:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:177c1642-1160-4570-8e78-11a6ac33988e</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;If I set optimization level to -O0 an error occurs:
bootloader_util.c:106:1: error: r7 cannot be used in asm here&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60509?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 10:58:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:979188b1-b1f3-46f6-af28-b28a123db67b</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;One more thing, when the content of flash at 0x0003FC00 after flashing the SD and Bootloader is FF&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60508?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 09:14:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:443059f4-7393-4cb6-93e0-f92737d74052</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;I said it the wrong way, when executing bootloader_util_settings_get(&amp;amp;p_bootloader_settings) p_bootloader_settings-&amp;gt; bank_0 gives BANK_INVALID_APP.
I tried with -Wall -O0 -g3, but had to change the FLASH origin to FLASH (rx) : ORIGIN = 0x3A000, LENGTH = 0x5C00 (and also in dfu_types.h).
The problem still remains, no change at all.
In flash my application is:
FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x10000&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60507?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 06:10:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a50beb6-4898-43d3-9e48-6b3efd64f2cb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Have you remembered to disable optimization (set &lt;code&gt;-O0&lt;/code&gt; in your Makefile instead of &lt;code&gt;-O3&lt;/code&gt;)? The reason I ask is that &lt;code&gt;bootloader_util_settings_get()&lt;/code&gt; do not return anything (it&amp;#39;s return type is &lt;code&gt;void&lt;/code&gt;), so it may be that you are debugging optimized code (which is not easy at all).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60512?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2016 18:24:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aaa20b09-82b0-4d5d-9f8a-0c1c8abeb6aa</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;Hello Einar, and thanks again.
I tried your suggestion and the result was:
After calling &lt;code&gt;bootloader_app_is_valid()&lt;/code&gt;, in bootloader_settings.c the function &lt;code&gt;bootloader_util_settings_get&lt;/code&gt; always returns &lt;code&gt;BANK_INVALID&lt;/code&gt; despite of using this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t m_boot_settings[CODE_PAGE_SIZE] __attribute__ ((section(&amp;quot;.bootloaderSettings&amp;quot;))) = {BANK_VALID_APP};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I don&amp;#39;t understand this issue.&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60511?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2016 06:06:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a356582-bc86-4938-a5cf-29f5e56fd1d9</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Can you use a debugger to step through the &lt;code&gt;bootloader_app_is_valid()&lt;/code&gt; and see where/why it returns &lt;code&gt;false&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60503?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2016 08:53:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a7bbe87-c580-4668-8579-599c438f524d</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;I already tried that but the problem remains.
The application is always considered invalid by the bootloader.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60506?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2016 05:49:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7061126-f48b-4ade-bf18-2146c1d5f8cd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;In order to set the application valid flag by default using GCC you should use this instead (in bootloader_settings.c):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t m_boot_settings[CODE_PAGE_SIZE] __attribute__ ((section(&amp;quot;.bootloaderSettings&amp;quot;))) = {BANK_VALID_APP};
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60505?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2016 16:47:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:529864c9-b8d0-4f21-b8c9-2bbb162a4aff</guid><dc:creator>Miguel</dc:creator><description>&lt;p&gt;Hello Einar, thank you for your answer.
I have written 1 to the 0x0003FC00 using the following command line: &lt;code&gt;nrfjprog --memwr 0x00003FC00 --val 1&lt;/code&gt;.
Yes you are right the applications works fine but with the softdevice.
I am using GCC so your suggestion is not applicable in my case.
In SDK 11 the line is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint8_t m_boot_settings[CODE_PAGE_SIZE] __attribute__ ((section(&amp;quot;.bootloaderSettings&amp;quot;)));
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BOOTLOADER considers application is not valid</title><link>https://devzone.nordicsemi.com/thread/60502?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2016 09:37:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fecd59e-22e6-419e-9acb-2a0eb398f3ea</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;You write that you have tried writing 0x00000001 to the bootloader settings address so it may be a dead end, but can you have written it to the correct address? You could do it in your application code as described in &lt;a href="https://devzone.nordicsemi.com/question/75238/how-to-create-combined-image-after-dfu/?answer=75502#post-id-75502"&gt;this post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Another question: you write that your blinky applications works without a bootloader. I assume that is with the SoftDevice also flashed onto the device? Or does your application start at address 0, leaving no room for the SoftDevice?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>