<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: A question about read EEPROM in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/A-question-about-read-EEPROM/m-p/1391931#M18345</link>
    <description>&lt;P&gt;Hello ,you need to set "preserve range". If you did not set this parameters,it will erase all sectors while flash programming the chip。&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArchieLuo_0-1640488576957.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/166227i9E9F0B122DBC7459/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ArchieLuo_0-1640488576957.png" alt="ArchieLuo_0-1640488576957.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Dec 2021 03:16:31 GMT</pubDate>
    <dc:creator>ArchieLuo</dc:creator>
    <dc:date>2021-12-26T03:16:31Z</dc:date>
    <item>
      <title>A question about read EEPROM</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/A-question-about-read-EEPROM/m-p/1391891#M18344</link>
      <description>&lt;P&gt;I CAN write and read EEPROM correctly in debug mode，but when I download the software again,the data I Writen into EEPROM will be lost,all&amp;nbsp; of the datas becomes to 0xFF,what happened?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My chip is MC9S12ZVMC12,this is my code:&lt;/P&gt;&lt;P&gt;EEPROM_Init(0x05);// 6.25MHz busclk&lt;/P&gt;&lt;P&gt;//.........................................&lt;BR /&gt;// check whether flash is erased and potentially erase it.&lt;BR /&gt;//.........................................&lt;BR /&gt;&lt;BR /&gt;for(addrl=0x100000UL; addrl&amp;lt;=0x10007FUL; addrl+=4) // entire sector&lt;BR /&gt;{&lt;BR /&gt;if(EEPROM_Erase_Verify_Section(addrl,4) == NON_ERASED)&lt;BR /&gt;{&lt;BR /&gt;err = EEPROM_Erase_Sector(addrl);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;//.........................................&lt;BR /&gt;// write the flash per words&lt;BR /&gt;//.........................................&lt;/P&gt;&lt;P&gt;for(addrl=0x100000UL; addrl&amp;lt;=0x10003FUL; addrl+=2)&lt;BR /&gt;{&lt;BR /&gt;err = EEPROM_Program(addrl, buffer, 1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;//.........................................&lt;BR /&gt;// write the flash per multiple words&lt;BR /&gt;//.........................................&lt;/P&gt;&lt;P&gt;for(addrl=0x100040UL; addrl&amp;lt;=0x10007FUL; addrl+=8)&lt;BR /&gt;{&lt;BR /&gt;err = EEPROM_Program(addrl, buffer, 4);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;//.........................................&lt;BR /&gt;// read the flash&lt;BR /&gt;//.........................................&lt;/P&gt;&lt;P&gt;for(addrl=0x100000UL; addrl&amp;lt;=0x10007FUL; addrl+=2)&lt;BR /&gt;{&lt;BR /&gt;data = EEPROM_Read_Word(addrl);&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 25 Dec 2021 06:42:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/A-question-about-read-EEPROM/m-p/1391891#M18344</guid>
      <dc:creator>Monke</dc:creator>
      <dc:date>2021-12-25T06:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: A question about read EEPROM</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/A-question-about-read-EEPROM/m-p/1391931#M18345</link>
      <description>&lt;P&gt;Hello ,you need to set "preserve range". If you did not set this parameters,it will erase all sectors while flash programming the chip。&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArchieLuo_0-1640488576957.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/166227i9E9F0B122DBC7459/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ArchieLuo_0-1640488576957.png" alt="ArchieLuo_0-1640488576957.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Dec 2021 03:16:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/A-question-about-read-EEPROM/m-p/1391931#M18345</guid>
      <dc:creator>ArchieLuo</dc:creator>
      <dc:date>2021-12-26T03:16:31Z</dc:date>
    </item>
  </channel>
</rss>

