<?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>Unexpected branch address rewrite when using XIP</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104682/unexpected-branch-address-rewrite-when-using-xip</link><description>I want to deploy a quite large C++ application on a nrf52840 eval board (version 3.0.1). To do so, I want to use the external flash memory. I changed the linker script, so that everything that is required to setup the chip and runtime, is allocated to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 Oct 2023 06:58:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104682/unexpected-branch-address-rewrite-when-using-xip" /><item><title>RE: Unexpected branch address rewrite when using XIP</title><link>https://devzone.nordicsemi.com/thread/451890?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2023 06:58:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a14c6b59-f336-4304-afbb-0fea0dec23ec</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Torsten,&lt;/p&gt;
&lt;p&gt;I am glad to hear you found the issue.&amp;nbsp;Thank you for letting us know and explaining what had happened.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected branch address rewrite when using XIP</title><link>https://devzone.nordicsemi.com/thread/451877?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2023 06:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f6ad228-50f2-4f5d-aee7-670ee060aa4e</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Good Morning Einar,&lt;/p&gt;
&lt;p&gt;I did not tried a second board, because the issue was so reproducible. But now, I&amp;#39;ve tried a second board (V2.0.1), installed the firmware, ran it and issued&amp;nbsp;&lt;span&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;nrfjprog --readregs&lt;/span&gt;. When issuing that command quite shortly after starting the firmware, I see different PCs. When I wait for a little bit longer (&amp;gt;15s), I see the PC at&amp;nbsp;&lt;/span&gt;&lt;span&gt;0x000003B6, which is according to my lis file the&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;HardFault_Handler&lt;/span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The 15s&amp;nbsp;&lt;/span&gt;seem a little bit long to me, so I&amp;#39;ve attached a debugger and this time, the Hardfault was caused by something else. And the call stack came from with main(), and all addresses on the call stack are looking reasonable. So, with the board, the problem is not reproducible.&lt;/p&gt;
&lt;p&gt;So, I&amp;#39;ve switched back to the V3.0.1 board. I again, got reproducible a Hardfault during the initialization of the C/C++ runtime. But this time the call stack was different from the original problem report.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve soldered small wires to the QSPI interface to debug the flash memory. That wires where attached to a Saleae and after I&amp;#39;ve disconnected the Saleae, the problem was gone.&lt;/p&gt;
&lt;p&gt;So, it looks like this was caused by me, attaching a logic analyzer. I&amp;#39;m sorry for wasting your time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you very much,&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected branch address rewrite when using XIP</title><link>https://devzone.nordicsemi.com/thread/451763?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2023 14:11:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7a3a01c-cb94-4603-b3eb-6ae82a1fa8ff</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Torsten,&lt;/p&gt;
&lt;p&gt;I see. I will test more tomorrow, but I wonder if you see this on multiple boards? The reason I ask is that for now I only tested running for a few seconds, and then reading out the CPU registers with &amp;quot;nrfjprog --readregs&amp;quot; I don&amp;#39;t see a hard fault. Can you share your output from &amp;quot;nrfjprog --readregs&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected branch address rewrite when using XIP</title><link>https://devzone.nordicsemi.com/thread/451753?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2023 13:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3eb1c23c-5f7e-491c-870d-f1fb386d7ee7</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;cool, thanks! If everything would work as expected, you should for example be able to set a breakpoint in main() and after a reset, you should set a debugger waiting there.&lt;/p&gt;
&lt;p&gt;But currently, the initialization of the C/C++ runtime does not execute as expected (see above) and a hard fault is caused by the jump to the unexpected address 0x122400da. If you are able to reproduce this hard fault, you have reproduced the issue.&lt;/p&gt;
&lt;p&gt;Maybe you can have a look at the initialization of the QSPI peripheral and maybe you can shed some light on why the jump instruction is redirected to that address.&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected branch address rewrite when using XIP</title><link>https://devzone.nordicsemi.com/thread/451745?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2023 13:32:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f677d1f-e166-435b-a789-38de2bbfb852</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Torsten,&lt;/p&gt;
&lt;p&gt;I am sorry for the delay, I was not able to look into your project until now.&amp;nbsp;I am able to build your application according to the instructions and program a nRF52840 DK with it. How should I test in order to reproduce the issue? And how should it normally function?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected branch address rewrite when using XIP</title><link>https://devzone.nordicsemi.com/thread/451019?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 09:43:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff79405f-f1ed-4358-a15c-303de878fe86</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Yes, it is open source:&amp;nbsp;&lt;a href="https://github.com/TorstenRobitzki/bluetoe/tree/feature/scheduled_radio2/tests/scheduled_radio"&gt;https://github.com/TorstenRobitzki/bluetoe/tree/feature/scheduled_radio2/tests/scheduled_radio&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried to add a short description as how to build the firmware (tester.elf). The project uses cmake/make/gcc for the build. One additional dependency is Catch2 (&lt;a href="https://github.com/catchorg/Catch2"&gt;https://github.com/catchorg/Catch2&lt;/a&gt;). As I&amp;#39;m currently evaluating different test framework, the path to Catch2 is hard coded in CMakeLists.txt:41 and has to be adjusted accordingly.&lt;/p&gt;
&lt;p&gt;Thank you very much for your effort. Please let me know, when I can assist or if you want me to provide binaries.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected branch address rewrite when using XIP</title><link>https://devzone.nordicsemi.com/thread/450998?ContentTypeID=1</link><pubDate>Wed, 18 Oct 2023 08:56:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:430606fb-c799-49c6-9498-bfa5643efd90</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Torsten,&lt;/p&gt;
&lt;p&gt;That is a good point. Can you share the&amp;nbsp;project&amp;nbsp;you run on the DK along with instructions on how to reproduce it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected branch address rewrite when using XIP</title><link>https://devzone.nordicsemi.com/thread/450555?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 12:12:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52189842-0d18-4a3b-955f-09c3ec2aa35d</guid><dc:creator>Torsten Robitzki</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;yes, I&amp;#39;ve stumbled over that too, but I would read it as, there is a problem when executing code out of the internal flash or RAM, that reads from the external flash. In my example, I&amp;#39;m purely executing from external flash.&lt;/p&gt;
&lt;p&gt;best regards,&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected branch address rewrite when using XIP</title><link>https://devzone.nordicsemi.com/thread/450545?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 12:01:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1d313d1-3785-4804-897f-03daf3de3d34</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Torsten,&lt;/p&gt;
&lt;p&gt;It seems like you are seeing &lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev3/ERR/nRF52840/Rev3/latest/anomaly_840_216.html"&gt;erratum&amp;nbsp;216&lt;/a&gt;, which unfortunately limits the usability of XIP on the nRF52840.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>