<?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: MC9S12XEP100 Flash burner question</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2076422#M20421</link>
    <description>&lt;P&gt;Hi Ladislav,&lt;/P&gt;&lt;P&gt;Thank you for that excellent attachment. It was just what I was looking for. It runs just fine on my controller, except for one thing.&lt;/P&gt;&lt;P&gt;I can't seem to get the debugger to update the memory window, either for the RAM or the D-Flash.&lt;/P&gt;&lt;P&gt;I when I single step through the program I expected to see the RAM addresses from $2100 to $2110 update with the appropriate steps. I'm not seeing this.&lt;/P&gt;&lt;P&gt;I also expected to see the D-Flash addresses from $10000 to $100010 update as I step through, but I'm not seeing that either.&lt;/P&gt;&lt;P&gt;Also, if I run the program and halt it, the memory locations are not updated.&lt;/P&gt;&lt;P&gt;Are there some settings in the de-bugger that I don't have set right?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
    <pubDate>Tue, 08 Apr 2025 18:32:23 GMT</pubDate>
    <dc:creator>roberthiebert</dc:creator>
    <dc:date>2025-04-08T18:32:23Z</dc:date>
    <item>
      <title>MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2068925#M20407</link>
      <description>&lt;P&gt;MC9S12XEP100. Code Warrior 5.9.0, single chip, absolute assembler.&lt;/P&gt;&lt;P&gt;I have a program, similar to the one I wrote using the MC9S12C64, but larger and more complex. I couldn't figure out the flash burner process for that one until I posted the question and Ladislav was able to explain it to me with his C64-FLASH-ASM test program. Using that I was able to get my program to work just fine.&lt;/P&gt;&lt;P&gt;Now I am having the same issue using the MC9S12XEP100 processor. I was hoping there would be enough similarities in the process that I could adapt what I learned, but I'm having some difficulties. Is there a test program similar to the&amp;nbsp;C64-FLASH-ASM, but specific to the MC9S12XEP100 in single chip, absolute assembler that I could study and see if I could get that to work?&lt;/P&gt;&lt;P&gt;I'm attaching a basic test code that I am using to troubleshoot.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 18:19:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2068925#M20407</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-03-26T18:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2068928#M20408</link>
      <description>&lt;P&gt;I'll try the attachment again&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 18:20:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2068928#M20408</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-03-26T18:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2068932#M20409</link>
      <description>&lt;P&gt;Oops. I forgot to mention that when I try to erase the sectors I get an Access Error code.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 18:27:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2068932#M20409</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-03-26T18:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2069436#M20411</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;there are no similarities. It is 2 levels higher MCU with different memory organization. In this case I suggest to use DFLASH for data storage. There is no ASM code available but I believe it is not any problem to do it by disassembling C code. If you are C coding engineer it must be easy for you to rebuilt it to asm.&lt;/P&gt;
&lt;P&gt;Here is a C code and the project is attached. You can go/step through the ASM code in debugger to see how it works.&lt;/P&gt;
&lt;P&gt;I have also attached C code for PFLASH programming. Nothing easier but it does not require to &amp;nbsp;perform partitioning of this memory. There are some similarities in addresses but global address must be used for data E/W. Short (4000-7FFF) and PPAGE_Offset addresses are used for program execution.&lt;/P&gt;
&lt;P&gt;In the case of the MCU it will require more effort to understand how flash is organized and how it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moreover, to go from relocatable assembly of the single file project to the absolute assembly is easy. Directive EQU is used for data placement into RAM and ORG is used to place code in given PFLASH space.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is necessary to be understand is that for reading and writing DFLASH the global address must be used. However in the case of this memory it is solved easily because it has higher word (DPAFE ) always 0x10 so it is enough to send to the routine only offset in the range 0000-7FFF and full address is created in routine, for example DFLASH_Program..&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I am sorry we do not have any empty space, resources or responsibility for such complex projects … plus in assembler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Ladislav&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 10:54:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2069436#M20411</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2025-03-27T10:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2069635#M20413</link>
      <description>&lt;P&gt;Hi Ladislav,&lt;/P&gt;&lt;P&gt;Thanks again for your prompt reply and the files. I am not a "C" engineer and only have a basic knowledge of the language so the disassembly process will be challenging, but I'll give it my best shot.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 16:42:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2069635#M20413</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-03-27T16:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2070582#M20414</link>
      <description>&lt;P&gt;Hi Ladislav,&lt;/P&gt;&lt;P&gt;This is not easy stuff for me, but I was able to load your XEP100-DFLASH-CW47 program into my controller using a USBDM. I believe the program is running correctly. I expected to see the D-Flash address from $10_0000 loaded with $12, $34, $56, $78 $9A, $BC, $DE, $F0, but nothing is there. I also expected to see each of the remainder of the 256 byte sector loaded with $FF.&amp;nbsp; Perhaps my understanding of how the program is supposed to work is flawed?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2025 23:49:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2070582#M20414</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-03-28T23:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2074602#M20418</link>
      <description>&lt;P&gt;I'm still not getting anywhere with this.&lt;/P&gt;&lt;P&gt;I've tried to figure out the ASM by stepping through the code, but I really have to be able to understand what the program is doing in "C" first. I believe that it partitions the DFlash then erases it all. Then it writes 16 bytes that it had written into RAM into D FLash. I can find the bytes in RAM, but in no place in D Flash can I find where it has written them in.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Sat, 05 Apr 2025 21:39:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2074602#M20418</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-04-05T21:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2074655#M20419</link>
      <description>&lt;P&gt;I'm still working hard at trying to figure this "C" code out but getting nowhere. The code runs and says that the first 256 bytes in D Flash have been erased at $10_0000, but I don't see that. Then it says that buffer[0] has been written into $0_0000, $10_0008 and $10_0010, But I don't see that either.&lt;/P&gt;&lt;P&gt;What am I missing here?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Sun, 06 Apr 2025 18:08:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2074655#M20419</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-04-06T18:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2076174#M20420</link>
      <description>&lt;P&gt;I am very sorry but I see no issue to rebuilt C to ASM. C shows you principle and this C code is not a object oriented programming. It is simple Ansi C.&lt;BR /&gt;&lt;BR /&gt;Here you can see programming of D-Flash. (Not P-Flash, it is a little bit different but in principle very similar)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;;**************************************************************&lt;BR /&gt;;* This stationery serves as the framework for a *&lt;BR /&gt;;* user application. For a more comprehensive program that *&lt;BR /&gt;;* demonstrates the more advanced functionality of this *&lt;BR /&gt;;* processor, please see the demonstration applications *&lt;BR /&gt;;* located in the examples subdirectory of the *&lt;BR /&gt;;* Freescale CodeWarrior for the HC12 Program directory *&lt;BR /&gt;;**************************************************************&lt;BR /&gt;; Include derivative-specific definitions&lt;BR /&gt;INCLUDE 'derivative.inc'&lt;/P&gt;
&lt;P&gt;; export symbols&lt;BR /&gt;XDEF Entry, _Startup, main&lt;BR /&gt;; we use export 'Entry' as symbol. This allows us to&lt;BR /&gt;; reference 'Entry' either in the linker .prm file&lt;BR /&gt;; or from C/C++ later on&lt;/P&gt;
&lt;P&gt;XREF __SEG_END_SSTACK ; symbol defined by the linker for the end of the stack&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;;*********************************************************************&lt;BR /&gt;OK EQU 0 &lt;BR /&gt;ERASED EQU 1&lt;BR /&gt;NON_ERASED EQU 2&lt;BR /&gt;LENGTH_OUT_OF_RANGE EQU 3&lt;BR /&gt;;*********************************************************************&lt;/P&gt;
&lt;P&gt;; variable/data section&lt;BR /&gt;MY_EXTENDED_RAM: SECTION&lt;/P&gt;
&lt;P&gt;; Insert here your data definition.&lt;/P&gt;
&lt;P&gt;Buffer ds.w 4;&lt;BR /&gt;Err ds.b 1;&lt;BR /&gt;Addr ds.w 1; &lt;BR /&gt;Cnt ds.b 1;&lt;BR /&gt;var_i ds.b 1;&lt;BR /&gt;var_j ds.b 1;&lt;BR /&gt;var_Data ds.w 1;&lt;BR /&gt;;*********************************************************************&lt;/P&gt;
&lt;P&gt;; code section&lt;BR /&gt;MyCode: SECTION&lt;BR /&gt;main:&lt;BR /&gt;_Startup:&lt;BR /&gt;Entry:&lt;BR /&gt;;---------------------------&lt;BR /&gt;LDS #__SEG_END_SSTACK ; initialize the stack pointer&lt;BR /&gt;CLI ; enable interrupts&lt;BR /&gt;;---------------------------&lt;BR /&gt;EndlessLoop:&lt;BR /&gt;;---------------------------&lt;BR /&gt;;EE_Init ... 0x0F //oscillator 16MHz -&amp;gt; divide by 0x0F to achieve FCLK 800kHz - 1.05MHz &lt;BR /&gt;;while(FSTAT_CCIF == 0); //wait if command in progress&lt;BR /&gt;BRCLR FSTAT,#128,*+0 ;abs = 0001&lt;BR /&gt;;FCLKDIV = fdiv; //osc = 16MHz &lt;BR /&gt;LDAB #$0F&lt;BR /&gt;STAB FCLKDIV&lt;BR /&gt;;---------------------------&lt;BR /&gt;;DFLASH_Erase_Sector(0x0000); //erase first sector (256 bytes)&lt;BR /&gt;MOVW #$0000,Addr&lt;BR /&gt;CALL DFLASH_Erase_Sector&lt;BR /&gt;;---------------------------&lt;BR /&gt;;err = DFLASH_Erase_Verify(0x0000, 16); //check if 16 words are erased - we will receive ERASED message&lt;BR /&gt;MOVW #$0000,Addr&lt;BR /&gt;MOVB #16,Cnt&lt;BR /&gt;CALL DFLASH_Erase_Verify ; note there is a status of verification in the Err variable after execution of this command&lt;BR /&gt;&lt;BR /&gt;;---------------------------&lt;BR /&gt;;err = DFLASH_Program(0x0000, &amp;amp;buffer[0], 4); //write 4 words to D Flash address 0x0000&lt;/P&gt;
&lt;P&gt;MOVW #$0000,Addr ; address to be written&lt;BR /&gt;&lt;BR /&gt;MOVB #4,Cnt ; number of words to be written&lt;BR /&gt;&lt;BR /&gt;;for example data to be written into DFLASH are 0123, 4567, 89AB, CDEF&lt;BR /&gt;LDX #Buffer ; Load the base address of the array into X register&lt;BR /&gt;LDD #$0123 ; Load the value 0123 into A register&lt;BR /&gt;STD 0,X ; Store the value at the 0th position of the array&lt;BR /&gt;LDD #$4567 ; Load the value 4567 into A register&lt;BR /&gt;STD 2,X ; Store the value at the 1st position of the array&lt;BR /&gt;LDD #$89AB ; Load the value 89SB into A register&lt;BR /&gt;STD 4,X ; Store the value at the 2nd position of the array&lt;BR /&gt;LDD #$CDEF ; Load the value CDEF into A register&lt;BR /&gt;STD 6,X ; Store the value at the 3rd position of the array&lt;/P&gt;
&lt;P&gt;CALL DFLASH_Program ; note there is a status of verifiction in the Err variable after execution of this command&lt;BR /&gt;;---------------------------&lt;BR /&gt;;err = DFLASH_Program(0x0008, &amp;amp;buffer[0], 4); //write 4 words to eeprom address 0x0000&lt;/P&gt;
&lt;P&gt;MOVW #$0008,Addr ; address to be written&lt;BR /&gt;&lt;BR /&gt;MOVB #4,Cnt ; number of words to be written&lt;BR /&gt;&lt;BR /&gt;;for example data to be written into DFLASH are 0123, 4567, 89AB, CDEF&lt;BR /&gt;LDX #Buffer ; Load the base address of the array into X register&lt;BR /&gt;LDD #$DEAD ; Load the value 0123 into A register&lt;BR /&gt;STD 0,X ; Store the value at the 0th position of the array&lt;BR /&gt;LDD #$BEEF ; Load the value 4567 into A register&lt;BR /&gt;STD 2,X ; Store the value at the 1st position of the array&lt;BR /&gt;LDD #$C0DE ; Load the value 89SB into A register&lt;BR /&gt;STD 4,X ; Store the value at the 2nd position of the array&lt;BR /&gt;LDD #$CAFE ; Load the value CDEF into A register&lt;BR /&gt;STD 6,X ; Store the value at the 3rd position of the array&lt;/P&gt;
&lt;P&gt;CALL DFLASH_Program ; note there is a status of verifiction in the Err variable after execution of this command&lt;BR /&gt;;---------------------------&lt;BR /&gt;; get written data&lt;BR /&gt;;---------------------------&lt;BR /&gt;MOVW #$0000,Addr&lt;BR /&gt;CALL DFLASH_Read&lt;BR /&gt;STD var_Data&lt;/P&gt;
&lt;P&gt;MOVW #$0002,Addr&lt;BR /&gt;CALL DFLASH_Read&lt;BR /&gt;STD var_Data&lt;/P&gt;
&lt;P&gt;MOVW #$0004,Addr&lt;BR /&gt;CALL DFLASH_Read&lt;BR /&gt;STD var_Data&lt;/P&gt;
&lt;P&gt;MOVW #$0006,Addr&lt;BR /&gt;CALL DFLASH_Read&lt;BR /&gt;STD var_Data&lt;BR /&gt;;---------------------------&lt;BR /&gt;JMP EndlessLoop ; restart.&lt;BR /&gt;;---------------------------&lt;BR /&gt;;*********************************************************************&lt;BR /&gt;;DFLASH_Read&lt;BR /&gt;;*********************************************************************&lt;BR /&gt;DFLASH_Read:&lt;BR /&gt;MOVB #$10, GPAGE&lt;BR /&gt;LDX Addr&lt;BR /&gt;GLDD X&lt;BR /&gt;RTC&lt;/P&gt;
&lt;P&gt;;*********************************************************************&lt;BR /&gt;;DFLASH_Program&lt;BR /&gt;;*********************************************************************&lt;BR /&gt;DFLASH_Program:&lt;BR /&gt;;if((Cnt &amp;lt; 1) || (Cnt &amp;gt; 4))&lt;BR /&gt;LDAB Cnt&lt;BR /&gt;CMPB #1&lt;BR /&gt;BCS LBL_DP1&lt;BR /&gt;CMPB #4&lt;BR /&gt;BLS LBL_DP2&lt;BR /&gt;;return LENGTH_OUT_OF_RANGE;&lt;BR /&gt;LBL_DP1: MOVB #LENGTH_OUT_OF_RANGE,Err&lt;BR /&gt;RTC&lt;BR /&gt;LBL_DP2: ;while(FSTAT_CCIF == 0); //wait if command in progress&lt;BR /&gt;BRCLR FSTAT,#128,*+0 ;abs = 000e&lt;BR /&gt;;FSTAT = 0x30; //clear ACCERR and PVIOL&lt;BR /&gt;MOVB #$30, FSTAT&lt;BR /&gt;;FCCOBIX = 0x00;&lt;BR /&gt;CLR FCCOBIX&lt;BR /&gt;;FCCOB = 0x1110;&lt;BR /&gt;MOVW #$1110,FCCOB&lt;BR /&gt;;FCCOBIX = 0x01;&lt;BR /&gt;MOVB #$1,FCCOBIX&lt;BR /&gt;;FCCOB = address;&lt;BR /&gt;MOVW Addr,FCCOB&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;;for(i=2; i&amp;lt;=Cnt+1; i++) //fill appropriate number of words to FCCOB&lt;BR /&gt;CLRA &lt;BR /&gt;LDX #Buffer&lt;BR /&gt;LDAB Cnt&lt;BR /&gt;INCB &lt;BR /&gt;STAB var_j ; end variable of cycle&lt;BR /&gt;LDAA #$2 ; start value of cycle&lt;/P&gt;
&lt;P&gt;LBL_DP3: &lt;BR /&gt;;FCCOBIX = A = 2 to {3,4,5}; &lt;BR /&gt;STAA FCCOBIX&lt;BR /&gt;;FCCOB = *ptr;&lt;BR /&gt;LDD 2,X+&lt;BR /&gt;STD FCCOB&lt;BR /&gt;&lt;BR /&gt;LDAA FCCOBIX&lt;BR /&gt;INCA&lt;BR /&gt;CMPA var_j&lt;BR /&gt;BLS LBL_DP3&lt;BR /&gt;&lt;BR /&gt;;FSTAT_CCIF = 1; //launch command&lt;BR /&gt;BSET FSTAT,#128&lt;BR /&gt;;while(FSTAT_CCIF == 0); //wait for done&lt;BR /&gt;BRCLR FSTAT,#128,*+0 ;abs = 004b&lt;BR /&gt;;return OK;&lt;BR /&gt;MOVB OK,Err&lt;BR /&gt;RTC&lt;/P&gt;
&lt;P&gt;;*********************************************************************&lt;BR /&gt;;DFLASH_Erase_Verify&lt;BR /&gt;;*********************************************************************&lt;BR /&gt;DFLASH_Erase_Verify:&lt;BR /&gt;;while(FSTAT_CCIF == 0); //wait if command in progress&lt;BR /&gt;BRCLR FSTAT,#128,*+0 ;abs = 0001&lt;BR /&gt;;FSTAT = 0x30; //clear ACCERR and PVIOL&lt;BR /&gt;MOVB #$30,FSTAT&lt;BR /&gt;;FCCOBIX = 0x00;&lt;BR /&gt;CLR FCCOBIX&lt;BR /&gt;;FCCOB = 0x1010;&lt;BR /&gt;MOVW #$1010, FCCOB&lt;BR /&gt;;FCCOBIX = 0x01;&lt;BR /&gt;MOVB #$1, FCCOBIX&lt;BR /&gt;;FCCOB = address;&lt;BR /&gt;MOVW Addr, FCCOB&lt;BR /&gt;;FCCOBIX = 0x02;&lt;BR /&gt;MOVB #$2, FCCOBIX&lt;BR /&gt;;FCCOB = number_of_bytes;&lt;BR /&gt;MOVB Cnt,FCCOB&lt;BR /&gt;;FSTAT_CCIF = 1; //launch command&lt;BR /&gt;BSET FSTAT,#128&lt;BR /&gt;;while(FSTAT_CCIF == 0); //wait for done &lt;BR /&gt;BRCLR FSTAT,#128,*+0 ;abs = 002b&lt;BR /&gt;;if(FSTAT_MGSTAT == 0)&lt;BR /&gt;BRCLR FSTAT,#3,*+7 ;abs = 0037&lt;BR /&gt;BRA lbl_nonerased&lt;BR /&gt;;return ERASED;&lt;BR /&gt;MOVB #ERASED, Err&lt;BR /&gt;RTC&lt;BR /&gt;lbl_nonerased:&lt;BR /&gt;;return NON_ERASED;&lt;BR /&gt;MOVB #NON_ERASED, Err&lt;BR /&gt;RTC&lt;/P&gt;
&lt;P&gt;;*********************************************************************&lt;BR /&gt;;void DFLASH_Erase_Sector(unsigned int address)&lt;BR /&gt;;*********************************************************************&lt;BR /&gt;DFLASH_Erase_Sector:&lt;BR /&gt;;while(FSTAT_CCIF == 0); //wait if command in progress&lt;BR /&gt;BRCLR FSTAT,#128,*+0 ;abs = 0001&lt;BR /&gt;;FSTAT = 0x30; //clear ACCERR and PVIOL&lt;BR /&gt;MOVB #$30, FSTAT&lt;BR /&gt;;FCCOBIX = 0x00;&lt;BR /&gt;CLR FCCOBIX&lt;BR /&gt;;FCCOB = 0x1210;&lt;BR /&gt;MOVW #$1210, FCCOB&lt;BR /&gt;;FCCOBIX = 0x01;&lt;BR /&gt;MOVB #$1, FCCOBIX&lt;BR /&gt;;FCCOB = address;&lt;BR /&gt;MOVW Addr,FCCOB&lt;BR /&gt;;FSTAT_CCIF = 1; //launch command&lt;BR /&gt;BSET FSTAT,#128&lt;BR /&gt;;while(FSTAT_CCIF == 0); //wait for done &lt;BR /&gt;BRCLR FSTAT,#128,*+0 ;abs = 0022&lt;BR /&gt;RTC &lt;BR /&gt;;*********************************************************************&lt;BR /&gt;;*********************************************************************&lt;BR /&gt;;*********************************************************************&lt;BR /&gt;;*********************************************************************&lt;BR /&gt;;*********************************************************************&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 12:32:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2076174#M20420</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2025-04-08T12:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2076422#M20421</link>
      <description>&lt;P&gt;Hi Ladislav,&lt;/P&gt;&lt;P&gt;Thank you for that excellent attachment. It was just what I was looking for. It runs just fine on my controller, except for one thing.&lt;/P&gt;&lt;P&gt;I can't seem to get the debugger to update the memory window, either for the RAM or the D-Flash.&lt;/P&gt;&lt;P&gt;I when I single step through the program I expected to see the RAM addresses from $2100 to $2110 update with the appropriate steps. I'm not seeing this.&lt;/P&gt;&lt;P&gt;I also expected to see the D-Flash addresses from $10000 to $100010 update as I step through, but I'm not seeing that either.&lt;/P&gt;&lt;P&gt;Also, if I run the program and halt it, the memory locations are not updated.&lt;/P&gt;&lt;P&gt;Are there some settings in the de-bugger that I don't have set right?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 18:32:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2076422#M20421</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-04-08T18:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2076492#M20422</link>
      <description>&lt;P&gt;Hi again Ladislav,&lt;/P&gt;&lt;P&gt;After stepping through the program again several times I noticed some other peculiar things.&lt;/P&gt;&lt;P&gt;After running the FLASH_ERASE_VERIFY subroutine the returned "err" was $01. Which was expected. However, after any FLASH_PROGRAM subroutine "returned "err" was $40.&lt;/P&gt;&lt;P&gt;The FLASH_READ&amp;nbsp; subroutine seems to work but it doesn't return the var_Data values I expected.&lt;/P&gt;&lt;P&gt;It returns $FA, $CF first. $4 second. $BB $B6 third.&amp;nbsp; $46 $46 forth. The values at address $100000 are $FA, $CF, $00,$04,$BB, $B6, $46, $46. These are not the values that should have been burned to this address if I am understanding the program correctly.&lt;/P&gt;&lt;P&gt;The values at address $2100 are $CA,$FE,$CA,$FE,$CA,$FE,$CA,$FE and they don't change.&lt;/P&gt;&lt;P&gt;Something seems odd here.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 21:55:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2076492#M20422</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-04-08T21:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2076915#M20423</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Do not step memory functions if the part of memory is displayed in the memory window of the debugger.&lt;/LI&gt;
&lt;LI&gt;Set refresh memory when halting &lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lama_0-1744187836708.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/332190i0E552E9CDAC8916E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lama_0-1744187836708.png" alt="lama_0-1744187836708.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lama_1-1744187836709.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/332189i175E26DEDF78B383/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lama_1-1744187836709.png" alt="lama_1-1744187836709.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lama_2-1744187836710.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/332188iD463C9146A6FE9EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lama_2-1744187836710.png" alt="lama_2-1744187836710.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;First loop &lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lama_3-1744187836713.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/332191iCB310F57C46BB72A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lama_3-1744187836713.png" alt="lama_3-1744187836713.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Second loop … after erase sector&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lama_4-1744187836719.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/332192i57A308D7E132CCC0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lama_4-1744187836719.png" alt="lama_4-1744187836719.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Second loop after writing data&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lama_5-1744187836724.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/332193iD7148DD244A7EB3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lama_5-1744187836724.png" alt="lama_5-1744187836724.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Second loop reading the data&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lama_6-1744187836726.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/332195i0C597FB988694D34/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lama_6-1744187836726.png" alt="lama_6-1744187836726.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lama_7-1744187836730.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/332197i56DEF19185E99E68/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lama_7-1744187836730.png" alt="lama_7-1744187836730.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lama_8-1744187836733.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/332194i5EC01A9FF5D57356/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lama_8-1744187836733.png" alt="lama_8-1744187836733.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lama_9-1744187836736.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/332198i81E9D21724DC5304/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lama_9-1744187836736.png" alt="lama_9-1744187836736.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;Moreover, it is always suitable to disable possible interrupts to do not change registers.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Create critical section which is not interrupted using CLI, SEI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Ladislav&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2025 09:07:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2076915#M20423</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2025-04-09T09:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2077340#M20424</link>
      <description>&lt;P&gt;I have the memory set to refresh on halt, but no matter what I do, the memory never changes. I've tried setting breakpoints where I see you have highlighted, but nothing. I tired running the program and halting it at random points. No change. What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2025 17:21:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2077340#M20424</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-04-09T17:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2078519#M20425</link>
      <description>&lt;P&gt;Hi Ladislav,&lt;/P&gt;&lt;P&gt;I have made some progress. To make a long story short, I discovered that my controller was secured. I don't know how that happened, but I was able to unsecure it and now your program is working the way you have shown in your last post.&lt;/P&gt;&lt;P&gt;Now I am able to study your ASM code to make sure I understand it fully before I try to adapt&amp;nbsp; it it work in my code.&lt;/P&gt;&lt;P&gt;I have one thing that is puzzling me though. If I am understanding you r code correctly, you have placed your test data to be burned to D-Flash, in RAM memory starting at Buffer: (address $2100). But when I look at that address all I ever see is $CA,$FE, repeat.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is this?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 16:22:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2078519#M20425</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-04-10T16:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2079198#M20426</link>
      <description>&lt;P&gt;Hi Ladislav,&lt;/P&gt;&lt;P&gt;One more thing. I did some more research and I understand that in order for CW to be able to read the D-Flash the FSEC register needs to be set to $FE. I see that your code has done this, but I can't find out where and how you did it. Could you explain how I can do that in my code&amp;nbsp; please?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 16:32:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2079198#M20426</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-04-11T16:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2082583#M20427</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The topic has already been processes...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-X-MCU-Security/ta-p/1111118" target="_blank"&gt;https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-X-MCU-Security/ta-p/1111118&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Unsecuring-MC9S12XEP100MAG/m-p/617603" target="_blank"&gt;https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Unsecuring-MC9S12XEP100MAG/m-p/617603&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Ladislav&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2025 12:40:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2082583#M20427</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2025-04-17T12:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2084001#M20431</link>
      <description>&lt;P&gt;I've spent a lot of time stepping through this code and recording all the variable and register states on each step. I think I have a pretty good understanding of what is happening here, but one thing in particular still has me puzzled.&lt;/P&gt;&lt;P&gt;In this section of code:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LDX #Buffer ; Load the base address of the array into X register&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LDD #$0123 ; Load the value 0123 into A register&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;STD 0,X ; Store the value at the 0th position of the array&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;X is loaded with $2100, the address of "Buffer" in RAM&lt;/P&gt;&lt;P&gt;D is loaded with decimal 0123&lt;/P&gt;&lt;P&gt;Decimal 0123 is copied into the first two bytes of the "Buffer" array at address $2100 in RAM.&lt;/P&gt;&lt;P&gt;Now, when I use the debugger to check the contents of RAM address $2100 I see $CA, $FE in the first two bytes, and they never change. Why is this and where are the example words stored?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Apr 2025 18:28:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2084001#M20431</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-04-21T18:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2085251#M20433</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/5684"&gt;@roberthiebert&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;What debugger do you use?&lt;/P&gt;
&lt;P&gt;The debugger can interpret the data as 0xCAFE because of ECC, for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 08:18:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2085251#M20433</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2025-04-23T08:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2085528#M20434</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;Code Warrior IDE V5.9.0 Build 5294 Special Edition.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 14:42:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2085528#M20434</guid>
      <dc:creator>roberthiebert</dc:creator>
      <dc:date>2025-04-23T14:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12XEP100 Flash burner question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2086336#M20435</link>
      <description>&lt;P&gt;Hi Robert, &lt;/P&gt;
&lt;P&gt;I mean debugger like PE Micro Multilink (with revision), USBDM, ...&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 07:17:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12XEP100-Flash-burner-question/m-p/2086336#M20435</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2025-04-24T07:17:50Z</dc:date>
    </item>
  </channel>
</rss>

