<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: FreeRTOS xSemaphoreTakeFromISR() not blocking in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-xSemaphoreTakeFromISR-not-blocking/m-p/557726#M5716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Momir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From instinct, it seems that xSemaphoreTakeFromISR() should not appear in an interrupt service routine as Erich said, how about creating a task, and put the xSemaphoreTakeFromISR() in a forever loop in the task.&lt;/P&gt;&lt;P&gt;I am not sure if the xSemaphoreTakeFromISR() can appear in an ISR, it is only my opinion, pls refer to the FreeRTOS website:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freertos.org/" title="http://www.freertos.org/"&gt;FreeRTOS - Market leading RTOS (Real Time Operating System) for embedded systems with Internet of Things extensions&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jun 2016 08:24:21 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2016-06-22T08:24:21Z</dc:date>
    <item>
      <title>FreeRTOS xSemaphoreTakeFromISR() not blocking</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-xSemaphoreTakeFromISR-not-blocking/m-p/557724#M5714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using FreeRTOS from the Kinetis SDK 1.3.0. A snippet of my code is provided below. Why is the second call to xSemaphoreTakeFromISR()&amp;nbsp; not blocking and not waiting for xSemaphoreGiveFromISR() to release the binary semaphore? If I disable xSemaphoreGiveFromISR() from within IRQHandler_A(), my code within IRQHandler_B() will still move to the next instruction.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void IRQHandler_A(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;…..&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;xSemaphoreGiveFromISR(Sem, NULL);&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;…..&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void IRQHandler_B(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;static bool once = true;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(once)&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;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xSemaphoreTakeFromISR(Sem, NULL);&amp;nbsp; // first time &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; once = false;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;…..&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;xSemaphoreTakeFromISR(Sem, NULL);&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;// next instruction&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;…..&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 18:53:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-xSemaphoreTakeFromISR-not-blocking/m-p/557724#M5714</guid>
      <dc:creator>momirpartalo</dc:creator>
      <dc:date>2016-06-21T18:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS xSemaphoreTakeFromISR() not blocking</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-xSemaphoreTakeFromISR-not-blocking/m-p/557725#M5715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Momir,&lt;/P&gt;&lt;P&gt;see &lt;A href="http://www.freertos.org/xSemaphoreTakeFromISR.html" title="http://www.freertos.org/xSemaphoreTakeFromISR.html"&gt;This page describes the xSemaphoreTakeFromISR() RTOS API function&lt;/A&gt; . Taking a semaphore in an interrupt is not (and should not!) block. Blocking in a semaphore would be a very, very bad thing anyway.&lt;/P&gt;&lt;P&gt;If you need to know if the semaphore was available, you can check the return value of xSemaphoreTakeFromISR() (see above lik to the documentation).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 05:22:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-xSemaphoreTakeFromISR-not-blocking/m-p/557725#M5715</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2016-06-22T05:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS xSemaphoreTakeFromISR() not blocking</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-xSemaphoreTakeFromISR-not-blocking/m-p/557726#M5716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Momir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From instinct, it seems that xSemaphoreTakeFromISR() should not appear in an interrupt service routine as Erich said, how about creating a task, and put the xSemaphoreTakeFromISR() in a forever loop in the task.&lt;/P&gt;&lt;P&gt;I am not sure if the xSemaphoreTakeFromISR() can appear in an ISR, it is only my opinion, pls refer to the FreeRTOS website:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freertos.org/" title="http://www.freertos.org/"&gt;FreeRTOS - Market leading RTOS (Real Time Operating System) for embedded systems with Internet of Things extensions&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 08:24:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-xSemaphoreTakeFromISR-not-blocking/m-p/557726#M5716</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-06-22T08:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: FreeRTOS xSemaphoreTakeFromISR() not blocking</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-xSemaphoreTakeFromISR-not-blocking/m-p/557727#M5717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI, the *FromISR() functions should be called only from an interrupt service routines.&lt;/P&gt;&lt;P&gt;From a task the xSemaphoreTake() API has to be called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 09:27:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/FreeRTOS-xSemaphoreTakeFromISR-not-blocking/m-p/557727#M5717</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2016-06-22T09:27:29Z</dc:date>
    </item>
  </channel>
</rss>

