<?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: Using Flash Commands resets the MKW01Z128 in Wireless MCU</title>
    <link>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425930#M545</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Hello Josep,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Could you please describe the project you are using specifically? It seems not to be any of our software solutions officially supported for KW0x. If that is the case, I am afraid we could not help you with any custom implementation. Anyway, a detailed description of how you are creating such project or where did you get it would give us a better context.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;AngelC&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Jun 2015 17:26:57 GMT</pubDate>
    <dc:creator>AngelC</dc:creator>
    <dc:date>2015-06-11T17:26:57Z</dc:date>
    <item>
      <title>Using Flash Commands resets the MKW01Z128</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425927#M542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im trying to use the "Program longword command" 0x06 to program in flash 4 bytes but when I clear de CCIF bit to execute the command, the debug goes to startup code "startup_MKW01Z4.s"&amp;nbsp; function Reset_Handler, Do you have any idea Why this is ocurring? im not using any interrupts to determine if the command has been executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here is the code using the command:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;//*****************************************************************************&lt;/P&gt;&lt;P&gt;UINT8 FlashIntMan_WriteLongWord(UINT32 startPos,UINT32 dataToWrite)&lt;/P&gt;&lt;P&gt;//*****************************************************************************&lt;/P&gt;&lt;P&gt;// description: Writes a longword of the MCU internal flash&lt;/P&gt;&lt;P&gt;// HW dependanty function&lt;/P&gt;&lt;P&gt;// prerequisities:&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp; - check if the last command has been executed&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp; - check for errors in the last command execution&lt;/P&gt;&lt;P&gt;//*****************************************************************************&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENTER_ATOMIC();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //validar el rango de los argumentos&lt;/P&gt;&lt;P&gt;&amp;nbsp; //if(FlashInt_CheckData)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //load the code of the operation in FCCOB reg&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB0 = PROGRAM_LONGWORD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //load the startting address&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB1 = (UINT8)((startPos &amp;amp; 0x00FF0000)&amp;gt;&amp;gt;16);&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB2 = (UINT8)((startPos &amp;amp; 0x0000FF00)&amp;gt;&amp;gt;8);&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB3 = (UINT8)((startPos &amp;amp; 0x000000FF));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //loading data&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB4 = (UINT8)((dataToWrite &amp;amp; 0xFF000000)&amp;gt;&amp;gt;24);&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB5 = (UINT8)((dataToWrite &amp;amp; 0x00FF0000)&amp;gt;&amp;gt;16);&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB6 = (UINT8)((dataToWrite &amp;amp; 0x0000FF00)&amp;gt;&amp;gt;8);&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB7 = (UINT8)((dataToWrite &amp;amp; 0x000000FF));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //launching the command writting 1 to CCIF&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FSTAT |= FTFA_FSTAT_CCIF_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //wait for the command completion&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(FTFA_FSTAT &amp;amp; FTFA_FSTAT_CCIF_MASK == 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LEAVE_ATOMIC();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; return OK;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could be a problem of the bus speed? Im using BLPI mode:&lt;/P&gt;&lt;P&gt;//in BLPI&lt;/P&gt;&lt;P&gt;//MCGCLKOUT = 4Mhz&lt;/P&gt;&lt;P&gt;//FLASH clk &amp;lt;= 800Khz&lt;/P&gt;&lt;P&gt;//bus clock &amp;lt;= 800Khz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could be a problem of trying to write a protected section of internal flash ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 19:26:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425927#M542</guid>
      <dc:creator>joseplluismoral</dc:creator>
      <dc:date>2015-06-03T19:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using Flash Commands resets the MKW01Z128</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425928#M543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Im using:&lt;/P&gt;&lt;P&gt;- KDS 3.0, without processor expert &lt;/P&gt;&lt;P&gt;- P&amp;amp;EMicro programmer &amp;amp; debugger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 19:28:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425928#M543</guid>
      <dc:creator>joseplluismoral</dc:creator>
      <dc:date>2015-06-03T19:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using Flash Commands resets the MKW01Z128</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425929#M544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Consulting the RCM SRS1, it indicates that the event is caused by a core lock-up...&lt;/P&gt;&lt;P&gt;Which situation using the flash commands can trigger that???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 21:19:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425929#M544</guid>
      <dc:creator>joseplluismoral</dc:creator>
      <dc:date>2015-06-03T21:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using Flash Commands resets the MKW01Z128</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425930#M545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Hello Josep,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Could you please describe the project you are using specifically? It seems not to be any of our software solutions officially supported for KW0x. If that is the case, I am afraid we could not help you with any custom implementation. Anyway, a detailed description of how you are creating such project or where did you get it would give us a better context.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;AngelC&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 17:26:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425930#M545</guid>
      <dc:creator>AngelC</dc:creator>
      <dc:date>2015-06-11T17:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using Flash Commands resets the MKW01Z128</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425931#M546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi AngelC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could write and read the internal flash memory of my kinetis MKW01Z device, the command to write or read the memory must be executed from other section of the internal flash memory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I post the bare metal code for write 4bytes of internal memory, I hope it could be useful to others:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//*****************************************************************************&lt;/P&gt;&lt;P&gt;UINT8 FlashIntMan_WriteLongWord(UINT32 startPos,UINT32 dataToWrite)&lt;/P&gt;&lt;P&gt;//*****************************************************************************&lt;/P&gt;&lt;P&gt;// description: Writes a longword of the MCU internal flash&lt;/P&gt;&lt;P&gt;// HW dependanty function&lt;/P&gt;&lt;P&gt;// prerequisities:&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp; - check if the last command has been executed&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp; - check for errors in the last command execution&lt;/P&gt;&lt;P&gt;//*****************************************************************************&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENTER_ATOMIC();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //waiting for last command to complete,if any&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(((FTFA-&amp;gt;FSTAT)&amp;amp;(1UL &amp;lt;&amp;lt; 7))==0x00);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //load the code of the operation in FCCOB reg&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB0 = PROGRAM_LONGWORD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //load the startting address&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB1 = startPos &amp;gt;&amp;gt; 16;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB2 = startPos &amp;gt;&amp;gt;&amp;nbsp; 8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB3 = startPos;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //loading data&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB4 = dataToWrite &amp;gt;&amp;gt; 24; //[MSB]&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB5 = dataToWrite &amp;gt;&amp;gt; 16;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB6 = dataToWrite &amp;gt;&amp;gt;&amp;nbsp; 8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FCCOB7 = dataToWrite;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //[LSB]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //launching the command writting 1 to CCIF&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA_FSTAT |= FTFA_FSTAT_CCIF_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //wait for the command completion&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(((FTFA-&amp;gt;FSTAT)&amp;amp;(1UL &amp;lt;&amp;lt; 7))==0x00);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LEAVE_ATOMIC();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; //check if address violation has ocurred&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(((FTFA-&amp;gt;FSTAT)&amp;amp;(1UL &amp;lt;&amp;lt; 4)) == 0x10)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //adress violation occurred reporting error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //clearing FPVIOL&lt;/P&gt;&lt;P&gt;&amp;nbsp; FTFA-&amp;gt;FSTAT |= 0x10;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CPrintf(flashViolString);&lt;/P&gt;&lt;P&gt;&amp;nbsp; return ERROR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; return OK;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 21:05:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425931#M546</guid>
      <dc:creator>joseplluismoral</dc:creator>
      <dc:date>2015-11-10T21:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using Flash Commands resets the MKW01Z128</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425932#M547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Josep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, thank you for having shared your code. It could be a starting point for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to develop a fllash programming SW for MKW01 and it seems that you already did it.&lt;/P&gt;&lt;P&gt;I would like to give to customers the capability to reflash their products without having to jump on their premisses!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will it be possible for you to share more code with me? This will same me a bunch of time.&lt;/P&gt;&lt;P&gt;Can you please explain the purpose of ENTER_ATOMIC() and LEAVE_ATOMIC() functions??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope, you'll consider my requuest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;Fabrice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 14:03:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/Using-Flash-Commands-resets-the-MKW01Z128/m-p/425932#M547</guid>
      <dc:creator>fabricetocci</dc:creator>
      <dc:date>2016-01-27T14:03:59Z</dc:date>
    </item>
  </channel>
</rss>

