<?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>Must re-flash SoftDevice every time I debug</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35661/must-re-flash-softdevice-every-time-i-debug</link><description>I am using the PCA10056 development board, running a custom application merging the MESH stack (2.0.1) with an IAR-based SDK v15 template, sd 140 v6. Whenever I go to debug with my I-Jet Trace, the program only runs if I erase the chip and re-program</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Oct 2020 23:21:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35661/must-re-flash-softdevice-every-time-i-debug" /><item><title>RE: Must re-flash SoftDevice every time I debug</title><link>https://devzone.nordicsemi.com/thread/272810?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 23:21:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2377e0ce-ec9a-4a6d-8606-22a6ec7011f2</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;For programming there are a few IAR posts, such as&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/60235/iar-flash-loader-error-nrf52810"&gt;iar-flash-loader-error-nrf52810&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To debug in IAR using a Softdevice the J-Link Monitor is required:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        &amp;lt;group&amp;gt;
            &amp;lt;name&amp;gt;JLink-Monitor&amp;lt;/name&amp;gt;
            &amp;lt;excluded&amp;gt;
                &amp;lt;configuration&amp;gt;nrf52832_xxaa&amp;lt;/configuration&amp;gt;
            &amp;lt;/excluded&amp;gt;
            &amp;lt;file&amp;gt;
                &amp;lt;name&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\JLink-Monitor\JLINK_Monitor.c&amp;lt;/name&amp;gt;
            &amp;lt;/file&amp;gt;
            &amp;lt;file&amp;gt;
                &amp;lt;name&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\JLink-Monitor\JLINK_MONITOR.h&amp;lt;/name&amp;gt;
            &amp;lt;/file&amp;gt;
            &amp;lt;file&amp;gt;
                &amp;lt;name&amp;gt;$PROJ_DIR$\..\..\..\..\..\..\JLink-Monitor\JLINK_Monitor_ISR_IAR.s&amp;lt;/name&amp;gt;
            &amp;lt;/file&amp;gt;
        &amp;lt;/group&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This requires the companion enable in main():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;   // This allows all interrupts higher than _PRIO_SD_LOW (ie 4, BLE SD stuff) to continue execution even during a break
   // note Two J-Link commands are required in command file:
   // SetMonModeDebug = 1
   // SetMonModeVTableAddr = ADDR, typically 0x2600
   //  where ADDR is the application&amp;#39;s vector table located in FLASH, ie the start address for the
   // application, probably either 0x1B000 or 0x1C000 or 0x26000 depending on SoftDevice
   // See https://github.com/NordicPlayground/j-link-monitoring-mode-debugging
   NVIC_SetPriority(DebugMonitor_IRQn, _PRIO_SD_LOW);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Must re-flash SoftDevice every time I debug</title><link>https://devzone.nordicsemi.com/thread/272803?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 21:55:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d18491a-21bb-421c-b9bc-be28fcd5683d</guid><dc:creator>E.Cho</dc:creator><description>&lt;p&gt;Did anyone resolve this issue? I&amp;#39;m having the same issue where I need to re-flash my board before I can download and debug my application from IAR.&lt;br /&gt;&lt;br /&gt;I am using SDK 17,&amp;nbsp;S112 v7.0.1, a custom board with nrf52810, IAR Embedded Workbench 8.50.1, and Segger JLink.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Must re-flash SoftDevice every time I debug</title><link>https://devzone.nordicsemi.com/thread/137759?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 19:01:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bfc9e85-ab4a-490a-a587-5acf981c2fc1</guid><dc:creator>Chuppster</dc:creator><description>&lt;p&gt;I did my normal thing and erased the board, programmed the SoftDevice, and debugged with IAR.&amp;nbsp; I then used nrfjprog to pull off the image.&amp;nbsp; I compared it to the .hex file generated by IAR and the contents are identical.&amp;nbsp; But if I go to debug again it always fails while initializing the softDevice.&amp;nbsp; It fails if I download again and if I just debug without downloading.&lt;/p&gt;
&lt;p&gt;The code does appear to run if I reset the chip and I&amp;#39;m not debugging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Must re-flash SoftDevice every time I debug</title><link>https://devzone.nordicsemi.com/thread/137732?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 15:20:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3b3a5e7-74d4-456f-97d6-84f6940b9963</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for the clarification. I think we can treat this as a general issue with the particular application for now, as that seems most likely.&lt;/p&gt;
&lt;p&gt;You can use the command line tool nrfjprog to dump the flash contents of the SoC, with&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nrfjprog --readcode file.hex&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The full flash contents will then be stored in a hexfile named file.hex. That should reveal if flash has been written to that should not have been.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Must re-flash SoftDevice every time I debug</title><link>https://devzone.nordicsemi.com/thread/137526?ContentTypeID=1</link><pubDate>Mon, 25 Jun 2018 17:27:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52575ca5-9a68-4f67-9ee6-94f98c5259c6</guid><dc:creator>Chuppster</dc:creator><description>&lt;p&gt;1. The issue occurs when using the onboard debugger and with my I-jet Trace.&amp;nbsp; Symptoms are exactly the same.&lt;/p&gt;
&lt;p&gt;2. Running the default ble_app_blinky_c using my I-jet works just fine.&lt;/p&gt;
&lt;p&gt;3. I have a PCA10056 with the 20 pin debugger header soldered on.&amp;nbsp; I use that with the I-jet Trace.&amp;nbsp; Other than that nothing is connected.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;4. Debugging works fine during the first session after erasing the board and flashing the SoftDevice.&amp;nbsp; While the program runs it may be writing to flash, but I don&amp;#39;t know how to get an image of the board to confirm this.&amp;nbsp; Then, I debug again and it doesn&amp;#39;t work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Must re-flash SoftDevice every time I debug</title><link>https://devzone.nordicsemi.com/thread/137519?ContentTypeID=1</link><pubDate>Mon, 25 Jun 2018 16:14:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50d820c0-6690-4827-898f-fe37651a605e</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The SoftDevice does not write anything to flash, neither on init nor at other times.&lt;/p&gt;
&lt;p&gt;In order to know more about when the error occurs (and when it does not) I still need to know:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;whether using the on-board programmer works&lt;/li&gt;
&lt;li&gt;whether debugging unmodified SDK examples works&lt;/li&gt;
&lt;li&gt;what is your full setup (what is connected to what, how is the board powered, is it connected to anything else, what are the switches set to, etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From what you wrote in your last post, I wonder: Does debugging work at first, before resetting the debugger, but not after restarting it? (Or does it work on the first debug session, but not on debug sessions after that?) Those details may be very important.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Must re-flash SoftDevice every time I debug</title><link>https://devzone.nordicsemi.com/thread/137456?ContentTypeID=1</link><pubDate>Mon, 25 Jun 2018 13:38:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2e3ca85-f94c-4785-830c-d5f7adb76ba6</guid><dc:creator>Chuppster</dc:creator><description>&lt;p&gt;I followed the Coexistence guide as best as I could.&lt;/p&gt;
&lt;p&gt;We have custom hardware on the way that will not be able to use the J-link.&lt;/p&gt;
&lt;p&gt;The issue presents itself if I just restart the debugger.&amp;nbsp; Here&amp;#39;s what happens:&lt;/p&gt;
&lt;p&gt;1. erase the board and flash softdevice 6.0.0 using nRFgo Studio&lt;/p&gt;
&lt;p&gt;2. Download and debug my application in IAR&lt;/p&gt;
&lt;p&gt;3. Restart debugger (without flashing)&lt;/p&gt;
&lt;p&gt;4. Program breaks in app_error_handler after mesh_softdevice_init() is called.&amp;nbsp; Call stack shows recursive calls to app_error_handler.&amp;nbsp; See below photo.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1529933581603v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Is something written to flash during the initialization of the SD that would break the init routines?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Must re-flash SoftDevice every time I debug</title><link>https://devzone.nordicsemi.com/thread/137437?ContentTypeID=1</link><pubDate>Mon, 25 Jun 2018 12:58:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:273d4d38-0cec-4fce-9ae5-04bc292ff8a2</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I assume that you have been following the guide for i&amp;quot;ncluding nRF5 SDK for Mesh functionality in an nRF5 SDK example&amp;quot;, from &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.meshsdk.v2.0.1%2Fmd_doc_getting_started_how_to_nordicSDK.html"&gt;Coexistence with nRF5 SDK BLE functionality&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;May it be something wrong with the setup with regards to downloading (the correct version of) the SoftDevice and application for debugging? Does this happen also for debugging without downloading?&lt;/p&gt;
&lt;p&gt;Does debugging work for a vanilla SDK example, before you add nRF5 SDK for Mesh functionality to it?&lt;/p&gt;
&lt;p&gt;Since you are using a PCA10056 development board, you should be able to use on-board programmer for debugging. Have you tried that instead? What is your full setup when you use the I-Jet Trace?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>