<?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>8-bit Microcontrollers中的主题 Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227252#M19349</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it was previously in the code,&lt;/P&gt;&lt;P&gt;if you are using the wdog:&lt;/P&gt;&lt;P&gt;be sure its period is long enough for flashing operation and&lt;/P&gt;&lt;P&gt;do wdog servicing just prior to flash operation launching&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Sep 2013 11:17:49 GMT</pubDate>
    <dc:creator>pavel_sadek</dc:creator>
    <dc:date>2013-09-05T11:17:49Z</dc:date>
    <item>
      <title>Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227232#M19329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the examples from AN4570. The example "EEPROM_ProgramUpto4Bytes". I am writing to location 0x3100 and the data is visible when using the "Memory Monitor" but when the chip is reset the data goes back to 0xFF.&amp;nbsp; I am erasing before writing and the functions are returning success. I am assuming that the BUSCLK is the 4MHz crystal that is clocking the chip (the datasheet is vague about this) so I have set FCLKDIV to 0x03 (3.6 to 4.6MHz). Any ideas on what I'm doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 19:42:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227232#M19329</guid>
      <dc:creator>gregoryberardi</dc:creator>
      <dc:date>2013-07-26T19:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227233#M19330</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 align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;Before command write sequence, NVM_FCLKDIV should be written to configure the flash clock to be between 0.8 and 1MHz.&lt;/P&gt;&lt;P align="left"&gt;be sure you are running the routine from RAM.&lt;/P&gt;&lt;P align="left"&gt;&lt;/P&gt;&lt;P align="left"&gt;Pavel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jul 2013 09:48:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227233#M19330</guid>
      <dc:creator>pavel_sadek</dc:creator>
      <dc:date>2013-07-28T09:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227234#M19331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gregory,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;was this helpful? Please let us know :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Monica.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Aug 2013 01:24:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227234#M19331</guid>
      <dc:creator>Monica</dc:creator>
      <dc:date>2013-08-07T01:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227235#M19332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have not been able to try running from ram but I believe that was my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Aug 2013 13:16:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227235#M19332</guid>
      <dc:creator>gregoryberardi</dc:creator>
      <dc:date>2013-08-07T13:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227236#M19333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been trying to run the code in ram but have run into a problem. When I uncomment the lines that copy flash to ram, the debugger fails to launch. I get the error shown in the attached image (EEPROM_ERROR_DEBUG.png).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attaching the project that is giving me the issues. The copy lines are in the file hal_eeprom_init.c. Lines 58 and 60.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The chip that I'm running this on is a MC9S08PA4. There is only 512 bytes of ram. The two functions (erase and write) are a total of 204 bytes. I am left with a very small amount of RAM. Could I use the same ram space and copy the functions in as I need them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 16:28:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227236#M19333</guid>
      <dc:creator>gregoryberardi</dc:creator>
      <dc:date>2013-08-13T16:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227237#M19334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to just have the code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp; NVM_FSTAT = 0x80;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp; while (!(NVM_FSTAT &amp;amp; NVM_FSTAT_CCIF_MASK));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run in ram rather than the complete functions? This seems to be the only time that the eeprom is accessed and it would help me with my memory constraints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 18:19:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227237#M19334</guid>
      <dc:creator>gregoryberardi</dc:creator>
      <dc:date>2013-08-13T18:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227238#M19335</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;you can use just this fragment in RAM&lt;/P&gt;&lt;P&gt;be sure interrupts are disabled during this operation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 07:34:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227238#M19335</guid>
      <dc:creator>pavel_sadek</dc:creator>
      <dc:date>2013-08-14T07:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227239#M19336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have used just that small bit of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 11.818181991577148px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;EM style="font-size: 10pt; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp; NVM_FSTAT = 0x80;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 11.818181991577148px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;EM style="font-size: 10pt; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp; while (!(NVM_FSTAT &amp;amp; NVM_FSTAT_CCIF_MASK));&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 11.818181991577148px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;EM style="font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 11.818181991577148px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;EM style="font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;and loaded it into an array that I call from the erase and write routines and it is still not writing the eeprom (I still see the values there when I write but when I power cycle it, the values are not retained).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I am having problems with the debugger (&lt;A _jive_internal="true" href="https://community.nxp.com/thread/310757"&gt;https://community.freescale.com/thread/310757&lt;/A&gt;). This kind of issue keeps coming up. While I'm working on this code it will go off and say that it can't show the disassembly for the current instruction. Sometimes it just completely loses connection to the micro and needs to be started again. Any idea why I can't write the eeprom and why the debugger is doing this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 20:07:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227239#M19336</guid>
      <dc:creator>gregoryberardi</dc:creator>
      <dc:date>2013-08-14T20:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227240#M19337</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 have ran your code on my PT60 TWR board - it is failing in hal_clk_init function,&lt;/P&gt;&lt;P&gt;I have excluded&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;// ICS_OSCSC_OSCOS= 0x01; // Output Select (1 Oscillator clock source is selected)&lt;/P&gt;&lt;P&gt;// while (ICS_OSCSC_OSCINIT == 0); /* waiting until oscillator is ready */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and flashed those 4 bytes into EEPROM space 0x3100&lt;/P&gt;&lt;P&gt;then I did a POR (I have disconnected the board completely to be sure)&lt;/P&gt;&lt;P&gt;and launched the code again with breakpoint at the beginning of main&lt;/P&gt;&lt;P&gt;the content of EEPROM is correct&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="VýstřižekFlash.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/40438iD648CCF00C500AA0/image-size/large?v=v2&amp;amp;px=999" role="button" title="VýstřižekFlash.PNG" alt="VýstřižekFlash.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;this ICS setup seems to be the source of an issue of your debugger too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will help&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2013 12:26:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227240#M19337</guid>
      <dc:creator>pavel_sadek</dc:creator>
      <dc:date>2013-08-15T12:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227241#M19338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did comment out those two lines but my experience was very different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Debug with no breakpoints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I get;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="TestEEPROM_0xFFFF.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/40447i93B7BFA74AE1AB67/image-size/large?v=v2&amp;amp;px=999" role="button" title="TestEEPROM_0xFFFF.png" alt="TestEEPROM_0xFFFF.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I step into ~7 times and then I get&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="TestEEPROM_LostCommunication.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/40448i6A62E99FED7CA65D/image-size/large?v=v2&amp;amp;px=999" role="button" title="TestEEPROM_LostCommunication.png" alt="TestEEPROM_LostCommunication.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is essentially the same as before. The only difference is that if I put a breakpoint on the line after the eeprom_init the debugger never reaches the breakpoint (same error as before) when I have those lines commented out. With those lines the debugger does reach the breakpoint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the debug circuit on the board I am using.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ResetCircuitS08.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/40449i6B69E40F0A14A965/image-size/large?v=v2&amp;amp;px=999" role="button" title="ResetCircuitS08.png" alt="ResetCircuitS08.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The datasheet does not have any pull-ups or a capacitor. Could this be the source of the debugging issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2013 14:52:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227241#M19338</guid>
      <dc:creator>gregoryberardi</dc:creator>
      <dc:date>2013-08-15T14:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227242#M19339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well, Reset is connected according ref manual fig. 2.5, that is correct. BKGD/MS pin pullup is not recomended anywhere however it has internal one, so the additional pullup hooked externally should not cause any issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would point you to errata document, it is available on S08P product summary page, there are 2 for different masks of PA4, so choose the correct one.&lt;/P&gt;&lt;P&gt;there are few issues and their workarounds&amp;nbsp; for Flash and Debugging mentioned&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the raw code of yours works, this is proved by my last trial, so issue might be with missing workaround for your exact device (mask)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not have any PA4 device here to check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 08:52:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227242#M19339</guid>
      <dc:creator>pavel_sadek</dc:creator>
      <dc:date>2013-08-16T08:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227243#M19340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pavel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked at the errata here (This is an N36F mask)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/errata/S08PA4_0N36F.pdf?fpsp=1&amp;amp;WT_TYPE=Errata&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation" title="http://cache.freescale.com/files/microcontrollers/doc/errata/S08PA4_0N36F.pdf?fpsp=1&amp;amp;WT_TYPE=Errata&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation"&gt;http://cache.freescale.com/files/microcontrollers/doc/errata/S08PA4_0N36F.pdf?fpsp=1&amp;amp;WT_TYPE=Errata&amp;amp;WT_VENDOR=FREESCALE&amp;amp;…&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't see where any of the issues are germane to what I am seeing? The flash issues (NVM) are related to the EEPROM?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 14:36:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227243#M19340</guid>
      <dc:creator>gregoryberardi</dc:creator>
      <dc:date>2013-08-16T14:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227244#M19341</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;yes - EEPROM is non volatile memory, there are 2 errata to check.&lt;/P&gt;&lt;P&gt;your code works correctly with PT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why is reset tied to 4V instead of 5V?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2013 08:28:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227244#M19341</guid>
      <dc:creator>pavel_sadek</dc:creator>
      <dc:date>2013-08-19T08:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227245#M19342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again Pavel,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;What I mean is that, when you actually read the errata, all it talks about is protected "Flash". There is no indication that it affects EEPROM. Is EEPROM protected or partially protected? I never read anything, the second time I read it, that says that EEPROM is an issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I didn't see that 4V when I posted it. I can assure you that this board is not wired that way.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thank you for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2013 16:55:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227245#M19342</guid>
      <dc:creator>gregoryberardi</dc:creator>
      <dc:date>2013-08-19T16:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227246#M19343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gregory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the EEEPROM has its protection too, it is stated on page 66 - 68 of reference manual, so it can be protected (or just partially protected - 32 / 64/ 96 or 128 bytes of size)&lt;/P&gt;&lt;P&gt;the workaround guides to use unprotected device&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this errata / workaround does not apply to PT60, so you can test it on your PT60 twr board (same as I did successfully few days ago), that is why I feel this errata as a suspect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 09:34:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227246#M19343</guid>
      <dc:creator>pavel_sadek</dc:creator>
      <dc:date>2013-08-23T09:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227247#M19344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I also ran this code on myPA4TWR board -&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;then,I also close the watchdog&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;when I debug,it also show&amp;nbsp; NO source available for"0x0000(0x0000)()"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 06:06:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227247#M19344</guid>
      <dc:creator>zbeehu</dc:creator>
      <dc:date>2013-08-28T06:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227248#M19345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gregory, Hu,&lt;/P&gt;&lt;P&gt;I have ordered PA4 sample to check your issue, I will be back soon with new reply&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 09:39:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227248#M19345</guid>
      <dc:creator>pavel_sadek</dc:creator>
      <dc:date>2013-08-28T09:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227249#M19346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pavel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 14:15:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227249#M19346</guid>
      <dc:creator>gregoryberardi</dc:creator>
      <dc:date>2013-08-28T14:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227250#M19347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gregory,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have wired the sample with BDM and power source - looks ugly however works.&lt;/P&gt;&lt;P&gt;now I have loaded your latest code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as I do not have anything hooked to the mcu, I had to replace your clock init whth&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;//hal_clk_init();&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left"&gt;ICS_C3 = *(&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;STRONG&gt;unsigned&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;STRONG&gt;char&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;*)0xFF6FU; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;//ICS trim&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ICS_C2 &amp;amp;= (&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;STRONG&gt;unsigned&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;STRONG&gt;char&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)(~ ICS_C2_BDIV_MASK); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have disabled the wdog, your code was missing the wdog unlock sequence which is not correct&lt;/P&gt;&lt;P&gt;WDOG_CNT = 0xC520; &lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;// write the 1st unlock word&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;WDOG_CNT = 0xD928; &lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;// write the 2nd unlock word&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;WDOG_CS1 = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am calling the eeprom functions from the main loop controled by global variable "operation" that I have made for this purpose.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;hal_eeprom_write_4_bytes works ok on my side&lt;/P&gt;&lt;P&gt;hal_eeprom_erase_4_bytes is erasing only first sector (two bytes), you need to exclude the alignment control that you have placed there and erase in sequence both sectors&amp;nbsp; that belongs to memory space (4 bytes) you want to erase - take a look into AN at page 6; segmantation is sector or whole block...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="VýstřižekFlash.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/39114iA05772182D8BE630/image-size/large?v=v2&amp;amp;px=999" role="button" title="VýstřižekFlash.PNG" alt="VýstřižekFlash.PNG" /&gt;&lt;/span&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;I have tested the debugger for freezing, I have noticed it occurs when fast toggling between run and stop, it might be due to propagation delays in eclipse (I have quite fast PC so it is not so obvious here for the first sight), however there were no freezes when stepping (F5/F6) at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also enabled the EEPROM preservation to exclude eeprom overwriting when debug session toggling (it is in propoerties of Multilink connection).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so as a conclusion - I think your issue was the watchdog, then you need to update the erase function and it might be ok&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pavel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 08:45:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227250#M19347</guid>
      <dc:creator>pavel_sadek</dc:creator>
      <dc:date>2013-09-05T08:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Writing EEPROM does not appear to be persistent when using example AN4570. MC9SO8PA4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227251#M19348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It must close the watchdog?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 08:56:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Writing-EEPROM-does-not-appear-to-be-persistent-when-using/m-p/227251#M19348</guid>
      <dc:creator>zbeehu</dc:creator>
      <dc:date>2013-09-05T08:56:02Z</dc:date>
    </item>
  </channel>
</rss>

