<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Best way to compile large image data into a program for use during run time</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/35717/best-way-to-compile-large-image-data-into-a-program-for-use-during-run-time</link><description> 
Hello, we&amp;#39;d like to compile some large image files into our
project, have the data available to stream to a display peripheral
via LTDC+DSI peripherals. I tried to get cute and created a desktop
program that imports pictures and generates C functions</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Best way to compile large image data into a program for use during run time</title><link>https://community.arm.com/thread/109522?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 12:21:52 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:30b5c9ea-df71-42dd-89de-b13342a1509e</guid><dc:creator>HansBernhard Broeker</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;Can I leave my image data in ROM/flash and access it there with
my code and peripherals?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Of course you can. Unless you reconfigured the tools rather
strangely, all your &amp;quot;const&amp;quot; variables will already reside there.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;How exactly do I merge in another file to my build?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Following my suggestion: you don&amp;#39;t. You do it &lt;b&gt;after&lt;/b&gt;
building, i.e. as a post-processing step that happens after linking,
modifying the final hex file. For debug sessions, you use a debugger
script to the same effect.&lt;/p&gt;

&lt;p&gt;
In the context of uVision for ARM, you may be better of (ab)using
their FCARM tool for this. It&amp;#39;s intended to be used for packaging the
image files used by an embedded web server (among other things), but
it might manage to do what you need, too.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way to compile large image data into a program for use during run time</title><link>https://community.arm.com/thread/94452?ContentTypeID=1</link><pubDate>Mon, 09 Jul 2018 14:06:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3f9e9685-ac8a-4c65-b57b-966eeb1589ab</guid><dc:creator>Chris Rice</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hm, point taken... my thought process was that the image data
would have to start out in ROM/flash, and then be written to RAM on
initialization. Encoding the image data as source code was basically
a roundabout way to do this, I thought... just pretty inefficient
w.r.t. ROM/flash space used (i.e., its both the data and the code to
move the data) (but I think we have plenty of code space).&lt;/p&gt;

&lt;p&gt;
Or is my premise wrong? Can I leave my image data in ROM/flash and
access it there with my code and peripherals? That would be
great.&lt;/p&gt;

&lt;p&gt;
&amp;quot;which can be merged with your program after linking&amp;quot;&lt;/p&gt;

&lt;p&gt;
Could you please (please, please) expand on this. How exactly do I
merge in another file to my build? I&amp;#39;ve been poking around my Keil
compiler options, I see how I can define different regions (IROM1,
IROM2, RAM1, RAM2)... what are the steps I take to merge in a hex
file (after creating it with srecord or something else). I was hoping
to see a way to refer to add&amp;#39;l files in my linker options, but I
don&amp;#39;t.&lt;/p&gt;

&lt;p&gt;
Thanks so much.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Best way to compile large image data into a program for use during run time</title><link>https://community.arm.com/thread/85672?ContentTypeID=1</link><pubDate>Mon, 09 Jul 2018 13:21:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5866e055-9d12-4c59-beca-bbd208fc5a3c</guid><dc:creator>HansBernhard Broeker</dc:creator><description>&lt;p&gt;&lt;p&gt;
In a nutshell: what you have there is a block of &lt;b&gt;data&lt;/b&gt;, so
what were you thinking turning all of that into &lt;b&gt;code&lt;/b&gt; for no
good reason? Let it stay data!&lt;/p&gt;

&lt;p&gt;
The compiler may not even have to see it. There are tools aplenty
that can directly turn raw binary data into hex files, which can be
merged with your program after linking. srecord is free.&lt;/p&gt;

&lt;p&gt;
Or, if you really need it inside the executable imabe directly,
there&amp;#39;s also a very old-fashioned actual picture file format, XPM
(&lt;a href="https://de.wikipedia.org/wiki/X_PixMap)"&gt;de.wikipedia.org/.../X_PixMap)&lt;/a&gt; that&amp;#39;s actually compilable C
code right there. Some conversion tools can still generate it to this
day (e.g. those in the netpbm library).&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>