<?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: Problem of writting PPAGE in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511583#M12476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;I am glad that the problem has been resolved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish you good luck in the future development.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 May 2016 08:44:21 GMT</pubDate>
    <dc:creator>RadekS</dc:creator>
    <dc:date>2016-05-11T08:44:21Z</dc:date>
    <item>
      <title>Problem of writting PPAGE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511579#M12472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, all&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an application that's reading data back from programmed flash. I'm using the CW of version 5.9.0, and the chip&lt;/P&gt;&lt;P&gt;is MC9S12XEP100. The application code is stored in $C0 page, and the programmed flash is $C1, before read data, I assign the 0xC1 to PPAGE, but the assignment can result in program run away. I can't find what's wrong with PPAGE assignment, can't PPAGE be accessed directly, or I miss something? Does anybody else has the same situation?&amp;nbsp; The code I pasted below. Any help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;..........................................&lt;/P&gt;&lt;P&gt;U8 temp_data[32];&lt;/P&gt;&lt;P&gt;U8 * ptr;&lt;/P&gt;&lt;P&gt;U8 page;&lt;/P&gt;&lt;P&gt;U8 page_backup;&lt;/P&gt;&lt;P&gt;U32 addr;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;addr = 0xC18560;&lt;/P&gt;&lt;P&gt;ptr = (U8 *)(addr &amp;amp; 0xFFFF);&lt;/P&gt;&lt;P&gt;page = (U8)(addr &amp;gt;&amp;gt; 16);&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; &lt;/P&gt;&lt;P&gt;if (page)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; page_backup = PPAGE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; PPAGE = page;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;.................................................&lt;/P&gt;&lt;P&gt;PS:&lt;/P&gt;&lt;P&gt;The same code is run ok in MC9S12G128. In this application, code is placed in 0 page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 06:07:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511579#M12472</guid>
      <dc:creator>jasoncui</dc:creator>
      <dc:date>2016-05-10T06:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of writting PPAGE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511580#M12473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Changing PPAGE contents while executing routine located in paged flash causes runaway. Try reading how code paging is supposed to work. CPU manual is good starting point.&lt;/P&gt;&lt;P&gt;To read paged memory either use global addressing or jump to nonpaged routine and manipulate PPAGE from there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 12:58:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511580#M12473</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2016-05-10T12:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of writting PPAGE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511581#M12474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;As correctly mentioned by Edward, this code could work only when this code is executed from unbanked memory. When code runs from banked memory, we cannot modify PPAGE directly.&lt;/P&gt;&lt;P&gt;So, we should decide for one of followed options:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;Keep automatic modification of pages (PPAGE, GPAGE) by compiler/linker – use far pointers, compiler option -CpPPAGE=RUNTIME (routines from datapage.c),…&lt;/LI&gt;&lt;LI&gt;Use own non-paged routines for manipulations with PPAGE.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is not clear to me for now: “In this application, code is placed in 0 page.”&lt;/P&gt;&lt;P&gt;S12G128 have PPAGE in range 0x08~0x0F (and potentially also 0x01 for Flash IFR)&lt;/P&gt;&lt;P&gt;S12XEP100 have PPAGE in range 0xC0~0xFF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Wed, 11 May 2016 07:51:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511581#M12474</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-05-11T07:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of writting PPAGE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511582#M12475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Edward &amp;amp; RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"0 page" is a mistake in writing, it should be non-paged:smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I placed the routine which manipulate the PPAGE in non-paged flash, and it works well.&lt;/P&gt;&lt;P&gt;You do me a great favor.&lt;/P&gt;&lt;P&gt;Thanks you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2016 08:19:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511582#M12475</guid>
      <dc:creator>jasoncui</dc:creator>
      <dc:date>2016-05-11T08:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of writting PPAGE</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511583#M12476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;I am glad that the problem has been resolved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wish you good luck in the future development.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2016 08:44:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-of-writting-PPAGE/m-p/511583#M12476</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-05-11T08:44:21Z</dc:date>
    </item>
  </channel>
</rss>

