<?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>Debug vs Flash VSC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94141/debug-vs-flash-vsc</link><description>I working on different applications using nRF5340 and nRF9160. 
 Debug: When Debugger is launched, the MCU reset repetitively as seen in LTE Monitor (Image 1) in case of asset_tracker application and in Bluetooth peripheral on 5340 also. Sometimes, during</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 13 Dec 2022 08:23:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94141/debug-vs-flash-vsc" /><item><title>RE: Debug vs Flash VSC</title><link>https://devzone.nordicsemi.com/thread/400305?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 08:23:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18f4b129-1108-4e7f-8316-e5a55586fae7</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;yes ... but could not resolve the issue&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug vs Flash VSC</title><link>https://devzone.nordicsemi.com/thread/400299?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 08:04:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bf089cb-391c-40ab-8c59-eb15909b2463</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Did you enable this&amp;nbsp;&lt;span&gt;CONFIG_THREAD_NAME in configuration&amp;nbsp;&lt;/span&gt;file?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug vs Flash VSC</title><link>https://devzone.nordicsemi.com/thread/398667?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2022 04:35:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18608fae-ba1a-498a-8989-d96e46442c1e</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote userid="108933" url="~/f/nordic-q-a/94141/debug-vs-flash-vsc/397674"]CONFIG_RESET_ON_FATAL_ERROR=n.&amp;nbsp;[/quote]
&lt;p&gt;this did not resolve the issue. I observed that in the mcuboot main.c file, inside doboot() finction, there appears some issue (see image 1). When step-in into doboot(), I found that the error occurs when at line number 274,&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;((&lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;)(&lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt;))&lt;/span&gt;&lt;span&gt;vt&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;reset&lt;/span&gt;&lt;span&gt;)();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;is executed (see image 2). I could not analyze, what is done by&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;((&lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;)(&lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt;))&lt;/span&gt;&lt;span&gt;vt&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;reset&lt;/span&gt;&lt;span&gt;&lt;span&gt;)();. After reaching to this line, when F11 is pressed, the code enters to reset.S file, see image 3.&amp;nbsp; Step-in in this file and reach to line number 153 (Image 4). Press F11, code enters prep_c.c. At last line of this file, inside z_start() function, code changes to cmsis_gcc.h and&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;__ASM &lt;/span&gt;&lt;span&gt;volatile&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;&amp;quot;MSR msp, &lt;/span&gt;&lt;span&gt;%&lt;/span&gt;&lt;span&gt;0&amp;quot;&lt;/span&gt;&lt;span&gt; : : &lt;/span&gt;&lt;span&gt;&amp;quot;r&amp;quot;&lt;/span&gt;&lt;span&gt; (topOfMainStack) : );&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; causes fatal error.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;I increased the&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_MAIN_STACK_SIZE from 8192 to 16394, but same error.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span&gt;How may I know reason of stack overflow and resolve ?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1669953164309v1.png" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1669955203713v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1669955451361v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pastedimage1669955664234v5.png" /&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug vs Flash VSC</title><link>https://devzone.nordicsemi.com/thread/397674?ContentTypeID=1</link><pubDate>Fri, 25 Nov 2022 14:15:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c4d5845-d2b5-47eb-b5f5-77be22688c68</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;It seems stack overflow. The default behavior is to reset. If you do not want to reset can set&amp;nbsp;&lt;span&gt;CONFIG_RESET_ON_FATAL_ERROR=n.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug vs Flash VSC</title><link>https://devzone.nordicsemi.com/thread/396888?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 12:07:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8d8e6ca-f406-490c-bdf7-70029b0c51d7</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;After, above changes, the debugger could not yet started, but during programming for debug, programming fails with error code 35 or 33. During past 20 years, I have worked on Microchip, Holtek, ST, NXP, SiLab and many architectures. SO much debug issues never occur on those IDEs. In Zephyr based VSC /&amp;nbsp; SES projects, I have wasted two days just launching the debugger. Only once, it got launched and during step-in, I had to reset using Debugger command, to re-start execution, it took two days, but could not launch. Very annoying debugging. Too much wastage of time.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After many tries, when debugger got launched, the Debug Output is in image below:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1669157729430v1.png" alt=" " /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debug vs Flash VSC</title><link>https://devzone.nordicsemi.com/thread/396875?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 11:46:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f21edd8-44a1-42c9-a08c-33bec4a75a9f</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can you try to set this in config file&amp;nbsp;&lt;span&gt;CONFIG_THREAD_NAME=y?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kazi Afroza Sultana&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>