<?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>MPC5xxxのトピックRe: MPC5646C</title>
    <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230365#M63</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;not sure what's wrong. You can try this piece of code that works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* unlock all blocks in bank 0 (0x0000_0000 - 0x0017_FFFF) */&lt;/P&gt;&lt;P&gt;&amp;nbsp; CFLASH_0.LML.R = 0xA1A11111; /* write password */&lt;/P&gt;&lt;P&gt;&amp;nbsp; CFLASH_0.LML.R = 0x00100000; /* unlock low and mid blocks primary */&lt;/P&gt;&lt;P&gt;&amp;nbsp; CFLASH_0.SLL.R = 0xC3C33333; /* write password */&lt;/P&gt;&lt;P&gt;&amp;nbsp; CFLASH_0.SLL.R = 0x00100000; /* unlock low and mid blocks secondary */&lt;/P&gt;&lt;P&gt; CFLASH_0.HBL.R = 0xB2B22222; /* write password */&lt;/P&gt;&lt;P&gt; CFLASH_0.HBL.R = 0x00000000;&amp;nbsp; /* unlock high blocks */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /* erase block B0F3 (0x0001_0000 - 0x0001_7FFF) */&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.ERS = 1;&lt;/P&gt;&lt;P&gt; CFLASH_0.LMS.R = 0x00000008; /* select B0F3 */&lt;/P&gt;&lt;P&gt; *(unsigned int *)0x00010000 = 0xFFFFFFFF; /* interlock write - write to any address in selected memory */&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.EHV = 1;&lt;/P&gt;&lt;P&gt; while(CFLASH_0.MCR.B.DONE == 0);&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.EHV = 0;&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.ERS = 0; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /* program double word to B0F3 */&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.PGM = 1;&amp;nbsp; &lt;/P&gt;&lt;P&gt; *(unsigned int *)0x00010000 = 0xAABBCCDD; /* interlock write */&lt;/P&gt;&lt;P&gt; *(unsigned int *)0x00010004 = 0x11223344; /* program data write */ &lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.EHV = 1;&lt;/P&gt;&lt;P&gt; while(CFLASH_0.MCR.B.DONE == 0);&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.EHV = 0;&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.PGM = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is for bank 0. If you want to program other banks, follow exactly the same procedure. The only difference is that you will use CFLASH_1 and DFLASH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next option is to use SSD flash drivers. These are for MPC5646C:&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/soft_dev_tools/software/device_drivers/MPC56XX_C90LC_JDP_SSD_100_DEVD.exe?fpsp=1&amp;amp;WT_TYPE=Device"&gt;http://www.freescale.com/files/soft_dev_tools/software/device_drivers/MPC56XX_C90LC_JDP_SSD_100_DEVD.exe&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 May 2013 07:54:25 GMT</pubDate>
    <dc:creator>lukaszadrapa</dc:creator>
    <dc:date>2013-05-10T07:54:25Z</dc:date>
    <item>
      <title>MPC5646C</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230362#M60</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what steps needs to be taken to execute a function from RAM for MPC5646C micro ?&lt;/P&gt;&lt;P&gt;Or.. points to a document that explains how to do it.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would really appreciate any help.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2013 12:51:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230362#M60</guid>
      <dc:creator>mikibart</dc:creator>
      <dc:date>2013-05-08T12:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5646C</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230363#M61</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;attached you will find sample code. See main.c and linker file. It was written for MPC5607B but the principle is the same for all MPC5xxx.&lt;/P&gt;&lt;P&gt;Lukas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 04:48:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230363#M61</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2013-05-09T04:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5646C</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230364#M62</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lukas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thank you for your quick response.&lt;/P&gt;&lt;P&gt;I think you could help with some other issues too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the thing. I am trying to run two functions in RAM (one that erases Flash and one that programs Flash memory). Before I run those two functions I run unlock function, then erase, and finally program. After I did that I try to verify the content of the flash memory that was supposed to be programmed and it is NOT programmed - the content is&lt;BR /&gt;still 0xFFFFFFFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea what might be the issue here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 15:08:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230364#M62</guid>
      <dc:creator>mikibart</dc:creator>
      <dc:date>2013-05-09T15:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5646C</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230365#M63</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;not sure what's wrong. You can try this piece of code that works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* unlock all blocks in bank 0 (0x0000_0000 - 0x0017_FFFF) */&lt;/P&gt;&lt;P&gt;&amp;nbsp; CFLASH_0.LML.R = 0xA1A11111; /* write password */&lt;/P&gt;&lt;P&gt;&amp;nbsp; CFLASH_0.LML.R = 0x00100000; /* unlock low and mid blocks primary */&lt;/P&gt;&lt;P&gt;&amp;nbsp; CFLASH_0.SLL.R = 0xC3C33333; /* write password */&lt;/P&gt;&lt;P&gt;&amp;nbsp; CFLASH_0.SLL.R = 0x00100000; /* unlock low and mid blocks secondary */&lt;/P&gt;&lt;P&gt; CFLASH_0.HBL.R = 0xB2B22222; /* write password */&lt;/P&gt;&lt;P&gt; CFLASH_0.HBL.R = 0x00000000;&amp;nbsp; /* unlock high blocks */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /* erase block B0F3 (0x0001_0000 - 0x0001_7FFF) */&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.ERS = 1;&lt;/P&gt;&lt;P&gt; CFLASH_0.LMS.R = 0x00000008; /* select B0F3 */&lt;/P&gt;&lt;P&gt; *(unsigned int *)0x00010000 = 0xFFFFFFFF; /* interlock write - write to any address in selected memory */&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.EHV = 1;&lt;/P&gt;&lt;P&gt; while(CFLASH_0.MCR.B.DONE == 0);&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.EHV = 0;&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.ERS = 0; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /* program double word to B0F3 */&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.PGM = 1;&amp;nbsp; &lt;/P&gt;&lt;P&gt; *(unsigned int *)0x00010000 = 0xAABBCCDD; /* interlock write */&lt;/P&gt;&lt;P&gt; *(unsigned int *)0x00010004 = 0x11223344; /* program data write */ &lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.EHV = 1;&lt;/P&gt;&lt;P&gt; while(CFLASH_0.MCR.B.DONE == 0);&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.EHV = 0;&lt;/P&gt;&lt;P&gt; CFLASH_0.MCR.B.PGM = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is for bank 0. If you want to program other banks, follow exactly the same procedure. The only difference is that you will use CFLASH_1 and DFLASH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next option is to use SSD flash drivers. These are for MPC5646C:&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/soft_dev_tools/software/device_drivers/MPC56XX_C90LC_JDP_SSD_100_DEVD.exe?fpsp=1&amp;amp;WT_TYPE=Device"&gt;http://www.freescale.com/files/soft_dev_tools/software/device_drivers/MPC56XX_C90LC_JDP_SSD_100_DEVD.exe&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 07:54:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230365#M63</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2013-05-10T07:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5646C</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230366#M64</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lukas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thank you for your quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is resolved !&lt;/P&gt;&lt;P&gt;Basically, everything worked fine from the beginning except when I&lt;BR /&gt;downloaded a new application program the debugger erases complete flash memory –&lt;BR /&gt;so I couldn’t verify that I programmed the flash memory correctly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 May 2013 14:42:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230366#M64</guid>
      <dc:creator>mikibart</dc:creator>
      <dc:date>2013-05-12T14:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5646C</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230367#M65</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to put some data in the data flash of my uC and I tried the above program. After this program I wrote the following lines and checked values of a1-8.&lt;/P&gt;&lt;P&gt;But, the value of all a1-8 comes 0xFF. Is there any other way to read the DFLASH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a1=*(unsigned int *)(0x00010000);&lt;/P&gt;&lt;P&gt;a2=*(unsigned int *)(0x00010001);&lt;/P&gt;&lt;P&gt;a3=*(unsigned int *)(0x00010002);&lt;/P&gt;&lt;P&gt;a4=*(unsigned int *)(0x00010003);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a5=*(unsigned int *)(0x00010004);&lt;/P&gt;&lt;P&gt;a6=*(unsigned int *)(0x00010005);&lt;/P&gt;&lt;P&gt;a7=*(unsigned int *)(0x00010006);&lt;/P&gt;&lt;P&gt;a8=*(unsigned int *)(0x00010007);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2014 17:10:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230367#M65</guid>
      <dc:creator>jatinarora</dc:creator>
      <dc:date>2014-04-30T17:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5646C</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230368#M66</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also checked the address through memory window, it shows 0xFF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my complete program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include "MPC5604B_M27V.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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void initPeriClkGen(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; CGM.SC_DC[0].R = 0x80;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CGM.SC_DC[2].R = 0x80;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void initModesAndClock(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; ME.MER.R = 0x0000001D;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; CGM.FMPLL_CR.R = 0x02400100;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; ME.RUN[0].R = 0x001F0074;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; ME.RUNPC[1].R = 0x00000010;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ME.PCTL[68].R = 0x01;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ME.MCTL.R = 0x40005AF0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; ME.MCTL.R = 0x4000A50F;&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;&amp;nbsp; while (ME.GS.B.S_MTRANS) {}&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; while(ME.GS.B.S_CURRENTMODE != 4) {}&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;void disableWatchdog(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; SWT.SR.R = 0x0000c520;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; SWT.SR.R = 0x0000d928; &lt;/P&gt;&lt;P&gt;&amp;nbsp; SWT.CR.R = 0x8000010A;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;&lt;/P&gt;&lt;P&gt;int main(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; volatile int i = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t a1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t a2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t a3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t a4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t a5;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t a6;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t a7;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t a8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; initPeriClkGen();&lt;/P&gt;&lt;P&gt;&amp;nbsp; initPeriClkGen();&lt;/P&gt;&lt;P&gt;&amp;nbsp; disableWatchdog();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DFLASH.LML.R = 0xA1A11111; // write password &lt;/P&gt;&lt;P&gt;DFLASH.LML.R = 0x00100000; // unlock low and mid blocks primary &lt;/P&gt;&lt;P&gt;DFLASH.SLL.R = 0xC3C33333; // write password &lt;/P&gt;&lt;P&gt;DFLASH.SLL.R = 0x00100000; // unlock low and mid blocks secondary &lt;/P&gt;&lt;P&gt;DFLASH.HBL.R = 0xB2B22222; // write password &lt;/P&gt;&lt;P&gt;DFLASH.HBL.R = 0x00000000; // unlock high blocks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// erase block B0F3 (0x00010000 - 0x00017FFF) &lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.ERS = 1;&lt;/P&gt;&lt;P&gt;DFLASH.LMS.R = 0x00000008; /* select B0F3 */&lt;/P&gt;&lt;P&gt;*(unsigned int *)0x00010000 = 0xFFFFFFFF; /* interlock write - write to any address in selected memory */&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.EHV = 1;&lt;/P&gt;&lt;P&gt;while(DFLASH.MCR.B.DONE != 1){}&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.EHV = 0;&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.ERS = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* program double word to B0F3 */&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.PGM = 1; &lt;/P&gt;&lt;P&gt;*(unsigned int *)0x00010000 = 0xAABBCCDD; /* interlock write */&lt;/P&gt;&lt;P&gt;*(unsigned int *)0x00010004 = 0x11223344; /* program data write */&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.EHV = 1;&lt;/P&gt;&lt;P&gt;while(DFLASH.MCR.B.DONE != 1){}&lt;/P&gt;&lt;P&gt;if(DFLASH.MCR.B.PEG==1) // check if PEG in MCR is 1&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;i=1;&lt;/P&gt;&lt;P&gt;//switch ON Led&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.EHV = 0;&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.PGM = 0; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a1=*(unsigned int *)(0x00010000);&lt;/P&gt;&lt;P&gt;a2=*(unsigned int *)(0x00010001);&lt;/P&gt;&lt;P&gt;a3=*(unsigned int *)(0x00010002);&lt;/P&gt;&lt;P&gt;a4=*(unsigned int *)(0x00010003);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a5=*(unsigned int *)(0x00010004);&lt;/P&gt;&lt;P&gt;a6=*(unsigned int *)(0x00010005);&lt;/P&gt;&lt;P&gt;a7=*(unsigned int *)(0x00010006);&lt;/P&gt;&lt;P&gt;a8=*(unsigned int *)(0x00010007);&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;while(1) {}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2014 18:06:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230368#M66</guid>
      <dc:creator>jatinarora</dc:creator>
      <dc:date>2014-04-30T18:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5646C</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230369#M67</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;two things:&lt;/P&gt;&lt;P&gt;1. There are two flash blocks on MPC5604B. CFLASH and DFLASH. Address range of CFLASH is 0x0000_0000 - 0x0007_FFFF, address range of DFLASH is 0x0080_0000 - 0x0080_3FFF. These flash blocks are independent and both have own set of registers. &lt;/P&gt;&lt;P&gt;I can see that you are trying to program the addresses around 0x0001_0000 which belongs to CFLASH but you are using DFLASH registers. This will not work, of course, you have to use CFLASH registers. &lt;/P&gt;&lt;P&gt;2. Notice that Read-While-Write is supported only between banks. So, it is not possible to access the CFLASH while it is being erased/programmed. It is necessary to execute the code from RAM or from DFLASH.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lukas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 06:18:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230369#M67</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2014-05-02T06:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5646C</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230370#M68</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lukas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx for reply, I have figured out the issue.&lt;/P&gt;&lt;P&gt;Now I am trying to save some data (acquired from sensors) in DFLASH using the following program. (the&amp;nbsp; main calls the program &lt;STRONG&gt;void writesamplestoflash (void)&lt;/STRONG&gt; at regular intervals)&lt;/P&gt;&lt;P&gt;I am successful at saving same data to the memory but I am facing a small problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I see the memory (dflash) through memory window in debugger, some locations appear as &lt;STRONG&gt;XX&lt;/STRONG&gt; and also I am not able to read the data at these locations.&lt;/P&gt;&lt;P&gt;I have also attached an image of memory window from debugger.&lt;/P&gt;&lt;P&gt;Can you tell me the reason for this. Also tell me if I can save data in some better way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*initially I kept a as 0x0080C000 ( the starting address of block B0F3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void writesamplestoflash (void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;DFLASH.MCR.B.PGM = 1; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;*(unsigned int *)(a) = ADC_data[0]; // interlock write&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*(unsigned int *)(a+4) =ADC_data[1] ;&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.EHV = 1;&lt;/P&gt;&lt;P&gt;while(DFLASH.MCR.B.DONE != 1){}&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.EHV = 0;&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.PGM = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;DFLASH.MCR.B.PGM = 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;*(unsigned int *)(a+8) = period;&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.EHV = 1;&lt;/P&gt;&lt;P&gt;while(DFLASH.MCR.B.DONE != 1){}&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.EHV = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;*(unsigned int *)(a+12) = period_measured;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.EHV = 1;&lt;/P&gt;&lt;P&gt;while(DFLASH.MCR.B.DONE != 1){}&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.EHV = 0;&lt;/P&gt;&lt;P&gt;DFLASH.MCR.B.PGM = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a=a+16;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="memory window.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/43684iF73E89C2F48CFB00/image-size/large?v=v2&amp;amp;px=999" role="button" title="memory window.jpg" alt="memory window.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 May 2014 12:20:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230370#M68</guid>
      <dc:creator>jatinarora</dc:creator>
      <dc:date>2014-05-03T12:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5646C</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230371#M69</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;"XX" in PEmicro debugger means that there are bus errors - in this case ECC errors.&lt;/P&gt;&lt;P&gt;Copied from reference manual:&lt;/P&gt;&lt;P&gt;"ECC is handled on a 64-bit boundary. Thus, if only one word in any given 64-bit ECC segment is&lt;/P&gt;&lt;P&gt;programmed, the adjoining word (in that segment) should not be programmed since ECC calculation has&lt;/P&gt;&lt;P&gt;already completed for that 64-bit segment. Attempts to program the adjoining word will probably result in&lt;/P&gt;&lt;P&gt;an operation failure. It is recommended that all programming operations be of 64 bits. The programming&lt;/P&gt;&lt;P&gt;operation should completely fill selected ECC segments within the Double Word.&lt;/P&gt;&lt;P&gt;Programming changes the value stored in an array bit from logic 1 to logic 0 only. Programming cannot&lt;/P&gt;&lt;P&gt;change a stored logic 0 to a logic 1."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if you want to change any double word that is already programmed, it is necessary to erase whole block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Lukas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 08:17:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5646C/m-p/230371#M69</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2014-05-05T08:17:00Z</dc:date>
    </item>
  </channel>
</rss>

