<?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>Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54438/booting-application-from-custom-bootloader</link><description>Hi, 
 I&amp;#39;m currently developing a custom bootloader for DFU, using I2C. 
 The bootloader is based upon the secure UART bootloader for nRF52832. Transferring and writing the image works fine, I receive the entire image and write it at the start address</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Nov 2019 11:23:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54438/booting-application-from-custom-bootloader" /><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/222604?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2019 11:23:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0929879-45ca-43e5-af6b-ef686a5d385c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Excellent! Thanks for the update.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/222592?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2019 10:43:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80adfffc-1188-4472-a6c8-a31af900bfc0</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;I tested it out and it works good, cheers for all the help Vidar.&lt;/p&gt;
&lt;p&gt;/ Anton&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/221754?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 08:34:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15ca5034-bdaa-42b2-9175-8740b1ae6776</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes that&amp;#39;s correct, CODE_SIZE gives the application size and is used to locate the CRC, which is appended at the end.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/221591?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2019 14:04:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47e63c14-96e0-48ab-91c4-cba168190fdf</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Not sure if I understand the code correctly, but does the CODE_SIZE define keep track of the length/size of the application? So that you know where the CRC is located in the memory.&lt;/p&gt;
&lt;p&gt;/ Anton&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/221561?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2019 13:05:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32c161f9-8dd3-46a0-ab03-ebe0da6b262a</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;I hit a fault handler when I tried to uninit fsstorage, resolved by waiting until it was not busy anymore. Now the app boots instantly :).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/221468?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2019 07:16:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e878caaf-1ded-40c9-81cd-c258f3fe6b5e</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;I&amp;#39;ve been trying to find out what&amp;#39;s going on but it seems like it might hit a fault handler?&lt;/p&gt;
&lt;p&gt;After receiving and image, verifying its CRC and writing it to memory the nRF52832 goes unresponsive for about 30-45 seconds. When I try to read the registers nrfjprog only returns:&lt;/p&gt;
&lt;p&gt;ERROR: JLinkARM DLL reported an error. Try again. If error condition&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;ERROR: persists, run the same command again with argument --log, contact Nordic&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;ERROR: Semiconductor and provide the generated log.log file to them.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After 30 seconds or so I can read the registers&lt;/p&gt;
&lt;p&gt;R0:&amp;nbsp;&amp;nbsp; 0x01000001&lt;br /&gt;R1:&amp;nbsp;&amp;nbsp; 0x40020518&lt;br /&gt;R2:&amp;nbsp;&amp;nbsp; 0xE000E100&lt;br /&gt;R3:&amp;nbsp;&amp;nbsp; 0x20002585&lt;br /&gt;R4:&amp;nbsp;&amp;nbsp; 0x200000C0&lt;br /&gt;R5:&amp;nbsp;&amp;nbsp; 0x00000000&lt;br /&gt;R6:&amp;nbsp;&amp;nbsp; 0xE000E000&lt;br /&gt;R7:&amp;nbsp;&amp;nbsp; 0x00000000&lt;br /&gt;R8:&amp;nbsp;&amp;nbsp; 0x00000000&lt;br /&gt;R9:&amp;nbsp;&amp;nbsp; 0x00000000&lt;br /&gt;R10:&amp;nbsp; 0x20000000&lt;br /&gt;R11:&amp;nbsp; 0x00000000&lt;br /&gt;R12:&amp;nbsp; 0x00000000&lt;br /&gt;SP:&amp;nbsp;&amp;nbsp; 0x2000FF38&lt;br /&gt;LR:&amp;nbsp;&amp;nbsp; 0x00015CCD&lt;br /&gt;PC:&amp;nbsp;&amp;nbsp; 0x00015CCE&lt;br /&gt;xPSR: 0x61000000&lt;br /&gt;MSP:&amp;nbsp; 0x2000FF38&lt;br /&gt;PSP:&amp;nbsp; 0x00000000&lt;/p&gt;
&lt;p&gt;And the application is running.&lt;/p&gt;
&lt;p&gt;Edit: Seems like it can take up to a minute or two. During this period I cannot connect to the nRF52832 using JLinkExe and I get disconnected when I boot the image:&lt;/p&gt;
&lt;p&gt;****** Error: Communication timed out: Requested 12 bytes, received 0 bytes !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/221266?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 09:57:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:991e9ca5-f008-4282-9936-3dd91ab56b05</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Do you know what the device is doing when it doesn&amp;#39;t boot the app? Maybe it went back to&amp;nbsp;DFU mode inside the bootloader, or got stuck in a fault handler? You can run &amp;quot;nrfjprog --readregs&amp;quot; to find out where&amp;nbsp;the program is running at.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/221112?ContentTypeID=1</link><pubDate>Wed, 20 Nov 2019 14:05:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:841583dd-1a6b-4185-a6ee-57585df1be69</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;That&amp;#39;s a nifty solution, something I will most likely use.&lt;/p&gt;
&lt;p&gt;One thing I&amp;#39;ve noticed is that in order to boot the application (after a succesful image transfer) I always have to reset an additional time on the devkit before the application boots. It seems like the NVIC_Systemreset() is not doing the trick after the image is flashed.&lt;/p&gt;
&lt;p&gt;Any thoughts what could be the cause?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/220843?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 12:52:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b720210b-66bb-4252-b075-9d7ae454494b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I don&amp;#39;t think you have to have to include a settings page. An alternative is to always calculate the app CRC on boot. If the check fails, you can just let the bootloader fall back to DFU mode.&lt;/p&gt;
&lt;p&gt;I guess the question is then where it&amp;#39;s best to store the CRC.&amp;nbsp;I encountered a fairly&amp;nbsp;similar project in a project where I was trying to add DFU support without having a dedicated bootloader. I&amp;nbsp;ended up appending&amp;nbsp;a 32 bit CRC at the end of the app image&amp;nbsp;to avoid having to&amp;nbsp;allocate a settings page in flash.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_beacon_5F00_w_5F00_dfu.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_beacon_5F00_w_5F00_dfu.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/220834?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 12:30:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:116f1083-4085-4494-ab95-8d2a71017233</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Hei hei Vidar,&lt;/p&gt;
&lt;p&gt;No I have not implemented a bootloader settings page, so yes, if there is an unexpected power loss during the transmission the bootloader would attempt to boot that application.&lt;/p&gt;
&lt;p&gt;Are there any information create/use the settings page for &amp;quot;custom&amp;quot; behaviour?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/220766?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 09:53:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b192791-4d16-4df2-8238-009a2f8e32bb</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hei Anton,&lt;/p&gt;
[quote user="AntonHellbe"]Is that a sufficient solution? - Clearing the GPREGRET reg and performing a NVIC_Systemreset() when booting up a new image written to flash. Or is there something else that I should to before booting up the new Image?[/quote]
&lt;p&gt;Can the bootloader boot an app that has not been fully updated if the GREPREGRET flag is cleared due to an unexpected power loss,etc, or do you also have a &amp;quot;bootloader settings&amp;quot; page in flash like the SDK bootloader has?&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/220747?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 09:08:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f92bb63f-17dc-4274-81b5-3fed308643f9</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I found the issue, after reading some of the memory addresses starting at 0x26000 I could see that the data written to flash was not correct. After correcting the memory writes the Softdevice now boots the application correctly.&lt;br /&gt;&lt;br /&gt;Regarding booting the application after a successful image transfer. Currently I receive the image, write it to flash. When the entire Image received I calculate CRC from what&amp;#39;s written to the memory and compare it to the CRC I receive in the start of the image transfer. If the CRC is correct, I clear the gpregret and and perform a NVIC_Systemreset() so that the bootloader will boot the new image. &lt;br /&gt;&lt;br /&gt;Is that a sufficient solution? - Clearing the GPREGRET reg and performing a NVIC_Systemreset() when booting up a new image written to flash. Or is there something else that I should to before booting up the new Image?&lt;/p&gt;
&lt;p&gt;Br,&lt;br /&gt;Anton&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/220726?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 08:10:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1187feb-0539-4ef5-9d8c-32be6f6e1bd1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;0x1000 is the correct address. Have you&amp;nbsp;confirmed that the program reaches the&amp;nbsp;jump_to_addr routine?&lt;/p&gt;
[quote userid="73389" url="~/f/nordic-q-a/54438/booting-application-from-custom-bootloader"]Edit: An additional question, is it possible to flash the nRF52832 using a Motorola Srecord hex file? I&amp;#39;ve tried looking for any documentation of which .hex files that nrfjprog accepts but cannot find any.[/quote]
&lt;p&gt;nrfjprog supports intelHex only, but Jlink commander seems to support it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Booting application from custom bootloader</title><link>https://devzone.nordicsemi.com/thread/220242?ContentTypeID=1</link><pubDate>Fri, 15 Nov 2019 09:13:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6be39ac-4873-429b-8a39-c64af9f56deb</guid><dc:creator>HuanVH</dc:creator><description>&lt;p&gt;You can see in this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33610/can-t-jump-to-a-custom-app-location-using-nrf_bootloader_app_start-with-sdk-v15"&gt;post&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you using softdevice, you must start at softdevice address: 0x1000&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>