<?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>Facing issues when running a simple Free rtos Button LED</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69653/facing-issues-when-running-a-simple-free-rtos-button-led</link><description>I am a beginner to Free RTOS. so I have tried to build a simple button led project. When I press the button it should light up the LED. I implemented this similar model in sequential programming. It is successful but in Free rtos I couldnt comprehend</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Jan 2021 08:25:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69653/facing-issues-when-running-a-simple-free-rtos-button-led" /><item><title>RE: Facing issues when running a simple Free rtos Button LED</title><link>https://devzone.nordicsemi.com/thread/287861?ContentTypeID=1</link><pubDate>Thu, 07 Jan 2021 08:25:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0cfb406-2d6d-49e4-9e1f-eb93bdf3a8e5</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Well, you have made no connection to the button/gpio handler to your task. I think instead of making this a task, you need to make this a button_callback handler that gets called from the button handler library when you press the button.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please read mode about the button library in the link i mentioned in my previous reply and the code snippet to aid to understand it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing issues when running a simple Free rtos Button LED</title><link>https://devzone.nordicsemi.com/thread/287837?ContentTypeID=1</link><pubDate>Thu, 07 Jan 2021 06:11:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf359df2-39b3-44f9-8968-e778b57cf175</guid><dc:creator>ashokraj</dc:creator><description>&lt;p&gt;Hi Susheel,,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thanks for your response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Why do you have a while(1) in your button_task_handler?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have kept a while(1) becuase I want to implement this logic in free rtos. I am with an impression that, every task in free rrtos needs to have a&amp;nbsp; while(1) loop.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I want to implement button , led as a two separate tasks running on freertos. so I tried to implement them as tasks!!&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing issues when running a simple Free rtos Button LED</title><link>https://devzone.nordicsemi.com/thread/287200?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2021 11:23:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2468faa-8a32-40c2-95d8-8d1593182977</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You are not initializing any button gpios to connect them to you button handler. Why do you have a while(1) in your button_task_handler?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please look at the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Flib_button.html&amp;amp;cp=7_1_3_7"&gt;app_button&amp;nbsp;&lt;/a&gt;library documentation and an example how to use it in&amp;nbsp;nRF5_SDK_17.0.0_9d13099\examples\ble_peripheral\ble_app_tile\main.c&lt;/p&gt;
&lt;p&gt;Normally you initialize a button handler to a gpio as below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void button_event_handler(uint8_t pin_no, uint8_t button_action)
{

}

/**@brief Function for initializing the button handler module.
 */
static void buttons_init(void)
{
    ret_code_t err_code;

    //The array must be static because a pointer to it will be saved in the button handler module.
    static app_button_cfg_t buttons[] =
    {
        {BUTTON, APP_BUTTON_ACTIVE_LOW, BUTTON_PULL, button_event_handler}
    };

    err_code = app_button_init(buttons, ARRAY_SIZE(buttons),
                               BUTTON_DETECTION_DELAY);
    APP_ERROR_CHECK(err_code);
}

itn main()
{
        buttons_init();
        uint32_t err_code = app_button_enable();
        APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You do not need to create a task for the button_handler as it should be a registered callback that should come from app_button library which is called when you press the button you registered.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing issues when running a simple Free rtos Button LED</title><link>https://devzone.nordicsemi.com/thread/286983?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2020 10:49:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ac8ebd4-d02b-45ce-b8dc-5f56fe067158</guid><dc:creator>ashokraj</dc:creator><description>&lt;p&gt;ok Thanks Marte, Will be waiting for your team to come back&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing issues when running a simple Free rtos Button LED</title><link>https://devzone.nordicsemi.com/thread/286405?ContentTypeID=1</link><pubDate>Wed, 23 Dec 2020 07:33:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7e4eab2-5203-444f-a3d4-b01f342a4c8f</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi Ashok,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m afraid our FreeRTOS expert is out of office because of holiday seasons, but I will come back to you when he&amp;#39;s back.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing issues when running a simple Free rtos Button LED</title><link>https://devzone.nordicsemi.com/thread/285924?ContentTypeID=1</link><pubDate>Sat, 19 Dec 2020 05:57:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4cb3d9e-a238-429c-88a6-e91778b4ea89</guid><dc:creator>ashokraj</dc:creator><description>&lt;p&gt;Hi Marte,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thanks for your response. I have developed the code based on Blinky freeRTOS example only. In my code led_toggle task is extraced from FreeRTOS example. Led_toggle_task is running but not button and LED task.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Ashok&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Facing issues when running a simple Free rtos Button LED</title><link>https://devzone.nordicsemi.com/thread/285826?ContentTypeID=1</link><pubDate>Fri, 18 Dec 2020 13:02:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93a6eb92-44c4-43d9-a4b9-a1ac37acdaca</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I would recommend starting out with one of the existing examples in the SDK, and then build on top of that one.&amp;nbsp;Since you&amp;#39;re working with FreeRTOS and you want to use the LEDs, you should start with the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/nrf_freertos_example.html"&gt;Blinky FreeRTOS example&lt;/a&gt;, and then add button functionality to that one.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>