<?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 Flash Problem in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-Problem/m-p/510235#M12438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My question is :&lt;/P&gt;&lt;P&gt;1. Why the Y value is 0xFFFF, but not what i write? and the map file is true.&lt;/P&gt;&lt;P&gt;2. Why i can't see the true value when i selected the PPAGE = 0x38, but the addr 0x38xxxx is always 0xFFFF at the memory window.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use MC9s12DG256B IC, and CSW IDE. True-Time Simulator &amp;amp; Real-Time Debugger.&lt;/P&gt;&lt;P&gt;at start file, the source code :&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PPAGE = 0x38;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;#define __MMCTL_SET(value) ((...&lt;/P&gt;&lt;P&gt;&amp;nbsp; __MMCTL1_SET(...&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; __asm {&lt;/P&gt;&lt;P&gt;&amp;nbsp; ldx #$95BA&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; ; Here the X value = 0x95BA&amp;nbsp;&amp;nbsp;&amp;nbsp; PPAGE = 0x38&lt;/P&gt;&lt;P&gt;&amp;nbsp; ldy 2,x+&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; ; Here the Y value = 0xFFFF, is wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and at the True-Time Simulator &amp;amp; Real-Time Debugger, memory always see 0xFFFF @ addr 0x3895BA. &lt;/P&gt;&lt;P&gt;but at the \bin\PE_Multilink_CyclonePro.map:&lt;/P&gt;&lt;P&gt;&amp;nbsp; VAR012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3895BA 2 2 0 ROM_38&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Mar 2016 07:08:06 GMT</pubDate>
    <dc:creator>xiaoli</dc:creator>
    <dc:date>2016-03-07T07:08:06Z</dc:date>
    <item>
      <title>Flash Problem</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-Problem/m-p/510235#M12438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My question is :&lt;/P&gt;&lt;P&gt;1. Why the Y value is 0xFFFF, but not what i write? and the map file is true.&lt;/P&gt;&lt;P&gt;2. Why i can't see the true value when i selected the PPAGE = 0x38, but the addr 0x38xxxx is always 0xFFFF at the memory window.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use MC9s12DG256B IC, and CSW IDE. True-Time Simulator &amp;amp; Real-Time Debugger.&lt;/P&gt;&lt;P&gt;at start file, the source code :&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PPAGE = 0x38;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;#define __MMCTL_SET(value) ((...&lt;/P&gt;&lt;P&gt;&amp;nbsp; __MMCTL1_SET(...&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; __asm {&lt;/P&gt;&lt;P&gt;&amp;nbsp; ldx #$95BA&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; ; Here the X value = 0x95BA&amp;nbsp;&amp;nbsp;&amp;nbsp; PPAGE = 0x38&lt;/P&gt;&lt;P&gt;&amp;nbsp; ldy 2,x+&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; ; Here the Y value = 0xFFFF, is wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and at the True-Time Simulator &amp;amp; Real-Time Debugger, memory always see 0xFFFF @ addr 0x3895BA. &lt;/P&gt;&lt;P&gt;but at the \bin\PE_Multilink_CyclonePro.map:&lt;/P&gt;&lt;P&gt;&amp;nbsp; VAR012&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3895BA 2 2 0 ROM_38&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 07:08:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-Problem/m-p/510235#M12438</guid>
      <dc:creator>xiaoli</dc:creator>
      <dc:date>2016-03-07T07:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Problem</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-Problem/m-p/510236#M12439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all ensure the CW project you have opened is Banked or Large Memory model. If it would be Small Memory model, then there is access to 64K linear addresses only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What the LDY instruction does in your case, it loads the Index register Y with the contents of address 2 + 95BA = 95BC.&lt;/P&gt;&lt;P&gt;Now you forgot to put $ string in front of number 2.&lt;/P&gt;&lt;P&gt;Anyways, the content on the memory location 0x3895BC is 0xFFFF.&lt;/P&gt;&lt;P&gt;Try LDX #$8000 to check if it&amp;nbsp; reads correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try this function to read the memory location and ensure it's correct:&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;volatile unsigned int readData;&lt;/P&gt;&lt;P&gt;unsigned int Flash_Read_Word(unsigned long int addr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; return *(unsigned int *far)addr;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void main(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; //read word at 0x30_8000 &lt;/P&gt;&lt;P&gt;&amp;nbsp; readData = Flash_Read_Word(0x308000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _FEED_COP(); /* feeds the dog */&lt;/P&gt;&lt;P&gt;&amp;nbsp; } /* loop forever */&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* please make sure that you never leave main */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;You can put there any address instead 0x308000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you expect other value to be read from that location, then your write function is not good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2016 16:09:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-Problem/m-p/510236#M12439</guid>
      <dc:creator>iggi</dc:creator>
      <dc:date>2016-03-09T16:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Flash Problem</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-Problem/m-p/510237#M12440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;First of all ensure the CW project you have opened is Banked or Large Memory model. If it would be Small Memory model, then there is access to 64K linear addresses only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;As: My CW Project is Banked Memory model.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;What the LDY instruction does in your case, it loads the Index register Y with the contents of address 2 + 95BA = 95BC.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Now you forgot to put $ string in front of number 2.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Anyways, the content on the memory location 0x3895BC is 0xFFFF.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Try LDX #$8000 to check if it&amp;nbsp; reads correctly.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;As: I just Wanted to Try to Get a data from addr=0x95BA the Value at addr 0x95Ba = 0x95BC. so, it's no problem.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;and also at $8000 , at memory is always 0xFFFF.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;pl's see my project and some file , such as : asm_main, prm file, start file. and map file. there is a picture about my project run status.&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Thanks for your answer.&amp;nbsp; your are so nice.&lt;A href="http://community.freescale.com/"&gt;&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 02:47:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Flash-Problem/m-p/510237#M12440</guid>
      <dc:creator>xiaoli</dc:creator>
      <dc:date>2016-03-10T02:47:19Z</dc:date>
    </item>
  </channel>
</rss>

