<?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>Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27607/softdevice-and-interrupt-lost</link><description>Hi everyone,
My configuration: 
 
 nrf52832 microcontroller 
 Softdevice S132 V4.0.2 
 Nordic SDK 13.0 
 IDE: Eclipse 
 
 I&amp;#39;m working with a &amp;quot;Stand-alone can bus controller&amp;quot; connected to nrf52832 with SPI interface.
The CAN controller informs</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Nov 2017 09:20:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27607/softdevice-and-interrupt-lost" /><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109026?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 09:20:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4946ee3-ece5-4efe-8dc2-49dd5d09e0b9</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;You can share your code in the one-on-one support portal so we can look at it in a confidential manner.
&lt;a href="http://www.nordicsemi.com/eng/Support/Contact-Support-Team"&gt;www.nordicsemi.com/.../Contact-Support-Team&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109025?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 08:53:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c7e9915-05c0-4366-9aa2-2957a2ae7f98</guid><dc:creator>leoc7</dc:creator><description>&lt;p&gt;Ok, many thanks for your support!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109024?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 15:00:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbe837a8-2301-4da7-8867-853276c5606d</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;ok, this typically means the interrupt routing is working ok with the softdevice enabled (since it is advertising), need to look at other issues in the code that is preventing the interrupt from running.
Can you set up a gpio toggle in the interrupt code on the logic analyzer and also the hardware pin that is interrupting the mcu, i.e.  and post some results.
Make sure that the volatile has not been optimized out in your build, try changes in the optimization level or look at the generated code to verify that volatile is still present.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109032?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 13:24:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dfd7f54-194d-4ca7-86d5-3bd6662823f0</guid><dc:creator>leoc7</dc:creator><description>&lt;p&gt;David, I confirm the situation you described&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109031?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 11:59:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c37ed9b4-3976-419d-8420-1b96d62c67c0</guid><dc:creator>leoc7</dc:creator><description>&lt;p&gt;I&amp;#39;m NOT getting the interrupt when there is BLE connection, but I&amp;#39;m getting the interrupt during advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109030?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 11:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3649f13a-6792-4654-b6e8-5ebc60325e3f</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;let me summarize:
You are getting the interrupt routine executed when the SD is advertising.
You are getting the interrupt routine executed when the SD is enabled but here is no active role.
You are not getting the interrupt when there is a BTLE connection.
Is this an accurate understanding of the issue ?
Edited: There is no interrupt on BTLE connection&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109029?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 11:52:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:071461eb-3bc2-4799-b7d5-aed7e7fe1ffa</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;These are wrapper calls with some checks.&lt;/p&gt;
&lt;p&gt;Chapter 6:
System on Chip (SoC) library&lt;/p&gt;
&lt;p&gt;NVIC Wrapper functions for the CMSIS NVIC functions
provided by ARM&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/00ae.svg" title="Registered"&gt;&amp;#x00ae;&lt;/span&gt;.
Important: To ensure reliable usage of
the SoftDevice you must use the wrapper
functions when the SoftDevice is enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109028?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 10:56:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cffef17-2922-4962-851a-35564f9640ce</guid><dc:creator>leoc7</dc:creator><description>&lt;p&gt;Thank you. But what does it mean &amp;quot;Make sure you are using the Softdevice provided wrappers for the NVIC&amp;quot;. Could you explain better please?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109027?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 10:54:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a9cc0f0-f9d4-4f1d-b8cd-39c3b26258a2</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;Ok, then you need look if the Interrupt is being routed correctly via the softdevice as all the interrupts need to be routed via the MBR/Softdevice. Make sure you are using the Softdevice provided wrappers for the NVIC. Please do read the Softdevice specification so you understand how the softdevice fits in the architecture.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109036?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 10:30:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1eeceaa-6e84-441f-9977-4c3f4b71d6dc</guid><dc:creator>leoc7</dc:creator><description>&lt;p&gt;Also, I investigated with debugger and interrupt works when there is no BLE connection.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109035?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 10:29:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edb1c2d4-1b69-4548-8c06-ef42737e23bb</guid><dc:creator>leoc7</dc:creator><description>&lt;p&gt;Yes, it&amp;#39;s volatile&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109034?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 10:22:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bdff3a88-74e4-413c-bac2-d31740fb305c</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;It should never be discarded but it may be delayed. Is the &amp;quot;flag_can_msg&amp;quot; already volatile ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109033?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 10:18:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a20f10b-25f7-409f-8756-5ee005f21904</guid><dc:creator>leoc7</dc:creator><description>&lt;p&gt;Thanks, I try to change Priority to 2. But nothing changes.
Using Timeslot APi can be a valid solution?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109023?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 09:13:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9ad72b1-c5ab-4048-988a-97d35b38ec02</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;I would suggest that you look at chapter 16 of the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/s130sds.html?cp=2_3_1_0"&gt;Softdevice specfication s132 SoftDevice v4.0&lt;/a&gt;. your interrupt should always be handled by the application and will never be discarded, however it can be delayed by the higher priority interrupt.&lt;/p&gt;
&lt;p&gt;I would typically make flags as &amp;quot;volatile&amp;quot; in the interrupt context.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109022?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 08:55:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0c87435-5044-424c-a790-206acbaf1b98</guid><dc:creator>leoc7</dc:creator><description>&lt;p&gt;Sorry for the missing information! I updated the answer with requested info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice and interrupt lost</title><link>https://devzone.nordicsemi.com/thread/109021?ContentTypeID=1</link><pubDate>Mon, 27 Nov 2017 08:40:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b82651e-2b23-4d4c-8903-683817df28b2</guid><dc:creator>David Edwin</dc:creator><description>&lt;p&gt;Can you add some profiling information on the SPI interrupt on how much time are you using in the interrupt. Can you also provide some information on the connection interval used and advertising interval used. The softdevice interrupt priority levels are documented in the &amp;quot;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/s130sds.html?cp=2_3_1_0"&gt;SoftDevice Specification
S132 SoftDevice v4.0&lt;/a&gt;&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>