<?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>NRF51822 reset handler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29429/nrf51822-reset-handler</link><description>Hi all, 
 I&amp;#39;m having a bit of trouble figuring out why my project using the RedBearLab BLE Nano board is not working. I&amp;#39;m using the NRF51822 as the hub in a star network using the ESB protocol. The hub is connected to a serial port and will return each</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Jan 2018 19:21:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29429/nrf51822-reset-handler" /><item><title>RE: NRF51822 reset handler</title><link>https://devzone.nordicsemi.com/thread/117050?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2018 19:21:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0abe6ba7-5457-4d98-9227-5fc69b481e1d</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;Sorry for the delay.  I had an all day meeting yesterday.&lt;/p&gt;
&lt;p&gt;I tried out the code on a 51822dk but it seems like I will have to set up quite a bit of hardware to make it all talk.&lt;/p&gt;
&lt;p&gt;Just based on your comments and I own experience with UART&amp;#39;s, I would guess some garbage is coming down the pipe from the usb transceiver on boot or since there is no flow control the uart just doesn&amp;#39;t sync up correctly first time around. This is why the RX buffer has data and you get an event from it. Then my next guess is that it fails to parse correctly in the switch and things fall apart from there.&lt;/p&gt;
&lt;p&gt;Assuming that the real issue is data in the RX buffer, some simple solutions you can try are to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;put a delay before you init the uart.  This will hopefully give time for the usb transceiver to be ready.&lt;/li&gt;
&lt;li&gt;do a reset if you see the RX event immediately after the uart init. If you are right and it should be clear then just wait till it is clear.&lt;/li&gt;
&lt;li&gt;put in a loop to read the RX buffer to clear it after init.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I noticed you put in some code for NRF_POWER-&amp;gt;RESETREAS.  The way you are using it isn&amp;#39;t correct.  The power registers just retain data through a reboot. So reading the register only tells you that it just came out of a reset.  The register doesn&amp;#39;t drive the reset, that is done by the watchdog timer.  I didn&amp;#39;t see the corresponding code to init the watchdog timer.  You can easily remove the code for resetreas and just make sure to init the WDT in main before the do loop.  Then you can refresh the WDT in the loop if you wish. If it truly locks up then it won&amp;#39;t run the main loop and will reset in one WDT interval.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 reset handler</title><link>https://devzone.nordicsemi.com/thread/117045?ContentTypeID=1</link><pubDate>Wed, 17 Jan 2018 01:36:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ef49acd-8e78-4755-8903-501522c37b3d</guid><dc:creator>Chris Hunt</dc:creator><description>&lt;p&gt;Yes, the topology of the network is as you described. I guess it is a bit difficult to describe what exactly the issue is. Right after flashing any device, it works as expected. For the hub, this entails receiving packets from each node over ESB and receiving and sending commands to the usb. Each node also reads data from its sensor over I2C and sends that data to the hub over ESB. Additionally, I get the expected behavior after I reset a device using a reset button. However, if I simply power on a device (say by plugging in the MK20 to the PC USB port or connecting a node to a battery), I no longer get the expected behavior. For the hub, it does not respond to any UART commands and the nodes no longer respond to GPIO events. However, they seem to both still undergo ESB communication. That&amp;#39;s kind of far as I have been able to parse out from my probing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 reset handler</title><link>https://devzone.nordicsemi.com/thread/117044?ContentTypeID=1</link><pubDate>Tue, 16 Jan 2018 23:54:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:689e0472-771f-4f21-aefb-1bdfab4b6ce1</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;Wow, quite the mix of hardware.  I assumed the Red Bear was a module.  Nope! It is a module with a BLE module slapped on it.&lt;/p&gt;
&lt;p&gt;So, can you clarify what is working and not? I assume you mean the uart on hub is not working, but I&amp;#39;m not sure how you could distinguish this from ESB not working, or client uart connections not working.&lt;/p&gt;
&lt;p&gt;Is the topology a red bear at each sensor, then ESB back to a red bear as hub, then uart to usb via MK20 to virtual uart on a PC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 reset handler</title><link>https://devzone.nordicsemi.com/thread/117049?ContentTypeID=1</link><pubDate>Mon, 15 Jan 2018 19:28:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95e04e21-fc11-4e79-8b58-a771e96be7a3</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;I don&amp;#39;t think it changes anything on the possible causes.  Please post your code and a schematic of the nano board if possible.
How are you powering it when it fails to start correctly?
Also, the serial devices you have it connected to, are these all 3volt devices?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 reset handler</title><link>https://devzone.nordicsemi.com/thread/117048?ContentTypeID=1</link><pubDate>Mon, 15 Jan 2018 18:46:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7f5a092-7aba-4779-9c52-30affed41e6b</guid><dc:creator>Chris Hunt</dc:creator><description>&lt;p&gt;Oh I am sorry. The register is NRF_UART0-&amp;gt;EVENTS_RXDRDY.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 reset handler</title><link>https://devzone.nordicsemi.com/thread/117047?ContentTypeID=1</link><pubDate>Mon, 15 Jan 2018 16:48:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6001bf7a-40ed-407d-b685-a8a816fda497</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;I have never heard of NRF_POWER-&amp;gt;EVENTS_RXDRDY. Do you mean NRF_UART-&amp;gt;EVENTS_RXDRDY?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 reset handler</title><link>https://devzone.nordicsemi.com/thread/117046?ContentTypeID=1</link><pubDate>Sun, 14 Jan 2018 17:21:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55fcc076-394a-4026-89c1-4c31db459bfb</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;Sounds like whomever wrote the code failed to initialize gpio/comms correctly. I don&amp;#39;t think you can even configure the reset vector so not much to say about configuring reset.  It should go to 0x0 and then start at the MBR if running SD, or the first line of your code if not running SD.&lt;/p&gt;
&lt;p&gt;Some gpio/comms take a few clocks to be configured.  Out of power reset everything goes back to defaults, but out of button reset this is not true.  So likely the code runs, stuff gets initialized, some of it wrong and it doesn&amp;#39;t work...you do a button reset, some of the settings are sticky and next time around it works.&lt;/p&gt;
&lt;p&gt;This is especially true of the NRF_POWER-&amp;gt; registers.&lt;/p&gt;
&lt;p&gt;Also, since it is not a Nordic DK you are using it could be a hardware issue.  Anything processor related takes quite a bit of current to get the ball rolling.  This aspect is often is lost on new engineers.&lt;br /&gt;
So, it could be some voltage dipping issue during a cold start.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>