<?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 conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45816/pwm-conflict-with-freertos-thread-example</link><description>Hi, 
 
 I&amp;#39;ve created 3 PWM pulses via: 
 
 
 
 Which works when I&amp;#39;m not starting Thread (from the examples/thread/freertos_coap_server example) 
 
 But when I start Thread (via the commands below), the last configured PWM is not working 
 
 
 
 In this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Apr 2019 05:20:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45816/pwm-conflict-with-freertos-thread-example" /><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/182972?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2019 05:20:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7eff770-31f5-49e3-bb94-fe5a952d717a</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Sorry for the late reply, we have been low on staff due to Easter.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve talked to one of the developers, and he could not come up with any reasons for this being related to the thread stack.&lt;/p&gt;
&lt;p&gt;The only thing that is triggered because of otThreadSetEnabled function is the otStateChangedCallback, which indicates e.g. that role has been changed DETACHED -&amp;gt; CHILD/ROUTER/LEADER.&lt;/p&gt;
&lt;p&gt;Could you try to remove the initialization of the &lt;strong&gt;bsp_thread&lt;/strong&gt; module and then try to debug?&lt;/p&gt;
&lt;p&gt;Note: I will be out of office on travel today.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/182079?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 11:38:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7454a25-bc47-43bd-a579-919899457a88</guid><dc:creator>jonbas</dc:creator><description>&lt;p&gt;Perfect, thanks for looking into this!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/182078?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 11:36:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db7a445c-5d0b-4e32-a132-adad9c2bcd20</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I have reproduced the issue, I&amp;#39;m not sure why it occured, so I will have to ask the development team on some feedback if that is OK for you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/181798?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 08:45:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49875a41-f345-4846-bf67-4922dc7a1475</guid><dc:creator>jonbas</dc:creator><description>&lt;p&gt;Sorry for wasting so much time, here the full zip (maybe something went wrong during compression)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://basalte-my.sharepoint.com/:u:/g/personal/jonathan_vervaeke_basalte_be/ERICxS3COrdMoiCGPNMwI_UBfRrOblLxIbVbDqRr_4AO4A?e=O8oSHN"&gt;https://basalte-my.sharepoint.com/:u:/g/personal/jonathan_vervaeke_basalte_be/ERICxS3COrdMoiCGPNMwI_UBfRrOblLxIbVbDqRr_4AO4A?e=O8oSHN&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If it does not compile straight, please let me know ;)&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/181794?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 08:30:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3056cf05-7878-46c6-acf6-1c462d5ff7cb</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been trying to compile the project for the last hour or so, but I&amp;#39;m unable to get it working. There is a lot of missing files and so on.&lt;/p&gt;
&lt;p&gt;Can you share the entire project folder with me so that it compiles out of the box?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/181775?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 07:27:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f061dbb4-bd9d-429e-965a-a29b1bd5c001</guid><dc:creator>jonbas</dc:creator><description>&lt;p&gt;The project is available here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://basalte-my.sharepoint.com/:u:/g/personal/jonathan_vervaeke_basalte_be/ERICxS3COrdMoiCGPNMwI_UBfRrOblLxIbVbDqRr_4AO4A?e=PQQsGO"&gt;https://basalte-my.sharepoint.com/:u:/g/personal/jonathan_vervaeke_basalte_be/ERICxS3COrdMoiCGPNMwI_UBfRrOblLxIbVbDqRr_4AO4A?e=PQQsGO&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This blinks an RGB led attached to R -&amp;gt; 1.10, G -&amp;gt; 1.14, B -&amp;gt; 1.11&lt;/p&gt;
&lt;p&gt;The main code is in drivers/led/led.c&lt;/p&gt;
&lt;p&gt;When running the example, only the R and G led works, the B led does not work.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve created two defines which changes the order of initializing the PWM, which breaks the Green led instead of the Blue led:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define LED_BLUE_BROKEN
//#define LED_GREEN_BROKEN&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another way of looking into this is by comment out the initialization of the thread device (in main.c).&lt;/p&gt;
&lt;p&gt;(This leaded me to the&amp;nbsp;&lt;span&gt;otIp6SetEnabled() function.)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When you do this, all leds blink correctly!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    /*thread_instance_init();
    thread_coap_init();
    thread_bsp_init();
    thread_coap_utils_light_changed_callback_set(light_changed);
    thread_initialized = true;*/&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for looking into this!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/181747?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 06:04:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a858939-68a4-42f6-9867-540f1b866f22</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m a bit unsure why this relates to otIp6SetEnabled().&lt;/p&gt;
&lt;p&gt;Could you share your project with me, so I can take a look at it?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/181579?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 12:10:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:752a750e-66da-4954-be01-e94a937bb85f</guid><dc:creator>jonbas</dc:creator><description>&lt;p&gt;I use this SDK:&amp;nbsp;nRF5SDKforThreadandZigbeev300d310e71&lt;/p&gt;
&lt;p&gt;The state is after the function has been called.&lt;/p&gt;
&lt;p&gt;I tested with app_pwm.c and with nrfx_pwm.c.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The problem is when using app_pwm.c, replace the functions with the one in nrfx_pwm.c, and the issue is gone.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/181576?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2019 12:06:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2907864-4a44-4020-a15b-f63029063ce5</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
[quote user="jonbas"]the state is&amp;nbsp;OT_ERROR_NONE[/quote]
&lt;p&gt;&amp;nbsp;Is that before or after you have called otIp6SetEnabled?&lt;/p&gt;
&lt;p&gt;Which SDK is the driver working from, which SDK is the driver not working from?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/181360?ContentTypeID=1</link><pubDate>Wed, 10 Apr 2019 14:19:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:044a71bd-ec42-4669-99d7-106f7b217d55</guid><dc:creator>jonbas</dc:creator><description>&lt;p&gt;the state is&amp;nbsp;OT_ERROR_NONE&lt;/p&gt;
&lt;p&gt;I tried with the old PWM driver (nrfx_pwm), and that works flawless.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/180652?ContentTypeID=1</link><pubDate>Mon, 08 Apr 2019 07:49:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4528b1dd-14d8-45a8-9ed8-f268cc211867</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Which state are you in when you call otIp6SetEnabled?&lt;/p&gt;
&lt;p&gt;Looking at the &lt;a href="https://github.com/openthread/openthread/blob/master/include/openthread/ip6.h"&gt;openThread stack&lt;/a&gt; it looks like the state could be the issue&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-9a13b8a870e64775bd6375546bb88016/pastedimage1554709710086v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM conflict with FreeRTOS Thread example</title><link>https://devzone.nordicsemi.com/thread/180458?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2019 09:49:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7454960d-9826-4a56-8b89-8143a375a335</guid><dc:creator>jonbas</dc:creator><description>&lt;p&gt;Maybe relevant, but when I change the order of initializing, another PWM fails&lt;/p&gt;
&lt;p&gt;For instance, when I do this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    err_code = app_pwm_init(&amp;amp;PWM2, &amp;amp;pwm2_cfg, pwm_ready_callback);
    err_code = app_pwm_init(&amp;amp;PWM3, &amp;amp;pwm3_cfg, pwm_ready_callback);
    err_code = app_pwm_init(&amp;amp;PWM1, &amp;amp;pwm1_cfg, pwm_ready_callback);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;PWM1 fails (RED led) instead of PWM3 (BLUE led)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>