<?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: S12Z-Bootloader in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612548#M13207</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gordon,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You are right. This is just &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;the &lt;/SPAN&gt;workaround. The default S12Z CW project do not place _Startup() function as the first object into flash - the init structure, DoZeroOut() and DoCopyDown() are placed as first. Therefore the application _Startup() address vary on a number of used variables in the application. That behavior is quite annoying in the case of a solution with separate bootloader and application projects. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The workaround: The application start address in bootloader is hard coded as the first byte of flash. The application linker file is modified that first byte of flash will be 0xBA (asm JMP instruction), followed by a vector to the application _Startup() function. So, bootloader's jump to the first byte of flash will cause another jump to the application _Startup() function. This workaround consumes 4bytes from flash and 1.5 bus cycle for an additional jump.&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The another possible solution (probably better) is to reorganize code in application Start12z.c file that _Startup() function will be placed into flash as first.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See my post above with both workarounds.&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;Best regards&lt;/P&gt;&lt;P&gt;Radek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jan 2017 20:15:09 GMT</pubDate>
    <dc:creator>RadekS</dc:creator>
    <dc:date>2017-01-23T20:15:09Z</dc:date>
    <item>
      <title>S12Z-Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612542#M13201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Iam now make the S12ZVC64-bootloader. when I download the S19 &amp;nbsp;file into the MCU .the programe will die . I couldnot find the reason .Could you help me solve the problem. The attachment is my codes.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339062"&gt;S12ZVC_Boot.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339062"&gt;S12ZVC-app.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2017 15:02:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612542#M13201</guid>
      <dc:creator>xiaohui200808</dc:creator>
      <dc:date>2017-01-12T15:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z-Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612543#M13202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing that the problem is related to the fact that the code you are copying to RAM is compiled and linked for execution out of Flash, not RAM. In addition, there is an easier way to perform the copy operation and then reference the two functions in RAM. I'm attaching a modified project that implements what I'll briefly describe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First in the SEGMENTS section of your .prm file, you'll want to replace&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;SHADOW_RAM_S&amp;nbsp; = READ_WRITE&amp;nbsp; 0x001000 TO 0x0011FF;&lt;SPAN class=""&gt; &lt;/SPAN&gt;// 512 for functions that will be copied to RAM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;SHADOW_ROM_S&amp;nbsp; = &lt;SPAN style="color: #007aaa;"&gt;&lt;STRONG&gt;READ_ONLY&lt;/STRONG&gt;&lt;/SPAN&gt; &amp;nbsp; 0xFFFC00 &lt;SPAN style="color: #007aaa;"&gt;&lt;STRONG&gt;TO&lt;/STRONG&gt;&lt;/SPAN&gt; 0xFFFDFF&amp;nbsp; &lt;SPAN style="color: #007aaa;"&gt;&lt;STRONG&gt;RELOCATE_TO&lt;/STRONG&gt;&lt;/SPAN&gt; 0x001000;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d81e00;"&gt;// 512 for funtions that will be copied to RAM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and remove "SHADOW_ROM_S" from&amp;nbsp;/* non-paged FLASHs */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will tell the linker to place the code in Flash from&amp;nbsp;&lt;SPAN&gt;0xFFFC00&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #007aaa;"&gt;&lt;STRONG&gt;TO&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;0xFFFDFF but to link it to address 0x001000.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Remove:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #d81e00; font-size: 10px;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;SHADOW_RAM&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #007aaa;"&gt;&lt;STRONG&gt;INTO&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; SHADOW_RAM_S;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;/* Reserve Shadow ROM to copy flash related functions here */&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;from the PLACEMENTS section.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Next, replace your &amp;nbsp;&lt;/SPAN&gt;Copy_Shadow() function with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #4e9072; font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;/*************************************************************************************/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt; __SEG_START_REF(a) __SEG_START_ &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;##&lt;/STRONG&gt;&lt;/SPAN&gt; a&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt; __SEG_END_REF(a) __SEG_END_ &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;##&lt;/STRONG&gt;&lt;/SPAN&gt; a&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt; __SEG_SIZE_REF(a) __SEG_SIZE_ &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;##&lt;/STRONG&gt;&lt;/SPAN&gt; a&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt; __SEG_START_DEF(a) &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;extern&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;char&lt;/STRONG&gt;&lt;/SPAN&gt; __SEG_START_REF(a) []&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt; __SEG_END_DEF(a) &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;extern&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;char&lt;/STRONG&gt;&lt;/SPAN&gt; __SEG_END_REF( a) []&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt; __SEG_SIZE_DEF(a) &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;extern&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;char&lt;/STRONG&gt;&lt;/SPAN&gt; __SEG_SIZE_REF( a) []&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;__SEG_START_DEF(SHADOW_ROM);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;__SEG_END_DEF(SHADOW_ROM);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;__SEG_SIZE_DEF(SHADOW_ROM);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;/P&gt;&lt;P style="color: #4e9072; font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;/*************************************************************************************/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;static&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;STRONG&gt;CopyCodeToRAM&lt;/STRONG&gt;(&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&lt;/SPAN&gt;/* Variable Declarations */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;&lt;SPAN style="color: #006141;"&gt;uchar&lt;/SPAN&gt; *Src;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;&lt;SPAN style="color: #006141;"&gt;uchar&lt;/SPAN&gt; *Dst;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;&lt;SPAN style="color: #006141;"&gt;uint&lt;/SPAN&gt;&amp;nbsp; SegSize;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;&lt;SPAN style="color: #006141;"&gt;uint&lt;/SPAN&gt;&amp;nbsp; x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;/P&gt;&lt;P style="color: #4e9072; font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&lt;/SPAN&gt;/* Begin Function CopyCodeToRAM() */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;Src = (&lt;/SPAN&gt;&lt;SPAN style="color: #006141;"&gt;uchar&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; *)__SEG_START_REF(SHADOW_ROM);&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;/* RAM code resides in Flash */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;Dst = (&lt;/SPAN&gt;&lt;SPAN style="color: #006141;"&gt;uchar&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; *)0x001000;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;/* copied to RAM */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;SegSize = (&lt;SPAN style="color: #006141;"&gt;uint&lt;/SPAN&gt;)__SEG_SIZE_REF(SHADOW_ROM);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #931a68;"&gt;&lt;STRONG&gt;for&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (x = 0; x &amp;lt; SegSize; x++)&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;/* just copy a byte at a time */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp; *Dst++ = *Src++;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #4e9072; font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;}&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;/* end CopyCodeToRAM */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px;"&gt;&lt;/P&gt;&lt;P style="color: #4e9072; font-size: 10px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 15px;"&gt;/*************************************************************************************/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macros are used to&amp;nbsp;obtain the&amp;nbsp;&lt;SPAN style="color: #000000;"&gt;SHADOW_ROM section start address and its size from linker defined symbols.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Finally, you no longer need the function pointers &lt;/SPAN&gt;FTMRZ_Erase_Flash_RAM and&amp;nbsp;FTMRZ_Prog_Phrase_RAM to call the functions. instead you can directly reference the two functions that were copied into RAM via their names i.e.&amp;nbsp;FTMRZ_Erase_Flash(); and&amp;nbsp;FTMRZ_Prog_Phrase(); because the code was linked to their relocated addresses in RAM.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully I've not missed describing any of the modifications I made to your project, but the modified project is attached. I couldn't completely test this out, but I could do enough via the debugger in a target system to see that the functions were being called in RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jan 2017 01:20:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612543#M13202</guid>
      <dc:creator>gordondoughman</dc:creator>
      <dc:date>2017-01-13T01:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z-Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612544#M13203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Hi Xiaohui,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;P&gt;Your app prm linker file contains:&lt;/P&gt;&lt;P&gt;VECTOR 0 app_entry&lt;/P&gt;&lt;P&gt;Please comment it out. The last sector of Flash is occupied by Bootloader and application cannot write reset vector at this place.&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt;Your APPLICATION_START_ADD value in bootloader is configured 0xFF0000. But, this address do not refer to _Startup() function in your application. Your application starts at address 0xFF002E&amp;nbsp; -&amp;nbsp; see app map file. Unfortunately the default placement of _Startup() function depends on used number of variables. The initial variable values with DoZeroOut() and DoCopyDown() finctions are placed into memory prior _Startup() function.&lt;/P&gt;&lt;P&gt;So, you have to somehow manage that _Startup() function will be placed into flash as first (see attached example of app Start12z.c file) or your pointer to _Startup() function must be dynamically modified according to app code update (see attached example of app prm linker file which contains jump to _Startup() function in first few bytes of flash).&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>Tue, 17 Jan 2017 15:23:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612544#M13203</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2017-01-17T15:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z-Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612545#M13204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I have already could update app by CAN BUS when the app donot relocated the interrupt &amp;nbsp;.but I want to relocated interrupt table in my app.something was wrong , app couldnot work.Attenchment is my codes,Could you help me where is the problem is.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 11:26:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612545#M13204</guid>
      <dc:creator>xiaohui200808</dc:creator>
      <dc:date>2017-01-23T11:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z-Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612546#M13205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Hi Xiaohui,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I shortly checked your code, but unfortunately I cannot see any obvious issue for what it shuld not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Just few notes:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You placed vector table at address 0xFFF010. In that case, you should exclude this area from ROM avialble for linker use. The default CW project do not report warning about memory overlapping.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The CPMUAPIR register is 16bit register.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, nothing from that should not have any influence on your vector table and their functionality.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Are you sure, that you bootloader programmed vector table?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did your vector table works when you load your app directly, without bootloader?&lt;/SPAN&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>Mon, 23 Jan 2017 17:28:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612546#M13205</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2017-01-23T17:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z-Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612547#M13206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;xiaohui wang,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;I took a look at the bootloader code and the application. In the bootloader function&amp;nbsp;Jump_Main_Application()&amp;nbsp;you are creating a function pointer with the "hard coded" address 0xff0000.&amp;nbsp;However, I can see looking at the S-Record file (159357.sx) that a value of 0xBAFF00 is stored at&amp;nbsp;0xff0000. It looks like the address to which you want to jump actually&amp;nbsp;begins at&amp;nbsp;&lt;SPAN&gt;0xff0001 (i.e. 0xFF0004).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN&gt;Remember, pointers, including function pointers, in the S12Z are &lt;EM&gt;&lt;STRONG&gt;three&lt;/STRONG&gt;&lt;/EM&gt; bytes not four.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN&gt;Gordon&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 19:42:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612547#M13206</guid>
      <dc:creator>gordondoughman</dc:creator>
      <dc:date>2017-01-23T19:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z-Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612548#M13207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gordon,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You are right. This is just &lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;the &lt;/SPAN&gt;workaround. The default S12Z CW project do not place _Startup() function as the first object into flash - the init structure, DoZeroOut() and DoCopyDown() are placed as first. Therefore the application _Startup() address vary on a number of used variables in the application. That behavior is quite annoying in the case of a solution with separate bootloader and application projects. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The workaround: The application start address in bootloader is hard coded as the first byte of flash. The application linker file is modified that first byte of flash will be 0xBA (asm JMP instruction), followed by a vector to the application _Startup() function. So, bootloader's jump to the first byte of flash will cause another jump to the application _Startup() function. This workaround consumes 4bytes from flash and 1.5 bus cycle for an additional jump.&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The another possible solution (probably better) is to reorganize code in application Start12z.c file that _Startup() function will be placed into flash as first.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See my post above with both workarounds.&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;Best regards&lt;/P&gt;&lt;P&gt;Radek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 20:15:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612548#M13207</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2017-01-23T20:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z-Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612549#M13208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Hi Xiaohui,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As I can see, you implemented both workarounds that I proposed. Using just one of them is enough.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The part of your code in bootloader:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case 0xFD: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; data[0]=0xC1;bootCAN_send(bootupID, data, 1); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisableInterrupts;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CAN0CTL0 = 0x01;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // MSCAN in initialization mode &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (!(CAN0CTL1_INITAK));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jump_Main_Application();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; for(;;) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }break;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The bootCAN_send() function just fill TX buffer and schedule transmitting data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The CAN0CTL0 = 0x01; command will abort all receiving and transmitting action on MSCAN module.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like to recommend switch MSCAN module into sleep mode prior enter into initialization mode. That will manage that MSCAN will wait until all TX buffers are empty and no RX message is receiving. In that case, the CAN bus will be not rushed by corrupted messages.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CAN0CTL0_SLPRQ = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //sleep mode request&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;while(CAN0CTL1_SLPAK == 0); //wait for acknowledge of sleep mode&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CAN0CTL0 = 0x01;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // MSCAN in initialization mode&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;while (!(CAN0CTL1_INITAK));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You may also try to clear CAN flags or disable CAN interrupt prior that operation.&lt;/SPAN&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>Mon, 23 Jan 2017 20:44:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612549#M13208</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2017-01-23T20:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z-Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612550#M13209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I tried modified my app started address 0xFF0004. if I use CAN received interrupt .it could work normally.if Iused API interrupt to light a led ,it couldnot work ,because &amp;nbsp; &lt;SPAN class=""&gt;machine exception&lt;/SPAN&gt;&amp;nbsp; interrupt&amp;nbsp;5U &amp;nbsp; will happen . &amp;nbsp;because &amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;MMCECL_ERR=1, &amp;nbsp;means&amp;nbsp;access to an illegal address.Is there any way to avoid this problem .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 01:27:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/612550#M13209</guid>
      <dc:creator>xiaohui200808</dc:creator>
      <dc:date>2017-02-06T01:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z-Bootloader</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/1715667#M19420</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm working with ZVM MCU, and develop bootloader, use the same strategy for this application.&lt;/P&gt;&lt;P&gt;I met a issue that: i can successfully implement the funtion in RAM -&amp;nbsp;&lt;SPAN&gt;FTMRZ_Erase_Flash_RAM()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and can return back, but died at the line -&amp;nbsp;&lt;SPAN&gt;u8flashErased = 1; /* Indicate that flash has been erased */.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;why have this issue?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;waiting for your feedback ,thanks.&lt;/SPAN&gt;&lt;/P&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;void Flash_Operation(void)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;UINT16 u16BP_ptr = 0, u16PS_ptr = 0; /* Boot Phrase and Program Structure pointers */&amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if(!u8flashErased) /* If the flash hasn't been erased, erase it */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RTI_Disable(); /* Stop the RTI timer, no timeout required anymore */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FTMRZ_Erase_Flash_RAM(); /* Jump to RAM and Erase Flash, return to Flash when done. */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//FTMRZ_Erase_Flash();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;u8flashErased = 1; /* Indicate that flash has been erased */ &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Sep 2023 08:45:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-Bootloader/m-p/1715667#M19420</guid>
      <dc:creator>kongst</dc:creator>
      <dc:date>2023-09-01T08:45:15Z</dc:date>
    </item>
  </channel>
</rss>

