<?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>Kinetis MicrocontrollersのトピックRe: Programming the  FTFA_FOPT register using blhost.</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Programming-the-FTFA-FOPT-register-using-blhost/m-p/678243#M41767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem has been found.&amp;nbsp; There was a&amp;nbsp; "Flash Configuration" definition in a assembly file that was overwriting the flash when we programmed the application.&amp;nbsp; We found the problem by looking at the memory map at the address that was being written by the application file we were building and then found the definition in the assembly file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Jun 2017 19:10:07 GMT</pubDate>
    <dc:creator>dougbaker</dc:creator>
    <dc:date>2017-06-08T19:10:07Z</dc:date>
    <item>
      <title>Programming the  FTFA_FOPT register using blhost.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Programming-the-FTFA-FOPT-register-using-blhost/m-p/678242#M41766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a KL17 I would like to be able to force the chip to the bootloader using the kl17’s reset pin and the BOOCFG0 pin.&amp;nbsp; According to the documentation on the KL17, I need to program the bits in the FTFA_FOPT register and write the value ZERO to bit NMI_DIS and also a ZERO to the BOOTPIN_OPT.&amp;nbsp; I would like to write the value 0xF9 to the register FTFA_FOPT.&lt;/P&gt;&lt;P&gt;The write to the register FTFA_FOPT is an indirect write where I need to write to the flash at location 0x0000_040D because the chip will read the contents of address 0x0000_040D and put it the FTFA_FOPT register.&lt;/P&gt;&lt;P&gt;Using blhost, I do the following:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;blhost -p COM44,115200 flash-erase-all-unsecure&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;blhost -p COM44,115200 read-memory&amp;nbsp; 0x040C 4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;blhost -p COM44,115200 write-memory 0x040C {{FEF9}}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;blhost -p COM44,115200 read-memory&amp;nbsp; 0x040C 4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now I power cycle the CPU and read the memory:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;blhost -p COM44,115200 read-memory&amp;nbsp; 0x040D 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;Ping responded in 1 attempt(s)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;Inject command 'read-memory'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;Successful response to command 'read-memory'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;f9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;(1/1)100% Completed!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;Successful generic response to command 'read-memory'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;Response status = 0 (0x0) Success.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;Response word 1 = 1 (0x1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;Read 1 of 1 bytes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, the address 0x040D is reading F9 so it has the correct value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then program an application on the KL17 using blhost:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;blhost -p COM44,115200 flash-image kl17_ShockSense.hex erase&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;blhost -p COM44,115200 reset&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The app I put on the KL17 only jumps to the boot code and does not touch the flash at all to erase or write it.&amp;nbsp; After the code jumps to boot, I can use blhost to read the flash again and the value at address is now 0x3F and not 0xF9.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;blhost -p COM44,115200 read-memory&amp;nbsp; 0x040D 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That tells me something would have to erase the flash at the location to change the ‘9’ to a ‘f’ and also then write the location to change the ‘f’ in the 0xf9 to a ‘3’.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Doug&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2017 15:51:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Programming-the-FTFA-FOPT-register-using-blhost/m-p/678242#M41766</guid>
      <dc:creator>dougbaker</dc:creator>
      <dc:date>2017-06-07T15:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Programming the  FTFA_FOPT register using blhost.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Programming-the-FTFA-FOPT-register-using-blhost/m-p/678243#M41767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem has been found.&amp;nbsp; There was a&amp;nbsp; "Flash Configuration" definition in a assembly file that was overwriting the flash when we programmed the application.&amp;nbsp; We found the problem by looking at the memory map at the address that was being written by the application file we were building and then found the definition in the assembly file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jun 2017 19:10:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Programming-the-FTFA-FOPT-register-using-blhost/m-p/678243#M41767</guid>
      <dc:creator>dougbaker</dc:creator>
      <dc:date>2017-06-08T19:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Programming the  FTFA_FOPT register using blhost.</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Programming-the-FTFA-FOPT-register-using-blhost/m-p/678244#M41768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Doug,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for coming back and sharing your finding. Indeed, the startup assembly file usually has the flash configuration data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2017 23:56:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Programming-the-FTFA-FOPT-register-using-blhost/m-p/678244#M41768</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2017-06-09T23:56:20Z</dc:date>
    </item>
  </channel>
</rss>

