<?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>Is TIMER2 now being used by Softdevice??</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14726/is-timer2-now-being-used-by-softdevice</link><description>Recently updated to SDK11 + s130 v2.0.1 on an nRF51822 xxAC LFCLKSRC=RC 
 BLE Advertising no longer works. Localized it to our use of TIMER2 for an implementation of systick(); 
 void systick_init(void)
{
 NRF_TIMER2-&amp;gt;MODE = 0x0000; // set timer mode</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Jun 2016 00:33:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14726/is-timer2-now-being-used-by-softdevice" /><item><title>RE: Is TIMER2 now being used by Softdevice??</title><link>https://devzone.nordicsemi.com/thread/56204?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 00:33:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:433f4982-cd31-4683-8a94-f1593d7d0011</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;happy to help - if you want to pick one of those comments you think is most helpful, convert it to an answer with the &amp;#39;convert to answer&amp;#39; link and give it a tick, that&amp;#39;ll marked it answered and save Nordic support having to read it all again in the morning!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is TIMER2 now being used by Softdevice??</title><link>https://devzone.nordicsemi.com/thread/56203?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 00:18:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efc8e35e-0d6d-4537-903e-e5d413eb552c</guid><dc:creator>kevray</dc:creator><description>&lt;p&gt;And thanks for the assist!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is TIMER2 now being used by Softdevice??</title><link>https://devzone.nordicsemi.com/thread/56202?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 00:18:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12badfd6-f63d-4e82-aa07-b971aedc6b68</guid><dc:creator>kevray</dc:creator><description>&lt;p&gt;I owe you a beer! I still think there&amp;#39;s a bug though that&amp;#39;s being triggered because of new timing issues. For instance, we have had no problem with the reverse order. Only now has this become a problem.&lt;/p&gt;
&lt;p&gt;E.g.,:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//  This now works:

ble_init();
nrf_delay_ms(100);
systick_init();

//  But this doesn&amp;#39;t work:
systick_init();
nrf_delay_ms(100);
ble_init();
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is TIMER2 now being used by Softdevice??</title><link>https://devzone.nordicsemi.com/thread/56205?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 00:07:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55976830-996a-4d63-8e16-1d3949d566dc</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;0x02, that&amp;#39;s easy then.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NRF_ERROR_SOFTDEVICE_NOT_ENABLED   (NRF_ERROR_BASE_NUM + 2)
#define 	NRF_ERROR_BASE_NUM   (0x0)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;so you&amp;#39;re calling the set tx power before you enable the softdevice. I would hazard a guess that the softdevice init takes a little longer than before and your timer handler goes off and results in your calling the power set in the wrong order. Or something like that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is TIMER2 now being used by Softdevice??</title><link>https://devzone.nordicsemi.com/thread/56201?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2016 00:00:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6b91fd9-c2c7-4afe-8795-c7be363d41e1</guid><dc:creator>kevray</dc:creator><description>&lt;p&gt;sd_ble_gap_tx_power_set(0x04) returns 0x02 which seems to read like it&amp;#39;s a bad parameter. But, if we do not make the call to systick_init() then this passes. I agree with your comment - probably an unrelated issue coming to light because of timing changes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is TIMER2 now being used by Softdevice??</title><link>https://devzone.nordicsemi.com/thread/56200?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2016 23:45:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:634d7609-d366-4a78-8bca-8b6bb5f7a687</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;So what do you do when that call fails? Ignore the faliure, error out, reset, try to recover? If you&amp;#39;ve failed to set the power, I have no idea what invalid state the softdevice is in. Where are you calling the power set function from?&lt;/p&gt;
&lt;p&gt;Wondered if you were compiling against the wrong softdevice headers but lots more wouldn&amp;#39;t work if you were doing that, but worth a check.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s very unlikely it really has anything to do with TIMER2, the change in SDK has most probably uncovered a bug which was lurking before, a timing-sensitive one. Oh and what&amp;#39;s the error return from the power set function?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is TIMER2 now being used by Softdevice??</title><link>https://devzone.nordicsemi.com/thread/56199?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2016 23:35:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:594a2e0b-6cfd-4b88-a5b1-19364363f005</guid><dc:creator>kevray</dc:creator><description>&lt;p&gt;Nope. No overt errors and everything else continues to run perfectly. Never goes to an error handler. One other clue, this function: sd_ble_gap_tx_power_set(NRF51822_TX_POWER_LEVEL_dBm) fails when systick_init() is called. Otherwise, no errors at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is TIMER2 now being used by Softdevice??</title><link>https://devzone.nordicsemi.com/thread/56198?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2016 23:05:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61cee2d5-f7d2-4177-be10-75e9e632bccb</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;No nothing has changed with regards usage of TIMER2, the softdevice didn&amp;#39;t use it before, it doesn&amp;#39;t use it now.&lt;/p&gt;
&lt;p&gt;&amp;#39;no longer get BLE Advertisements&amp;#39; usually translates to &amp;#39;failed an error check and are in the error handler/hardfault handler&amp;#39;. So if you hit break in the debugger, where are you?&lt;/p&gt;
&lt;p&gt;.. and there are no calls to any softdevice functions from your timer interrupt handler are there?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>