<?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>PWM app hangs on app_pwm_channel_duty_set with softdevice s110</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42833/pwm-app-hangs-on-app_pwm_channel_duty_set-with-softdevice-s110</link><description>I am using the PWM app from nRF51_SDK_10.0.0_dc26b5e\components\libraries\pwm. I have loaded s110, and am running no other code. 
 The application hangs on the second cycle (duty factor = 1%) with LED0 permanently on, LED1 off. 
 The freeze occurs at</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Jan 2019 22:19:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42833/pwm-app-hangs-on-app_pwm_channel_duty_set-with-softdevice-s110" /><item><title>RE: PWM app hangs on app_pwm_channel_duty_set with softdevice s110</title><link>https://devzone.nordicsemi.com/thread/167780?ContentTypeID=1</link><pubDate>Thu, 24 Jan 2019 22:19:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7899d340-3719-4514-a18b-7897990b6f22</guid><dc:creator>northernLight</dc:creator><description>&lt;p&gt;Kenneth,&lt;/p&gt;
&lt;p&gt;Many thanks for your helpful prompts. It finally worked when I modified the Cortex_M_startup.s file using externalISR names from ses_nrf51_startup.s.&amp;nbsp; Both files attached.&lt;/p&gt;
&lt;p&gt;Your suggestion that:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;em&gt;&amp;#39;I think the problem here is that the timer irq handler is not enabled somehow&amp;#39;&lt;/em&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;was correct !!!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Cortex_5F00_M_5F00_Startup.s"&gt;devzone.nordicsemi.com/.../Cortex_5F00_M_5F00_Startup.s&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ses_5F00_nrf51_5F00_startup.s"&gt;devzone.nordicsemi.com/.../ses_5F00_nrf51_5F00_startup.s&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM app hangs on app_pwm_channel_duty_set with softdevice s110</title><link>https://devzone.nordicsemi.com/thread/167480?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 20:45:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ffd4b77-60a8-458e-89de-58efa838f22d</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I was not aware you have ported this to Segger Embedded Studio, I am using Keil.&lt;/p&gt;
&lt;p&gt;I assume you have looked at:&lt;br /&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.gs.ses/dita/gs/developing/import_ses.html?cp=1_1_0_7_1"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.gs.ses/dita/gs/developing/import_ses.html?cp=1_1_0_7_1&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is also this guide:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/b/blog/posts/segger-embedded-studio-a-cross-platform-ide"&gt;https://devzone.nordicsemi.com/b/blog/posts/segger-embedded-studio-a-cross-platform-ide&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sometimes downloading the exact version mentioned may be a good idea.&lt;/p&gt;
&lt;p&gt;Have you considered using the nRF52-series? All the new SDK examples support Segger Embedded Studio. Also the nRF52-series have a hardware PWM module.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM app hangs on app_pwm_channel_duty_set with softdevice s110</title><link>https://devzone.nordicsemi.com/thread/167448?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 16:54:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63a2e2d8-25d0-408b-9c3c-557b7753a6be</guid><dc:creator>northernLight</dc:creator><description>&lt;p&gt;Many thanks for the&amp;nbsp;check and the help with the problem solving.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The issue might be the project set-up created by the import.&amp;nbsp; The import function adds&amp;nbsp;two *.s files that are different from those&amp;nbsp; in earlier documentation, as you can see from the screenshot attached.&amp;nbsp; Are these the same as on your set-up?&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Project-folders.JPG" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;BTW which preprocessor definitions did you use?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Preprocessor-definitions.JPG" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The old documentation&amp;nbsp;says:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Add the definition&amp;nbsp;&lt;/span&gt;&lt;kbd class="ph userinput"&gt;NO_VTOR_CONFIG&lt;/kbd&gt;&lt;span&gt;&amp;nbsp;to the Preprocessor Definitions.&lt;/span&gt;&amp;nbsp;If there is a softdevice&lt;/p&gt;
&lt;p&gt;Many thanks&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Rob&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM app hangs on app_pwm_channel_duty_set with softdevice s110</title><link>https://devzone.nordicsemi.com/thread/167370?ContentTypeID=1</link><pubDate>Wed, 23 Jan 2019 12:45:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6aa673d9-88b1-43cb-ad20-71bc3bcaa03e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I replaced main.c in the mentioned SDK project, and it compiles and run fine here on a nRF51-DK. Not sure what the problem is on your end though. Maybe you need to send the entire project.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM app hangs on app_pwm_channel_duty_set with softdevice s110</title><link>https://devzone.nordicsemi.com/thread/167230?ContentTypeID=1</link><pubDate>Tue, 22 Jan 2019 23:25:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ac341ff-7436-4f5a-8940-f45d6089b48f</guid><dc:creator>northernLight</dc:creator><description>&lt;p&gt;Thankyou for the reply.&amp;nbsp; Unfortunately I am still stuck.&amp;nbsp; The default example is indeed the one I have been using which includes the instantiation you highlighted in main.c&lt;/p&gt;
&lt;p&gt;Specifically I imported the project&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nRF51_SDK_10.0.0_dc26b5e\examples\peripheral\pwm\pca10028\arm5_no_packs\pwm_pca10028.uvprojx&lt;/p&gt;
&lt;p&gt;Imported as Keil MDK. The device is 51822QFAA&lt;/p&gt;
&lt;p&gt;The problem of an infinite while loop has been reported elsewhere but is _not_ occurring here (main.c line 69).&lt;/p&gt;
&lt;p&gt;Instead in main.c line 69 the call to&amp;nbsp;&lt;span&gt;app_pwm_channel_duty_set does not return at all. Is this consistent with failure to enable the timer IRQ handler?&amp;nbsp; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;How do I test whether the IRQ handler has been&amp;nbsp;enabled?&lt;/p&gt;
&lt;p&gt;When&amp;nbsp;I step through the code it hangs on&amp;nbsp;line 549 in app_pwm.c:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; return app_pwm_channel_duty_ticks_set(p_instance, channel, ticks);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/63057.main.c"&gt;devzone.nordicsemi.com/.../63057.main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM app hangs on app_pwm_channel_duty_set with softdevice s110</title><link>https://devzone.nordicsemi.com/thread/167101?ContentTypeID=1</link><pubDate>Tue, 22 Jan 2019 13:09:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d453609-c1c9-45dc-bd71-d6a590ea2a8b</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Think you will have to take a look at the default example again and make sure it runs as expected:&lt;/p&gt;
&lt;p&gt;\nRF51_SDK_10.0.0_dc26b5e\examples\peripheral\pwm&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think the problem here is that the timer irq handler is not enabled somehow. This should be set in main.c by adding:&lt;/p&gt;
&lt;p&gt;APP_PWM_INSTANCE(PWM1,1);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Create the instance &amp;quot;PWM1&amp;quot; using TIMER1.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>