First I must declare one thing: all the source codes and functions are automatically added to segment DEAFULT_ROM unless we use “#pragma CODE_SEG MY_SECTION” to change it.
There is no doubt that your lib function has already integrated with your other source code, but all lib functions is still in the DEAFULT_ROM because you never put “#pragma CODE_SEG MY_SECTION ” on it.
To change the section of the lib function, i usually follow the steps as below:
- make sure where your lib function locates in. (consult .map file)
- ie. The lib function is string.c. Copy string.c and string.h from system directory and paste these files in your current project folder.
- Open IDE, add these two files in your project.
- add ” include “string.h”” to the associated files
- add “#pragma CODE_SEG MY_SECTION” before the lib fuction in string.c
- Compile the project. Go to .map file and look the result.
I have tried to set up an example of this that I am sending as an attachment.