<?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中的主题 Re: EVB9S12XEP100 Bootloader project -- EPROM/D-FLASH</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/EVB9S12XEP100-Bootloader-project-EPROM-D-FLASH/m-p/144310#M3727</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Peter,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Several points -&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1) I recommend always following &lt;FONT face="Helvetica-Bold" size="2"&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;Generic Flash Command Write Sequence Flow&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; in the data book as a&amp;nbsp;MUST else you&amp;nbsp;can be violating the spec for the part.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;2) I suspect that, apart from mybe not having set FCLKDIV and not checking CCIF == 1 (both of which are&amp;nbsp;checked&amp;nbsp;in the &lt;FONT face="Helvetica-Bold" size="2"&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;Generic Flash Command Write Sequence Flow)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;, one of your problems is certainly coming&amp;nbsp;from the '|=' in this line&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;FSTAT |= (PVIOL | ACCERR);&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;the OR-EQUALS is a read modify write operation which is a real hazzard on any registers containing 'write&amp;nbsp;1' to clear flags and an absolute MUST NOT DO especially on the&amp;nbsp;FSTAT register. Here's what it does&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;a) reads the FSTAT register (CCIF will probably be 1, or at least it should be if you are trying to execute an FTM command (and you should be checking))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;b) OR's (PVIOL|ACCERR) with it&amp;nbsp; - NOTE you now have at least CCIF set in this intermediate result&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;c) writes the result back to FSTAT&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and writing a 1 to the CCIF bit launches the FTM command !!!!!!!!!!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So you should use FSTAT = (PVIOL | ACCERR);&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Same goes for FSTAT |= CCIF, probably won't cause any probelms in fact but better practice to just use FSTAT = CCIF.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;3)&amp;nbsp;FYI, the ENABLE_D_FLASH command was renamed to FULL_PARTITION_DFLASH some time ago - make sure you have the latest data book from the Freescale web.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;4) Also, I would recommend leaving the MMCCTL1 register at it's default -no need to enable the IFR visibility at all.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;5) Something else to watch out for if you are debugging programming the Flash in CodeWarrior and want to see the value change:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In your cable menu you'll find a option called Debugging Memory Map (or similar)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;double click on global 00100000-0013FFFF global eeprom and make sure 'refresh memory when halting' is set (by default it isn't)&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;this will result&amp;nbsp;in the D-Flash changes being updated in the memory&amp;nbsp;window.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;6) An EEE&amp;nbsp;ApNote will be available on the web site shortly.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;cheers,&lt;/DIV&gt;&lt;DIV&gt;dog&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Sep 2007 23:52:43 GMT</pubDate>
    <dc:creator>dog</dc:creator>
    <dc:date>2007-09-10T23:52:43Z</dc:date>
    <item>
      <title>EVB9S12XEP100 Bootloader project -- EPROM/D-FLASH</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/EVB9S12XEP100-Bootloader-project-EPROM-D-FLASH/m-p/144308#M3725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;Dear Sir/Madam&lt;BR /&gt;&lt;BR /&gt;I am working on a Bootloader project for Ford, and I can not handle the EPROM/D-FLASH.&lt;BR /&gt;&lt;BR /&gt;I use codewarrior 4.5, and a EVB9S12XEP100 EVB. I have had no problem with the common P-Flash but I cannot read/erase/write the D-Flash only can read 4k EEEPROM (at FC0800-FC0BFF,FD..,FE..,FF..) with the debugger. Can You please send me the address list where I can reach EEPROM and D-Flash with the debugger?&lt;BR /&gt;&lt;BR /&gt;I have to erase and download in D-Flash but I cannot even enable D-flash, I always get access error.&lt;BR /&gt;&lt;BR /&gt;The init code:&lt;BR /&gt;/* EEE IFR visible in the memory map */&lt;BR /&gt;MMCCTL1 |= EEEIFRO;&lt;BR /&gt;/* Clear error flags */&lt;BR /&gt;FSTAT |= (PVIOL | ACCERR);&lt;BR /&gt;/* Enable D-Flash */&lt;BR /&gt;FCCOBIX = 0;&lt;BR /&gt;FCCOBHI = ENABLE_D_FLASH; //0x0f&lt;BR /&gt;FCCOBLO = 0;&lt;BR /&gt;FCCOBIX = 1;&lt;BR /&gt;FCCOB = D_FLASH_SIZE_32K; //128&lt;BR /&gt;FCCOBIX = 2;&lt;BR /&gt;FCCOB = (uint16)0;&lt;BR /&gt;FSTAT |= CCIF;&lt;BR /&gt;/* until finished or error occured */&lt;BR /&gt;while(((FSTAT &amp;amp; (PVIOL | ACCERR))==0) &amp;amp;&amp;amp; ((FSTAT &amp;amp; CCIF) == 0))&lt;BR /&gt;{}&lt;BR /&gt;&lt;BR /&gt;Can You please send me an application note about D-Flash and EEPROM handling?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Peter Laczko&lt;BR /&gt;Embedded Software Engineer&lt;BR /&gt;Mentor Graphics&lt;BR /&gt;Automotive Networking Business Unit&lt;BR /&gt;Montevideo u. 2/C&lt;BR /&gt;H-1037 Budapest&lt;BR /&gt;HUNGARY&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 1;"&gt;Alban changed subject&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by Alban on &lt;SPAN class="date_text"&gt;2007-02-02&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;07:49 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Feb 2007 01:39:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/EVB9S12XEP100-Bootloader-project-EPROM-D-FLASH/m-p/144308#M3725</guid>
      <dc:creator>Pedrito</dc:creator>
      <dc:date>2007-02-03T01:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: EVB9S12XEP100 Bootloader project -- EPROM/D-FLASH</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/EVB9S12XEP100-Bootloader-project-EPROM-D-FLASH/m-p/144309#M3726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;There are currently two main sources of information about the emulated EEPROM and D-Flash. Firstly, the Reference Manual and AN3242. The EEPROM system on the EP100 is an emulated EEPROM system which you must configure before using it. Depending on how you configure the EEPROM you may or may not have D-Flash available too.&lt;/DIV&gt;&lt;DIV&gt;As far as I can understand your code you are attempting to use the part with no EEPROM.&lt;/DIV&gt;&lt;DIV&gt;Line by line:&lt;/DIV&gt;&lt;DIV&gt;The IFR and the D-Flash are two different things - it's unlikely you will want to see the IFR.&lt;/DIV&gt;&lt;DIV&gt;I don't see you writing to FCLKDIV but since the P-Flash works I expect that you are doing this elsewhere.&lt;/DIV&gt;&lt;DIV&gt;The CCOB command will configure the part not to use EEPROM but it must be executed in a special mode (see the Functional Description section in the flash chapter). If you execute it in normal mode it will not work. Also this is an execute once command - it is like partitioning a hard disk. You can partition again but you will lose all the contents of your D-Flash.&lt;/DIV&gt;&lt;DIV&gt;D-Flash is in the memory map at 0x100000 and you access it via global memory or in local memory using the EPAGE.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2007 17:31:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/EVB9S12XEP100-Bootloader-project-EPROM-D-FLASH/m-p/144309#M3726</guid>
      <dc:creator>Steve</dc:creator>
      <dc:date>2007-02-06T17:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: EVB9S12XEP100 Bootloader project -- EPROM/D-FLASH</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/EVB9S12XEP100-Bootloader-project-EPROM-D-FLASH/m-p/144310#M3727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Peter,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Several points -&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1) I recommend always following &lt;FONT face="Helvetica-Bold" size="2"&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;Generic Flash Command Write Sequence Flow&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; in the data book as a&amp;nbsp;MUST else you&amp;nbsp;can be violating the spec for the part.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;2) I suspect that, apart from mybe not having set FCLKDIV and not checking CCIF == 1 (both of which are&amp;nbsp;checked&amp;nbsp;in the &lt;FONT face="Helvetica-Bold" size="2"&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;Generic Flash Command Write Sequence Flow)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;, one of your problems is certainly coming&amp;nbsp;from the '|=' in this line&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;FSTAT |= (PVIOL | ACCERR);&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;the OR-EQUALS is a read modify write operation which is a real hazzard on any registers containing 'write&amp;nbsp;1' to clear flags and an absolute MUST NOT DO especially on the&amp;nbsp;FSTAT register. Here's what it does&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;a) reads the FSTAT register (CCIF will probably be 1, or at least it should be if you are trying to execute an FTM command (and you should be checking))&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;b) OR's (PVIOL|ACCERR) with it&amp;nbsp; - NOTE you now have at least CCIF set in this intermediate result&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;c) writes the result back to FSTAT&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and writing a 1 to the CCIF bit launches the FTM command !!!!!!!!!!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So you should use FSTAT = (PVIOL | ACCERR);&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Same goes for FSTAT |= CCIF, probably won't cause any probelms in fact but better practice to just use FSTAT = CCIF.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;3)&amp;nbsp;FYI, the ENABLE_D_FLASH command was renamed to FULL_PARTITION_DFLASH some time ago - make sure you have the latest data book from the Freescale web.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;4) Also, I would recommend leaving the MMCCTL1 register at it's default -no need to enable the IFR visibility at all.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;5) Something else to watch out for if you are debugging programming the Flash in CodeWarrior and want to see the value change:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In your cable menu you'll find a option called Debugging Memory Map (or similar)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;double click on global 00100000-0013FFFF global eeprom and make sure 'refresh memory when halting' is set (by default it isn't)&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;this will result&amp;nbsp;in the D-Flash changes being updated in the memory&amp;nbsp;window.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;6) An EEE&amp;nbsp;ApNote will be available on the web site shortly.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;cheers,&lt;/DIV&gt;&lt;DIV&gt;dog&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 23:52:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/EVB9S12XEP100-Bootloader-project-EPROM-D-FLASH/m-p/144310#M3727</guid>
      <dc:creator>dog</dc:creator>
      <dc:date>2007-09-10T23:52:43Z</dc:date>
    </item>
  </channel>
</rss>

