<?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>S12 / MagniV MicrocontrollersのトピックSharing Data between XGATE and CPU</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Sharing-Data-between-XGATE-and-CPU/m-p/125058#M240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Fri Sep 16, 2005 7:31 am&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt; I want to transfer Data, which is produced by the CPU, over the SCI. The SCI is controlled by the XGATE. How can i share Data between the CPU and the XGATE? Are there any software examples? I'm using Codeworrier 4.1.&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Fri Sep 16, 2005 7:50 am&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;the easiest way is simply to declare a buffer or structure that both CPU and XGATE can see.&lt;BR /&gt; You can define this in either the XGATE source or the CPU source and it works in the same way that sharing data between any C source files works.&lt;BR /&gt; So starting from the wizard example you could declare a buffer in xgate.cxgate:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;unsigned char buffer[10];&lt;/PRE&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Then in main.c you would declare this as externally defined:&lt;BR /&gt;&lt;/DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;extern unsigned char buffer[];&lt;/PRE&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Now both cores can write into and read buffer.&lt;BR /&gt;&lt;BR /&gt;If you need to use a structure then define that in some common header.&lt;BR /&gt;&lt;BR /&gt;You need to be careful that both are not writing the same location at the same time so consider using the hardware MUTEX semaphores on XGATE or some other scheme.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Fri Sep 16, 2005 8:24 am&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;Thank's for your help&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Jan 2006 11:04:42 GMT</pubDate>
    <dc:creator>RChapman</dc:creator>
    <dc:date>2006-01-28T11:04:42Z</dc:date>
    <item>
      <title>Sharing Data between XGATE and CPU</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Sharing-Data-between-XGATE-and-CPU/m-p/125058#M240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Fri Sep 16, 2005 7:31 am&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt; I want to transfer Data, which is produced by the CPU, over the SCI. The SCI is controlled by the XGATE. How can i share Data between the CPU and the XGATE? Are there any software examples? I'm using Codeworrier 4.1.&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Fri Sep 16, 2005 7:50 am&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;the easiest way is simply to declare a buffer or structure that both CPU and XGATE can see.&lt;BR /&gt; You can define this in either the XGATE source or the CPU source and it works in the same way that sharing data between any C source files works.&lt;BR /&gt; So starting from the wizard example you could declare a buffer in xgate.cxgate:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;unsigned char buffer[10];&lt;/PRE&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Then in main.c you would declare this as externally defined:&lt;BR /&gt;&lt;/DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;extern unsigned char buffer[];&lt;/PRE&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Now both cores can write into and read buffer.&lt;BR /&gt;&lt;BR /&gt;If you need to use a structure then define that in some common header.&lt;BR /&gt;&lt;BR /&gt;You need to be careful that both are not writing the same location at the same time so consider using the hardware MUTEX semaphores on XGATE or some other scheme.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Fri Sep 16, 2005 8:24 am&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;Thank's for your help&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jan 2006 11:04:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Sharing-Data-between-XGATE-and-CPU/m-p/125058#M240</guid>
      <dc:creator>RChapman</dc:creator>
      <dc:date>2006-01-28T11:04:42Z</dc:date>
    </item>
  </channel>
</rss>

