<?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>Not possible to restart debugging without reloading in VSCode (nrf9160dk)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100611/not-possible-to-restart-debugging-without-reloading-in-vscode-nrf9160dk</link><description>I&amp;#39;m trying desperately to find a way to restart a debugging session (reset device and go back to main) on the nrf9160dk without reloading the FW onto the device. 
 I&amp;#39;m using VSCode and the nordic 2.3.0 sdk &amp;amp; toolchain. 
 I&amp;#39;m desperate to find way(s) to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Apr 2024 02:18:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100611/not-possible-to-restart-debugging-without-reloading-in-vscode-nrf9160dk" /><item><title>RE: Not possible to restart debugging without reloading in VSCode (nrf9160dk)</title><link>https://devzone.nordicsemi.com/thread/479322?ContentTypeID=1</link><pubDate>Thu, 18 Apr 2024 02:18:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:867daa4e-ca29-4aef-8562-c67e7a5627ca</guid><dc:creator>liteyear</dc:creator><description>[quote userid="2115" url="~/f/nordic-q-a/100611/not-possible-to-restart-debugging-without-reloading-in-vscode-nrf9160dk/478872"]Are you seeing the same gdb-assertion message?[/quote]
&lt;p&gt;I haven&amp;#39;t even looked. My issue is as per the OP&amp;#39;s. The workaround is just a workaround.&lt;br /&gt;&lt;br /&gt;I want to be able to restart a debugging session without&amp;nbsp;the firmware&amp;nbsp;re-flashing. That fundamental function does not appear possible without this debug console workaround.&lt;br /&gt;&lt;br /&gt;Are you saying that the original issue is due to the GDB issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to restart debugging without reloading in VSCode (nrf9160dk)</title><link>https://devzone.nordicsemi.com/thread/478872?ContentTypeID=1</link><pubDate>Tue, 16 Apr 2024 07:22:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2e7910a-8025-4304-93f3-9c6e04a0d9a3</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;Are you seeing the same gdb-assertion message?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;...gdb/gdb/infrun.c:5825: internal-error: finish_step_over: Assertion `ecs-&amp;gt;event_thread-&amp;gt;control.trap_expected&amp;#39; failed.&lt;/pre&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If yes, this is an issue that we have reported back to the toolchain:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/sdk-ng/issues/727"&gt;https://github.com/zephyrproject-rtos/sdk-ng/issues/727&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The issue seems to occur if your first breakpoint is inside interrupt context, and you have thread aware configurations (DEBUG_THREAD_INFO / DEBUG_INFO) enabled. If your first breakpoint is in thread context (main or something); the issue seems&amp;nbsp;to be less frequent.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&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: Not possible to restart debugging without reloading in VSCode (nrf9160dk)</title><link>https://devzone.nordicsemi.com/thread/478658?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2024 06:12:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1aedfafb-9641-41b4-abb3-2dc620dbb3c7</guid><dc:creator>liteyear</dc:creator><description>&lt;p&gt;It&amp;#39;s a pity the OP didn&amp;#39;t continue with the thread, although their workaround is excellent.&lt;br /&gt;&lt;br /&gt;This issue has plagued me for a long time. FWIW, here&amp;#39;s my report. I&amp;#39;ve just replaced project/client names with placeholders.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf-connect-support-info.txt"&gt;devzone.nordicsemi.com/.../nrf-connect-support-info.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to restart debugging without reloading in VSCode (nrf9160dk)</title><link>https://devzone.nordicsemi.com/thread/430804?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 14:31:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e4b643f-354a-4e7f-ad68-91baf4ac2753</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Thank you for elaborating on your process.&lt;/p&gt;
&lt;p&gt;The intended process is that the device shall reset (ie. exit and re-enter debug mode) without having to flash again.&lt;/p&gt;
&lt;p&gt;I have seen this behavior before, but I am not able to successfully recreate this at my end now, unfortunately. I&amp;#39;ve tested with a macbook m1 (big sur) and two different linux PCs (Intel and AMD based).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q1: Are there specific projects that invoke this behavior at your end, or is it pretty much any sample in the NCS tree?&lt;/p&gt;
&lt;p&gt;Q2: Could you share the report generated by executing this command in vscode?&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/pastedimage1686665877108v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&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: Not possible to restart debugging without reloading in VSCode (nrf9160dk)</title><link>https://devzone.nordicsemi.com/thread/430487?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 12:34:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbb81846-7122-464f-84c6-052264ef26a8</guid><dc:creator>jpnorair</dc:creator><description>&lt;p&gt;This reset button is the first thing I tried.&lt;/p&gt;
&lt;p&gt;It indeed performs a reloading of the fw onto the target, which is not only slow but also full of problems (you can see the other ticket for this). &amp;nbsp;The only way I&amp;#39;ve found to successfully restart the device (or reset it at all) is via the [-exec mon reset] command you presented.&lt;/p&gt;
&lt;p&gt;Having a fast reset is very important if trying to breakpoint-debug in the presence of a second core which doesn&amp;#39;t stop when the first core is breakpointed. &amp;nbsp;Most nordic products seem to have a&amp;nbsp;second core for the comms stack.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to restart debugging without reloading in VSCode (nrf9160dk)</title><link>https://devzone.nordicsemi.com/thread/430434?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 10:35:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12e6fb20-418d-40ab-8525-870eb1b184da</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;My apologies for coming with bad advice here, and I&amp;#39;m glad to hear that you have found a partial workaround to the problem.&lt;/p&gt;
&lt;p&gt;I have confirmed with testing and R&amp;amp;D that we have seen similar behavior with GDB when issuing a monitor reset command. I&amp;#39;ll ask the team to look deeper into this, and possibly bring it up with segger as well.&lt;/p&gt;
[quote user="jpnorair"]&lt;p&gt;This other workflow does provide a workaround, however:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set a user breakpoint at&amp;nbsp;main()&lt;/li&gt;
&lt;li&gt;Set another breakpoint where you want it, wait for it to hit.&lt;/li&gt;
&lt;li&gt;Step the debugger&lt;/li&gt;
&lt;li&gt;apply -exec mon reset&lt;/li&gt;
&lt;li&gt;Push resume button&lt;/li&gt;
&lt;li&gt;Debugger WILL arrive at the breakpoint on main()&lt;/li&gt;&lt;/ol&gt;[/quote]
&lt;p&gt;A question that came up when discussing this with the VS Code team:&lt;/p&gt;
&lt;p&gt;How does the green restart button behave at your end?&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/pastedimage1686565019070v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The intended behavior is that it should quickly (ie. in less than 5 seconds) reload the debug session and reset your device, ie. no loading of the firmware, unless there has been a change in the firmware itself.&lt;/p&gt;
&lt;p&gt;Is this the reset source that you&amp;#39;ve been using?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&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: Not possible to restart debugging without reloading in VSCode (nrf9160dk)</title><link>https://devzone.nordicsemi.com/thread/430295?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:48:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb5b12ba-23d5-4381-8684-11d58f0f4b58</guid><dc:creator>jpnorair</dc:creator><description>&lt;p&gt;This workaround helps, although I do seriously hope your improvements also get implemented. &amp;nbsp;I will describe my experience with the workaround.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;This workflow does NOT work. &amp;nbsp;It results in an error (copied below).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set a breakpoint, and wait for it to hit.&lt;/li&gt;
&lt;li&gt;apply -exec mon reset&lt;/li&gt;
&lt;li&gt;Push resume button&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Thread 15 hit Breakpoint 2 ...
-exec mon reset
Resetting target
[New Remote target]
/Volumes/Workspace/build/.build/HOST-aarch64-apple-darwin/arm-zephyr-eabi/src/gdb/gdb/infrun.c:5825: internal-error: finish_step_over: Assertion `ecs-&amp;gt;event_thread-&amp;gt;control.trap_expected&amp;#39; failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
/Volumes/Workspace/build/.build/HOST-aarch64-apple-darwin/arm-zephyr-eabi/src/gdb/gdb/infrun.c:5825: internal-error: finish_step_over: Assertion `ecs-&amp;gt;event_thread-&amp;gt;control.trap_expected&amp;#39; failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
ERROR: GDB exited unexpectedly with exit code 134 (0x86). Debugging will now abort.
The program &amp;#39;/Users/jpnorair/.../build/zephyr/zephyr.elf&amp;#39; has exited with code -1 (0xffffffff).&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This other workflow does provide a workaround, however:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set a user breakpoint at&amp;nbsp;main()&lt;/li&gt;
&lt;li&gt;Set another breakpoint where you want it, wait for it to hit.&lt;/li&gt;
&lt;li&gt;Step the debugger&lt;/li&gt;
&lt;li&gt;apply -exec mon reset&lt;/li&gt;
&lt;li&gt;Push resume button&lt;/li&gt;
&lt;li&gt;Debugger WILL arrive at the breakpoint on main()&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;With this workaround, I am at least able to debug the software we need to work-on. &amp;nbsp;Thank you: your suggestion was very helpful.&lt;/p&gt;
&lt;p&gt;I will add an additional point -- I wrote another ticket recently about issues programming the target (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/100497/vs-code-debug-flash-works-once-then-fails-on-second-instantiation"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/100497/vs-code-debug-flash-works-once-then-fails-on-second-instantiation&lt;/a&gt;). &amp;nbsp;By applying [-exec mon reset] when I am finished with the debugging session, I am able to flash the board again without problems (at least, so far).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not possible to restart debugging without reloading in VSCode (nrf9160dk)</title><link>https://devzone.nordicsemi.com/thread/430217?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 11:50:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdf0c00f-89f9-4c72-baeb-851a1dd42596</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;I share your concerns.&lt;/p&gt;
&lt;p&gt;This is an improvement task that I&amp;#39;ve raised internally.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As a workaround, you can issue gdb commands in the debug console by first appending &amp;quot;-exec&amp;quot;, for instance monitor reset:&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/pastedimage1686311337439v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Could you try this and see if that works for you?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind 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>