<?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: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412772#M11152</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;Still not able to erase as well as write to flash memory .i shared my code please have a look at this with reference to .prm file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) i used pragmas for moving code in to ram .correct me if i am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;///////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* RAM */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp; 0x001000 TO 0x001FFF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* EEPROM */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EEPROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp; 0x100000 TO 0x1003FF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* non-paged FLASHs */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp; 0xFF0000 TO 0xFFFDFF;&lt;/P&gt;&lt;P&gt;/*&amp;nbsp; VECTORS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xFFFE00 TO&amp;nbsp; 0xFFFFFF; intentionally not defined: used for VECTOR commands below */&lt;/P&gt;&lt;P&gt;&amp;nbsp; //OSVECTORS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xFFFE10 TO&amp;nbsp; 0xFFFFFF;&amp;nbsp; /* OSEK interrupt vectors (use your vector.o) */&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _PRESTART,&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; /* Used in HIWARE format: jump to _Startup at the code start */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STARTUP,&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; /* startup data structures */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROM_VAR,&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; /* constant variables */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STRINGS,&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; /* string literals */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VIRTUAL_TABLE_SEGMENT,&amp;nbsp; /* C++ virtual table segment */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.ostext,&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; /* OSEK */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NON_BANKED,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* runtime routines which must not be banked */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFAULT_ROM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COPY&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; ROM;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.stackstart,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* eventually used for OSEK kernel awareness: Main-Stack Start */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSTACK,&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; /* allocate stack first to avoid overwriting variables on overflow */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.stackend,&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; /* eventually used for OSEK kernel awareness: Main-Stack End */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFAULT_RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO&amp;nbsp; RAM;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;////////////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Nov 2015 04:48:34 GMT</pubDate>
    <dc:creator>sathishkannan</dc:creator>
    <dc:date>2015-11-09T04:48:34Z</dc:date>
    <item>
      <title>how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412756#M11136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please explain about FFCOB register.in that command ,address and data's are there .what they mean ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2015 08:32:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412756#M11136</guid>
      <dc:creator>sathishkannan</dc:creator>
      <dc:date>2015-10-20T08:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412757#M11137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sathish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In attachment you could find my example code for write routines to flash and EEPROM.&lt;/P&gt;&lt;P&gt;Example were created for S12ZVL, but it should be able also simply use for S12ZVM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Protection feature helps to protection against unwanted program and erase operations.&lt;/P&gt;&lt;P&gt;You could select one of eight protection scenario by writing into FPROT register.&lt;/P&gt;&lt;P&gt;Additionally you could also select sizes of protected area(s) or areas which will be excluded from protection. For more details about available scenarios, please look at Figure 20-14. P-Flash Protection Scenarios.&lt;/P&gt;&lt;P&gt;By default, you could only increase protected area in Normal Single Chip mode.&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, 21 Oct 2015 13:47:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412757#M11137</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-10-21T13:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412758#M11138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your kind reply.I am able to understand few more about the module .But i am having few more questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I am having confusions about memory address in flash.what that 23 bit address means ? &lt;/P&gt;&lt;P&gt;2) whats the difference between sectors,blocks,phrase ?please explain with the help of our memory map.&lt;/P&gt;&lt;P&gt;3)How to pass data to the flash memory.Is it through FCCOB registers ?or directly ?&lt;/P&gt;&lt;P&gt;3) Do we want to take care of sectors ?If yes means how the know the boundaries ?&lt;/P&gt;&lt;P&gt;4)I want to flash bootloader code of about 40K in size .how to write in the memory.Is it sector wise or block wise.&lt;/P&gt;&lt;P&gt;5)Please share memory mapping of flash.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Oct 2015 08:04:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412758#M11138</guid>
      <dc:creator>sathishkannan</dc:creator>
      <dc:date>2015-10-23T08:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412759#M11139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi santhis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I suppose that you mean 24bit address. 24bit is wide of address bus in S12Z core. So, it means that address space is limited by address range 0x000000..0xFFFFFF (address could have 24bits).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.For S12ZVC:&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2.1 EEPROM Sector — The EEPROM sector is the smallest portion of the EEPROM memory that can be erased. The EEPROM sector consists of 4 bytes.&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2.2 P-Flash Sector — The P-Flash sector is the smallest portion of the P-Flash memory that can be erased. Each P-Flash sector contains 512 bytes.&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2.3 Block is unit of flash memory. Some of operations cannot be executed simultaneously at the same block (like execute code and write). MCU could have one or more flash blocks. If MCU has more than one block, we could execute code from one block and write into second block simultaneously. Example of MCU with more than one flash block is for example S12XEP100. Most of already released S12Z MCUS has just one Flash block. Therefore critical part of example code is executed from RAM. S12ZVC has two P-Flash blocks (block-0S and block-0N)&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2.4 Phrase — An aligned group of four 16-bit words within the P-Flash memory. Each phrase includes two sets of aligned double words with each set including 7 ECC bits for single bit fault correction and double bit fault detection within each double word. Phrase is minimum programming unit for P-Flash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Yes, correct. We will fill FCCOBIX register and appropriate number of FCCOBx registers. After that we trigger command start and wait for command finish (could be used also interrupt notification). Direct write to flash do not work – only write access is trough&amp;nbsp; FCCOBx registers. Into of FCCOBx registers we will store type of command, target address and data (if necessary for that command).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Yes, sectors are minimum units which could be erased. If we want change one bit in already programmed flash, we have to read whole sector, modify that data in RAM, erase sector and write it back by phrases. Sectors are aligned. So, if P-Flash sector is 512bytes, sectors will start at addresses with lower 9 bits equal to 0. For example 0xFD0000, 0xFD0200, 0xFD0400…0xFEFE00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.I created memory map in excel sheet for you. Please look at attachment.&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>Fri, 23 Oct 2015 11:46:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412759#M11139</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-10-23T11:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412760#M11140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am happy with your answers.But need more clarifications.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) with reference to 2.4 ,even if i have to program 40 kb i have to program by phrases isnt .Do i&amp;nbsp; need to take care of sectors?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)Sectors start with lower &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;9 bits equal to 0,How to calculate sectors with reference to the below mentioned flash address.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;3)With reference to your excel sheet.I found 2 flash memory ,I found in my datasheet as this &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;16Kx39&lt;/P&gt;&lt;P&gt;HardBlock-0S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;32Kx39&lt;/P&gt;&lt;P&gt;HardBlock-0N&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what this means ?Is it possible to erase one flash as well as programming in another flash.Please mention starting address and ending address of 2 flash blocks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) As my flash memory is mentioned as 0xFD_0000 – 0xFF_FFFF .is it possible to write programs through out these memory with out considering sectors as well as blocks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5)Please explain how to check boundaries of each phrases with ref to the code.Is that completely applicable to my controller series or do we need to modify ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//check if address is aligned (global address [2:0] = 000)&lt;/P&gt;&lt;P&gt;&amp;nbsp; if((address &amp;amp; 0x00000007) != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return MISALIGNED_ADDRESS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Oct 2015 15:39:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412760#M11140</guid>
      <dc:creator>sathishkannan</dc:creator>
      <dc:date>2015-10-23T15:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412761#M11141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sathish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Yes, you have to program by phrases. You have to take care about sectors when you want erase flash. Sector is smallest portion of flash which could be erased.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) For example&amp;nbsp; if((address &amp;amp; 0x000001FF) != 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Description in datasheet is related to physical hardware implementation of flash. For example HardBlock-0S consist 16384 (16K) lines of 39 bites (4bytes +7bit ECC checksum). It give us 65536 bytes (16384*4bytes, calculated without ECC) user accessible flash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to apologize for my confusing last answer. I tested S12ZVC on our board and we cannot simultaneously read code from one block and erase/program second block. It seems that it is because both blocks are still Block0 (0S and 0N) and their share some resources. So, only way is executing flash commands from RAM. From that point of view, hardware dividing into two blocks is irrelevant information and we have to work with P-flash as it is just one block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Yes, we accessing flash trough flash controller and only way how to program is by aligned phrases. This way we are automatically aligned also to sectors and&amp;nbsp; blocks boundaries. So, you could work with whole memory range 0xFD_0000 – 0xFF_FFFF as one memory block and&amp;nbsp; program trough aligned phrases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5)S12ZVL example tests whether phrase (8bytes, 4 words) is aligned or not. S12ZVC use the same flash phrase size, therefore you don’t need change that part of code.&lt;BR /&gt; Note: There is additionally check of that alignment on hardware side. Flash module will set FSTAT_ACCERR bit when we try to program unaligned phrase. See Table 22-41. Program P-Flash Command Error Handling.&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>Mon, 26 Oct 2015 09:59:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412761#M11141</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-10-26T09:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412762#M11142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I Tried your program with code warrior,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)I am not able to erase the memory location.I checked with the MGSTAT flags they are stays clear&amp;nbsp; so it indicates that blank check passed.(not reflecting in memory regions)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)I am able to write the FFCOB data registers,but how to check whether the data successfully written in flash memory ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)With reference to your code,in erase function if i am giving&amp;nbsp; address it has to erase memory of 512 bytes starting from that ,Is nt it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4)How to know the free memory in flash,Is it visible in code warrior debugger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) I found some points from other forum about the code warrior debugger.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; How do verify that flash contents doesn't change? If it's Codewarrior debugger, you should keep in mind that by default it caches flash and EEPROM contents and doesn't display actual flash contents, unless you make modifications to debugger memory map (in debugger go to Multtilink menu)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What this means ?&lt;/P&gt;&lt;P&gt;6) Guide me step by step procedure to check the memory regions in debugger.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Nov 2015 15:36:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412762#M11142</guid>
      <dc:creator>sathishkannan</dc:creator>
      <dc:date>2015-11-01T15:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412763#M11143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sathish,&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;Did you use code which I provided to you few replies above?&lt;/LI&gt;&lt;LI&gt;For example you could read that flash. See PFLASH_Read_Byte() function.&lt;/LI&gt;&lt;LI&gt;Yes&lt;/LI&gt;&lt;LI&gt;No, there isn’t such tool which directly told you occupancy of you flash (rather say, I do not know about such tool for S12Z). Please look at your map file and check amount of used flash and area where linker placed your code/data. In prm file are defined available areas for linker.&lt;/LI&gt;&lt;LI&gt;In fact, this note is related to CW5.1 or older – Classic IDE. CW10 - Eclipse IDE do not have such configuration of debugger memory map. So, you could simply use memory monitor in debugger for display any area for MCU memory map. Since programming takes some time and debugger refresh data when MCU halts, new changes in flash memory could be displayed with small delay (typically one step) during stepping over code.&lt;/LI&gt;&lt;LI&gt;Go to Debugger Memory Monitor window, click on “+” icon and fill target memory address in flash…&lt;/LI&gt;&lt;/OL&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>Mon, 02 Nov 2015 09:03:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412763#M11143</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-11-02T09:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412764#M11144</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;1) yes .i checked the erase function with memory regions where the memory locations are already flashed by application.Will it take time to reflect in debugger address map ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) If i use &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;PFLASH_Read_Byte() to read the memory locations I am not possible to get the data from locations where the locations are already programmed by application.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;5)Right now i am stepping the debugger to see the change in memory map.Do i need to do anything else to see the programmed memory region ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7)i am not moving my code to ram will it be a problem to erase and program flash memory ?If yes explain the reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Erasing a sector will set all its bits to 1. After erasing a sector, the FTMRZ can try to write data into it but this can’t be done&lt;/P&gt;&lt;P&gt;while executing code from Flash, since Flash can’t be read-from and written-to at the same time. To write to a Flash sector,&lt;/P&gt;&lt;P&gt;the application must be executing code from RAM"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What this means ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2015 10:16:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412764#M11144</guid>
      <dc:creator>sathishkannan</dc:creator>
      <dc:date>2015-11-02T10:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412765#M11145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sathish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)Yes, see Table K-2. NVM Timing Characteristics 32 MHz in RM. Erase P-Flash Sector takes 20ms. Also reading trough BDM interface takes some time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)That is strange. Could you please let me know which address you erase and try program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) no, that should be enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7) Yes, it is a problem. It is not possible to read from P-Flash memory while some commands are executing on the same P-Flash block. If a Flash block is read during execution of an algorithm (CCIF = 0) on that same block, the read operation may return invalid data resulting in an illegal access. So, there is high chance that CPU will execute something different instead of main code. Debugger will be confused and/or MCU could go into reset due to Illegal opcode or Illegal address.&lt;/P&gt;&lt;P&gt;CW10 typically reports that issue by opening new window with some numbers. Only way how to back synchronize debugger with MCU is trough MCU reset.&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>Mon, 02 Nov 2015 14:01:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412765#M11145</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-11-02T14:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412766#M11146</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;I tried to erase a memory location which contained flashed code.In that location i am not able to erase as well as program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to get the address from prm file can you explain with an example ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 15:52:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412766#M11146</guid>
      <dc:creator>sathishkannan</dc:creator>
      <dc:date>2015-11-05T15:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412767#M11147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sathish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prm file defines available RAM/EEPROM/Flash space for linker.&lt;/P&gt;&lt;P&gt;So, if we want use some part of flash for our data, we should exclude this part of flash from linker memory map otherwise we could meet with situation that we will rewrite our code – this typically means crash of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Default Flash range for S12ZVC is defined as:&lt;/P&gt;&lt;P&gt;ROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp; 0xFD0000 TO 0xFFFDFF;&lt;/P&gt;&lt;P&gt;Note: Range 0xFFFE00 to 0xFFFFFF is used for vectors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want use for example range 0xFE0000 to 0xFE7FFF (32kB) to storage our user data. In that case we should define Flash as:&lt;/P&gt;&lt;P&gt;ROM1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp; 0xFD0000 TO 0xFDFFFF;&lt;/P&gt;&lt;P&gt;ROM2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp; 0xFE0000 TO 0xFE7FFF;&lt;/P&gt;&lt;P&gt;ROM3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp; 0xFE8000 TO 0xFFFDFF;&lt;/P&gt;&lt;P&gt;And section “PLACEMENT” will contain:&lt;/P&gt;&lt;P&gt;…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFAULT_ROM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COPY&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; ROM1, ROM3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case, default code cannot be placed into ROM2 area since this area is not in default placement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we want store also some data (code or constants) into ROM2 area as part of our project, we could create our own segment in section “PLACEMENT”. For example:&lt;/P&gt;&lt;P style="text-indent: 36.0pt;"&gt;MY_DATA&amp;nbsp; INTO ROM2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In our C file we could place our data into this segment by pragmas. For example:&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG MY_DATA&lt;/P&gt;&lt;P&gt;const unsigned char test1 = 0xAA;&lt;/P&gt;&lt;P&gt;#pragma CONST_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: CONST_SEG pragmas are used for constants placement. CODE_SEG pragmas are used for code placement. DATA_SEG pragmas are used for variables placement.&lt;/P&gt;&lt;P&gt;Note: these pragmas are not limited by end of file, therefore I would like to strictly recommend return to default settings (#pragma xxxx_SEG DEFAULT) inside this file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way we could simply drive placement of code/constants/variables in MCU memory map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: If possible, I would like to recommend do not use direct placement like:&lt;/P&gt;&lt;P&gt;const unsigned char temp1 @0xFE0000 = 0xAA;&lt;/P&gt;&lt;P&gt;without exclude this area from linker memory map. Linker does not aware about that data in code placement and any overlapping just lead to warning message. Unfortunately default CW10.6 project has disabled these warnings due to 24bit register constructions in S12Z derivative header file.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Disabled overlapping warnings.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/26207i68E2FC2F6E223412/image-size/large?v=v2&amp;amp;px=999" role="button" title="Disabled overlapping warnings.png" alt="Disabled overlapping warnings.png" /&gt;&lt;/span&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>Fri, 06 Nov 2015 09:32:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412767#M11147</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-11-06T09:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412768#M11148</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;thanks alot for the explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain how to open and see the linker file from codewarrior for particular project.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 10:03:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412768#M11148</guid>
      <dc:creator>sathishkannan</dc:creator>
      <dc:date>2015-11-06T10:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412769#M11149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="CW10_6 prm file.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/25972i3D52AA607C8B94DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="CW10_6 prm file.png" alt="CW10_6 prm file.png" /&gt;&lt;/span&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>Fri, 06 Nov 2015 11:01:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412769#M11149</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-11-06T11:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412770#M11150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi My linker file is defined as below.I need to know the free address for writing data .How to edit this file ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* This is a linker parameter file for the MC9S12ZVC64 */&lt;/P&gt;&lt;P&gt;NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEGMENTS&amp;nbsp; /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Register space&amp;nbsp; */&lt;/P&gt;&lt;P&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp; IO_SEG&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = PAGED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x000000 TO&amp;nbsp;&amp;nbsp; 0x000FFF; intentionally not defined */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* RAM */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; = READ_WRITE&amp;nbsp; 0x001000 TO 0x001FFF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* EEPROM */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EEPROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0x100000 TO 0x1003FF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* non-paged FLASHs */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp; 0xFF0000 TO 0xFFFDFF;&lt;/P&gt;&lt;P&gt;/*&amp;nbsp;&amp;nbsp; VECTORS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xFFFE00 TO&amp;nbsp;&amp;nbsp; 0xFFFFFF; intentionally not defined: used for VECTOR commands below */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; //OSVECTORS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xFFFE10 TO&amp;nbsp;&amp;nbsp; 0xFFFFFF;&amp;nbsp;&amp;nbsp; /* OSEK interrupt vectors (use your vector.o) */&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _PRESTART,&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; /* Used in HIWARE format: jump to _Startup at the code start */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STARTUP,&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; /* startup data structures */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROM_VAR,&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; /* constant variables */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STRINGS,&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; /* string literals */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VIRTUAL_TABLE_SEGMENT,&amp;nbsp; /* C++ virtual table segment */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.ostext,&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; /* OSEK */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NON_BANKED,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* runtime routines which must not be banked */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFAULT_ROM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COPY&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; ROM;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.stackstart,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* eventually used for OSEK kernel awareness: Main-Stack Start */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSTACK,&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; /* allocate stack first to avoid overwriting variables on overflow */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.stackend,&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; /* eventually used for OSEK kernel awareness: Main-Stack End */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFAULT_RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO&amp;nbsp; RAM;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //.vectors&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; OSVECTORS; /* OSEK */&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENTRIES /* keep the following unreferenced variables */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* OSEK: always allocate the vector table and all dependent objects */&lt;/P&gt;&lt;P&gt;&amp;nbsp; //_vectab OsBuildNumber _OsOrtiStackStart _OsOrtiStart&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STACKSIZE 0x100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VECTOR 0 _Startup /* reset vector: this is the default entry point for a C/C++ application. */&lt;/P&gt;&lt;P&gt;//VECTOR 0 Entry&amp;nbsp; /* reset vector: this is the default entry point for an Assembly application. */&lt;/P&gt;&lt;P&gt;//INIT Entry&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* for assembly applications: that this is as well the initialization entry point */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 11:15:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412770#M11150</guid>
      <dc:creator>sathishkannan</dc:creator>
      <dc:date>2015-11-06T11:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412771#M11151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sathish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use procedure four posts above for modification in your prm file.&lt;/P&gt;&lt;P&gt;EEPROM or P-Flash (marked as ROM for linker) could be used for storage your data.&lt;/P&gt;&lt;P&gt;User data placement depends on your needs however I would like to recommend keeps user segments (which you plan to rewrite by code) aligned with sector size. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More details about linker and prm file could be found in file:&lt;/P&gt;&lt;P&gt;"c:\Freescale\CW MCU v10.6\MCU\Help\PDF\MCU_Build_Tools_Utilities.pdf" &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>Fri, 06 Nov 2015 12:54:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412771#M11151</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-11-06T12:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412772#M11152</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;Still not able to erase as well as write to flash memory .i shared my code please have a look at this with reference to .prm file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) i used pragmas for moving code in to ram .correct me if i am wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;///////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* RAM */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp; 0x001000 TO 0x001FFF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* EEPROM */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EEPROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp; 0x100000 TO 0x1003FF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* non-paged FLASHs */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp; 0xFF0000 TO 0xFFFDFF;&lt;/P&gt;&lt;P&gt;/*&amp;nbsp; VECTORS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xFFFE00 TO&amp;nbsp; 0xFFFFFF; intentionally not defined: used for VECTOR commands below */&lt;/P&gt;&lt;P&gt;&amp;nbsp; //OSVECTORS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_ONLY&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xFFFE10 TO&amp;nbsp; 0xFFFFFF;&amp;nbsp; /* OSEK interrupt vectors (use your vector.o) */&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _PRESTART,&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; /* Used in HIWARE format: jump to _Startup at the code start */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STARTUP,&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; /* startup data structures */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROM_VAR,&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; /* constant variables */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STRINGS,&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; /* string literals */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VIRTUAL_TABLE_SEGMENT,&amp;nbsp; /* C++ virtual table segment */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.ostext,&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; /* OSEK */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NON_BANKED,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* runtime routines which must not be banked */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFAULT_ROM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COPY&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; ROM;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.stackstart,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* eventually used for OSEK kernel awareness: Main-Stack Start */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSTACK,&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; /* allocate stack first to avoid overwriting variables on overflow */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.stackend,&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; /* eventually used for OSEK kernel awareness: Main-Stack End */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DEFAULT_RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTO&amp;nbsp; RAM;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;////////////////////////////////////////////////////////////////////////////////////&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2015 04:48:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412772#M11152</guid>
      <dc:creator>sathishkannan</dc:creator>
      <dc:date>2015-11-09T04:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412773#M11153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sathish,&lt;/P&gt;&lt;P&gt;I shortly checked your files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You didn’t use either Send_Command() or PFLASH_Send_Command() function from example code (from my first reply to this thread).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Send_Command() missing in your code and PFLASH_Send_Command() is commented out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of these functions has to be used for trigger flash command (by clearing CCIF flag).&lt;/P&gt;&lt;P&gt;You code just modify FCCOBx registers, but it never starts such flash command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use one of commands (PFLASH_Send_Command(); or asm JSR Send_Command;) in your LLD_FLS_Erase_Verify_Section(),LLD_FLS_Program() and LLD_FLS_Erase_Sector() functions.&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>Mon, 09 Nov 2015 07:07:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412773#M11153</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-11-09T07:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412774#M11154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Thanks alot for pointing out the mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I modified the flash program file as you said .If it has mistake correct me.Which is in bold colour.Why we are using that PFLASH_Send_Command(); function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do i need to change anything in main.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//////////////////////////////////////////////////////////&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include &amp;lt;hidef.h&amp;gt;&lt;/P&gt;&lt;P&gt;#include "lld_flash.h"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//or we can use linker pragmas for placing this function into RAM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG DEFAULT_RAM&lt;/P&gt;&lt;P&gt;void PFLASH_Send_Command(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; DisableInterrupts;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; FSTAT_CCIF = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //launch command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; while(FSTAT_CCIF == 0){}; //wait for done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; EnableInterrupts;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;&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; &lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;//LLD_FLS_Erase_Verify_Section&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;u8 LLD_FLS_Erase_Verify_Section(u32 address, u32 number_of_phrases)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; //check if address is aligned (global address [2:0] = 000)&lt;/P&gt;&lt;P&gt;&amp;nbsp; if((address &amp;amp; 0x00000007) != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return MISALIGNED_ADDRESS; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; while(FSTAT_CCIF == 0){};&amp;nbsp;&amp;nbsp; //wait if command in progress&lt;/P&gt;&lt;P&gt;&amp;nbsp; FSTAT = 0x30;&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; //clear ACCERR and PVIOL&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOBIX = 0x02;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //we will write command up to FCCOB2&lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB0HI = 0x03;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB0LO = ((address &amp;amp; 0x00FF0000)&amp;gt;&amp;gt;16);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB1 = (address &amp;amp; 0x0000FFFF);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB2 = number_of_phrases;&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;STRONG&gt;PFLASH_Send_Command();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if((FSTAT &amp;amp; (FSTAT_ACCERR_MASK | FSTAT_FPVIOL_MASK)) != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ACCESS_ERROR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; //check if phrases are erased and return result&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(FSTAT_MGSTAT != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return NON_ERASED;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ERASED;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;//LLD_FLS_Program&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;u8 LLD_FLS_Program(u32 address, u8 *ptr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; u8 i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; //check if address is aligned (global address [2:0] != 000)&lt;/P&gt;&lt;P&gt;&amp;nbsp; if((address &amp;amp; 0x00000007) != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return MISALIGNED_ADDRESS; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; //check if the phrase is erased&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; if((LLD_FLS_Erase_Verify_Section(address, 1)) == NON_ERASED)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return NON_ERASED;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; while(FSTAT_CCIF == 0){};&amp;nbsp;&amp;nbsp; //wait if command in progress&lt;/P&gt;&lt;P&gt;&amp;nbsp; FSTAT = 0x30;&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; //clear ACCERR and PVIOL&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOBIX = 0x05;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //we will write command up to FCCOB5&lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB0HI = 0x06;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB0LO = ((address &amp;amp; 0x00FF0000)&amp;gt;&amp;gt;16);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB1 = (address &amp;amp; 0x0000FFFF);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB2 = ptr[0];&lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB3 = ptr[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB4 = ptr[2];&lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB5 = ptr[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PFLASH_Send_Command();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if((FSTAT &amp;amp; (FSTAT_ACCERR_MASK | FSTAT_FPVIOL_MASK)) != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ACCESS_ERROR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return OK;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;//LLD_FLS_Erase_Sector&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;u8 LLD_FLS_Erase_Sector(u32 address)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; //size of sector is 512B&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; //check if address is aligned (global address [2:0] != 000)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; if((address &amp;amp; 0x00000007) != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return MISALIGNED_ADDRESS; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; while(FSTAT_CCIF == 0){};&amp;nbsp;&amp;nbsp; //wait if command in progress&lt;/P&gt;&lt;P&gt;&amp;nbsp; FSTAT = 0x30;&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; //clear ACCERR and PVIOL&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOBIX = 0x01;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //we will write command up to FCCOB1&lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB0HI = 0x0A;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB0LO = ((address &amp;amp; 0x00FF0000)&amp;gt;&amp;gt;16);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FCCOB1 = (address &amp;amp; 0x0000FFFF);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PFLASH_Send_Command();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; if((FSTAT &amp;amp; (FSTAT_ACCERR_MASK | FSTAT_FPVIOL_MASK)) != 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ACCESS_ERROR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return OK;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;//LLD_FLS_Read_Byte&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;u8 LLD_FLS_Read_Byte(u32 address)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; u8 data8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data8 = *(u8 *)address;&lt;/P&gt;&lt;P&gt;&amp;nbsp; return data8;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;//LLD_FLS_Read_Word&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;u32 LLD_FLS_Read_Word(u32 address)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; u32 data16;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; data16 = *(u32 *)address;&lt;/P&gt;&lt;P&gt;&amp;nbsp; return data16;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;//LLD_FLS_Init&lt;/P&gt;&lt;P&gt;//==============================================================================&lt;/P&gt;&lt;P&gt;void LLD_FLS_Init(u8 fdiv)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(FSTAT_CCIF == 0){};&amp;nbsp;&amp;nbsp; //wait if command in progress&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; FCLKDIV = fdiv;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //osc = ? MHz&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2015 07:45:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412774#M11154</guid>
      <dc:creator>sathishkannan</dc:creator>
      <dc:date>2015-11-09T07:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure and write code for flash module in MC9S12ZVCRMV1 controller.How to configure protection register and FCCOB register.It will be great if i get a sample code for flash and eeprom.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412775#M11155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sathish,&lt;/P&gt;&lt;P&gt;I am sorry, but I didn’t check your main code.&lt;/P&gt;&lt;P&gt;Please delete these lines in main():&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG DEFAULT_RAM&lt;/P&gt;&lt;P&gt;&amp;nbsp; DisableInterrupts;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FSTAT_CCIF = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //launch command&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(FSTAT_CCIF == 0){}; //wait for done&lt;/P&gt;&lt;P&gt;&amp;nbsp; EnableInterrupts;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;They have no sense here since we didn’t configure FCCOBx registers before that code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This part of code is called as PFLASH_Send_Command().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We cannot execute code flash block which we currently erase/program. Therefore we just configure flash command, jump to code in RAM (PFLASH_Send_Command()) and start execution of flash command from there. We also waits until flash command finish and return back to code in flash.&lt;/P&gt;&lt;P&gt;Since default vector table and interrupt routines are stored in the same flash block, we should also disable interrupts during execution of flash command. If time critical interrupts has to be executed during flash command, we have to also move vector table and interrupt routines into RAM (in that case we will not disable interrupt during flash command execution).&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>Mon, 09 Nov 2015 10:12:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-configure-and-write-code-for-flash-module-in/m-p/412775#M11155</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-11-09T10:12:05Z</dc:date>
    </item>
  </channel>
</rss>

