<?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: Problem in using D-Flash for XS128, Need help</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-in-using-D-Flash-for-XS128-Need-help/m-p/173868#M6020</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hello&lt;BR /&gt;&lt;BR /&gt;The global addresses are required. i.e. 0x10_0C00 must be used in this case&lt;BR /&gt;&lt;PRE&gt;    FCCOBIX =  0x00;
    FCCOBHI =  0x12;    /* Erase D-Flash sector command */
-&amp;gt;  FCCOBLO =  0x&lt;FONT color="#CC0000"&gt;1&lt;/FONT&gt;0;    /* Global address = &lt;FONT color="#CC0000"&gt;10&lt;/FONT&gt; */
   &lt;/PRE&gt;To disable D-Flash protection DFPROT[7] must be set. i.e. DFPROT = 0x80 instead of DFPROT = 0x10.&lt;BR /&gt;&lt;PRE&gt;-&amp;gt; DFPROT  = 0x&lt;FONT color="#CC0000"&gt;8&lt;/FONT&gt;0;  /* Disables D-Flash memory protection from program and erase */&lt;/PRE&gt;No further configuration of the sort mentioned (INITEE and MISC) is neccesary.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;DPB&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:22:35 GMT</pubDate>
    <dc:creator>DPB</dc:creator>
    <dc:date>2020-10-29T09:22:35Z</dc:date>
    <item>
      <title>Problem in using D-Flash for XS128, Need help</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-in-using-D-Flash-for-XS128-Need-help/m-p/173867#M6019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Good day everyone,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am working on MC9S12XS128 MCU.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I know that this MCU has the new feature of D-Flash. I am facing a problem in using this and executing its commands on it. I am not very clear about this D-Flash and have the following questions&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I do not want to use the Global address in my project, so after reviewing the datasheets, i am thinking that a 1Kbyte D-flash is available for XS128 mcu in the local memory map in the range 0x0C00 to 0x0FFF. so, i want to perform program/erase commands in this memory area&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is my sample code&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;PRE&gt;&lt;/PRE&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;void Init_Project(void){&amp;nbsp;&amp;nbsp; /* Init Flash module */&amp;nbsp; &lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&amp;nbsp; FCLKDIV = 0x07;&amp;nbsp; /* FDIV generates an FCLK frequency of 1.05 MHz */&amp;nbsp;&amp;nbsp; DFPROT&amp;nbsp; = 0x10;&amp;nbsp; /* Disables D-Flash memory protection from program and erase */}void Erase_DFlash_Sector(void){&amp;nbsp;&amp;nbsp;&amp;nbsp; if(FSTAT_CCIF == 0) /* Is command not completed — */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Break current process */&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; FSTAT = 48;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* ESTAT: PVIOL=1,ACCERR=1, clear error flags */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FCCOBIX =&amp;nbsp; 0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp; FCCOBHI =&amp;nbsp; 0x12;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Erase D-Flash sector command */&amp;nbsp;&amp;nbsp;&amp;nbsp; FCCOBLO =&amp;nbsp; 0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Global address = 0 */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FCCOBIX =&amp;nbsp; 0x01;&amp;nbsp;&amp;nbsp;&amp;nbsp; FCCOB&amp;nbsp;&amp;nbsp; =&amp;nbsp; 0x0C00;&amp;nbsp; /* Local D-Flash address, 0x0C00 */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FSTAT_CCIF = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Clear command complete flag to start new command */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!FSTAT_CCIF); /* wait for command to complete */}void main(void){&amp;nbsp;&amp;nbsp;&amp;nbsp; Init_Project();&amp;nbsp;&amp;nbsp;&amp;nbsp; Erase_DFlash_Sector();}&amp;nbsp; &lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;But after downloading the code and run in the Codewarrior debugger, i can see the memory from&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;0x0800 to 0x0BFF is filled with all " rr rr rr rr rr .... rr"&amp;nbsp;&amp;nbsp; and&lt;/DIV&gt;&lt;DIV&gt;0x0C00 to 0x0FFF is filled with all " -- -- -- -- -- ....--"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and i always see the ACCERR bit of FSTAT register is set. that means some acces error.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have the following doubts....&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1. Do i need to specailly enable the D-Flash and Initialize the D-Flash before running the commands to the memory 0x0C00 to 0x0FFF... (like in case of MC9S12DG128, or D64.. etc.. we will configure the EEPROM with "INITEE" and enable the EEPROM using "MISC")......??&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;2. And am I writing the correct values to the registers FCCOBIX&amp;nbsp;and FCCOB&amp;nbsp;&amp;nbsp;in my function "Erase_DFlash_Sector()"... ???&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;3. The data sheet mentioned, the FCCOB parameters for this command should contains the Global address [22:16]&amp;nbsp; to identify D-Flash blocks to be erased... and I dont want to use global memory.. is this creates any problem...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Finally, I am confused how to configure the 1KByte D-Flash from 0x0C00 to 0x0FFF and how to run the commands on this memory area.. specially how to write the FCCOB registers if I am not using global memory model..&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any kind of suggestions will be greatly helpful to me.,.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Nandu&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:22:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-in-using-D-Flash-for-XS128-Need-help/m-p/173867#M6019</guid>
      <dc:creator>nandu</dc:creator>
      <dc:date>2020-10-29T09:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in using D-Flash for XS128, Need help</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-in-using-D-Flash-for-XS128-Need-help/m-p/173868#M6020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hello&lt;BR /&gt;&lt;BR /&gt;The global addresses are required. i.e. 0x10_0C00 must be used in this case&lt;BR /&gt;&lt;PRE&gt;    FCCOBIX =  0x00;
    FCCOBHI =  0x12;    /* Erase D-Flash sector command */
-&amp;gt;  FCCOBLO =  0x&lt;FONT color="#CC0000"&gt;1&lt;/FONT&gt;0;    /* Global address = &lt;FONT color="#CC0000"&gt;10&lt;/FONT&gt; */
   &lt;/PRE&gt;To disable D-Flash protection DFPROT[7] must be set. i.e. DFPROT = 0x80 instead of DFPROT = 0x10.&lt;BR /&gt;&lt;PRE&gt;-&amp;gt; DFPROT  = 0x&lt;FONT color="#CC0000"&gt;8&lt;/FONT&gt;0;  /* Disables D-Flash memory protection from program and erase */&lt;/PRE&gt;No further configuration of the sort mentioned (INITEE and MISC) is neccesary.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;DPB&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:22:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-in-using-D-Flash-for-XS128-Need-help/m-p/173868#M6020</guid>
      <dc:creator>DPB</dc:creator>
      <dc:date>2020-10-29T09:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in using D-Flash for XS128, Need help</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-in-using-D-Flash-for-XS128-Need-help/m-p/173869#M6021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi DPB sir...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you&amp;nbsp;very very&amp;nbsp;much ...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Now, I can run the D-Flash commands using the global address.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I can Erase/Program the D-Flash from 0x10_0000 to 0x10_1FFF i.e in a total of&amp;nbsp;8kbytes&amp;nbsp;(Since MC9S12XS128 has 8K bytes of D-Flash)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;But,&amp;nbsp;if&amp;nbsp;I also want to read the data that is present in those locations by directly accessing those memory locations...but I couldn't able to do it..&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;for example:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;#define U32_GLOBAL_DFLASH_START_ADDR    0x100000unsigned char DFlash_Data[10];&lt;/PRE&gt;&lt;PRE&gt;void my_function(void){    for(i=0; i&amp;lt;10; i++)    {            DFlash_Data[i]  = *(uint8_t *)(U32_GLOBAL_DFLASH_START_ADDR + i);         /* byte access */             }}&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;After I download the source code, I can see that the whole D-Flash memory contains the value of 0xFF.&lt;/DIV&gt;&lt;DIV&gt;(i.e. D-flash memory from 0x10_0000 to 0x10_1FFF is completely erased). But when I read those memory locations by directly accessing as shown in the above sample code, it always returns 'zero' instead of 0xFF.&lt;/DIV&gt;&lt;DIV&gt;i.e. the variable "DFlash_Data[ ]" always receives the value of '0' from the D-Flash memroy.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1. Can I direclty access the global address as shown above...??&lt;/DIV&gt;&lt;DIV&gt;2. why does the routine always a value zero to the variable 'DFlash_Data[ ]' ..??&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Could you please suggest me the solution to read the data that is store in the D-Flash memory locations from 0x10_0000 to 0x10_1FFF&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you very much agian&lt;/DIV&gt;&lt;DIV&gt;Nandu&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:22:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-in-using-D-Flash-for-XS128-Need-help/m-p/173869#M6021</guid>
      <dc:creator>nandu</dc:creator>
      <dc:date>2020-10-29T09:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in using D-Flash for XS128, Need help</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-in-using-D-Flash-for-XS128-Need-help/m-p/173870#M6022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;Hi DPB sir&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think my problem was solved as off now.. i.e. to read/access the memory locations from D-Flash for MC9S12XS128 MCU.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After going through several threads in this forum and the Codewarrior documents like TN238.pdf, TN240.pdf, AN2734.pdf. I am now in a position to understand some of the familiar terms of the XS family memory organization like Logica addressing, Global addressing, __far,__pptr etc. So, I would like to share my views here, please have a look at it and kindly correct me if I am wrong any where&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In case of XS128 MCU, I think the D-Flash memory can be viewed as 3 pictures... Please reffer to the&amp;nbsp;attachment&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. Local Address Map&amp;nbsp;&amp;nbsp;&amp;nbsp; (General 64Kbytes of memory)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Logical Address Map (Memory&amp;nbsp;locations which can be accessed usign the respective memory block pages like RPAGE, EPAGE, PPAGE)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Global Address Map&amp;nbsp; (The whole Memory locations which can be&amp;nbsp;accessed&amp;nbsp;using a single global page called GPAGE)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All the three address maps are logically same, but it depends on the user how he will tell the compiler to access those locations...So, he can tell the compiler either to access the memory locally, or logically (using EPAGE) or gloabally (using GPAGE).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And to use each access, we can use different schemes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. Inorder to access/read the memory from global map, I use the following method...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#3333CC"&gt;#define U32_GLOBAL_DFLASH_START_ADDR&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x100000&lt;BR /&gt;&lt;BR /&gt;unsigned char DFlash_Data[10];&lt;BR /&gt;&lt;BR /&gt;void my_function(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(i=0; i&amp;lt;10; i++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DFlash_Data[i]&amp;nbsp; = *(uint8_t* __far)(U32_GLOBAL_DFLASH_START_ADDR + i);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* byte access */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i.e. we should use the&lt;/SPAN&gt; &lt;SPAN&gt;&lt;FONT color="#3333CC"&gt;'__far'&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN&gt;pointer access to tell compiler to access data from the Global memory&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Inorder to access/read the memory from&amp;nbsp;logical map, I use the following method...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-----------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3333CC"&gt;&lt;SPAN&gt;#define U16_LOGICAL_DFLASH_START_ADDR&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00800&lt;BR /&gt;&lt;BR /&gt;unsigned char DFlash_Data[10];&lt;BR /&gt;&lt;BR /&gt;void my_function(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(i=0; i&amp;lt;10; i++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DFlash_Data[i]&amp;nbsp; = *(uint8_t* __eptr)(U16_LOGICAL_DFLASH_START_ADDR + i);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* byte access */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i.e. we should use the&lt;/SPAN&gt; &lt;SPAN&gt;'&lt;FONT color="#3333CC"&gt;__eptr'&lt;/FONT&gt;&lt;/SPAN&gt; &lt;SPAN&gt;pointer access to tell compiler to access data from the&amp;nbsp;Logical&amp;nbsp;memory map&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Inorder to access/read the memory from local map, I use the following method...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-----------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3333CC"&gt;&lt;SPAN&gt;#define U16_LOCAL_DFLASH_START_ADDR&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0C00&lt;BR /&gt;&lt;BR /&gt;unsigned char DFlash_Data[10];&lt;BR /&gt;&lt;BR /&gt;void my_function(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(i=0; i&amp;lt;10; i++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DFlash_Data[i]&amp;nbsp; = *(uint8_t* )(U16_LOCAL_DFLASH_START_ADDR + i);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* byte access */&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think, here there is no need to use any pointer access since 0x0C00 is the non-paged D-Flash memroy area&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and Finally, since global addressing&amp;nbsp;is used mainly where the very large size data structure are required to improve the speed a little,&amp;nbsp;I use the Logical address scheme in my code,&amp;nbsp;as my data in the D-Flash is not bigger than a size of D-Flash (i.e. 1Kbytes). i.e I use the 2nd scheme.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jul 2008 04:00:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problem-in-using-D-Flash-for-XS128-Need-help/m-p/173870#M6022</guid>
      <dc:creator>nandu</dc:creator>
      <dc:date>2008-07-25T04:00:00Z</dc:date>
    </item>
  </channel>
</rss>

