4
votes

I'm building a uClinux system to run on an NXP LPC2478. The chip has 512k on-board 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 pre-load 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 fix-ups manually, I'll do that.

1

1 Answers

1
votes

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.