<?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>S310 IAR will not debug with RTC1 interrupt active</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33111/s310-iar-will-not-debug-with-rtc1-interrupt-active</link><description>It seems like a similar IAR debugging problem has been solved but after a day of trying everything... 
 BLE application with SDK 6.1 and SD 310 1.0 running IAR 8.1 (and identical issue for IAR 7.20). J-Link 9.3 with 6.30j firmware. 
 - -drv_vector_table_base</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Apr 2018 12:23:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33111/s310-iar-will-not-debug-with-rtc1-interrupt-active" /><item><title>RE: S310 IAR will not debug with RTC1 interrupt active</title><link>https://devzone.nordicsemi.com/thread/127831?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 12:23:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:578f5b08-8ef2-48ec-82a3-c736cf34a583</guid><dc:creator>Jason Long</dc:creator><description>&lt;p&gt;Ok, thanks.&lt;/p&gt;
&lt;p&gt;As an update for the record and to help others: I have now tried this work-around on IAR 7.2 and 8.10 both with a J-Link OB and J-Link EDU both running JLinkARM.dll 6.10e.&amp;nbsp; I have experimented with various modes of operation to see how everything works:&lt;/p&gt;
&lt;p&gt;- Including or removing &lt;span&gt;--drv_vector_table_base=0x0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- Enabling and or not enabling the soft device&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- Enabling or not enabling application interrupts&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I can get the debugging I need with various combinations of the above, but not everything works with all combinations.&amp;nbsp; For example, using IAR &amp;quot;reset&amp;quot; does not work when --drv is in place.&amp;nbsp; The debugger gets lost in the same way (I assume the .mac file is not referenced in this case).&amp;nbsp; Restarting after a breakpoint in the application code can also lead to a PC lost in RAM somewhere after the code is restarted.&amp;nbsp; But overall, it&amp;#39;s workable and still my fault for using an old SD.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&lt;br /&gt;Jason&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S310 IAR will not debug with RTC1 interrupt active</title><link>https://devzone.nordicsemi.com/thread/127804?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 11:00:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30343272-214a-44fa-a055-e1496256cdb3</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Always happy to help. All credit goes to &lt;a href="https://devzone.nordicsemi.com/members/mattb"&gt;Matt Barr&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;The .mac file states where the initial stack pointer and the Reset_Handler of the S310 is located, which is normally fetched by reading address 0 (initial_sp) and address 4 (reset_handler).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S310 IAR will not debug with RTC1 interrupt active</title><link>https://devzone.nordicsemi.com/thread/127707?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 02:17:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dc87d23-7343-46d9-80bf-df8381f6da75</guid><dc:creator>Jason Long</dc:creator><description>&lt;p&gt;Yes, yes, yes!!!!!&lt;/p&gt;
&lt;p&gt;Thank you for finding that post and solution from &lt;a href="https://devzone.nordicsemi.com/members/mattb"&gt;Matt Barr&lt;/a&gt; (thank you, Matt!).&lt;/p&gt;
&lt;p&gt;This is what I get for using old versions of SDs, as Matt&amp;#39;s comment on newer SDs not read-protecting&amp;nbsp;makes sense and explains why the rest of the world isn&amp;#39;t fighting this with me.&lt;/p&gt;
&lt;p&gt;Though I don&amp;#39;t understand what the macro file is doing with the debugger (I&amp;#39;ll look that up), this definitely feels like the root cause solved.&lt;/p&gt;
&lt;p&gt;Awesome, thank you&amp;nbsp;&lt;span&gt;H&amp;aring;kon!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Love you guys at Nordic!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S310 IAR will not debug with RTC1 interrupt active</title><link>https://devzone.nordicsemi.com/thread/127604?ContentTypeID=1</link><pubDate>Tue, 10 Apr 2018 11:50:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5333e61-2d9a-4a24-96eb-c0df3e944743</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First off, sorry for the delayed answer!&lt;/p&gt;
&lt;p&gt;I have been trying to debug your project for a while now, and I am seeing the exact same behavior as you describe.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using IAR v7.80.3.&lt;/p&gt;
&lt;p&gt;Tried setting the drv_vector_table_base=0 and =0x20000, and I see the exact same behavior. When set to 0, no chance of debugging, and when set to 0x20000, it will fail at the first interrupt called (end up in 0xFFFFFFE).&lt;/p&gt;
&lt;p&gt;I tried debugging the .out file (generated by IAR) with GDB. I did a small alteration by setting the TIMER1 IRQn as pending in main (after softdevice enable), and just added a delay to it instead of a while(1). GDB did not halt at the interrupts, and it looks like that debug session runs as normal.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I found this older thread, which indicates that the IAR debugger does not like it when the initial stack pointer and reset vector is unavailable (in this case, readback protected):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/3704/s310-and-iar-i-jet-load-run/13447#13447"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/3704/s310-and-iar-i-jet-load-run&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After creating a .mac file (see attached) and pointing to it in the IAR settings:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-b505fdf2b6664c3bb3279dff053cb7a3/pastedimage1523360921641v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Then the debug session started up as normal.&lt;/p&gt;
&lt;p&gt;Could you try this and see if it works at your end?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-b505fdf2b6664c3bb3279dff053cb7a3/exec.mac"&gt;devzone.nordicsemi.com/.../exec.mac&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S310 IAR will not debug with RTC1 interrupt active</title><link>https://devzone.nordicsemi.com/thread/127405?ContentTypeID=1</link><pubDate>Mon, 09 Apr 2018 11:01:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08155fcb-8384-48b4-8ec6-e1da1f0f1152</guid><dc:creator>Jason Long</dc:creator><description>&lt;p&gt;I am convinced that the debugger cannot see the vector table at 0x0.&amp;nbsp; Anything I do that would require the main vector table fails including even JUST trying the reset vector with the --drv_vector_table_base=0x0. All is fine without the debugger.&lt;/p&gt;
&lt;p&gt;Just for sanity check, here&amp;#39;s a shot of the load from nRFGo Studio&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1523270715694v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Defeated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S310 IAR will not debug with RTC1 interrupt active</title><link>https://devzone.nordicsemi.com/thread/127329?ContentTypeID=1</link><pubDate>Mon, 09 Apr 2018 04:54:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ec46f64-80bf-4d13-b950-949b90de0c67</guid><dc:creator>Jason Long</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I fought this for another day.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With --drv_vector_table_base=0x0 the debugger starts immediately at 0xfffffffe if &amp;quot;run to main&amp;quot; is on and I can do nothing&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Without the&amp;nbsp;--drv_vector_table_base=0x0 the debugger kicks out to 0xfffffffe on the first interrupt (any enabled interrupt, RTC1 or SD event right now).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In both cases, the code works without the debugger.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Same behavior in IAR 7.2 and 8.10 and with J-Link OB with 6.10e and a J-Link EDU v9.3 with J-Link 6.10e and 6.30j dlls.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is without any breakpoints.&amp;nbsp; When I run without interrupts enabled, I can halt the debugger once.&amp;nbsp; If I restart, it is lost and subsequent halts will usually find the program counter in RAM space!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Questions: should &amp;quot;use flash loaders&amp;quot; be on in project options?&amp;nbsp; Are there different flash loaders than default?&amp;nbsp; Are there any special project settings that must be set?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;FYI I&amp;#39;ve used IAR and J-Link tools for over a decade, so hopefully that experience is helping and not hindering my exploration... I have limited experience developing specifically on the nRF51s, though.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Today I&amp;#39;ll see if I can find an example project from Nordic and see if it works and try an older project that I did on these same boards that worked fine (but with SD 210 just for ANT).&amp;nbsp; Sorry I&amp;#39;m stuck way back in SDK 6.1 and old SD 310 due to my version 2 nRF51422 hardware.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The project is on Gihub in the &amp;quot;pin_config&amp;quot; branch:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://github.com/eiefirmware/eiefw3/tree/pin_config"&gt;https://github.com/eiefirmware/eiefw3/tree/pin_config&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S310 IAR will not debug with RTC1 interrupt active</title><link>https://devzone.nordicsemi.com/thread/127212?ContentTypeID=1</link><pubDate>Fri, 06 Apr 2018 12:21:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:608f139a-4fe1-4522-82a8-1f4e42e3c074</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There shouldn&amp;#39;t be a whitespace between the two &amp;quot;-&amp;quot;:&lt;/p&gt;
&lt;p&gt;--drv_vector_table_base=0x0&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you setting a breakpoint while the softdevice is running? This will cause an assertion inside the softdevice if you run after hitting a breakpoint, as it&amp;#39;s timing will be skewed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>