<?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>CodeWarrior for MCU中的主题 Re: semaphore</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/semaphore/m-p/422602#M11735</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;do{XGSEM=0x0101;}while(!XGSEM); &lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Waiting for any bit set in XGSEM is OK while one semaphore is used in your app. Using more semaphores, you need wait for specific bit in XGSEM. Like this&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;do{XGSEM=0x0101;}while( !(XGSEM &amp;amp; 0x0001));&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;EM&gt;or better something like this&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#define SCISEMAPHORENO 0&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;#define I2CSEMAPHORENO 1&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;do{XGSEM=(0x0101 &amp;lt;&amp;lt; SCISEMAPHORENO) ;}while( !(XGSEM &amp;amp; (0x0001 &amp;lt;&amp;lt; SCISEMAPHORENO)));&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;..&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;XGSEM= 0x0100 &amp;lt;&amp;lt; SCISEMAPHORENO;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;do{XGSEM=(0x0101 &amp;lt;&amp;lt; I2CSEMAPHORENO) ;}while( !(XGSEM &amp;amp; (0x0001 &amp;lt;&amp;lt; I2CSCISEMAPHORENO)));&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;..&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;XGSEM= 0x0100 &amp;lt;&amp;lt; I2CSEMAPHORENO;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;(This is S12X specific question. I think you would be better asking here &lt;EM&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/community/16bit"&gt;https://community.freescale.com/community/16bit&lt;/A&gt;&lt;/EM&gt;)&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;Regards&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;Edward&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Nov 2015 17:23:33 GMT</pubDate>
    <dc:creator>kef2</dc:creator>
    <dc:date>2015-11-19T17:23:33Z</dc:date>
    <item>
      <title>semaphore</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/semaphore/m-p/422600#M11733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;i'm using HCS12X with Xgate .&lt;/P&gt;&lt;P&gt;first, i use hc12 core for my main program and xgate core for have SCI communication.&lt;/P&gt;&lt;P&gt; for the semaphore, in my main program :&lt;/P&gt;&lt;P&gt;&lt;EM&gt;do{XGSEM=0x0101;}while(!XGSEM); &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;....&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;XGSEM=0x0100;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and in the Xgate program i use :&lt;/P&gt;&lt;P&gt;&lt;EM&gt;while(!_ssem(0)){}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;_csem(0);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;this program work fine&lt;/P&gt;&lt;P&gt;now, i want to add an I2C function in Xgate core, so in my main program i try to use a 2nd semaphore :&lt;/P&gt;&lt;P&gt;&lt;EM&gt;do{XGSEM=0x0202;}while(!XGSEM); &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;....&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;XGSEM=0x0200;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and in the Xgate program i use :&lt;/P&gt;&lt;P&gt;&lt;EM&gt;while(!_ssem(1)){}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;_csem(1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;this program work fine&lt;/P&gt;&lt;P&gt;i must have a problem, the 2 communication work fine while 5 or 10 minut but stop after this time.&lt;/P&gt;&lt;P&gt;someone can say me if this declaration of semaphore is correct ?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Stéphane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2015 14:45:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/semaphore/m-p/422600#M11733</guid>
      <dc:creator>steph</dc:creator>
      <dc:date>2015-11-18T14:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: semaphore</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/semaphore/m-p/422601#M11734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stéphane,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to have more info regarding the tool used.&lt;/P&gt;&lt;P&gt;Do you use CodeWarrior for HC12 V5.1 ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; or an older version ? which one ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do that you must:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Under CodeWarrior IDE (classic)&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; Start the IDE and click on Help | About Freescale CodeWarrior.&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; Click on Installed Products &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; Provide us all info displayed.&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; Or you can save them in a txt file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you use Osek or Autosar ?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Pascal&lt;BR /&gt;Freescale Technical Support&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 08:55:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/semaphore/m-p/422601#M11734</guid>
      <dc:creator>trytohelp</dc:creator>
      <dc:date>2015-11-19T08:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: semaphore</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/semaphore/m-p/422602#M11735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;do{XGSEM=0x0101;}while(!XGSEM); &lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Waiting for any bit set in XGSEM is OK while one semaphore is used in your app. Using more semaphores, you need wait for specific bit in XGSEM. Like this&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;do{XGSEM=0x0101;}while( !(XGSEM &amp;amp; 0x0001));&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;EM&gt;or better something like this&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#define SCISEMAPHORENO 0&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;#define I2CSEMAPHORENO 1&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;do{XGSEM=(0x0101 &amp;lt;&amp;lt; SCISEMAPHORENO) ;}while( !(XGSEM &amp;amp; (0x0001 &amp;lt;&amp;lt; SCISEMAPHORENO)));&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;..&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;XGSEM= 0x0100 &amp;lt;&amp;lt; SCISEMAPHORENO;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;do{XGSEM=(0x0101 &amp;lt;&amp;lt; I2CSEMAPHORENO) ;}while( !(XGSEM &amp;amp; (0x0001 &amp;lt;&amp;lt; I2CSCISEMAPHORENO)));&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;..&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;XGSEM= 0x0100 &amp;lt;&amp;lt; I2CSEMAPHORENO;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;(This is S12X specific question. I think you would be better asking here &lt;EM&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/community/16bit"&gt;https://community.freescale.com/community/16bit&lt;/A&gt;&lt;/EM&gt;)&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;Regards&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;&lt;EM&gt;Edward&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 17:23:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/semaphore/m-p/422602#M11735</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2015-11-19T17:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: semaphore</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/semaphore/m-p/422603#M11736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="transpan"&gt;&lt;SPAN style="background-color: #efefef;"&gt;OK, thank you for the information and the maniere of proceder by renaming(reappointing) semaphores. Now I have find my error, I had forgotten a variable which had no semaphore. The question that I settled was is that I used well the good syntax:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="background-color: #efefef;"&gt;XGSEM = 0x0101 for SSEM ( 0 ) and XGSM = 0x0202 for SSEM ( 1 )&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Nov 2015 14:10:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/semaphore/m-p/422603#M11736</guid>
      <dc:creator>steph</dc:creator>
      <dc:date>2015-11-23T14:10:31Z</dc:date>
    </item>
  </channel>
</rss>

