views:

189

answers:

1

I'm building a uClinux system to run on an NXP LPC2478. The chip has 512k onboard fast flash from which it can directly execute code. I want to load and run a user app out of regular external SDRAM. But I have a special graphics library that I would like to preload to execute out of the on board flash.

Is there a way to compile the graphics library to run at a fixed location in memory (the flash) and then compile/link the app that uses it to have all it's references to that library fixed to the appropriate locations in flash?

If I have to write a custom app loader that does the fixups manually, I'll do that.

+1  A: 

I assume that you are using GCC. Also, I believe that you are linking uCLinux, the graphics library and your application in a single phase to produce an executable. The linking of all the components is controlled by a linker script (ld file). To do what you want, you need to edit the ld file and also do the proper initialization in start up code.

In the linker script you should put the data section in external RAM. Then create a special section for the graphics library and place it in flash. When creating a section, you can instruct, which object files will it include. In your start up code, you need to copy the data section from flash to RAM. The linker will take care of linking your application in RAM with the graphics library in flash.

This is how things are generally done. Based on your requirements from your tool chain and libraries, there might be more steps involved.

kgiannakakis
Yeah. It's GCC. I'll look into what you suggested. FIgured it'd be pretty much along those lines.
Bill Ataras