<?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>MCUXpresso IDEのトピックRe: MCUXpresso IDE How do I fix the compiled generated bin file size</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1897082#M9893</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/170511"&gt;@ywjack&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should change my_bootloader.bin name to the generated name.&lt;/P&gt;
&lt;P&gt;For example, if your project is&amp;nbsp;evkbmimxrt1170_hello_world_demo_cm7&lt;/P&gt;
&lt;P&gt;you should change the&amp;nbsp;my_bootloader.bin to the&amp;nbsp;evkbmimxrt1170_hello_world_demo_cm7.bin&lt;/P&gt;
&lt;P&gt;Hope this will help you.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Hang&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2024 03:00:49 GMT</pubDate>
    <dc:creator>Harry_Zhang</dc:creator>
    <dc:date>2024-07-02T03:00:49Z</dc:date>
    <item>
      <title>MCUXpresso IDE How do I fix the compiled generated bin file size</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1887665#M9869</link>
      <description>&lt;P&gt;HI：NXP&amp;nbsp;&lt;SPAN&gt;Technical support&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I use NXP RT1172 microcontroller and use MCUXpresso IDE v11.6.1_8255 &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I have a question to consult, I am doing bootloader. Now my boot code is compiled and the bin file is 100K, the size is generated according to the actual code amount of my code, but I want to make it fixed and the compiled size is fixed, such as 512K, how should I modify it?&lt;/SPAN&gt;&lt;SPAN class=""&gt; The reserved boot space is 3M (0x30000000~30300000). The space is definitely enough. &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Another problem is: I want to compile the bin file a fixed address inside the value is a constant how to operate, for example, I compile the boot size is 100K I want to 511K which address is a constant 0xAA55AA55&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 07:50:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1887665#M9869</guid>
      <dc:creator>ywjack</dc:creator>
      <dc:date>2024-06-14T07:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso IDE How do I fix the compiled generated bin file size</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1887715#M9870</link>
      <description>&lt;P&gt;Have a look at the SRecord tool (&lt;A href="https://srecord.sourceforge.net/" target="_blank"&gt;https://srecord.sourceforge.net/&lt;/A&gt;) which you can use to manipulate different kind of files, including S19, Intel hex and binary files.&lt;/P&gt;&lt;P&gt;Another hint is that you can use the linker to fill your binary, see &lt;A href="https://mcuoneclipse.com/2014/06/23/filling-unused-memory-with-the-gnu-linker/" target="_blank"&gt;https://mcuoneclipse.com/2014/06/23/filling-unused-memory-with-the-gnu-linker/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you are looking for having the resulting binary at relocatable addresses, see &lt;A href="https://mcuoneclipse.com/2021/06/05/position-independent-code-with-gcc-for-arm-cortex-m/" target="_blank"&gt;https://mcuoneclipse.com/2021/06/05/position-independent-code-with-gcc-for-arm-cortex-m/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 08:23:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1887715#M9870</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2024-06-14T08:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso IDE How do I fix the compiled generated bin file size</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1889263#M9871</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/170511"&gt;@ywjack&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak"&gt;1. Fix the Compiled Size to 512K&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak"&gt;You can add a post-build step to pad the binary file. In MCUXpresso IDE, you can specify post-build commands:&lt;BR /&gt;&lt;BR /&gt;1. Open your project properties.&lt;BR /&gt;2. Navigate to “C/C++ Build” -&amp;gt; “Settings”.&lt;BR /&gt;3. Under “Build Steps”, in the “Post-build steps” section, add a command to pad the binary:&lt;BR /&gt;&lt;BR /&gt;# Replace "my_bootloader.bin" with your actual output binary filename&lt;BR /&gt;# Replace "512K" with the fixed size in bytes (524288 bytes)&lt;BR /&gt;python -c "with open('my_bootloader.bin', 'ab') as f: f.write(b'\x00' * (524288 - f.tell()))"&lt;BR /&gt;&lt;BR /&gt;This script pads the binary with zeroes up to 512KB.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak"&gt;2. Setting a Fixed Address Value Inside the Binary&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak"&gt;To place a constant value at a specific address (e.g., 0x511K), modify your source code and linker script:&lt;BR /&gt;&lt;BR /&gt;Define a Constant in Your Code&lt;BR /&gt;&lt;BR /&gt;Define a variable with the desired constant value:&lt;BR /&gt;&lt;BR /&gt;const uint32_t fixed_value __attribute__((section(".fixed_value"))) = 0xAA55AA55;&lt;BR /&gt;&lt;BR /&gt;Modify the Linker Script&lt;BR /&gt;&lt;BR /&gt;Ensure the .fixed_value section is placed at the specific address within the binary:&lt;BR /&gt;&lt;BR /&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;/* Adjust your memory layout as necessary */&lt;BR /&gt;&amp;nbsp;FLASH (rx) : ORIGIN = 0x30000000, LENGTH = 0x80000&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;SECTIONS&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;/* Existing sections */&lt;BR /&gt;&amp;nbsp;.text :&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;/* Existing code */&lt;BR /&gt;&amp;nbsp;} &amp;gt; FLASH&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;.rodata :&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;/* Existing code */&lt;BR /&gt;&amp;nbsp;} &amp;gt; FLASH&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;/* Add fixed value section */&lt;BR /&gt;&amp;nbsp;.fixed_value 0x30080000 - 0x80000 + 0x1FFFC :&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;KEEP(*(.fixed_value))&lt;BR /&gt;&amp;nbsp;} &amp;gt; FLASH&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;.padding :&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;. = ALIGN(4);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;KEEP(*(.padding))&lt;BR /&gt;&amp;nbsp; &amp;nbsp;. = 0x30080000; /* End address to ensure 512KB size */&lt;BR /&gt;&amp;nbsp;} &amp;gt; FLASH&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;This will place the constant 0xAA55AA55 at the address 0x30080000 - 0x80000 + 0x1FFFC (511K within the binary).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak"&gt;Hope this will help you.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak"&gt;BR&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak"&gt;Hang&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 07:57:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1889263#M9871</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2024-06-18T07:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso IDE How do I fix the compiled generated bin file size</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1892823#M9883</link>
      <description>Can you show me this screenshot Under "Build Steps", in the "Post-build steps" section, add a command to pad the binary。&lt;BR /&gt;According to what you said, 515K is all 0x00, which is not what I want. I need the total bin file size to be 512K, and the unused fill 0x00 or 0xFF</description>
      <pubDate>Mon, 24 Jun 2024 11:13:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1892823#M9883</guid>
      <dc:creator>ywjack</dc:creator>
      <dc:date>2024-06-24T11:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso IDE How do I fix the compiled generated bin file size</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1893577#M9885</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/170511"&gt;@ywjack&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can refer to below picture.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HangZhang_0-1719311050256.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/285639i3234F24F848D9C0A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HangZhang_0-1719311050256.png" alt="HangZhang_0-1719311050256.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I didn't say&amp;nbsp;515K is all 0x00, i said that&amp;nbsp;&lt;SPAN&gt;the total bin file size to be 512K, and the unused fill 0x00 or 0xFF.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this will help you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BR&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hang&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 10:25:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1893577#M9885</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2024-06-25T10:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso IDE How do I fix the compiled generated bin file size</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1896319#M9890</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ywjack_0-1719805374292.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/286342i741DE85418E73FF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ywjack_0-1719805374292.png" alt="ywjack_0-1719805374292.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ywjack_1-1719805396852.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/286343iEA7A97E213421490/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ywjack_1-1719805396852.png" alt="ywjack_1-1719805396852.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I did it according to your configuration, and still generated 512K bin file is 0x00.&lt;/SPAN&gt;&lt;SPAN class=""&gt; Is there something wrong with my other configuration? Can you check it for me&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 03:44:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1896319#M9890</guid>
      <dc:creator>ywjack</dc:creator>
      <dc:date>2024-07-01T03:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: MCUXpresso IDE How do I fix the compiled generated bin file size</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1897082#M9893</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/170511"&gt;@ywjack&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should change my_bootloader.bin name to the generated name.&lt;/P&gt;
&lt;P&gt;For example, if your project is&amp;nbsp;evkbmimxrt1170_hello_world_demo_cm7&lt;/P&gt;
&lt;P&gt;you should change the&amp;nbsp;my_bootloader.bin to the&amp;nbsp;evkbmimxrt1170_hello_world_demo_cm7.bin&lt;/P&gt;
&lt;P&gt;Hope this will help you.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Hang&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 03:00:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/MCUXpresso-IDE-How-do-I-fix-the-compiled-generated-bin-file-size/m-p/1897082#M9893</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2024-07-02T03:00:49Z</dc:date>
    </item>
  </channel>
</rss>

