<?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>How to determine cause of a SoftDevice reset?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39653/how-to-determine-cause-of-a-softdevice-reset</link><description>I trying to debug an interaction between using SPIM3 on the nRF52840 and the BLE stack in the SoftDevice . A reset is happening, which I think is being generated by the SoftDevice, maybe due to an assertion or timeout failure. But how I do find out the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Oct 2018 16:42:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39653/how-to-determine-cause-of-a-softdevice-reset" /><item><title>RE: How to determine cause of a SoftDevice reset?</title><link>https://devzone.nordicsemi.com/thread/153894?ContentTypeID=1</link><pubDate>Mon, 22 Oct 2018 16:42:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f1b81d3-6568-4fc0-a6a1-0f8ac3087482</guid><dc:creator>Dan Halbert</dc:creator><description>&lt;p&gt;Thanks - you&amp;#39;ve answered my misconception about resets from the SD.&amp;nbsp;I can close this case.&lt;/p&gt;
&lt;p&gt;We&amp;#39;re using the DK PCA10056 with the Rev 1 chip, not the pre-production chip. The SPIM3 frequency does not seem to matter. I set it as low as possible, and the reset still happens. What&amp;#39;s odd is that the reset happens when we try to send data via SPIM3, not when we try to do a BLE operation. If we use SPIM2 instead, it works fine&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll work up a test case that doesn&amp;#39;t involve Python code and open a new case with a better title. You can see schematically what&amp;#39;s going on here in the Python code, but it doesn&amp;#39;t tell you the details of the nrfx and SD calls:&lt;/p&gt;
&lt;p&gt;import board,busio,ubluepy&lt;br /&gt;p = ubluepy.Peripheral()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Set a a BLE peripheral&lt;br /&gt;p.advertise()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # start advertising. If this is removed, no crash.&lt;br /&gt;spi = busio.SPI(board.D0, board.D1)&amp;nbsp; &amp;nbsp; &amp;nbsp;# Set up SPIM3 on P!.01 and P1.02&lt;br /&gt;spi.try_lock()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# internal locking - unrelated to SD or nrfx&lt;br /&gt;#spi.configure(baudrate=1000)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # tried various baudrates - no change&lt;br /&gt;spi.write(&amp;#39;AB&amp;#39;)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# reset happens when spim xfer happens&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to determine cause of a SoftDevice reset?</title><link>https://devzone.nordicsemi.com/thread/153886?ContentTypeID=1</link><pubDate>Mon, 22 Oct 2018 16:00:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e89059b3-baef-46fa-8cb3-9c418fce3725</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The Softdevice never resets your application. To catch asserts you should check the return code of all Softdevice API calls. Have you implemented some sort of error handler? As I mentioned in the other thread, this is normally done with the Error module in our SDK. Timeouts should be reported to your application through BLE events from the Softdevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your colleague is correct in that the Softdevice protects its portion of RAM and if you try to access it you will get &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.sds/dita/softdevices/s130/mem_usage/mem_resource_map_usage.html?cp=2_3_2_0_13_0"&gt;undefined behavior&lt;/a&gt;. I don&amp;#39;t think you should get RESETPIN as reset reason in this case though.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What PCA10056 version do you use?&lt;/p&gt;
&lt;p&gt;How do you configure SPIM3? What kind of frequency etc.?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>