<?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 launch flash command,   fallowing program cann't be executed in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152286#M4403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi. i have a problem.&lt;/P&gt;&lt;P&gt;After i launch flash commad. the fallowing program cann't be &lt;SPAN&gt;executed( i use LED_OFF to &lt;SPAN&gt;indicate command &lt;SPAN&gt;complete, but LED do not off, and interrupt cann't enable&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;). so i have to reset my MCU. and after reset, the flash command is executed&lt;/SPAN&gt;&amp;nbsp;Successfully. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fallowing is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LED_ON(D27);&lt;BR /&gt;&lt;BR /&gt;if(!FCLKDIV_FDIVLD){&lt;BR /&gt;FCLKDIV = 0x03;&lt;BR /&gt;}&lt;BR /&gt;while(!FSTAT_CCIF)&lt;BR /&gt;;&lt;BR /&gt;if(( FSTAT_ACCERR || FSTAT_FPVIOL )){&lt;/P&gt;&lt;P&gt;FSTAT = 0x30;&lt;BR /&gt;}&lt;BR /&gt;FCCOBIX = 0;&lt;BR /&gt;FCCOB = 0x0A7F; /*erase sector */&lt;BR /&gt;FCCOBIX = 1;&lt;BR /&gt;FCCOB = 0x4000;&lt;/P&gt;&lt;P&gt;Erase_ROM();&lt;/P&gt;&lt;P&gt;LED_OFF(D27);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG __NEAR_SEG ramcodeseg&lt;BR /&gt;&lt;BR /&gt;void Erase_ROM(void) {&lt;/P&gt;&lt;P&gt;asm&lt;BR /&gt;{&lt;BR /&gt;PSHC // remember I-bit state&lt;BR /&gt;SEI // disable interrupts&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;FSTAT = 0x80; //launch command&lt;BR /&gt;&lt;BR /&gt;while(!FSTAT_CCIF); //wait for done&lt;BR /&gt;&lt;BR /&gt;asm PULC; // restore I-bit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;#pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anyone helps me?thanks!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 07 Apr 2012 21:13:30 GMT</pubDate>
    <dc:creator>gogoranger</dc:creator>
    <dc:date>2012-04-07T21:13:30Z</dc:date>
    <item>
      <title>launch flash command,   fallowing program cann't be executed</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152286#M4403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi. i have a problem.&lt;/P&gt;&lt;P&gt;After i launch flash commad. the fallowing program cann't be &lt;SPAN&gt;executed( i use LED_OFF to &lt;SPAN&gt;indicate command &lt;SPAN&gt;complete, but LED do not off, and interrupt cann't enable&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;). so i have to reset my MCU. and after reset, the flash command is executed&lt;/SPAN&gt;&amp;nbsp;Successfully. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fallowing is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LED_ON(D27);&lt;BR /&gt;&lt;BR /&gt;if(!FCLKDIV_FDIVLD){&lt;BR /&gt;FCLKDIV = 0x03;&lt;BR /&gt;}&lt;BR /&gt;while(!FSTAT_CCIF)&lt;BR /&gt;;&lt;BR /&gt;if(( FSTAT_ACCERR || FSTAT_FPVIOL )){&lt;/P&gt;&lt;P&gt;FSTAT = 0x30;&lt;BR /&gt;}&lt;BR /&gt;FCCOBIX = 0;&lt;BR /&gt;FCCOB = 0x0A7F; /*erase sector */&lt;BR /&gt;FCCOBIX = 1;&lt;BR /&gt;FCCOB = 0x4000;&lt;/P&gt;&lt;P&gt;Erase_ROM();&lt;/P&gt;&lt;P&gt;LED_OFF(D27);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG __NEAR_SEG ramcodeseg&lt;BR /&gt;&lt;BR /&gt;void Erase_ROM(void) {&lt;/P&gt;&lt;P&gt;asm&lt;BR /&gt;{&lt;BR /&gt;PSHC // remember I-bit state&lt;BR /&gt;SEI // disable interrupts&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;FSTAT = 0x80; //launch command&lt;BR /&gt;&lt;BR /&gt;while(!FSTAT_CCIF); //wait for done&lt;BR /&gt;&lt;BR /&gt;asm PULC; // restore I-bit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;#pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anyone helps me?thanks!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Apr 2012 21:13:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152286#M4403</guid>
      <dc:creator>gogoranger</dc:creator>
      <dc:date>2012-04-07T21:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: launch flash command,   fallowing program cann't be executed</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152287#M4404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, i forgot to mention that my MCU is MC9S12XF512&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Apr 2012 21:17:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152287#M4404</guid>
      <dc:creator>gogoranger</dc:creator>
      <dc:date>2012-04-07T21:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: launch flash command,   fallowing program cann't be executed</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152288#M4405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you check what address Erase_ROM is allocated at? In case ramcodeseg placement is not defined in PRM file, Erase_ROM&amp;nbsp;probably ends in&amp;nbsp;flash, which is wrong. Your PRM file should have line like below&amp;nbsp;in the PLACEMENT section:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ramcodeseg INTO RAM;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Apr 2012 23:20:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152288#M4405</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2012-04-07T23:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: launch flash command,   fallowing program cann't be executed</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152289#M4406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi! thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fallowing is my prm file:&lt;/P&gt;&lt;P&gt;RAM2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = READ_WRITE &amp;nbsp; &amp;nbsp;0x3000 TO &amp;nbsp; 0x3FFF ALIGN 2[1:1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ramcodeseg &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;INTO &amp;nbsp;RAM2;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;fallowing is my map file:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Module &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; Addr &amp;nbsp; hSize &amp;nbsp; dSize &amp;nbsp; &amp;nbsp; Ref &amp;nbsp; &amp;nbsp;Section &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&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; Erase_ROM &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; 2000 &amp;nbsp; &amp;nbsp; &amp;nbsp; F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; ramcodeseg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there any else possible error?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2012 10:39:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152289#M4406</guid>
      <dc:creator>gogoranger</dc:creator>
      <dc:date>2012-04-09T10:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: launch flash command,   fallowing program cann't be executed</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152290#M4407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi! i think i have no error in prm file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;could you give me more&amp;nbsp;&lt;SPAN&gt;suggestion to solve my problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my flash command can be&amp;nbsp;&lt;SPAN&gt;&lt;SPAN&gt;accomplish&lt;/SPAN&gt;, but fallowing line in program can not be&amp;nbsp;&lt;SPAN&gt;execute.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;thank you very much!!!!!!!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 22:42:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152290#M4407</guid>
      <dc:creator>gogoranger</dc:creator>
      <dc:date>2012-04-10T22:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: launch flash command,   fallowing program cann't be executed</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152291#M4408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have no warning about missing prototype? Are Erase_ROM and&amp;nbsp;surrounding&amp;nbsp;__NEAR_SEG&amp;nbsp;block #pragmas defined before Erase_ROM is called? It is not enough to put just prototype above caller. It may be that Erase_ROM is called with CALL instruction, while it returns with RTS...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 23:35:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152291#M4408</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2012-04-10T23:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: launch flash command,   fallowing program cann't be executed</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152292#M4409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi!&lt;/P&gt;&lt;P&gt;you are right!! it works!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i use "FAR_SEG" replace "NEAR_SEG"&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG __FAR_SEG ramcodeseg&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thank you!!!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 14:18:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/launch-flash-command-fallowing-program-cann-t-be-executed/m-p/152292#M4409</guid>
      <dc:creator>gogoranger</dc:creator>
      <dc:date>2012-04-11T14:18:34Z</dc:date>
    </item>
  </channel>
</rss>

