<?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>MQX Software SolutionsのトピックMQXLite Semaphore issue in an interrupt</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQXLite-Semaphore-issue-in-an-interrupt/m-p/574477#M16569</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing an issue using&amp;nbsp;MQXLite. My project runs on CW10.6 + &amp;nbsp;PEx + MQXLite.&lt;/P&gt;&lt;P&gt;I'm calling &amp;nbsp;"_lwsem_post" in an interrupt handler to synchronize a task with this ISR but my program goes in HardFault. I well initialized the semaphore and it is valid before calling the "post" method. The fault comes in the "lwsem.c" file just at the "_INT_ENABLE" line.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/4455iC3713908F2C2FFC7/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So.... well, enabling/disabling the interrupts in an interrupt does not sound good, but that normally the usual&amp;nbsp;purpose of the&amp;nbsp;semaphores.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody got the answer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Aug 2016 12:38:22 GMT</pubDate>
    <dc:creator>anthonyduhamel</dc:creator>
    <dc:date>2016-08-30T12:38:22Z</dc:date>
    <item>
      <title>MQXLite Semaphore issue in an interrupt</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQXLite-Semaphore-issue-in-an-interrupt/m-p/574477#M16569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing an issue using&amp;nbsp;MQXLite. My project runs on CW10.6 + &amp;nbsp;PEx + MQXLite.&lt;/P&gt;&lt;P&gt;I'm calling &amp;nbsp;"_lwsem_post" in an interrupt handler to synchronize a task with this ISR but my program goes in HardFault. I well initialized the semaphore and it is valid before calling the "post" method. The fault comes in the "lwsem.c" file just at the "_INT_ENABLE" line.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/4455iC3713908F2C2FFC7/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So.... well, enabling/disabling the interrupts in an interrupt does not sound good, but that normally the usual&amp;nbsp;purpose of the&amp;nbsp;semaphores.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody got the answer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 12:38:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQXLite-Semaphore-issue-in-an-interrupt/m-p/574477#M16569</guid>
      <dc:creator>anthonyduhamel</dc:creator>
      <dc:date>2016-08-30T12:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: MQXLite Semaphore issue in an interrupt</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQXLite-Semaphore-issue-in-an-interrupt/m-p/574478#M16570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anthony,&lt;/P&gt;&lt;P&gt;You should be able to call the _lwsem_post() from ISR OK.&lt;/P&gt;&lt;P&gt;Have you checked your task stack size to ensure it is not overflowing.&lt;/P&gt;&lt;P&gt;Are there any ISR's in the system that are enabled but not initialized yet?&lt;/P&gt;&lt;P&gt;Is your LWSEM_STRUCT_PTR a global variable? &amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:41:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQXLite-Semaphore-issue-in-an-interrupt/m-p/574478#M16570</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-08-31T14:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: MQXLite Semaphore issue in an interrupt</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQXLite-Semaphore-issue-in-an-interrupt/m-p/574479#M16571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My semaphore is a global variable&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2809i577B34F6E8525D14/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&amp;nbsp;and initialized is my init_task.&lt;/P&gt;&lt;P&gt;There is no task in overflow.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2761iE0B23F4A76478F95/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is is valid when the ISR occurs.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2857i3F8DAB64DD00B49B/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My task I called &amp;nbsp;"Door" is waiting for the semaphore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2762i05D29997015A349F/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And all the enabled ISRs would be initialized. I have removed the semaphore and replaced it by a simple variable (_b_IsMoved) and it works. But it is not memory&amp;nbsp;safe when you deal with several threads....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried the semaphore out of the ISR, and it works. So my issue is probably ISR dependent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can share the source code if you want to take a look at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 07:44:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQXLite-Semaphore-issue-in-an-interrupt/m-p/574479#M16571</guid>
      <dc:creator>anthonyduhamel</dc:creator>
      <dc:date>2016-09-02T07:44:15Z</dc:date>
    </item>
  </channel>
</rss>

