Hello, we'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 to set memory locations, like:
void InitImageData_Untitled_400x400_To(uint32_t img_address) { *(uint32_t*) (img_address + 0x00000000) = 0xFF00A400; //... }
except for larger images this function gets impossibly large and crashes my compiler. :)
So I'm done being clever, and I'm asking the experts about the Right way to do this. What is the easiest way to compile bulk image data into a program for access during runtime?
Thanks very much!
Can I leave my image data in ROM/flash and access it there with my code and peripherals?
Of course you can. Unless you reconfigured the tools rather strangely, all your "const" variables will already reside there.
How exactly do I merge in another file to my build?
Following my suggestion: you don't. You do it after 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.
In the context of uVision for ARM, you may be better of (ab)using their FCARM tool for this. It'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.