This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to build a official-ROM-like statick library

I need to build a library and hand it over to customer, usually we'll just hand over the compiled .lib file. But I would like to do a further thing, which is locating the library to a fixed memory (Flash) area, which is similar with the offical 'ROM' but reside in flash.

Have anyone ever done this before?

I can build a executable project with a dummy 'main' routine and have those code allocated to certain area, but there are might be several issues:

1. how can this kind of 'ROM' allocate memory for global variables if it is not compiled together with the application?

2. how can I include the 'ROM' into the application project so that it can be loaded to the flash together with the application while debugging? 

Any words are appreciated.