<?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: Binary File as resource for project in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606015#M32265</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way would be to use the &lt;STRONG&gt;incbin&lt;/STRONG&gt; assembler directive to pull the binary into an assembler file that is part of your project:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A class="link-titled" href="https://sourceware.org/binutils/docs/as/Incbin.html" title="https://sourceware.org/binutils/docs/as/Incbin.html"&gt;https://sourceware.org/binutils/docs/as/Incbin.html&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you could look at the arm-none-eabi-objcopy&amp;nbsp;&lt;STRONG&gt;-I binary&lt;/STRONG&gt; option:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A class="link-titled" href="https://sourceware.org/binutils/docs/binutils/objcopy.html" title="https://sourceware.org/binutils/docs/binutils/objcopy.html"&gt;https://sourceware.org/binutils/docs/binutils/objcopy.html&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is quite a lot around on the web on importing binary blobs like this that you might find useful, for example:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://balau82.wordpress.com/2012/02/19/linking-a-binary-blob-with-gcc/" title="https://balau82.wordpress.com/2012/02/19/linking-a-binary-blob-with-gcc/"&gt;Linking a binary blob with GCC | Freedom Embedded&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;LPCXpresso Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Sep 2016 20:09:48 GMT</pubDate>
    <dc:creator>lpcxpresso_supp</dc:creator>
    <dc:date>2016-09-09T20:09:48Z</dc:date>
    <item>
      <title>Binary File as resource for project</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606014#M32264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am wanting to include a binary graphic binary file into my C application and haven't found anyway to do this yet with the LPCXpresso IDE as a resource manager.&lt;/P&gt;&lt;P&gt;Can someone explain how I could possibly include the binary file into my project tree as a 'Resource' which will get bound into the project and assigned flash memory which could be accessed&amp;nbsp;by my application for a data transfer operation??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only why I know right now&amp;nbsp;is to write a PC application which will open up the binary file and create and generate a 'C' module defining an initialized array with the data. &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;binary file contents in hexadecimal: 02234323590AFFE0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C code:&lt;/P&gt;&lt;P&gt;static unsigned char &amp;nbsp;FileData[] = {0x02, 0x23, 0x43, 0x23, 0x59, 0x0a, 0xff, 0e0};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There has got to be a way Xpresso could manage the binary file as a resource which gets coded to Flash on build?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance-&lt;/P&gt;&lt;P&gt;Lon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 16:46:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606014#M32264</guid>
      <dc:creator>lonniewalker</dc:creator>
      <dc:date>2016-09-09T16:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Binary File as resource for project</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606015#M32265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way would be to use the &lt;STRONG&gt;incbin&lt;/STRONG&gt; assembler directive to pull the binary into an assembler file that is part of your project:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A class="link-titled" href="https://sourceware.org/binutils/docs/as/Incbin.html" title="https://sourceware.org/binutils/docs/as/Incbin.html"&gt;https://sourceware.org/binutils/docs/as/Incbin.html&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you could look at the arm-none-eabi-objcopy&amp;nbsp;&lt;STRONG&gt;-I binary&lt;/STRONG&gt; option:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A class="link-titled" href="https://sourceware.org/binutils/docs/binutils/objcopy.html" title="https://sourceware.org/binutils/docs/binutils/objcopy.html"&gt;https://sourceware.org/binutils/docs/binutils/objcopy.html&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is quite a lot around on the web on importing binary blobs like this that you might find useful, for example:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://balau82.wordpress.com/2012/02/19/linking-a-binary-blob-with-gcc/" title="https://balau82.wordpress.com/2012/02/19/linking-a-binary-blob-with-gcc/"&gt;Linking a binary blob with GCC | Freedom Embedded&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;LPCXpresso Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 20:09:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606015#M32265</guid>
      <dc:creator>lpcxpresso_supp</dc:creator>
      <dc:date>2016-09-09T20:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Binary File as resource for project</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606016#M32266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have followed the instructions as per &lt;A data-content-finding="Community" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fbalau82.wordpress.com%2F2012%2F02%2F19%2Flinking-a-binary-blob-with-gcc%2F" rel="nofollow" target="_blank"&gt;Linking a binary blob with GCC | Freedom Embedded&lt;/A&gt; and have created the BLOB object that I want to include in a different project:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BootLoader.o:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file format elf32-littlearm&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOL TABLE:&lt;BR /&gt;00000000 l&amp;nbsp;&amp;nbsp;&amp;nbsp; d&amp;nbsp; .data&amp;nbsp;&amp;nbsp; &amp;nbsp;00000000 .data&lt;BR /&gt;00000000 g&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .data&amp;nbsp;&amp;nbsp; &amp;nbsp;00000000 _binary_BootLoader_bin_start&lt;BR /&gt;00002b54 g&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .data&amp;nbsp;&amp;nbsp; &amp;nbsp;00000000 _binary_BootLoader_bin_end&lt;BR /&gt;00002b54 g&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *ABS*&amp;nbsp;&amp;nbsp; &amp;nbsp;00000000 _binary_BootLoader_bin_size&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question is, how do I tell LPCXpresso where to find this object file, or where do I put it in the project directory so that the linker can find it?&amp;nbsp; I tried putting it in the same directory as the project's other object files, but I still get undefined reference error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...ReplaceBootloader\Debug/../example/src/main.c:181: undefined reference to `_binary_BootLoader_bin_start'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[ Background:&amp;nbsp; I have a "bootloader" at the beginning of flash that loads and/or executes&amp;nbsp; a "firmware" image that follows.&amp;nbsp; I need to create a special firmware image that replaces the existing bootloader in flash.&amp;nbsp; So the bootloader binary needs to be embedded within the special firmware file so it can be copied to flash. The "bootloader" and "ReplaceBootloader" are separate projects in the same workspace. ]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 04:25:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606016#M32266</guid>
      <dc:creator>jdupre</dc:creator>
      <dc:date>2017-01-21T04:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Binary File as resource for project</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606017#M32267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my projcts, I use 'incbin'. as if the binary file changes, it is easily rebuilt, without having to remember to do it manually. Also, the IDE will automatically include it in the linker.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you want to do it your way, you just need to add the blob object files to the linker by adding it to the list of 'Other objects' on the Linker 'Miscellaneous' settings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 09:16:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606017#M32267</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2017-01-21T09:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Binary File as resource for project</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606018#M32268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&amp;nbsp; Can you provide a sample of how you used incbin?&amp;nbsp; I'm not that versed in assembly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to add the extra object file as you described.&amp;nbsp; I only had to add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --rename-section .data=.rodata,alloc,load,readonly,data,contents&lt;/P&gt;&lt;P&gt;to my objcopy command so that the binary object stayed in flash rather than getting loaded to RAM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 00:41:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Binary-File-as-resource-for-project/m-p/606018#M32268</guid>
      <dc:creator>jdupre</dc:creator>
      <dc:date>2017-01-23T00:41:59Z</dc:date>
    </item>
  </channel>
</rss>

