<?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>Custom uart bootloader doesn&amp;#39;t jump to application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63855/custom-uart-bootloader-doesn-t-jump-to-application</link><description>Hi! 
 This is what I&amp;#39;m using: 
 -SoftDevice S113 v7.0.1 
 -SDK v17.0.0.0 
 -SES v4.52c 
 -nRF52840 
 
 I&amp;#39;ve created a custom buttonless uart bootloader based on the &amp;quot;secure_bootloader_uart&amp;quot; for the nRF52480 without any of the security and encryption functions</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Aug 2020 13:24:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63855/custom-uart-bootloader-doesn-t-jump-to-application" /><item><title>RE: Custom uart bootloader doesn't jump to application</title><link>https://devzone.nordicsemi.com/thread/262814?ContentTypeID=1</link><pubDate>Mon, 03 Aug 2020 13:24:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc2c9e37-3702-4aa1-a688-bfde4a4d2c8d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi David,&amp;nbsp;&lt;br /&gt;I had a quick test here with the open USB bootloader (debug version) for PCA10059 with optimization level set to 0. I don&amp;#39;t see any issue with it jumping to the application. Could you try to test on your side ? Which IDE did you use for compiling?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;What I can suggest is to try simplify the bootloader to very simple one, just have the code to jump to application and nothing else. So when you test it you flash MBR, App, BL (so no DFU feature) just to check the difference between your code and the stock bootloader .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom uart bootloader doesn't jump to application</title><link>https://devzone.nordicsemi.com/thread/262109?ContentTypeID=1</link><pubDate>Wed, 29 Jul 2020 07:42:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16e5684f-9b2d-4f10-a77b-e8e2f14732d4</guid><dc:creator>dbagan</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;sorry for my late response.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been checking the PC in both applications: my BL and the original secure BL. As you might expectected is that both PC are not equal. My BL PC jumps to a wrong address although the address set to the function is correct. Why? I don&amp;#39;t know&lt;/p&gt;
&lt;p&gt;I debugged the original BL step by step and I did the same with my BL. Both BL applies the same jump destination address, but the original BL jumps correctly and mine no. The only difference between both projects is the optimization level.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My application is too small, so I don&amp;#39;t need to apply any optimization to fit it in the bootloader area, meanwhile the original BL needs to apply a Level 1 optimization in order to fit. I decided to apply the same optimization level into my BL application and guess what happened.... it worked&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f631.svg" title="Scream"&gt;&amp;#x1f631;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know why, but for my it&amp;#39;s not&amp;nbsp;normal.&lt;/p&gt;
&lt;p&gt;Do you have any explanation for that behaviour?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom uart bootloader doesn't jump to application</title><link>https://devzone.nordicsemi.com/thread/261543?ContentTypeID=1</link><pubDate>Fri, 24 Jul 2020 09:20:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45c91a28-0421-405e-858e-823f779f30e1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;You may want to break and check where the PC counter jumps to.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom uart bootloader doesn't jump to application</title><link>https://devzone.nordicsemi.com/thread/261339?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2020 10:37:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95f9663e-b55e-4101-884c-605530272418</guid><dc:creator>dbagan</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll make a blinky hex file and do what you said.&lt;/p&gt;
&lt;p&gt;No. Inside the bootloader I do not initialize the SoftDevice.&lt;/p&gt;
&lt;p&gt;I do not use or call any SoftDevice function inside the BL.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve generated a simply blinky program starting at address 0x1000.&lt;/p&gt;
&lt;p&gt;I flashed the MBR+BL and downloaded via serie the blinky hex file. The BL doesn&amp;#39;t jump to application, so there&amp;#39;s something related to BL that I&amp;#39;m not doing correctly&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom uart bootloader doesn't jump to application</title><link>https://devzone.nordicsemi.com/thread/261333?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2020 10:06:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:112d8c48-9a48-43cb-a11d-98f9d2b2c813</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi David,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It seems that the issue is around the bootloader on how it jumped to the softdevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please check and make sure that all the steps we do in our example bootloader has been done properly in your custom bootloader.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please try what I suggested to do DFU update with a blinky (for example) application that start at address 0x1000 (instead of the softdevice)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Did you initialize the softdevice in the bootloader, for some reason ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom uart bootloader doesn't jump to application</title><link>https://devzone.nordicsemi.com/thread/261229?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2020 14:35:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a2ab1bd-4541-4ffc-a0ab-29f8c6a3a4b4</guid><dc:creator>dbagan</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s ok, don&amp;#39;t worry.&lt;br /&gt;Before testing your proposal I&amp;#39;ve done another test&lt;/p&gt;
&lt;p&gt;Test1:&lt;br /&gt; - Create a hex file with: MBR + S113 + myApp, then flash and execute it.&lt;br /&gt; - The program runs correctly &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Test2:&lt;br /&gt; - Create a hex file with: MBR + BL then flash and execute it.&lt;br /&gt; - The BL is exeucted and ready to receive SoftDevice and application code&lt;br /&gt; - I&amp;#39;ve downloaded the SoftDevice (S113 without the MBR) and the application throught the BL app&lt;br /&gt; - After all code is downloaded the BL executes the new code, but my app doesn&amp;#39;t run &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f61e.svg" title="Disappointed"&gt;&amp;#x1f61e;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I decied to check if flash contents in both tests are the same or if there are any difference between them.&lt;br /&gt;I&amp;#39;ve used the nrfjprog to read the flash content from Test2 and I&amp;#39;ve compared it with the Test1 hex file.&amp;nbsp;What I&amp;#39;ve seen is:&lt;/p&gt;
&lt;p&gt;- Both SoftDevice and application partitions have the same data --&amp;gt; good&lt;br /&gt; - Test2 MBR has the jumping addresses placed on 0xFF8 and 0xFFC meanwhile Test1 MBR have 0xFFFFFFFF in both addresses --&amp;gt; The expected, because one has a BL and the other no&lt;/p&gt;
&lt;p&gt;Seeing this, I&amp;#39;ve removed MBR jumping addresses (0xFF8 and 0xFFC) from Test2&amp;#39;s hex file and I flash it via nrfjprog to the nRF52. After flashing the modified hex file, my application runs &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f62e.svg" title="Open mouth"&gt;&amp;#x1f62e;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Conclusion?&lt;br /&gt;If I&amp;#39;m not wrong the MBR, S113 and myApp are correct and well placed on flash and there are no issues with them.&lt;/p&gt;
&lt;p&gt;I think that the problem is focused on the BL app. I suppose that there is a missing step in my BL. I don&amp;#39;t know, probably I missed to erase or config something into the UICR register or anything else.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I hope this information will give you some light. Thank you.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom uart bootloader doesn't jump to application</title><link>https://devzone.nordicsemi.com/thread/261155?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2020 09:40:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47be7f7a-1a11-4099-b1d6-ef16b574fb92</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Dbagan,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry for the late reply.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I&amp;#39;m&amp;nbsp; not sure what could be wrong here.&amp;nbsp;Maybe you would need to test without the softdevice. So that the bootloader will just jump to the application located right behind the MBR (the place where the softdevice should be). Make sure you flash the MBR + BL.&lt;/p&gt;
&lt;p&gt;If that work then we need to look into why the softdevice didn&amp;#39;t jump to the application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you break the code you should be able to find where the PC counter is and based on the location the PC we can check if it&amp;#39;s the softdevice or bootloader or application area.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>