Executing Code Preloaded into NOR Flash

I am creating a uClinux system to run on the NXP LPC2478. The chip has a 512k built-in fast flash, from which it can directly execute code. I want to download and run a custom application from a regular external SDRAM. But I have a special graphics library that I would like to preload in order to execute from the built-in flash.

Is there a way to compile a graphics library to work in a fixed location in memory (flash), and then compile / link the application that uses it so that all references to this library are fixed in the appropriate places in the flash memory?

If I need to write my own custom application loader that will perform manual corrections, I will do it.

+4
source share
1 answer

I assume you are using GCC. In addition, I believe that you link uCLinux, the graphics library, and your application in one step to create an executable. The binding of all components is controlled by the linker script (ld file). To do what you want, you need to edit the ld file, and also perform the correct initialization when the code runs.

In the script builder, you have to put the data section in external RAM. Then create a special section for the graphics library and put it in flash. When creating a section, you can specify which object files it will include. In your startup code, you need to copy the data section from the flash memory to RAM. The compiler will take care of associating your application in RAM with the graphic library in flash.

Here's how to do it in general. Based on your requirements, there may be more steps out of your toolchain and library chain.

+1
source

All Articles