<?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: HEX files and customized bootloader in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/HEX-files-and-customized-bootloader/m-p/463052#M4887</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yaniv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no knowledge with your bootloader, so I cannot tell exactly why it returns&amp;nbsp; ERR_SIZE and ERR_ACCERR error. Below is only a tip for your hex data align question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;The HEX file is not generated by compiler, it is created by tool “arm-none-eabi-objcopy.exe” from ELF file, this tool locates at:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;C:\Freescale\CW MCU v10.6.4\Cross_Tools\arm-none-eabi-gcc-4_7_3\bin&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;For its options, please run “arm-none-eabi-objcopy.exe -help” to get the descriptions. Or refer to this link:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;&lt;A href="https://manned.org/arm-none-eabi-objcopy"&gt;https://manned.org/arm-none-eabi-objcopy&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;Unfortunately This tool does not support align Hex data, I found a workaround, that is to first generate S-record file as below (this tool supports to align S-record data):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="s-record.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/59375i8B001ED0D32A0D3C/image-size/large?v=v2&amp;amp;px=999" role="button" title="s-record.png" alt="s-record.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;Then run “arm-none-eabi-objcopy.exe” to convert S-record data into hex, like below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;arm-none-eabi-objcopy.exe -I srec -O ihex sfs.srec fixed_result.hex&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;This is the comparison of HEX file generated in KDS IDE,&amp;nbsp; and the one converted from S-record file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="comparison .png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/59402i1626C90BB3FEAA2D/image-size/large?v=v2&amp;amp;px=999" role="button" title="comparison .png" alt="comparison .png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Fiona Kuang&lt;/P&gt;&lt;P&gt;TIC - Technical Information Center&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Mark Correct button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 May 2016 07:46:42 GMT</pubDate>
    <dc:creator>TICS_Fiona</dc:creator>
    <dc:date>2016-05-31T07:46:42Z</dc:date>
    <item>
      <title>HEX files and customized bootloader</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/HEX-files-and-customized-bootloader/m-p/463050#M4885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working with K64 and KDS .&lt;/P&gt;&lt;P&gt;since there is no USB Host Bootloader for this device I'm tring to implement my own Bootloader.&lt;/P&gt;&lt;P&gt;Based on a "BM USB Host" example for this device (&lt;A _jive_internal="true" data-containerid="11234" data-containertype="14" data-objectid="331376" data-objecttype="102" href="https://community.nxp.com/docs/DOC-331376"&gt;USB Host Project with KSDK 1.3 and Processor Expert&lt;/A&gt; ) I create a tool which read and parse .hex file in order to program it automatically.&lt;/P&gt;&lt;P&gt;I edited the original linker file for the code to push adresses by 0x020000 so all the data should be writen in the rest of the memory.&lt;/P&gt;&lt;P&gt;When I'm asking the KDS complier to create in addition to the elf file a HEX file there is just one critical problem : somewhere in the middle of the HEX file one of the packets size takes just 4/8 bytes and then the addresses of the rest of the file now is starting from a XXX8 and XXXC address which is not aligned anymore.&lt;/P&gt;&lt;P&gt;tring to program this packets on the flash returns with FTFx_ERR_SIZE (0x2000) error for the first 4 Byte packet and with FTFx_ERR_ACCERR (0x0020) error for the rest packets probably since the data is not 16 byte aligned anymore.&lt;/P&gt;&lt;P&gt;What is the solution for this situation? is there a simple way to enforce the compiler to create a 16 bytes aligned HEX file or i should invest more time with better robust algorithm for handeling the non-align data?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="152607_152607.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/121682iECB51E1FA1DD4838/image-size/large?v=v2&amp;amp;px=999" role="button" title="152607_152607.png" alt="152607_152607.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2016-05-30_16-46-01.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/58789iDFA48F0257734D8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="2016-05-30_16-46-01.png" alt="2016-05-30_16-46-01.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2016 14:02:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/HEX-files-and-customized-bootloader/m-p/463050#M4885</guid>
      <dc:creator>bouhady</dc:creator>
      <dc:date>2016-05-30T14:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: HEX files and customized bootloader</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/HEX-files-and-customized-bootloader/m-p/463051#M4886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yani,&lt;/P&gt;&lt;P&gt;When you erase ,it return the FTFx_ERR_SIZE , it is not the reason of the HEX file .&lt;/P&gt;&lt;P&gt;What about the part number of your chip ? What about the size of one sector ?&lt;/P&gt;&lt;P&gt;And when you erase , the least size is one sector , please check. You can show how do&lt;/P&gt;&lt;P&gt;you call the function of "FlashEraseSector()" .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 07:05:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/HEX-files-and-customized-bootloader/m-p/463051#M4886</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-05-31T07:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: HEX files and customized bootloader</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/HEX-files-and-customized-bootloader/m-p/463052#M4887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yaniv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no knowledge with your bootloader, so I cannot tell exactly why it returns&amp;nbsp; ERR_SIZE and ERR_ACCERR error. Below is only a tip for your hex data align question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;The HEX file is not generated by compiler, it is created by tool “arm-none-eabi-objcopy.exe” from ELF file, this tool locates at:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;C:\Freescale\CW MCU v10.6.4\Cross_Tools\arm-none-eabi-gcc-4_7_3\bin&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;For its options, please run “arm-none-eabi-objcopy.exe -help” to get the descriptions. Or refer to this link:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;&lt;A href="https://manned.org/arm-none-eabi-objcopy"&gt;https://manned.org/arm-none-eabi-objcopy&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;Unfortunately This tool does not support align Hex data, I found a workaround, that is to first generate S-record file as below (this tool supports to align S-record data):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="s-record.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/59375i8B001ED0D32A0D3C/image-size/large?v=v2&amp;amp;px=999" role="button" title="s-record.png" alt="s-record.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;Then run “arm-none-eabi-objcopy.exe” to convert S-record data into hex, like below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;arm-none-eabi-objcopy.exe -I srec -O ihex sfs.srec fixed_result.hex&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;This is the comparison of HEX file generated in KDS IDE,&amp;nbsp; and the one converted from S-record file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="comparison .png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/59402i1626C90BB3FEAA2D/image-size/large?v=v2&amp;amp;px=999" role="button" title="comparison .png" alt="comparison .png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Fiona Kuang&lt;/P&gt;&lt;P&gt;TIC - Technical Information Center&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Mark Correct button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 07:46:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/HEX-files-and-customized-bootloader/m-p/463052#M4887</guid>
      <dc:creator>TICS_Fiona</dc:creator>
      <dc:date>2016-05-31T07:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: HEX files and customized bootloader</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/HEX-files-and-customized-bootloader/m-p/463053#M4888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;You can use &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fsrecord.sf.net" rel="nofollow" target="_blank"&gt;http://srecord.sf.net&lt;/A&gt;&lt;SPAN&gt; to filter/transform .HEX files or convert between S19 and HEX.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2016 12:26:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/HEX-files-and-customized-bootloader/m-p/463053#M4888</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2016-05-31T12:26:16Z</dc:date>
    </item>
  </channel>
</rss>

