<?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 Change protection K64 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411244#M23249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am paying with the protection changing, using the kinetis bootloader 1.2&lt;/P&gt;&lt;P&gt;I use the g_bootloaderContext.memoryMap[ kIndexFlashArray ].memoryInterface-&amp;gt;read( ... )&lt;/P&gt;&lt;P&gt;for reading the flash from address 0 to 4095 in a buffer. I change the protection at the offset of the configuration word,&lt;/P&gt;&lt;P&gt;setting one bit of the FPROT. Then I rewrite the buffer in flash.&lt;/P&gt;&lt;P&gt;The operation appears successful, If I enquiry the protection situation the section is flagged as protected (after a reset).&lt;/P&gt;&lt;P&gt;The problem is, if I try to repeat a similar operation, the reading of the flash is no more possible, the CPU resets.&lt;/P&gt;&lt;P&gt;What is happening???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Sep 2015 09:31:30 GMT</pubDate>
    <dc:creator>pietrodicastri</dc:creator>
    <dc:date>2015-09-25T09:31:30Z</dc:date>
    <item>
      <title>Change protection K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411244#M23249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am paying with the protection changing, using the kinetis bootloader 1.2&lt;/P&gt;&lt;P&gt;I use the g_bootloaderContext.memoryMap[ kIndexFlashArray ].memoryInterface-&amp;gt;read( ... )&lt;/P&gt;&lt;P&gt;for reading the flash from address 0 to 4095 in a buffer. I change the protection at the offset of the configuration word,&lt;/P&gt;&lt;P&gt;setting one bit of the FPROT. Then I rewrite the buffer in flash.&lt;/P&gt;&lt;P&gt;The operation appears successful, If I enquiry the protection situation the section is flagged as protected (after a reset).&lt;/P&gt;&lt;P&gt;The problem is, if I try to repeat a similar operation, the reading of the flash is no more possible, the CPU resets.&lt;/P&gt;&lt;P&gt;What is happening???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 09:31:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411244#M23249</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2015-09-25T09:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Change protection K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411245#M23250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pietro di Castri:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, I got confused.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;I change the protection at the offset of the configuration word, setting one bit of the FPROT. Then I rewrite the buffer in flash.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please clarify this?&lt;/P&gt;&lt;P&gt;Are you doing this with the project code or with the blhost tool?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let us know more details or code snippets to understand your situation better.&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>Sat, 26 Sep 2015 01:52:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411245#M23250</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-09-26T01:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change protection K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411246#M23251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning.&lt;/P&gt;&lt;P&gt;and thank You for the assistance.&lt;/P&gt;&lt;P&gt;I try to dump the action I take..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;uint32_t start, length;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;start = g_bootloaderContext.propertyInterface-&amp;gt;store-&amp;gt;flashStartAddress;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;length = g_bootloaderContext.propertyInterface-&amp;gt;store-&amp;gt;flashSectorSize;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;g_bootloaderContext.memoryMap[ kIndexFlashArray ].memoryInterface-&amp;gt;read(&amp;nbsp; start, length, fbuf );&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The previous code reads the first 4096 bytes of the flash.&lt;/P&gt;&lt;P&gt;At the addresses 0x0_0408 - 0x0_040B are the Program flash protection bytes. I reset one bit in the address&lt;/P&gt;&lt;P&gt;0x0_0408, in the fbuf, corresponding the FPROT0, &lt;/P&gt;&lt;P&gt;I rewrite the buffer &lt;/P&gt;&lt;P&gt; g_bootloaderContext.memoryMap[ kIndexFlashArray ].memoryInterface-&amp;gt;write( start, length, fbuf );&lt;/P&gt;&lt;P&gt;I expect to protect the first 32 Kb of the flash.&lt;/P&gt;&lt;P&gt;I reset the processor.&lt;/P&gt;&lt;P&gt;When I ask the protection situation with &lt;/P&gt;&lt;P&gt;flash_is_protected( ... );&lt;/P&gt;&lt;P&gt;I get one section protected. Everything is ok.&lt;/P&gt;&lt;P&gt;But if I try to read from the same address the processor resets. Simply the reading...&lt;/P&gt;&lt;P&gt;Let me know ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pietro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2015 09:46:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411246#M23251</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2015-09-27T09:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Change protection K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411247#M23252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a problem. I don t delete the sector before the rewrite. Now the protection modification appears to work.&lt;/P&gt;&lt;P&gt;But I see a problem from a different perspective. If I change the protection for the section 0, containing the FPROTx ,&lt;/P&gt;&lt;P&gt;There will be no way to modify the protection, because the flash in itself is protected. Is a back door action is still possible?&lt;/P&gt;&lt;P&gt;Or maybe the backdoor is related to the security rather than the protection...&lt;/P&gt;&lt;P&gt;Is it ????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pietro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2015 11:45:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411247#M23252</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2015-09-27T11:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change protection K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411248#M23253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge&lt;/P&gt;&lt;P&gt;I am working like a horse to finalize the bootloading..&lt;/P&gt;&lt;P&gt;I see now another problem:&lt;/P&gt;&lt;P&gt;The HEX file produce a string &lt;/P&gt;&lt;P&gt;:04D41C0011040000F7&lt;/P&gt;&lt;P&gt;The address D4C0 fails the flash_check_range( ... ) &lt;/P&gt;&lt;P&gt;But I need to write there...&lt;/P&gt;&lt;P&gt;So what do to????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2015 17:25:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411248#M23253</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2015-09-27T17:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change protection K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411249#M23254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge&lt;/P&gt;&lt;P&gt;I understand it is not so interesting and I am creating some confusion. &lt;/P&gt;&lt;P&gt;I am using a console for the boot load, so I am bypassing the offered protocol now.&lt;/P&gt;&lt;P&gt;I am accomodating the relevant problems now.&lt;/P&gt;&lt;P&gt;The write function defaults to the status_t flash_mem_write(uint32_t address, uint32_t length, const uint8_t * buffer )&lt;/P&gt;&lt;P&gt;using the programming without the flexram.&lt;/P&gt;&lt;P&gt;In the driver also a possibility exists, it seems. I see the&lt;/P&gt;&lt;P&gt;status_t flash_program_section(flash_driver_t * driver, uint32_t start, uint32_t * src, uint32_t lengthInBytes)&lt;/P&gt;&lt;P&gt;in the flash_program_section.c. Do You think it is possible to use??&lt;/P&gt;&lt;P&gt;Is there a documentation of the performances of the two approaches? I am writing in small chunks of 16 or less byte per time,&lt;/P&gt;&lt;P&gt;I don t know if it is worth to use the FLEX ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pietro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 07:28:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411249#M23254</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2015-09-29T07:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change protection K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411250#M23255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pietro&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the delay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use either of the available programming functions, as long as the flash spaces to write are previously erased.&lt;/P&gt;&lt;P&gt;If you have enough data to fill the program section buffer (FlexRAM space) then using the program section command is of course advisable, since you eliminate some delays between programming 8-bytes at a time with the Program Phrase command. Other than that then the command used will entirely depend on your application or the bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About the backdoor key, that is only for use when the MCU is secured. For detailed information there is an application note:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN4507.pdf" title="http://www.freescale.com/files/microcontrollers/doc/app_note/AN4507.pdf"&gt;http://www.freescale.com/files/microcontrollers/doc/app_note/AN4507.pdf&lt;/A&gt; &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>Tue, 29 Sep 2015 20:09:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411250#M23255</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-09-29T20:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change protection K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411251#M23256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning&lt;/P&gt;&lt;P&gt;Thank You for follow up. I have a good solution for the flash writing and interaction with protection and security.&lt;/P&gt;&lt;P&gt;I write correctly all the application code in the flash.&lt;/P&gt;&lt;P&gt;But I am definitely in a hell, when jumping to the target application.&lt;/P&gt;&lt;P&gt;The &lt;EM&gt;&lt;STRONG&gt;jump_to_application(...)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;function has the&lt;STRONG&gt; farewellBootloader()&lt;/STRONG&gt; .. The MSP and PSP are correctly loaded, the program counter is loaded with the correct address.&lt;/P&gt;&lt;P&gt;I see the first instruction of the target application, but there is no way to proceed, the hard fault handler is resetting the CPU. &lt;/P&gt;&lt;P&gt;It could be related to some privilege or register situation on the ARM core. I really do not understand.&lt;/P&gt;&lt;P&gt;If at reset I force the program counter to the target application ( same as &lt;STRONG&gt;farewellBootloader )&lt;/STRONG&gt; The target application execute normally..&lt;/P&gt;&lt;P&gt;What can this hell be....????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 09:31:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411251#M23256</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2015-10-01T09:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Change protection K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411252#M23257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a very hard day... The invstat in the hard fault register status tells me the jump instruction need to provide&lt;/P&gt;&lt;P&gt;always an odd address. When jumping to the main application the address of the main is provided with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; farewellBootloader = (void (*)(void))( applicationAddress&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt; );&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the C code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt; farewellBootloader();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will produce the hard fault.&lt;/P&gt;&lt;P&gt;I modify with &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt; farewellBootloader = (void (*)(void))( applicationAddress | 1&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt; );&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and Everything works fine. I wander how this error is there.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your comments are welcome..&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;Pietro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 15:37:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411252#M23257</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2015-10-01T15:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Change protection K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411253#M23258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pietro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the original KBOOT bootloader the &lt;STRONG&gt;applicationAddress&lt;/STRONG&gt; is taken from the application's vector table. When filled correctly with the linker/compiler of the application's project, then the vector table should have the entry point address already considering the &lt;STRONG&gt;+1&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From your issue I guess you are hard-coding the &lt;STRONG&gt;applicationAddress&lt;/STRONG&gt; instead of taking the value from the vector table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this clarifies.&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>Thu, 01 Oct 2015 22:58:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Change-protection-K64/m-p/411253#M23258</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-10-01T22:58:36Z</dc:date>
    </item>
  </channel>
</rss>

