<?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>Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20364/problem-with-double-reset-after-flashing</link><description>Hello, 
 I am trying to get to the bottom of a double-reset-problem which I am facing, whenever I flash my software-program to the nRF52832 (1 for the flashing and 1 after a short startup). 
 Currently I am using a Windows 8.1 machine with an Eclipse</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Mar 2017 14:55:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20364/problem-with-double-reset-after-flashing" /><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79371?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2017 14:55:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b6aaeee-028c-4b52-b0cc-d455d2a08204</guid><dc:creator>Ray Breslin</dc:creator><description>&lt;p&gt;Oh my god... there you pinned the problem regarding this minor issue! After checking the paths of both examples from where I ran &amp;quot;make flash&amp;quot;, I could easily see it... one was &amp;quot;examples\peripheral\blinky\pca10040\s132\armgcc&amp;gt;&amp;quot; while the other one was &amp;quot;examples\peripheral\uart\pca10040\blank\armgcc&amp;gt;&amp;quot; - thanks for that!&lt;/p&gt;
&lt;p&gt;At least now just the initial problem with the double-reset remains, but as I said before it is tolerable for now...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79370?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2017 14:36:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3461c8ac-2fae-4aba-9eff-0e90422fb0d0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;There are 2 flavor for blinky example, one as &amp;quot;blank&amp;quot; and the other one is &amp;quot;s132&amp;quot;.&lt;/p&gt;
&lt;p&gt;The &amp;quot;S132&amp;quot; is to use when softdevice is flashed. It doesn&amp;#39;t use any softdevice feature though, just a show case how to have an application when softdevice is flashed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79369?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2017 12:41:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dccd282-e446-4c7e-ac33-950918dacf10</guid><dc:creator>Ray Breslin</dc:creator><description>&lt;p&gt;Ah ok that seems to be the problem then, but why would there be a difference in these 2 examples taken from the /examples/peripheral/-directory?&lt;/p&gt;
&lt;p&gt;Havent modified anything in the code and just removed some obsolete paths in the Makefile (as there seem to be plenty throughout all examples).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79368?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2017 12:27:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e8ec9b4-523b-45af-bc76-344ff3dc4db9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I can see the uart hex has the flash located at address 0x00000 are you sure it should be used with the softdevice  ?
The blinky start address was at 0x1F000.&lt;/p&gt;
&lt;p&gt;If it wasn&amp;#39;t made to work with softdevice then it&amp;#39;s quite normal to explain what you saw. You flash the softdevice and blinky first, it works, normally.&lt;/p&gt;
&lt;p&gt;Then you flash the uart.hex and it will overwrite the softdevice and start from address 0x0000 .&lt;/p&gt;
&lt;p&gt;After that you flash the blinky, it won&amp;#39;t work as the uart is still at address 0x00000&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79367?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 16:05:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e569b68e-6863-4850-8360-2a4bc89b4662</guid><dc:creator>Ray Breslin</dc:creator><description>&lt;p&gt;Oh sorry that was an accident! I edited my answer above and exchanged the 2 files and those shouldnt be identical (at least not in size - 16KB vs. 27 KB). Hopefully you can work with those!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79364?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 12:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58782294-0aae-4990-a88e-3d7a4392ec10</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Ray: Please double check, the 2 files are identical. And let me know which softdevice version you used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79363?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 17:04:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64991313-2b8a-40e2-a9b8-030ecdc1d2a5</guid><dc:creator>Ray Breslin</dc:creator><description>&lt;p&gt;Yes indeed it does! I edited my previous answer and attached the 2 hex-files there. Hopefully that is going to bring some insights, even though the actual cause of the double-reset would be of more interest. In the next few days I will update the J-Link-Firmware on the other pc that has no double-reset so far, just to make sure that this is excluded as potential cause.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79366?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 08:58:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b8d5055-f061-419c-8926-47ba58181874</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;It sounds very strange, could you give me the 2 hex files you used ? We can do a hex dump and compare what inside the chip after flashing in 2 different orders.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79365?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 16:26:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:328e5e6a-8067-488b-89e6-83c733ecd886</guid><dc:creator>Ray Breslin</dc:creator><description>&lt;p&gt;@Hung Bui:
Currently I am using the v12.0.0 of the Nordic SDK that I downloaded in September 2016. As for the compilation- and flashing-procedure, I normally just use a specific Make-Target in Eclipse, which you can install for a Makefile. After your suggestion I already tried &amp;quot;make flash&amp;quot; directly from the command-line and I am seeing exactly the same kind of behaviour. This is why I am assuming my observation is correct and I can simply uncomment &amp;quot;nrfjprog --reset -f nrf52&amp;quot; in my Makefile.
For the &amp;quot;over-flashing&amp;quot;-problem I simply first compiled and flashed the ble_app_blinky-example, which is working just fine triggering LED1-4 and then I compiled and flashed the ble_app_uart-example, which gave me a &amp;quot;Start: &amp;quot;-prompt - waiting for keyboard-input. So this way is working! But the other way around is not, so I would guess the command-prompt is causing some kind of flash-interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79362?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2017 08:34:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51b2563d-eb58-4605-9afb-c6c45d127f77</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Ray: You did compile and flash from command line or from Eclipse ?
If you try simply call &amp;quot;make flash&amp;quot; from command line do you see the same early reset  ?&lt;/p&gt;
&lt;p&gt;When you mentioned the issue when you flash ble_app_uart over ble_app_blinky , what exactly happened ? Can you try to debug to see if the program actually executed and if there is any assertion ?
Which SDK you are using ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79361?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2017 15:59:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fc4f505-9cb9-4577-adb3-7b9731dd8faf</guid><dc:creator>Ray Breslin</dc:creator><description>&lt;p&gt;Ok I did what you suggested and here are my observations...&lt;/p&gt;
&lt;p&gt;First I got the blinky- and the uart-example setup in Eclipse and ready for compilation. When compiling directly through a Make-Target (flash) then I am seeing precisely the same double-reset like I got from flashing my own program. In addition to that I found out something else...&lt;/p&gt;
&lt;p&gt;Whenever I flash the uart-example over the blinky-example it get taken directly, but if I want to do it the other way around, then it only works when re-flashing the softdevice first! If I dont flash the softdevice then I basically re-flash the uart-example no matter which program I want to flash... Is that normal? (Just curious but I can live with that!)&lt;/p&gt;
&lt;p&gt;(Edit 22.03.17: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6327.nrf52832_5F00_xxaa.hex"&gt;basic_blinky.hex&lt;/a&gt;/&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4621.nrf52832_5F00_xxaa.hex"&gt;basic_uart.hex&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Now to the direct command-line-tests for nrfjprog:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;C:\Nordic\nRF5_SDK\examples\ble_peripheral\test\pca10040\s132\armgcc&amp;gt;nrf
jprog --program _build/nrf52832_xxaa.hex -f nrf52 --sectorerase
Parsing hex file.
Erasing page at address 0x1F000.
Erasing page at address 0x20000.
Erasing page at address 0x21000.
Erasing page at address 0x22000.
Erasing page at address 0x23000.
Erasing page at address 0x24000.
Erasing page at address 0x25000.
Erasing page at address 0x26000.
Erasing page at address 0x27000.
Erasing page at address 0x28000.
Erasing page at address 0x29000.
Erasing page at address 0x2A000.
Erasing page at address 0x2B000.
Erasing page at address 0x2C000.
Erasing page at address 0x2D000.
Erasing page at address 0x2E000.
Erasing page at address 0x2F000.
Erasing page at address 0x30000.
Erasing page at address 0x31000.
Erasing page at address 0x32000.
Erasing page at address 0x33000.
Erasing page at address 0x34000.
Applying system reset.
Checking that the area to write is not protected.
Programing device.

C:\Nordic\nRF5_SDK\examples\ble_peripheral\test\pca10040\s132\armgcc&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And that directly gives me a &amp;quot;normal&amp;quot; startup already without an additional reset.&lt;/p&gt;
&lt;p&gt;So if I skip the &amp;quot;nrfjprog --reset -f nrf52&amp;quot; in the Makefile then it is the way I want it, but I am unsure about causing a mailfunction that way...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79359?ContentTypeID=1</link><pubDate>Mon, 13 Mar 2017 13:38:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2f39fde-dc64-4778-85c5-32084fd697ae</guid><dc:creator>Ray Breslin</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;thank you for your reply - for the double print-out of the reset-code you are absolutely correct.
I did one as early as possible (directly after initializing the UART and the timer-clk) and one as late as possible, where I am basically &amp;quot;hanging&amp;quot; in the main-loop and waiting for bt-, signal- or interrupt-events.&lt;/p&gt;
&lt;p&gt;Will try to do the nrfjprog-tests asap and get back to you with the results!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with double-reset after flashing</title><link>https://devzone.nordicsemi.com/thread/79360?ContentTypeID=1</link><pubDate>Mon, 13 Mar 2017 12:01:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ad8eda5-987b-463c-96ce-786f519b18f2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ray,&lt;/p&gt;
&lt;p&gt;Have you tried to use nrfjprog (in your commandline , not from the make file) to flash and reset ?
If you try, will try see the double reset ?
Is there any chance that it&amp;#39;s reset because of the application code ? I would suggest you to test with one of our example in the SDK, try to print something at the beginning of the code.&lt;/p&gt;
&lt;p&gt;I assume &amp;quot;Reset code ...&amp;quot; is printed twice in your application ? one after UART Start and one after Advertising Initialized ? It&amp;#39;s a coincident that it reset right after that ?&lt;/p&gt;
&lt;p&gt;RESETREAS is cumulative, if you don&amp;#39;t clear  it it will collect all the reset reasons happen before unless it&amp;#39;s a power reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>