<?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>Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2860/flashing-bootloader-and-application-via-j-link</link><description>Hello.
I want to make flashing of devices for production faster.
So I want to write application together with bootloader via J-Link simultaneously and not via OTA DFU.
I&amp;#39;m using S110 v6 and dual bank BLE DFU from SDK 5.1 example.
I know that after</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Jun 2017 11:01:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2860/flashing-bootloader-and-application-via-j-link" /><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10922?ContentTypeID=1</link><pubDate>Tue, 06 Jun 2017 11:01:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b56b1f9e-3d25-4bb1-93a3-0505c8f73ecb</guid><dc:creator>Jackxl</dc:creator><description>&lt;p&gt;If I add BLE_VALID_APP I will get
ERROR: The file specified is not a valid hex file, has data outside valid areas
ERROR: or does not have data in valid areas.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10913?ContentTypeID=1</link><pubDate>Mon, 05 Jun 2017 08:31:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36f2bb98-f2b9-4e52-bf5d-53f1363d544c</guid><dc:creator>Jackxl</dc:creator><description>&lt;p&gt;This error means that you don&amp;#39;t have enought RAM memory. O3 change your size.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10912?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2016 22:07:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89301c93-4a03-4689-97b2-92c4aa7da437</guid><dc:creator>Justin</dc:creator><description>&lt;p&gt;if anyone is trying to do this with GCC you have to make sure to edit the linker script and remove the &amp;quot;NOLOAD&amp;quot; attribute from the bootloadSettings section.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10925?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2014 19:49:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5752f5a7-c974-46a5-a8c0-e09bd5b2ae54</guid><dc:creator>Clem Taylor</dc:creator><description>&lt;p&gt;The &amp;#39;const&amp;#39; issue with data bound to sections but not in the binary stumped me as well. I was reading the data in my program and it was coming up zeros and reading it with gdb and it wasn&amp;#39;t. Turns out that the optimizer (maybe -flto) was seeing that the data was constant and zero filled and just compiling the reads away. I removed the &amp;#39;const&amp;#39; to get it to run. I haven&amp;#39;t had the chance to figure out what the proper linker command file option is to convince gcc that the data values are unknown at compile time. NOLOAD does not seem to be enough.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10911?ContentTypeID=1</link><pubDate>Wed, 10 Sep 2014 14:40:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:930c7236-1598-46f0-a52c-aec2feb3b116</guid><dc:creator>John</dc:creator><description>&lt;p&gt;See this answer: &lt;a href="https://devzone.nordicsemi.com/question/14988/cannot-init-the-m_boot_settings-in-s110-70-bootloader/?answer=15146#post-id-15146"&gt;Linker error fix&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10910?ContentTypeID=1</link><pubDate>Wed, 10 Sep 2014 14:01:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6271c953-8c47-4a69-b3c7-00a167d4a4ea</guid><dc:creator>Patriko</dc:creator><description>&lt;p&gt;But after changing m_boot_settings, I receive&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;.\_build\bootloader.axf: Error: L6220E: Load region LR_IROM1 size (16624 bytes) exceeds limit (16384 bytes). Region contains 2209 bytes of padding and 0 bytes of veneers (total 2209 bytes of linker generated content).
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Could you help me to fix it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10927?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2014 05:51:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86f640ee-5a27-4bcc-a250-51c45a9bdd00</guid><dc:creator>RatocKen</dc:creator><description>&lt;p&gt;Thank you Nick-san.
I merged 3 hex files to 1 file and wrote as follows.
nrfjprog --reset --erase --program &amp;quot;app_beacon_r1.0.hex&amp;quot;&lt;/p&gt;
&lt;p&gt;CongigMode and DfuMode button work fine now.&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10926?ContentTypeID=1</link><pubDate>Mon, 23 Jun 2014 14:56:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6f9d6b1-f352-489c-87a3-b5d59aa9ca6d</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Strange behavior of the compiler, but useful to know, thanks for sharing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10924?ContentTypeID=1</link><pubDate>Mon, 23 Jun 2014 14:46:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f41e7f2e-60c4-40ca-9980-9c4a3e9506bc</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;I finally figured out how to get the bootloader working with -O0 -&amp;gt; &amp;quot;const&amp;quot; is required as shown below:&lt;/p&gt;
&lt;p&gt;const uint8_t  m_boot_settings[CODE_PAGE_SIZE] &lt;strong&gt;attribute&lt;/strong&gt;((at(BOOTLOADER_SETTINGS_ADDRESS))) &lt;strong&gt;attribute&lt;/strong&gt;((used)) = {BANK_VALID_APP};&lt;/p&gt;
&lt;p&gt;const uint32_t m_uicr_bootloader_start_address &lt;strong&gt;attribute&lt;/strong&gt;((at(NRF_UICR_BOOT_START_ADDRESS))) = BOOTLOADER_REGION_START;&lt;/p&gt;
&lt;p&gt;All my problems are solved now :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10909?ContentTypeID=1</link><pubDate>Mon, 23 Jun 2014 06:52:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69518957-e4c7-4145-86d7-fa402ff835f1</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;It&amp;#39;s strange that &lt;em&gt;more&lt;/em&gt; optimization solves the issue... I wonder which parts of the code actually requires the optimization (note: -O2 does not work either)... I&amp;#39;ve tried setting -O0 on various individual source files to get my I2C code working but to no avail - Any ideas?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10923?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 13:30:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deaf625d-9a9f-4755-8f60-e869c1d48d69</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;You&amp;#39;re right! -O3 solves the issue. The reason I had it on -O0 was because -O3 was making some of my I2C code behave strangely... I guess I need to solve that now! Thank you so much for your help! :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10908?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 13:14:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9e658ae-387a-4f47-bf92-7cbbc91714e2</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Oh, okay, I suddenly made it work. Just add -O3 optimization.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10907?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 13:05:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c14df6a2-e5a2-4cdd-b1e8-671778f62d61</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Something is strange... I&amp;#39;m using gcc and it seems that it&amp;#39;s something with Keil&amp;#39;s linker because I have hex like this:
/attachment/50b3f5b9a4a01250aa03a626a7216643
And your hex is like this:
/attachment/c589a5a67c914868bfc69e9342fd0208
As you can see in bootloader settings address (0x3FC00) I have 0x01 in the beginning and all other data is 0:
:020000023000CC
...
:10FC000001000000000000000000000000000000F3
But in your hex file you have some garbage in bootloader settings address - 02FF0101FF01FF01FF810000:
:020000040003F7
:0CFC000002FF0101FF01FF01FF81000075
I don&amp;#39;t know why it is so, I&amp;#39;ll try to look more into it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10906?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 11:54:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3c60063-c27a-4ad5-8ce8-ece73b350ab3</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Sorry! That change is actually there... Git didn&amp;#39;t export the latest code base.
&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/bl2.zip"&gt;bl2.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10921?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 11:23:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7add9abb-9f88-46df-bfc4-f2f972338b84</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;It seems you didn&amp;#39;t initialize m_boot_settings in your bootloader_util_arm.c:
uint8_t  m_boot_settings[CODE_PAGE_SIZE] &lt;strong&gt;attribute&lt;/strong&gt;((at(BOOTLOADER_SETTINGS_ADDRESS))) &lt;strong&gt;attribute&lt;/strong&gt;((used));
But what you need is:
uint8_t  m_boot_settings[CODE_PAGE_SIZE] &lt;strong&gt;attribute&lt;/strong&gt;((at(BOOTLOADER_SETTINGS_ADDRESS))) &lt;strong&gt;attribute&lt;/strong&gt;((used)) = {BANK_VALID_APP};&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10920?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 11:13:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80a68a34-5618-41fd-b85e-0c3360e5edcc</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;@Nikita: Here is the bootloader project. Many thanks&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/bl.zip" alt="bl.zip" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10905?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 11:03:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0a722bc-12d1-4480-9bac-cda3ba1e797e</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Upload your bootloader project, I&amp;#39;ll check the code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10904?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 11:00:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37727053-1781-4507-9f1f-27ade1fd2046</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Just checked with a debugger by placing a breakpoint @ if (p_bootloader_settings-&amp;gt;bank_0 == BANK_VALID_APP) : As I suspected, every member of the &amp;quot;p_bootloader_settings&amp;quot; structure is zero. Very strange!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10903?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 10:03:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1af29c87-ee6b-4956-a1be-b4aa626c7503</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;So after flashing S110 + bootloader + app via J-Link application doesn&amp;#39;t run? Then after flashing S110 + bootloader + app via J-Link try to look via debugger at flash content in bootloader settings sector and check if it contains BANK_VALID_APP (0x01) value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10902?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 09:39:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:420582ea-c9ea-40fa-84e7-2150bb5f2530</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Correct. Flashing S110 + bootloader + app via J-Link works. However, the one problem is that the bootloader does not run the application. At this point, I can use the UART DFU to reflash the application and it then loads correctly (everything works!). The source of this problem seems to be that &amp;quot;p_bootloader_settings&amp;quot; does not have BANK_VALID_APP set and crc set to ZERO (so it is failing the bootloader valid check).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10919?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 09:26:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43dba5bb-8c74-498f-915c-643995397723</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;What exactly are your your actions?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Flashing S110 + bootloader + app via J-Link
It must all works fine at this point.&lt;/li&gt;
&lt;li&gt;You updating your app via bootloader (?)
Now your bootloader works but your newly flashed app is not loading (?)
Is it correct?&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10918?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 08:37:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8abf704-050a-4b29-ba25-28257cf95eda</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Bootloader works perfectly after the aforementioned flash routine: the app can be flashed via the UART bootloader and it boots correctly. The line that is failing is: if (p_bootloader_settings-&amp;gt;bank_0 == BANK_VALID_APP) ... which Is evaluating to FALSE even though I have set BANK_VALID_APP using John&amp;#39;s method. &amp;quot;bank_0_crc&amp;quot; is also NOT zero. So my conclusion is that &amp;quot;p_bootloader_settings&amp;quot; doesn&amp;#39;t have contain the correct data in the first place - any ideas?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10917?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 08:25:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e87c5a9e-b97c-46a4-a2e6-3c22e4e12231</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Does the bootloader working properly?
If the bootloader working properly and updates your app just fine but app doesn&amp;#39;t start then it may be that UICR are not programmed.
If you write your UICR separately from bootloader hex then you need to add additional nrfjprog write to the UICR.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10901?ContentTypeID=1</link><pubDate>Sun, 22 Jun 2014 06:58:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12408e86-af56-4a72-bf71-c95bc9ab3b59</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Thanks Nikita. I&amp;#39;m using the following with no luck (app does not boot):&lt;/p&gt;
&lt;p&gt;nrfjprog --eraseall
nrfjprog --programs %SOFTDEVICE% --verify
nrfjprog --program %APP% %BOOTLOADER% --verify
nrfjprog --reset&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing bootloader and application via J-Link</title><link>https://devzone.nordicsemi.com/thread/10916?ContentTypeID=1</link><pubDate>Sat, 21 Jun 2014 06:20:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33c66c86-2fd6-43fa-8cac-c2a41ae5519a</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;We don&amp;#39;t have to write the CRC because bootloader_app_is_valid function first checks if the application in CODE region 1 is flagged as valid during update and if it&amp;#39;s flagged as valid it then checks whether CRC matches but if CRC = 0 it skips this check and assume that the application is valid.
And just flash it all like this:
nrfjprog.exe --eraseall --programs s110_nrf51822_6.0.0_softdevice.hex --program application.hex nRF51822_BLE_DFU.hex --verify --reset&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>