<?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のトピックProblems using &amp;quot;pragma sections&amp;quot; with BDM in the OpenTCP project.</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-using-quot-pragma-sections-quot-with-BDM-in-the-OpenTCP/m-p/140094#M3021</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope someone can help me with my pragma problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Equipment:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;I'm running &lt;EM&gt;Codewarrior 3.1&lt;/EM&gt; on a &lt;EM&gt;MC9S12NE64EVB&lt;/EM&gt; using a "&lt;EM&gt;BDM Pod (P&amp;amp;E ICD)&lt;/EM&gt;" and I use the code from the &lt;EM&gt;OpenTCP&lt;/EM&gt; project.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;What I want to do:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;BR /&gt;I would like to allocate a memory block in RAM in order to move and run a function there. Below you can see the necesary lines in my .prm-file for the allocation and my code implementation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;****************************************************************************************&lt;BR /&gt;NAMES&lt;BR /&gt;END&lt;BR /&gt;SEGMENTS&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;RAM_FBURN&amp;nbsp;&amp;nbsp;= READ_ONLY&amp;nbsp; 0x2180 TO 0x24FF;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Memory allocation&lt;BR /&gt;&amp;nbsp;&amp;nbsp;RAM&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;= READ_WRITE 0x2500 TO 0x3FFE;&amp;nbsp;&amp;nbsp; /* BUFMAP = 0 (128 byte) END&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PLACEMENT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FBURN&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; INTO&amp;nbsp; RAM_FBURN;&lt;BR /&gt;END&lt;BR /&gt;****************************************************************************************&lt;BR /&gt;==========================================================&lt;BR /&gt;void main(void)&lt;BR /&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;test_function();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;#pragma CODE_SEG FBURN&lt;BR /&gt;void test_function(){&lt;BR /&gt;int a;&lt;BR /&gt;char tecken = 'A';&lt;BR /&gt;for(a=0;a&amp;lt;5;a++){&lt;BR /&gt;&amp;nbsp;tecken++;&lt;BR /&gt;}&lt;BR /&gt;&amp;nbsp;#pragma CODE_SEG DEFAULT&lt;BR /&gt;===========================================================&lt;BR /&gt;&lt;STRONG&gt;The problem:&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;When I use the serial monitor interface everything works exactly as I want. &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif"&gt;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But as soon as I switch to the BDM pod it's like a one way ticket to hell.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-mad.gif"&gt;&lt;IMG alt=":smileymad:" class="emoticon-smileymad emoticon" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-mad.gif" title="Smiley Mad" /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The first problem I encounter while starting the Debugger is (Elf Loader) &lt;STRONG&gt;Error while writing to 2180...2380. Information: No memory at this address.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I believe that the problem is some sort of a "memory offset" problem because when I look in the "Debugging Memory Map"-window it displays that the RAM should be between &lt;STRONG&gt;0x0000 - 0x1FFF&lt;/STRONG&gt;. However if I modify this to start at &lt;STRONG&gt;0x2000&lt;/STRONG&gt; instead, I'm able to run the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the beginning Everything seems to work fine, the function &lt;STRONG&gt;test_function&lt;/STRONG&gt; is placed at &lt;STRONG&gt;0x2180&lt;/STRONG&gt; in the RAM area, but when I'm using the single step the code in the Assembly window seems out of place but the other windows are displayed correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I also noticed the following line in the &lt;STRONG&gt;ne64driver.c&lt;/STRONG&gt;, I've tried to modify this without any success (I also believe that modifing this file affects the Emac buffer.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#define RAM_START 0x2000&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; RAM block starting address */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I really hope any of you&amp;nbsp;can help me solve this annoying problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jun 2006 19:48:57 GMT</pubDate>
    <dc:creator>Mr_void</dc:creator>
    <dc:date>2006-06-19T19:48:57Z</dc:date>
    <item>
      <title>Problems using "pragma sections" with BDM in the OpenTCP project.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-using-quot-pragma-sections-quot-with-BDM-in-the-OpenTCP/m-p/140094#M3021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope someone can help me with my pragma problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Equipment:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;I'm running &lt;EM&gt;Codewarrior 3.1&lt;/EM&gt; on a &lt;EM&gt;MC9S12NE64EVB&lt;/EM&gt; using a "&lt;EM&gt;BDM Pod (P&amp;amp;E ICD)&lt;/EM&gt;" and I use the code from the &lt;EM&gt;OpenTCP&lt;/EM&gt; project.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;What I want to do:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;BR /&gt;I would like to allocate a memory block in RAM in order to move and run a function there. Below you can see the necesary lines in my .prm-file for the allocation and my code implementation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;****************************************************************************************&lt;BR /&gt;NAMES&lt;BR /&gt;END&lt;BR /&gt;SEGMENTS&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;RAM_FBURN&amp;nbsp;&amp;nbsp;= READ_ONLY&amp;nbsp; 0x2180 TO 0x24FF;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Memory allocation&lt;BR /&gt;&amp;nbsp;&amp;nbsp;RAM&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;= READ_WRITE 0x2500 TO 0x3FFE;&amp;nbsp;&amp;nbsp; /* BUFMAP = 0 (128 byte) END&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PLACEMENT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FBURN&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; INTO&amp;nbsp; RAM_FBURN;&lt;BR /&gt;END&lt;BR /&gt;****************************************************************************************&lt;BR /&gt;==========================================================&lt;BR /&gt;void main(void)&lt;BR /&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;test_function();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;#pragma CODE_SEG FBURN&lt;BR /&gt;void test_function(){&lt;BR /&gt;int a;&lt;BR /&gt;char tecken = 'A';&lt;BR /&gt;for(a=0;a&amp;lt;5;a++){&lt;BR /&gt;&amp;nbsp;tecken++;&lt;BR /&gt;}&lt;BR /&gt;&amp;nbsp;#pragma CODE_SEG DEFAULT&lt;BR /&gt;===========================================================&lt;BR /&gt;&lt;STRONG&gt;The problem:&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;When I use the serial monitor interface everything works exactly as I want. &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif"&gt;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But as soon as I switch to the BDM pod it's like a one way ticket to hell.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-mad.gif"&gt;&lt;IMG alt=":smileymad:" class="emoticon-smileymad emoticon" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-mad.gif" title="Smiley Mad" /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The first problem I encounter while starting the Debugger is (Elf Loader) &lt;STRONG&gt;Error while writing to 2180...2380. Information: No memory at this address.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I believe that the problem is some sort of a "memory offset" problem because when I look in the "Debugging Memory Map"-window it displays that the RAM should be between &lt;STRONG&gt;0x0000 - 0x1FFF&lt;/STRONG&gt;. However if I modify this to start at &lt;STRONG&gt;0x2000&lt;/STRONG&gt; instead, I'm able to run the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the beginning Everything seems to work fine, the function &lt;STRONG&gt;test_function&lt;/STRONG&gt; is placed at &lt;STRONG&gt;0x2180&lt;/STRONG&gt; in the RAM area, but when I'm using the single step the code in the Assembly window seems out of place but the other windows are displayed correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I also noticed the following line in the &lt;STRONG&gt;ne64driver.c&lt;/STRONG&gt;, I've tried to modify this without any success (I also believe that modifing this file affects the Emac buffer.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#define RAM_START 0x2000&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; RAM block starting address */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I really hope any of you&amp;nbsp;can help me solve this annoying problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jun 2006 19:48:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-using-quot-pragma-sections-quot-with-BDM-in-the-OpenTCP/m-p/140094#M3021</guid>
      <dc:creator>Mr_void</dc:creator>
      <dc:date>2006-06-19T19:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problems using "pragma sections" with BDM in the OpenTCP project.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-using-quot-pragma-sections-quot-with-BDM-in-the-OpenTCP/m-p/140095#M3022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;you experience that the Serial monitor does Remap the RAM, so &lt;BR /&gt;when using the serial monitor, the RAM is always just below 0x3FFF. &lt;BR /&gt;Without the serial monitor, the RAM is at its reset location (check the NE64 docu).&lt;BR /&gt;&lt;BR /&gt;Maybe the AN2881 helps, here's the URL:&lt;BR /&gt;&lt;A href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN2881.pdf?srch=1" target="test_blank"&gt;http://www.freescale.com/files/microcontrollers/doc/app_note/AN2881.pdf?srch=1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You have two alternatives:&lt;BR /&gt;- either change the prm file so it uses the out of reset ram configuration (some HCS12's then don't have access to the full RAM. Not sure for the NE64).&lt;BR /&gt;- init the needed registers to map the ram differently in the preload command file, so the RAM gets mapped before the debugger loads the elf file.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2006 20:37:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-using-quot-pragma-sections-quot-with-BDM-in-the-OpenTCP/m-p/140095#M3022</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2006-06-20T20:37:55Z</dc:date>
    </item>
  </channel>
</rss>

