<?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>Determining source of &amp;quot;reset&amp;quot;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7139/determining-source-of-reset</link><description>Hello all, 
 I have a simple C++ application flashed to my device to operate the UART - every time I send a char from an external source, the device appears to reset - specifically, the disassembly window leaps to 0xfffffffe. The call stack shows - I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 May 2015 13:52:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7139/determining-source-of-reset" /><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25237?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 13:52:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de9fe458-42a6-4bab-8578-e26b91357e68</guid><dc:creator>Richard Phillips</dc:creator><description>&lt;p&gt;Ok, thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25236?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 12:29:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3559cca5-45bd-4ea5-ac7d-e57ebdb098e0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Richard: I can find that you fixed the issue in the linked case. I suggest we can close this case here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25235?ContentTypeID=1</link><pubDate>Fri, 22 May 2015 09:36:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8351b315-8586-439b-b0c6-77dc2aeb60d3</guid><dc:creator>Richard Phillips</dc:creator><description>&lt;p&gt;Hung, I created a new (more specific) topic here:
&lt;a href="https://devzone.nordicsemi.com/question/38670/cannot-breakpoint-on-uart0_irqhandler-with-c/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In there, I&amp;#39;ve had some more help and have &lt;em&gt;nearly&lt;/em&gt; resolved my issue... I think your suspicion was right though!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25231?ContentTypeID=1</link><pubDate>Fri, 22 May 2015 09:30:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b96bd8c0-c96b-4638-9a1e-b71acd288bfd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Richard: Have you managed to figure out what caused the issue ?&lt;/p&gt;
&lt;p&gt;I suspect that it was because there is no link in the vector table to the UART IRQ handler, then the compiler simply ignore the function because there is no reference/call to it.
I&amp;#39;m not sure how it&amp;#39;s done on IAR but in KEIL the IRQ handler is linked at arm_startup_nrf51.s file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25230?ContentTypeID=1</link><pubDate>Thu, 21 May 2015 10:58:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf0f1102-346d-4ac1-a8ec-6f4d166969a1</guid><dc:creator>Richard Phillips</dc:creator><description>&lt;p&gt;It seems that UART0_IRQHandler() is missing from the map-file.  However, looking at the lst-file for app_uart_fifo (both projects), everything seems ok.  So is it a linker issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25229?ContentTypeID=1</link><pubDate>Thu, 21 May 2015 08:51:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5f442d6-895a-4375-9e35-830ee1780b28</guid><dc:creator>Richard Phillips</dc:creator><description>&lt;p&gt;One early observation - I am unable to set breakpoints (in my project) within UART0_IRQHandler(), even though app_uart_fifo.c is part of my project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25228?ContentTypeID=1</link><pubDate>Thu, 21 May 2015 08:33:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb97daa0-4a0e-441f-9e88-bf39f2f3578d</guid><dc:creator>Richard Phillips</dc:creator><description>&lt;p&gt;Hung, I&amp;#39;ve gone back to the UART example (my code was based on it actually), I&amp;#39;ve made a few trivial mods to get it working on my custom hardware (pin changes, remove the LED stuff), and it works!  So, now I need to figure out what&amp;#39;s different...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25227?ContentTypeID=1</link><pubDate>Wed, 20 May 2015 15:52:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6493a5f1-de44-47cb-bdca-d90ca24505b1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Richard: I&amp;#39;m not very familiar with IAR, I would suggest you to isolate the issue, maybe creating a project to test just the UART module.
Note that we provided an example on UART in the SDKv8.x and there is an IAR project for UART that you can test.&lt;/p&gt;
&lt;p&gt;If it doesn&amp;#39;t help, I would suggest you to post a case in our support portal (Mypage section in our website), it&amp;#39;s private portal where you can send confidential information/code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25233?ContentTypeID=1</link><pubDate>Wed, 20 May 2015 15:20:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb6174af-b05c-43fa-bf62-0983596fa9b7</guid><dc:creator>Richard Phillips</dc:creator><description>&lt;p&gt;Having dug further... I&amp;#39;m still not sure what might cause a LOCKUP.  Plus, I am unable to set a breakpoint on UART0_IRQHandler() - having looked through the stack and compared to map file, it &lt;em&gt;looks&lt;/em&gt; like the code might be getting as far as somewhere in &amp;quot;app_uart_fifo&amp;quot;, but not sure where yet...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25226?ContentTypeID=1</link><pubDate>Wed, 20 May 2015 15:17:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6c248e7-f62d-49ab-a742-3e8d0660d9e9</guid><dc:creator>Richard Phillips</dc:creator><description>&lt;p&gt;IAR Embedded Workbench.  I am happy to share the code, but it&amp;#39;s probably not quite simple enough to post up here (more than one module, each with it&amp;#39;s own boilerplate code).  I could email it as a zip (entire project!), or can look at posting if it&amp;#39;s the only option, but it&amp;#39;ll run to a good few screens!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25225?ContentTypeID=1</link><pubDate>Wed, 20 May 2015 14:43:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bddd76d9-c71a-4a6c-bbcc-ba8904cbb380</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Richard: Which compiler did you use ? Could you post your code ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25234?ContentTypeID=1</link><pubDate>Wed, 20 May 2015 12:29:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f5ccd5a-2983-49ab-a4e5-a07a368b0049</guid><dc:creator>Richard Phillips</dc:creator><description>&lt;p&gt;RESETREAS indicates LOCKUP (and only that - I clear RESETREAS at the start of main()).  Does that sound consistent with a missing handler, or should I be looking elsewhere now?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining source of "reset"</title><link>https://devzone.nordicsemi.com/thread/25232?ContentTypeID=1</link><pubDate>Tue, 19 May 2015 17:11:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaf8c432-6934-4c8b-8b9b-75087ba4c21b</guid><dc:creator>Nick Pelis</dc:creator><description>&lt;p&gt;You can look at NRF_POWER-&amp;gt;RESETREAS register to determine the source of the reset.&lt;/p&gt;
&lt;p&gt;A soft reset should not kill the state of memory.  You&amp;#39;ll know this because at the time the processor jumps to the reset vector, your stack pointer will still be valid (sp register is nonzero).  If this is the case, then another trick you can use is to put the stack pointer in the memory window and see what was on the stack at the time of the reset.  Of particular interest will be values corresponding to function return addresses (anything in the memory range 0x00000000 - SIZE_OF_FLASH_IN_HEX).  You can then match those return addresses up using the .map file and work out the sequence of calls at the time the reset occurred.&lt;/p&gt;
&lt;p&gt;My guess is that somewhere you have an undefined event handler which is invoked when UART characters are received, so the processor is executing a BLX instruction to address zero.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>