<?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: D flash memory read after reset ( without enabled emulated eeprom) in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/D-flash-memory-read-after-reset-without-enabled-emulated-eeprom/m-p/625485#M13396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sastek,&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried ur above code. Its working at that context.&lt;/P&gt;&lt;P&gt;Our controller is MC9S12XET256 (MC9S12XEP100 family) with bus clock 24 MHz external oscillator 4MHz.&lt;/P&gt;&lt;P&gt;As the fact, im not using any partition command( not using emulated eeprom).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the problem i observed is after writing to eeprom location in Runtime. Please write the same 0x23 @ 10_0000'G in run time using D flash command ( FCCOB,FCCOBIX registers). I verified that the value is stored in eeprom ( memory window). I did battery reset, checked the value again, its reading as '0'. However its working in Debugger reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if put a delay of 5ms&amp;nbsp; in start up()&amp;nbsp;and then reading value stored in the eeprom. Its read as 0x23. Its working in all ranges.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me in deciphering the issue!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Nov 2016 04:28:31 GMT</pubDate>
    <dc:creator>rubykrishna</dc:creator>
    <dc:date>2016-11-03T04:28:31Z</dc:date>
    <item>
      <title>D flash memory read after reset ( without enabled emulated eeprom)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/D-flash-memory-read-after-reset-without-enabled-emulated-eeprom/m-p/625483#M13394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are using MC9S12XEP100 family. It has emulated eeprom feature, However we are not using it, we used to store eeprom data in d flash ( traditional approach) without using &amp;nbsp;emulated eeprom &amp;nbsp;buffer ram.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On start up,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_starup()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;main()&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;uint8 c;&lt;/P&gt;&lt;P&gt;clock_init();&lt;/P&gt;&lt;P&gt;flash_init();&lt;/P&gt;&lt;P&gt;&amp;nbsp; c=*(uint8* __far)0x100000 (i.e 0x100000 start address of the d flash memory)&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets us consider that i have value 23 in the following address 0x100000'G&lt;/P&gt;&lt;P&gt;Wen i tried to read that value, i couldn't read it. It's reading it as c=0.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i modified the code as such&amp;nbsp;&lt;/P&gt;&lt;P&gt;main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;uint8 c;&lt;/P&gt;&lt;P&gt;clock_init();&lt;/P&gt;&lt;P&gt;flash_init();&lt;/P&gt;&lt;P&gt;delay(5ms);&lt;/P&gt;&lt;P&gt;&amp;nbsp; c=*(uint8* __far)0x100000 (i.e 0x100000 start address of the d flash memory)&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wen i kept a delay 5 ms it reading the value &amp;nbsp;at 100000 c=23&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me ! Is any delay required after reset for reading a d flash memory. I didn't find &amp;nbsp;these case in other micro controllers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 08:22:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/D-flash-memory-read-after-reset-without-enabled-emulated-eeprom/m-p/625483#M13394</guid>
      <dc:creator>rubykrishna</dc:creator>
      <dc:date>2016-11-02T08:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: D flash memory read after reset ( without enabled emulated eeprom)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/D-flash-memory-read-after-reset-without-enabled-emulated-eeprom/m-p/625484#M13395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruby,&lt;/P&gt;&lt;P&gt;I am not aware of any necessary delay for reading D-Flash.&lt;/P&gt;&lt;P&gt;Unfortunately, I was not able to reproduce described issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is _startup() function first function executed after reset (like _Startup() function in standard project)?&lt;/P&gt;&lt;P&gt;If yes, I cannot see stack initialization command in your code.&lt;/P&gt;&lt;P&gt;For example: INIT_SP_FROM_STARTUP_DESC();&lt;/P&gt;&lt;P&gt;The same is valid for zero out and copy down functions like standard Init(); function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created very simple code in main.c file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include &amp;lt;hidef.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* common defines and macros */&lt;/P&gt;&lt;P&gt;#include "derivative.h"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* derivative-specific definitions */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const unsigned char mydata @0x000800 = 0x23;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void main(void) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; volatile unsigned char c;&lt;/P&gt;&lt;P&gt;&amp;nbsp; c=*(unsigned char * __far)0x100000;&lt;/P&gt;&lt;P&gt;DDRA = 0x01;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (c == 0x23) PORTA = 0x01;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else PORTA = 0x00;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; } /* loop forever */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Additionally I placed “mydata” name into ENTRIES section in prm file because mydata is not directly referenced in the code and I want avoid to optimizing it out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The c variable is loaded correctly despite on fact whether main() is called after or before Init() function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the variable c is declared inside main() function, it will be created on the stack.&lt;/P&gt;&lt;P&gt;If the variable c is declared as the global variable, it will be created on RAM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This leads me to question how did you test variable c value and how you signalize it?&lt;/P&gt;&lt;P&gt;When the variable is on the stack, there may be some problem with address position or stack pointer modifying.&lt;/P&gt;&lt;P&gt;When you use BDM for reading variable c value, the BDM communication needs some time for reading it and 0 may be just initial value before getting first value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please specify your MCU by part number and maskset?&lt;/P&gt;&lt;P&gt;I tested P9S12XET256MAL with maskset 1M53J running on 16MHz crystal.&lt;/P&gt;&lt;P&gt;The MCU was not partitioned (DFPART,ERPART=0xFF)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you send me your project, I may shortly check it for any obvious or potential issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;Radek&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, 02 Nov 2016 16:29:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/D-flash-memory-read-after-reset-without-enabled-emulated-eeprom/m-p/625484#M13395</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-11-02T16:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: D flash memory read after reset ( without enabled emulated eeprom)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/D-flash-memory-read-after-reset-without-enabled-emulated-eeprom/m-p/625485#M13396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sastek,&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried ur above code. Its working at that context.&lt;/P&gt;&lt;P&gt;Our controller is MC9S12XET256 (MC9S12XEP100 family) with bus clock 24 MHz external oscillator 4MHz.&lt;/P&gt;&lt;P&gt;As the fact, im not using any partition command( not using emulated eeprom).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the problem i observed is after writing to eeprom location in Runtime. Please write the same 0x23 @ 10_0000'G in run time using D flash command ( FCCOB,FCCOBIX registers). I verified that the value is stored in eeprom ( memory window). I did battery reset, checked the value again, its reading as '0'. However its working in Debugger reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if put a delay of 5ms&amp;nbsp; in start up()&amp;nbsp;and then reading value stored in the eeprom. Its read as 0x23. Its working in all ranges.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me in deciphering the issue!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 04:28:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/D-flash-memory-read-after-reset-without-enabled-emulated-eeprom/m-p/625485#M13396</guid>
      <dc:creator>rubykrishna</dc:creator>
      <dc:date>2016-11-03T04:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: D flash memory read after reset ( without enabled emulated eeprom)</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/D-flash-memory-read-after-reset-without-enabled-emulated-eeprom/m-p/625486#M13397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruby,&lt;/P&gt;&lt;P&gt;Thank you for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please specify content of your clock_init(); and flash_init(); functions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We cannot simultaneously read D-Flash and execute any flash command on the same flash block.&lt;/P&gt;&lt;P&gt;I guess that this may be a reason of incorrect reading from D-Flash.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may try to comment out these functions or read D-Flash address prior these functions.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;uint8 c;&lt;/P&gt;&lt;P&gt;c=*(uint8* __far)0x100000&lt;/P&gt;&lt;P&gt;clock_init();&lt;/P&gt;&lt;P&gt;flash_init();&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 hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Radek&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>Thu, 03 Nov 2016 16:06:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/D-flash-memory-read-after-reset-without-enabled-emulated-eeprom/m-p/625486#M13397</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-11-03T16:06:20Z</dc:date>
    </item>
  </channel>
</rss>

