<?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>CodeWarrior for MCUのトピックProcessor Expert and erasing flash</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Processor-Expert-and-erasing-flash/m-p/382460#M11410</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using Processor Expert with&amp;nbsp; CW 10.4 on a MCF51QU32VFM (coldfire+).&amp;nbsp; I'm trying to write data to the internal flash. I've inserted a flash component using Processor Expert and defined a 1KB flash space at 0x200000 (where the DFlash starts). I copied the functions from the demo projects packaged with CW to erase, read and write to the flash. The following events methods have been defined in Events.c:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;void FLASH1_OnOperationComplete(LDD_TUserData *UserDataPtr)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; uint8_t *OpStatus = (LDD_TUserData*) UserDataPtr;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; *OpStatus = TRUE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;void FLASH1_OnError(LDD_TUserData *UserDataPtr)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my main function I first try to erase the 1KB of flash by calling the following function:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;bool EraseFlash(LDD_TDeviceData *DeviceData, LDD_FLASH_TAddress FromAddress, LDD_FLASH_TDataSize Size, uint8_t* OpStatus)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; LDD_TError Error;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; int i = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; *OpStatus = FALSE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; Error = FLASH1_Erase(DeviceData, FromAddress, Size); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; if (Error) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return FALSE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; while(*OpStatus != TRUE);&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; return TRUE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When &lt;SPAN style="color: #0000ff;"&gt;FLASH1_Erase(..)&lt;/SPAN&gt; is called in the above function, the&lt;SPAN style="color: #0000ff;"&gt; FLASH1_OnError(..)&lt;/SPAN&gt; event is triggered although&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;FLASH1_Erase(..)&lt;/SPAN&gt; returns with no error. &lt;SPAN style="color: #0000ff;"&gt;FLASH1_OnOperationComplete(.. )&lt;/SPAN&gt; is never triggered, so &lt;SPAN style="color: #0000ff;"&gt;EraseFlash(..)&lt;/SPAN&gt; is stuck in an infinite loop at&lt;SPAN style="color: #0000ff;"&gt; while(*OpStatus != TRUE)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Philip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Aug 2014 14:52:21 GMT</pubDate>
    <dc:creator>phlp</dc:creator>
    <dc:date>2014-08-26T14:52:21Z</dc:date>
    <item>
      <title>Processor Expert and erasing flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Processor-Expert-and-erasing-flash/m-p/382460#M11410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using Processor Expert with&amp;nbsp; CW 10.4 on a MCF51QU32VFM (coldfire+).&amp;nbsp; I'm trying to write data to the internal flash. I've inserted a flash component using Processor Expert and defined a 1KB flash space at 0x200000 (where the DFlash starts). I copied the functions from the demo projects packaged with CW to erase, read and write to the flash. The following events methods have been defined in Events.c:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;void FLASH1_OnOperationComplete(LDD_TUserData *UserDataPtr)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; uint8_t *OpStatus = (LDD_TUserData*) UserDataPtr;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; *OpStatus = TRUE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;void FLASH1_OnError(LDD_TUserData *UserDataPtr)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my main function I first try to erase the 1KB of flash by calling the following function:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;bool EraseFlash(LDD_TDeviceData *DeviceData, LDD_FLASH_TAddress FromAddress, LDD_FLASH_TDataSize Size, uint8_t* OpStatus)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; LDD_TError Error;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; int i = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; *OpStatus = FALSE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; Error = FLASH1_Erase(DeviceData, FromAddress, Size); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; if (Error) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return FALSE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; while(*OpStatus != TRUE);&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; return TRUE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When &lt;SPAN style="color: #0000ff;"&gt;FLASH1_Erase(..)&lt;/SPAN&gt; is called in the above function, the&lt;SPAN style="color: #0000ff;"&gt; FLASH1_OnError(..)&lt;/SPAN&gt; event is triggered although&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;FLASH1_Erase(..)&lt;/SPAN&gt; returns with no error. &lt;SPAN style="color: #0000ff;"&gt;FLASH1_OnOperationComplete(.. )&lt;/SPAN&gt; is never triggered, so &lt;SPAN style="color: #0000ff;"&gt;EraseFlash(..)&lt;/SPAN&gt; is stuck in an infinite loop at&lt;SPAN style="color: #0000ff;"&gt; while(*OpStatus != TRUE)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Philip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 14:52:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Processor-Expert-and-erasing-flash/m-p/382460#M11410</guid>
      <dc:creator>phlp</dc:creator>
      <dc:date>2014-08-26T14:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Processor Expert and erasing flash</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Processor-Expert-and-erasing-flash/m-p/382461#M11411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Philip.&lt;/P&gt;&lt;P&gt;can you please try the same with CW10.6?&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CW-MCU10&amp;amp;tid=CWH" title="https://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CW-MCU10&amp;amp;tid=CWH"&gt;https://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CW-MCU10&amp;amp;tid=CWH&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the problem persists in CW10.6, please upload your testing demo code. We will check it here. thansk!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;ZhangJun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Sep 2014 11:08:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Processor-Expert-and-erasing-flash/m-p/382461#M11411</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2014-09-09T11:08:37Z</dc:date>
    </item>
  </channel>
</rss>

