<?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: KL02 FLASH_OnOperationComplete() does not happen in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-FLASH-OnOperationComplete-does-not-happen/m-p/352639#M17495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patricia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually the problem is still there.&lt;/P&gt;&lt;P&gt;As this is a customer's target board, and we provide tech support for the F/W. There are limited target boards for our testing. We cannot be sure if it is an issue of IC, PCBA, or software? and have to wait for the next new FAB of new target boards (it is customer's schedule).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We just wondering why this problem happened - Multilink downloading is ok, but F/W program white failed?&lt;/P&gt;&lt;P&gt;Is there a way to debug this problem.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Benjamin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2015 01:19:25 GMT</pubDate>
    <dc:creator>benjaminchang</dc:creator>
    <dc:date>2015-05-06T01:19:25Z</dc:date>
    <item>
      <title>KL02 FLASH_OnOperationComplete() does not happen</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-FLASH-OnOperationComplete-does-not-happen/m-p/352637#M17493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have a long time bootloader works fine for KL25. Now we revise it for KL02.&lt;/P&gt;&lt;P&gt;The same program code is used, with CodeWarrior 10.6 and ProcessorExpert component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We first tried on FRDM-KL02 (&lt;SPAN lang="EN-US" style="font-size: 12.0pt; font-family: 'Calibri','sans-serif'; color: #5b9bd5;"&gt;MKL02Z32VFM4&lt;/SPAN&gt;), and also works fine.&lt;/P&gt;&lt;P&gt;But after we port it to custom target board (&lt;SPAN lang="EN-US" style="font-size: 12.0pt; font-family: 'Calibri','sans-serif'; color: #5b9bd5;"&gt;MKL02Z32VFG4&lt;/SPAN&gt;), using MultiLink to debug in CW,&lt;/P&gt;&lt;P&gt;The function &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 12.0pt; font-family: Consolas; color: black;"&gt;FLASH_OnOperationComplete()&lt;/SPAN&gt;&lt;/STRONG&gt; never reach, and it just keep looping and wait for complete&lt;/P&gt;&lt;P&gt;"&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: #7f0055; background: yellow;"&gt;while&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Consolas; color: black; background: yellow;"&gt;(OpStatus != TRUE)&lt;/SPAN&gt;&lt;/STRONG&gt;" as below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With CW debug, the program flash is correctly downloaded.&lt;/P&gt;&lt;P&gt;Please check and comment what might be the reason for this? Or what kind data/action can we check/make?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Next is the part of code&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// in event.c, hook for complete and error&lt;/P&gt;&lt;P&gt;void FLASH_OnOperationComplete(LDD_TUserData *UserDataPtr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Write your code here ... */&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t *OpStatus = (LDD_TUserData*) UserDataPtr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; *OpStatus = TRUE;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void FLASH_OnError(LDD_TUserData *UserDataPtr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Write your code here ... */&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t *OpStatus = (LDD_TUserData*) UserDataPtr; // Bj, 140605&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; *OpStatus = 8;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;// User program file, function to perform flash&lt;/P&gt;&lt;P&gt;bool WriteFlash(LDD_FLASH_TAddress FromAddress, LDD_TData* DataPtr, LDD_FLASH_TDataSize Size)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; LDD_TError Error;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //*OpStatus = FALSE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LDD_TDeviceData *FlashDevData;&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint8_t OpStatus=FALSE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; FlashDevData = IntFlash(&amp;amp;OpStatus);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Error = FLASH_Write(FlashDevData, DataPtr, FromAddress, Size);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (Error) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // no function call error found&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return FALSE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(OpStatus != TRUE)&amp;nbsp; // as flash never complete, so it keeps looping in this while loop!!&lt;/P&gt;&lt;P&gt;&amp;nbsp; {/* Wait while operation done , Bj, 0605*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (OpStatus == 8)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf ("Wf8");&amp;nbsp; // on error flag, set in event.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; return TRUE;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;// Reserve 1KB size of data on top of BootLoader as Signature&lt;/P&gt;&lt;P&gt;// main program will try to write a version number to the top of Bootloader for the 1st time (empty sector)&lt;/P&gt;&lt;P&gt;.. ..&lt;/P&gt;&lt;P&gt;if (BootVer1.VerBoot==0xff) { // check empty flag for the very first one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;BootVer1.VerBoot = 3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WriteFlash (BL_TOP, &amp;amp;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;BootVer1.VerBoot, 1); // write a new flag, &amp;lt;&amp;lt; this is where the program stuck!!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;.. ..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;// We also tried to add checking in the loop&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; FLASH_Main(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;FlashDevData);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; OpStatus=FLASH_GetOperationStatus (FlashDevData);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;// but OpStatus is always 4 (LDD_FLASH_START)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;// 2015/3/29 add:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;// Before write Bootloader program, we developed AP program on this target board, and it works fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;// We developed under CW10.6, using Multilink to download and debug, and running OK.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;// The H/W is simple, checked, and nothing wrong can be found.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;// We tested two boards, and both have this Flashing problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;// We tried to revise the sample FLASH program of CW (for KL05), to KL02, only to found Erase is failed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;// Could this be a chip issue? How to identify it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;// Could the flash be locked? But CW downloading is working fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 08:38:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-FLASH-OnOperationComplete-does-not-happen/m-p/352637#M17493</guid>
      <dc:creator>benjaminchang</dc:creator>
      <dc:date>2015-03-26T08:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: KL02 FLASH_OnOperationComplete() does not happen</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-FLASH-OnOperationComplete-does-not-happen/m-p/352638#M17494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Benjamin&lt;/P&gt;&lt;P&gt;Sorry for the late response, are you still&amp;nbsp; having problems?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Patricia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2015 17:42:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-FLASH-OnOperationComplete-does-not-happen/m-p/352638#M17494</guid>
      <dc:creator>PatriciaTeran</dc:creator>
      <dc:date>2015-05-05T17:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: KL02 FLASH_OnOperationComplete() does not happen</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-FLASH-OnOperationComplete-does-not-happen/m-p/352639#M17495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patricia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually the problem is still there.&lt;/P&gt;&lt;P&gt;As this is a customer's target board, and we provide tech support for the F/W. There are limited target boards for our testing. We cannot be sure if it is an issue of IC, PCBA, or software? and have to wait for the next new FAB of new target boards (it is customer's schedule).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We just wondering why this problem happened - Multilink downloading is ok, but F/W program white failed?&lt;/P&gt;&lt;P&gt;Is there a way to debug this problem.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Benjamin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 01:19:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-FLASH-OnOperationComplete-does-not-happen/m-p/352639#M17495</guid>
      <dc:creator>benjaminchang</dc:creator>
      <dc:date>2015-05-06T01:19:25Z</dc:date>
    </item>
  </channel>
</rss>

