<?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 ezport write_section fails/bugs in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ezport-write-section-fails-bugs/m-p/760335#M46342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;Hi,&lt;/P&gt;&lt;P&gt;I am trying to write firmware from flash of 1 kinnetis device to another. And I had success until my aim firmware size grown up.(20550 bytes by far)&lt;/P&gt;&lt;P&gt;I've made "write section" command followed by read function to check correctness. I got difference at address 0x4001 so having 0x4000 bytes written correct.(need to say that something was written after 0x4000. it is not 0xff bytes)&lt;/P&gt;&lt;P&gt;Ok, I thought it was a fail because of RAM or sector sizes. I've made "write_sector"(with varying sector size) function and "check_sector" functions. It looks like working(it writes and checks at a sectors address with no issues) but when I check the whole firmware I got difference just after first sector at 1st byte.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thinking of root of my problem it seems like wrong address been calculated. Am i correct that 32-bit aligned address is a simple address that has 2 LSB's equal to 0?&lt;/P&gt;&lt;P&gt;So to start a write at 0x2000 i need to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ez_transmit(0x02);&amp;nbsp; //programm sector opcode&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; ez_transmit(0x00); &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; ez_transmit(0x20);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; ez_transmit(0x00);&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Attached file give a view of a code used.(nonrelevant part is deleted)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Apr 2018 12:38:27 GMT</pubDate>
    <dc:creator>alexeyusoltsev</dc:creator>
    <dc:date>2018-04-03T12:38:27Z</dc:date>
    <item>
      <title>ezport write_section fails/bugs</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ezport-write-section-fails-bugs/m-p/760335#M46342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;Hi,&lt;/P&gt;&lt;P&gt;I am trying to write firmware from flash of 1 kinnetis device to another. And I had success until my aim firmware size grown up.(20550 bytes by far)&lt;/P&gt;&lt;P&gt;I've made "write section" command followed by read function to check correctness. I got difference at address 0x4001 so having 0x4000 bytes written correct.(need to say that something was written after 0x4000. it is not 0xff bytes)&lt;/P&gt;&lt;P&gt;Ok, I thought it was a fail because of RAM or sector sizes. I've made "write_sector"(with varying sector size) function and "check_sector" functions. It looks like working(it writes and checks at a sectors address with no issues) but when I check the whole firmware I got difference just after first sector at 1st byte.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thinking of root of my problem it seems like wrong address been calculated. Am i correct that 32-bit aligned address is a simple address that has 2 LSB's equal to 0?&lt;/P&gt;&lt;P&gt;So to start a write at 0x2000 i need to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ez_transmit(0x02);&amp;nbsp; //programm sector opcode&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; ez_transmit(0x00); &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; ez_transmit(0x20);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp; ez_transmit(0x00);&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Attached file give a view of a code used.(nonrelevant part is deleted)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2018 12:38:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ezport-write-section-fails-bugs/m-p/760335#M46342</guid>
      <dc:creator>alexeyusoltsev</dc:creator>
      <dc:date>2018-04-03T12:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: ezport write_section fails/bugs</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ezport-write-section-fails-bugs/m-p/760336#M46343</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;Could you let us know what's your target Kinetis product part number?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2018 03:24:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ezport-write-section-fails-bugs/m-p/760336#M46343</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-04-04T03:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: ezport write_section fails/bugs</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ezport-write-section-fails-bugs/m-p/760337#M46344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;Hi Mike,&lt;/P&gt;&lt;P&gt;mkv31f128. I cant attach python script that converts my .bin to .c file. But I've checked with binary viewer that it did work.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alexey.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2018 10:14:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ezport-write-section-fails-bugs/m-p/760337#M46344</guid>
      <dc:creator>alexeyusoltsev</dc:creator>
      <dc:date>2018-04-04T10:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: ezport write_section fails/bugs</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ezport-write-section-fails-bugs/m-p/760338#M46345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From KV31F128 reference manual, the EzPort buffers the data in System RAM before sequentially&lt;BR /&gt;moving the data into flash using the Program Longword command. For this reason, the number of bytes to be programmed must be a multiple of 4 and up to one flash section can be programmed at a time.&lt;/P&gt;&lt;P&gt;The KV31F128 Flash sector size is 2KB.&lt;/P&gt;&lt;P&gt;EzPort command [Flash Section Program]&amp;nbsp; Address must be 32-bit aligned (two LSBs must be zero).&lt;/P&gt;&lt;P&gt;Thank you for the attention.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2018 06:32:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ezport-write-section-fails-bugs/m-p/760338#M46345</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2018-04-09T06:32:53Z</dc:date>
    </item>
  </channel>
</rss>

