<?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>PPI AND SOFTDEVICE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2484/ppi-and-softdevice</link><description>Hi 
 I try to configure a ppi channel with timers to generate pwm signal
My entire code is working well without softdevice.
Here my ppi init function: 
 NRF_PPI-&amp;gt;CH[0].EEP = (uint32_t)&amp;amp;NRF_TIMER2-&amp;gt;EVENTS_COMPARE[0];
 NRF_PPI-&amp;gt;CH[0].TEP = (uint32_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 May 2014 13:38:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2484/ppi-and-softdevice" /><item><title>RE: PPI AND SOFTDEVICE</title><link>https://devzone.nordicsemi.com/thread/9997?ContentTypeID=1</link><pubDate>Fri, 09 May 2014 13:38:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97fd4395-3a65-4609-a213-93c97d79fb25</guid><dc:creator>thomas</dc:creator><description>&lt;p&gt;I can&amp;#39;t due to confidentiality. I will open a new support case.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;-------------------------------Edit 30/07/14------------------------------------------&lt;/p&gt;
&lt;p&gt;Here response from nordic&amp;#39;s support. It may be helpful....&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I tried to compile and run your code,
but think the hardfault occur when you
try to write to the CLOCK module
directly, this module is protected by
the softdevice. The solution is to use
the nrf_soc API in timer_init() as
shown below:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code&gt;/** @brief Function for initializing the Timer 2 peripheral.

 */

static void timer_init(void)

{

    // Start 16 MHz crystal oscillator .

    //NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED  = 0;

    //NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART     = 1;

    sd_clock_hfclk_request();

 

    // Wait for the external oscillator to start up.

    //while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0)

    //{

        //Do nothing.

    //}

    uint32_t crystal_is_running = 0;

   

    while(!crystal_is_running)

    {

        sd_clock_hfclk_is_running(&amp;amp;crystal_is_running);

    }   

 

    PWM_TIMER-&amp;gt;MODE                = TIMER_MODE_MODE_Timer;

                                PWM_TIMER-&amp;gt;BITMODE                                             = 0;

                                PWM_TIMER-&amp;gt;PRESCALER                          = PRESCAL ;

                               

    // Clears the timer, sets it to 0.

    PWM_TIMER-&amp;gt;TASKS_CLEAR = 1;

                               

    // Interrupt setup.

    PWM_TIMER-&amp;gt;INTENSET = TIMER_INTENSET_COMPARE0_Msk | TIMER_INTENSET_COMPARE1_Msk;

                                                                                                                                                                 

}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI AND SOFTDEVICE</title><link>https://devzone.nordicsemi.com/thread/9996?ContentTypeID=1</link><pubDate>Fri, 09 May 2014 13:32:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d138416-dd76-4bbe-90ea-a3b610a9a327</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Could you attach the whole project so I can debug it?&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI AND SOFTDEVICE</title><link>https://devzone.nordicsemi.com/thread/9995?ContentTypeID=1</link><pubDate>Fri, 09 May 2014 13:30:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd078f01-ff7a-4092-8303-5c01b9ba1fe0</guid><dc:creator>thomas</dc:creator><description>&lt;p&gt;Non i&amp;#39;m not calling them from an interrupt&lt;/p&gt;
&lt;p&gt;Attached my code.&lt;/p&gt;
&lt;p&gt;Error occure line 101 of nrf_tone.c&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf_5F00_tone.c"&gt;nrf_tone.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf_5F00_tone.h"&gt;nrf_tone.h&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI AND SOFTDEVICE</title><link>https://devzone.nordicsemi.com/thread/9994?ContentTypeID=1</link><pubDate>Fri, 09 May 2014 13:26:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb60bf7a-d4af-4a1e-995b-8033b9d9774e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Are you calling the sd_ppi-functions from an interrupt?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI AND SOFTDEVICE</title><link>https://devzone.nordicsemi.com/thread/9993?ContentTypeID=1</link><pubDate>Fri, 09 May 2014 13:24:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8faf501f-9a2d-4223-a505-5fa036b8bf9b</guid><dc:creator>thomas</dc:creator><description>&lt;p&gt;I&amp;#39;m using s110 6.0.0 and SDK 5.2.0.&lt;/p&gt;
&lt;p&gt;Peripherals :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Timer2 ( normally free )&lt;/li&gt;
&lt;li&gt;PPI Chanel 0&lt;/li&gt;
&lt;li&gt;GPIO 8&lt;/li&gt;
&lt;li&gt;GPIOTE task 0&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI AND SOFTDEVICE</title><link>https://devzone.nordicsemi.com/thread/9992?ContentTypeID=1</link><pubDate>Fri, 09 May 2014 13:18:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:777619dd-09b1-4b15-a3cd-6ee3dd88bd2b</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That sounds strange. All the peripherals that you&amp;#39;re using are open for the application and should not cause a hardfault.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Which SDK are you developing on?&lt;/li&gt;
&lt;li&gt;What version of the softdevice are you using?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>