<?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 UART tx interrupt not firing, arbitrarily when soft device is enabled.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13273/nrf51822-uart-tx-interrupt-not-firing-arbitrarily-when-soft-device-is-enabled</link><description>Hi, 
 I&amp;#39;ve written an app on the nrf51822 (rev2), with S110 (v7.3.0) and SDK v6.1.0. I&amp;#39;ve written a custom non-blocking UART driver. I&amp;#39;m running into an issue where the UART TX interrupt arbitrarily decides not to fire. ie, 
 NRF_UART0-&amp;gt;TXD.AsWord32</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 17 Apr 2016 19:15:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13273/nrf51822-uart-tx-interrupt-not-firing-arbitrarily-when-soft-device-is-enabled" /><item><title>RE: nrf51822 UART tx interrupt not firing, arbitrarily when soft device is enabled.</title><link>https://devzone.nordicsemi.com/thread/50590?ContentTypeID=1</link><pubDate>Sun, 17 Apr 2016 19:15:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06f2ea45-d1ab-4d90-b865-4fa6e722f269</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;Sorry, I can&amp;#39;t really explain that behavior. The UART should not be touched at all by the SoftDevice. Are you checking for UART errors in the IRQ handler as well? Is the chip otherwise operative in the interrupt-less state, or is it sleeping? If it is doing e.g. directed advertisements, it will block all incoming interrupts for 1.28s. This is due to a PAN in the earlier chip revisions that requires the SD to own the CPU whenever the radio is on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 UART tx interrupt not firing, arbitrarily when soft device is enabled.</title><link>https://devzone.nordicsemi.com/thread/50589?ContentTypeID=1</link><pubDate>Sun, 17 Apr 2016 13:33:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a1035f0-8f9e-4b24-a68d-cd60d1f9e1a4</guid><dc:creator>SBatt</dc:creator><description>&lt;p&gt;Thanks Ulrich for the response, though I am not using WFI, WFE or sd_app_evt_wait() anywhere. I removed it from the ble_hrs app because I have processes in the main loop.&lt;/p&gt;
&lt;p&gt;I did solve the problem, however, on a whim. Anytime I send a packet out my serial driver I have to start tx (NRF_UART0-&amp;gt;TASKS_STARTTX = ENABLE) and then when the entire packet is emptied in the interrupts I had to stop (NRF_UART0-&amp;gt;TASKS_STOPTX = ENABLE). Prior to this I just enabled TX during initialisation, which as mentioned in my original question, works fine when the soft device isn&amp;#39;t enabled.&lt;/p&gt;
&lt;p&gt;Any ideas why this fixed my problem?&lt;/p&gt;
&lt;p&gt;I couldn&amp;#39;t find it mentioned in the reference manual, but I may have missed it. I&amp;#39;m hesitant to call it 100% fixed because I can&amp;#39;t explain why it worked. I&amp;#39;m running some tests now and it&amp;#39;s been successful so far.&lt;/p&gt;
&lt;p&gt;Cheers,
Sam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 UART tx interrupt not firing, arbitrarily when soft device is enabled.</title><link>https://devzone.nordicsemi.com/thread/50588?ContentTypeID=1</link><pubDate>Sun, 17 Apr 2016 10:42:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eec601f7-8efa-4289-b943-3508699cee69</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;Except for the peripherals that are reserved/restricted, the SoftDevice should not touch anything else. What could be happening is that you call a form of WFE (e.g. sd_app_evt_wait()) right when the interrupt triggers, also from a higher (i.e. lower numbered) priority than the UART interrupt. The call will then immediately return, but also clear the pending bit. If you then WFE again, without servicing the interrupt, you will not be woken up again from it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 UART tx interrupt not firing, arbitrarily when soft device is enabled.</title><link>https://devzone.nordicsemi.com/thread/50587?ContentTypeID=1</link><pubDate>Sun, 17 Apr 2016 10:01:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4542d665-32ef-44ca-a28b-0a13d56ac0b3</guid><dc:creator>SBatt</dc:creator><description>&lt;p&gt;More info:
When I set the priority of the UART interrupt to 0, the problem doesn&amp;#39;t occur. Though the stack we become un-reliable, so this is not a solution. Is it possible that the BLE SD is clearing the UART TX interrupt within a higher/equal priority interrupt?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>