<?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 add binary Size and Checksum into the Adjacent flash section in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/add-binary-Size-and-Checksum-into-the-Adjacent-flash-section/m-p/1294772#M60872</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a requirement where I need to add the Binary size and the Checksum to be loaded into different flash sections.&lt;/P&gt;&lt;P&gt;Device : MK10DN 512K&lt;/P&gt;&lt;P&gt;I have divided the flash into 2 sections 256K primarily to perform the Firmware Update and Flash Swap.&lt;/P&gt;&lt;P&gt;Each of 2 sections are further divided into 252K (Build Firmware) and 2k * 2 to store Flash indicator and flash verification such as like this :&lt;/P&gt;&lt;P&gt;First partition:&lt;/P&gt;&lt;P&gt;0x0000- 0x3f000 First flash section&amp;nbsp;&lt;/P&gt;&lt;P&gt;0x3f000-0x3f800 Second Flash section&lt;/P&gt;&lt;P&gt;0x3f800-0x40000&lt;/P&gt;&lt;P&gt;Similarly for second Partition ..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the Project settings, I understand that if checksum flag checked , the 32Bit checksum is generated as a part of "post Build Step" and adds to "Reserved Memory" at 0x1c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But Instead of inbuilt 32bit checksum,I would like to store&amp;nbsp; 3 attributes&lt;/P&gt;&lt;P&gt;1) 16bit checksum&lt;/P&gt;&lt;P&gt;2) start address&lt;/P&gt;&lt;P&gt;3) bytecount(size) of the built binary&lt;/P&gt;&lt;P&gt;&amp;nbsp;into the second flash location mentioned above 0x3f000-0x3f800.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I played around with the SRecord mentioned from similar support requests,&lt;/P&gt;&lt;P&gt;where I have to generate srec files, So if my firmware has 60% of the first flash section&lt;/P&gt;&lt;P&gt;I filled remaining parts of First flash section with 0xFF , then added the 16Bit Checksum.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to add the other 2 attributes in the similar way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But is there a way that I can do this post build step ie 16 bit checksum and Size of binary directly at 2nd flash location?&lt;/P&gt;&lt;P&gt;maybe by modifying the linker script or using the Macros in "cr_section_macros.h"?&lt;/P&gt;&lt;P&gt;or by changing settings here?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="viveknath_thulasi_0-1624026643124.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/147464i22B9CAD224BC6CF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="viveknath_thulasi_0-1624026643124.png" alt="viveknath_thulasi_0-1624026643124.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Especially as a post build step, the inbuilt 32 checksum is getting added to generated .bin files directly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;P&gt;thanks in Advance!&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Viveknath&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jun 2021 14:32:56 GMT</pubDate>
    <dc:creator>viveknath_thulasi</dc:creator>
    <dc:date>2021-06-18T14:32:56Z</dc:date>
    <item>
      <title>add binary Size and Checksum into the Adjacent flash section</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/add-binary-Size-and-Checksum-into-the-Adjacent-flash-section/m-p/1294772#M60872</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a requirement where I need to add the Binary size and the Checksum to be loaded into different flash sections.&lt;/P&gt;&lt;P&gt;Device : MK10DN 512K&lt;/P&gt;&lt;P&gt;I have divided the flash into 2 sections 256K primarily to perform the Firmware Update and Flash Swap.&lt;/P&gt;&lt;P&gt;Each of 2 sections are further divided into 252K (Build Firmware) and 2k * 2 to store Flash indicator and flash verification such as like this :&lt;/P&gt;&lt;P&gt;First partition:&lt;/P&gt;&lt;P&gt;0x0000- 0x3f000 First flash section&amp;nbsp;&lt;/P&gt;&lt;P&gt;0x3f000-0x3f800 Second Flash section&lt;/P&gt;&lt;P&gt;0x3f800-0x40000&lt;/P&gt;&lt;P&gt;Similarly for second Partition ..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the Project settings, I understand that if checksum flag checked , the 32Bit checksum is generated as a part of "post Build Step" and adds to "Reserved Memory" at 0x1c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But Instead of inbuilt 32bit checksum,I would like to store&amp;nbsp; 3 attributes&lt;/P&gt;&lt;P&gt;1) 16bit checksum&lt;/P&gt;&lt;P&gt;2) start address&lt;/P&gt;&lt;P&gt;3) bytecount(size) of the built binary&lt;/P&gt;&lt;P&gt;&amp;nbsp;into the second flash location mentioned above 0x3f000-0x3f800.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I played around with the SRecord mentioned from similar support requests,&lt;/P&gt;&lt;P&gt;where I have to generate srec files, So if my firmware has 60% of the first flash section&lt;/P&gt;&lt;P&gt;I filled remaining parts of First flash section with 0xFF , then added the 16Bit Checksum.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to add the other 2 attributes in the similar way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But is there a way that I can do this post build step ie 16 bit checksum and Size of binary directly at 2nd flash location?&lt;/P&gt;&lt;P&gt;maybe by modifying the linker script or using the Macros in "cr_section_macros.h"?&lt;/P&gt;&lt;P&gt;or by changing settings here?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="viveknath_thulasi_0-1624026643124.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/147464i22B9CAD224BC6CF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="viveknath_thulasi_0-1624026643124.png" alt="viveknath_thulasi_0-1624026643124.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Especially as a post build step, the inbuilt 32 checksum is getting added to generated .bin files directly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;P&gt;thanks in Advance!&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Viveknath&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 14:32:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/add-binary-Size-and-Checksum-into-the-Adjacent-flash-section/m-p/1294772#M60872</guid>
      <dc:creator>viveknath_thulasi</dc:creator>
      <dc:date>2021-06-18T14:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: add binary Size and Checksum into the Adjacent flash section</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/add-binary-Size-and-Checksum-into-the-Adjacent-flash-section/m-p/1295065#M60882</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;One easy way is to use the python. After you generate the program bin file. You can write a python file. This python program will calculate the parameter you need and write it into the bin file's specified address. Good luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 days after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 01:56:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/add-binary-Size-and-Checksum-into-the-Adjacent-flash-section/m-p/1295065#M60882</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2021-06-21T01:56:53Z</dc:date>
    </item>
  </channel>
</rss>

