<?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>Resetting device via python bindings</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8456/resetting-device-via-python-bindings</link><description>I am developing a tool that will be using the existing NRF51 dongle to run the S130 SD and it is being written in Python. There is no way to change any of these parameters since dev has been going for years on the tool chain via a different chip supplier</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 Aug 2015 15:18:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8456/resetting-device-via-python-bindings" /><item><title>RE: Resetting device via python bindings</title><link>https://devzone.nordicsemi.com/thread/30809?ContentTypeID=1</link><pubDate>Tue, 04 Aug 2015 15:18:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5e9f603-d15b-43e4-99cd-cd8f570293e4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;From the nRF51 point of view, what happens on the other side, the COM port on Windows should be out of sight.&lt;/p&gt;
&lt;p&gt;What the nRF51 can probably see is that the UART peer (the Segger chip) stop responding or HWFC line stopping it from transmit more data. The stack will keep normal operation, and time out may occurs as I mentioned above.&lt;/p&gt;
&lt;p&gt;However potential issue could be some events go missing, if the HWFC is not controlled properly. So the nRF51 keeps transmitting on the UART line when there is no control over it.&lt;/p&gt;
&lt;p&gt;I think it&amp;#39;s better to have a fresh start for the S130. That&amp;#39;s safer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Resetting device via python bindings</title><link>https://devzone.nordicsemi.com/thread/30808?ContentTypeID=1</link><pubDate>Tue, 04 Aug 2015 14:39:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59b1cf59-6a16-4240-b03d-c1c2e453e01f</guid><dc:creator>Jim Dattolo</dc:creator><description>&lt;p&gt;when this happens my app callback for log messages gets hammered with serial error messages.   Windows can and will yank port assignments around.  Normally there are reservations so that the same device will always get the same number.  The problem occurs if the port is yanked and the app still is connected.  In come cases the port is listed in the registry still and windows sees that the reservation cannot be honored and it advances the port number by one.  The other case is that the port goes down do to a hub reunumeration (ESD, etc) and the reervation is honored, however the app now has a stale handle to the port that gets errors.  I have a port chaser app that keeps tabs on things and restarts various parts of my system with the new or old com port number as needed.   When this happens what is going on with the S130 stack running on the dongle?  Can I just re-register without restart&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Resetting device via python bindings</title><link>https://devzone.nordicsemi.com/thread/30807?ContentTypeID=1</link><pubDate>Tue, 04 Aug 2015 11:11:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f8f9262-f8f5-464b-b322-c53a65927fab</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jim,&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t seen the Segger COM port being changed when being in-use. Sometimes, I saw it changed when I unplug and plug it into another USB port. But there maybe different behaviour on other machine.&lt;/p&gt;
&lt;p&gt;From my point of view there are some situations when Windows remunerates the USB-COM port that can cause the issue:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When BLE is active and waiting for a reply call from the application. Then a time-out can happens.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When the stack throw events, but the application fail to get the event out (because of the COMport switching), most likely again end up with a procedure timeout on the connection.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I can&amp;#39;t think of anything other than these.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Resetting device via python bindings</title><link>https://devzone.nordicsemi.com/thread/30806?ContentTypeID=1</link><pubDate>Mon, 03 Aug 2015 14:32:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0aa60d59-2532-4ef7-9940-404fa1e847f5</guid><dc:creator>Jim Dattolo</dc:creator><description>&lt;p&gt;Thanks for the response.  I&amp;#39;ll probably use nrfjprog as long as I can link the com port to the serial number via the registry.  That was the part that was missing for me.   I&amp;#39;ll look forward to seeing the updated python bindings with the API exposed to do the reset as that would be the cleanest way for me to use.   I have other questions that I will be posting about the com ports.  Windows often renumerates USB serial devices and moves port numbers around while keeping power on the device.  My old system would chase the port around and reconfigure the port to allow the retry manager to start working again.  With moving over to the S130/Python stack the com port management is different and I want to know what Nordic is recommending as the correct way to keep chasing windows.  Can I just setup the serial connection again while leaving the stack alone and will it keep working?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Resetting device via python bindings</title><link>https://devzone.nordicsemi.com/thread/30805?ContentTypeID=1</link><pubDate>Mon, 03 Aug 2015 11:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c47ad04f-e707-4ecf-ab19-77b922d640e4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jim,&lt;/p&gt;
&lt;p&gt;Thanks for the clarification. Sorry that I wasn&amp;#39;t sure you were using the BLE driver or the Master Emulator. But you were right, you mentioned v0.5.0 and python.&lt;/p&gt;
&lt;p&gt;On the BLE connectivity set-up we use an extra GPIO pin to do physical pin reset on the connectivity chip. We are actually working to implement the sd_nvic_SystemReset() in the future release of the serialization firmware.&lt;/p&gt;
&lt;p&gt;What you can do for now if you don&amp;#39;t plan to wait for the release that has the soft reset API provided is either:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Implement your own soft reset API on both the connectivity firmware on the nRF51 and the python bindings.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use nrfjprog --reset with the Jlink serial number match with the COM port that you are connected to. You can find the corresponding Jlink serial number for the COM port using Windows Registry. The solution is described &lt;a href="https://devzone.nordicsemi.com/question/33035/relating-com-port-name-and-segger-id/"&gt;here&lt;/a&gt;. The registry section you should look into is HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB. You would need to use the ParentIdPrefix to match them.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Resetting device via python bindings</title><link>https://devzone.nordicsemi.com/thread/30804?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 14:25:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3044404f-30c9-4ba6-8aba-b43539516df5</guid><dc:creator>Jim Dattolo</dc:creator><description>&lt;p&gt;I thought I was quite clear.  I&amp;#39;m using the python bindings to the device which means that it&amp;#39;s running the connectivity app.  It&amp;#39;s has to be by definition.  I cannot change languages (which you are suggesting by telling me the solution is to call the C function in nvic) I have multiple years of python codebase that is currently talking to a different BLE solution via python wrappers that I developed years ago and that cannot change to accomodate a lack in the python bindings that are currently being used.  There is no sd_nvic_SystemReset in the python bindings like I already mentioned.  Without a way to reset the device via the bindings I cannot configure the stack again since it&amp;#39;s &lt;em&gt;already&lt;/em&gt; configured from a previous run (which can be from a different tool using different settings)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Resetting device via python bindings</title><link>https://devzone.nordicsemi.com/thread/30803?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 09:20:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85e4b0ad-1364-45d8-90ea-bb133cc3a67a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jim,&lt;/p&gt;
&lt;p&gt;I am not quite sure I fully understand your setup. Could you tell a little bit more on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Which firmware do you use on the nRF51  that you mentioned has S130 ?&lt;/li&gt;
&lt;li&gt;You mentioned that &amp;quot;dev has been going for years on the tool chain via a different chip supplier for BLE. &amp;quot; I don&amp;#39;t understand this and how it&amp;#39;s related to the Python code running with the nRF51 dongle.&lt;/li&gt;
&lt;li&gt;What is the issue you are having ? You mentioned &amp;quot;it&amp;#39;s already running in a state that I cannot guess &amp;quot;. What is that ?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To reset the chip, you can call sd_nvic_SystemReset() API.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>