<?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/"><channel><title>SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><description>This tutorial will take less than 15 minutes.
#Motivation
Never lose a BLE connection when debugging your applications again! This technique will also be useful for any application using the PWM peripheral and many others as well!
Monitor mode deb</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><item><title>RE: SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><pubDate>Mon, 08 Oct 2018 10:06:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c264ec6-ba87-4bed-9161-c1dc13e284b8</guid><dc:creator>awneil</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;[quote]&amp;nbsp;&amp;nbsp;&lt;span&gt;#How to make MMD work in any &lt;em&gt;(sic)&lt;/em&gt; application&amp;nbsp; &lt;/span&gt;[/quote]&lt;/p&gt;
&lt;p&gt;&lt;span&gt;That list will only work for applications &lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;without&lt;/em&gt;&lt;/span&gt; a SoftDevice&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;For applications &lt;em&gt;with&lt;/em&gt; a SoftDevice, an extra J-Link command is required:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:c9a43b36-e977-46d3-a4e2-d5df6eb28ffe:type=text&amp;text=mon%20exec%20SetMonModeVTableAddr%3D0x1f000]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Where &lt;/span&gt;the 0x1f000 must be changed to match the FLASH_START value.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;See:&amp;nbsp;&lt;a href="/f/nordic-q-a/38438/a-working-demo-of-monitor-mode-debug-mmd-on-sdk-15-please/151972#151972"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/38438/a-working-demo-of-monitor-mode-debug-mmd-on-sdk-15-please/151972#151972&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And:&amp;nbsp;&lt;a href="/b/blog/posts/monitor-mode-debugging-with-j-link-and-gdbeclipse"&gt;https://devzone.nordicsemi.com/b/blog/posts/monitor-mode-debugging-with-j-link-and-gdbeclipse&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also:&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/j-link-monitoring-mode-debugging"&gt;https://github.com/NordicPlayground/j-link-monitoring-mode-debugging&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;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=881&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><pubDate>Thu, 13 Sep 2018 12:06:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c264ec6-ba87-4bed-9161-c1dc13e284b8</guid><dc:creator>awneil</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;em&gt;&amp;quot;At the top of main.c add &amp;#39; NVIC_SetPriority(DebugMonitor_IRQn, 7ul);&amp;#39; to be the lowest priority possible (7 on nRF52)&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;(I removed the irrelevant nRF51 bits - see separate comment)&lt;/p&gt;
&lt;p&gt;Note that this is &lt;strong&gt;not&lt;/strong&gt; the recommended Priority given here:&amp;nbsp;&lt;a href="/b/blog/posts/monitor-mode-debugging-with-j-link-and-gdbeclipse"&gt;https://devzone.nordicsemi.com/b/blog/posts/monitor-mode-debugging-with-j-link-and-gdbeclipse&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;&amp;quot;Using priority &lt;span style="text-decoration:underline;"&gt;level 6&lt;/span&gt; allows breakpoints to be set in the&amp;nbsp;on_ble_evt&amp;nbsp;function and &lt;span style="text-decoration:underline;"&gt;is the recommended level for most applications&lt;/span&gt;&amp;quot;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=881&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><pubDate>Wed, 12 Sep 2018 16:56:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c264ec6-ba87-4bed-9161-c1dc13e284b8</guid><dc:creator>awneil</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Note that MMD is &lt;strong&gt;not&lt;/strong&gt; licensed on the on on-board J-Link of nRF dev boards - you will get a message like this:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-3c264ec6-ba87-4bed-9161-c1dc13e284b8/pastedimage1536771353501v1.png" alt=" " /&gt;&lt;/p&gt;&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=881&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><pubDate>Sat, 23 Jan 2016 00:57:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c264ec6-ba87-4bed-9161-c1dc13e284b8</guid><dc:creator>RK</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Yes I&amp;#39;ve used MMD a couple of times. It&amp;#39;s 2 orders of magnitude better than normal debugging even though it&amp;#39;s not 100% absolutely perfect. I found it was great for breaking, looking at the state of things, then letting the code run on for a while and doing the same again. I did find that if I single stepped over code constantly, eventually it would break in the softdevice in a similar way to normal debugging, so I&amp;#39;d say it stays 99% out of the way of the softdevice but if you hammer at it, you&amp;#39;ll probably break in the end.&lt;/p&gt;
&lt;p&gt;I also confused myself a bit because code was running while I was stopped and so you had to be aware that &amp;#39;current state&amp;#39; wasn&amp;#39;t necessarily quite what you thought.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s another great tool to have in your tool belt. With this plus RTT most things you can attempt debugging on the fly without disrupting the softdevice operations. It&amp;#39;s really time everyone moved on from UARTS. I haven&amp;#39;t yet tried any of the ETM trace stuff, I think there&amp;#39;s yet more options for good debugging and hopefully profiling there. I note that Segger also has just released &amp;#39;SystemView&amp;#39; which I haven&amp;#39;t got working yet (think I don&amp;#39;t have my trace properly configured) which looks like another great tool for performance tuning and looking &amp;#39;under the hood&amp;#39; and as we discussed offline there&amp;#39;s the JLink Debugger as well which you can just throw a binary into and get some results out quickly. So it&amp;#39;s been a killer week for Segger!&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=881&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><pubDate>Fri, 22 Jan 2016 15:15:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c264ec6-ba87-4bed-9161-c1dc13e284b8</guid><dc:creator>Michael Dietz</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;RK: So have you used MMD on the nRF52 to help debug BLE applications? How helpful was it for you if you have? We will work on getting a package for the nRF series.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=881&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><pubDate>Fri, 22 Jan 2016 15:04:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c264ec6-ba87-4bed-9161-c1dc13e284b8</guid><dc:creator>RK</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;No I can&amp;#39;t find those options either - there are a lot of options in the full Crossworks, I don&amp;#39;t even know what half of them do, SES has a well-chosen subset of them.&lt;/p&gt;
&lt;p&gt;I hope they put out a package for the NRF series soon, it will make configuring new projects just that little bit easier. Currently Tools .. Package Manager just shows a few for Freescale, NXP and a few others.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=881&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><pubDate>Fri, 22 Jan 2016 14:50:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c264ec6-ba87-4bed-9161-c1dc13e284b8</guid><dc:creator>Michael Dietz</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Thanks for the catch, MMD is not supported on Cortex M0. I&amp;#39;m going to remove nRF51 notes from this blog post.&lt;/p&gt;
&lt;p&gt;No I don&amp;#39;t think the JLink command has to come from SES. In IAR you have a macro file that sends this command but it does call JLink Commander. You can also execut &amp;quot;exec SetMonModeDebug=1&amp;quot; from JLink.exe and then debug your application. I haven&amp;#39;t seen either of those options in SES maybe SEGGER can answer better.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=881&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><pubDate>Fri, 22 Jan 2016 14:31:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c264ec6-ba87-4bed-9161-c1dc13e284b8</guid><dc:creator>RK</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I didn&amp;#39;t know the Cortex M0 supported MMD, I thought it was just M3, M4 and M7, so I never tried it before I started working with the nRF52 series, wish I&amp;#39;d known.&lt;/p&gt;
&lt;p&gt;Do you have to supply the actual JLink command for SES, the SetMonDebugMode=1, on Crossworks, which as we know is quite similar, there are two defined properties, &amp;#39;Monitor Mode Debug&amp;#39; and &amp;#39;Monitor Mode Memory&amp;#39; which you can set and do it for you. I haven&amp;#39;t had a chance to look and see if they exist on SES or not.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=881&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><pubDate>Fri, 22 Jan 2016 14:03:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c264ec6-ba87-4bed-9161-c1dc13e284b8</guid><dc:creator>Michael Dietz</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hey, I will make sure something is posted for Keil next week. Setting it up in Keil &amp;amp; IAR is very similar to what was done in this post for SES. So I will most likely edit this post with a section about making it work in Keil &amp;amp; IAR.&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=881&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: SEGGER Embedded Studio Part 2 - Monitor Mode Debugging</title><link>https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-part-2-monitor-mode-debuggi</link><pubDate>Fri, 22 Jan 2016 13:49:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c264ec6-ba87-4bed-9161-c1dc13e284b8</guid><dc:creator>Adrian Eggenberger</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;This MMD looks great to me. It solves the biggest problem when debugging nRF5x devices. An example for GCC and Keil would be awesome!&lt;/p&gt;
&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=881&amp;AppID=4&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>